Merge branch 'upstream-main'

Change-Id: I6e539cc62e3fb47dc4ae17f6f3781a274a16019f
diff --git a/.clang-format b/.clang-format
new file mode 120000
index 0000000..5f196c3
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1 @@
+../../../build/soong/scripts/system-clang-format-2
\ No newline at end of file
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..743c955
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,1032 @@
+//
+// Copyright (C) 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package {
+    default_applicable_licenses: ["system_tools_aidl_license"],
+}
+
+// Added automatically by a large-scale-change
+// See: http://go/android-license-faq
+license {
+    name: "system_tools_aidl_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+    ],
+    license_text: [
+        "NOTICE",
+    ],
+}
+
+cc_defaults {
+    name: "aidl_defaults",
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wextra",
+    ],
+    tidy: true,
+    tidy_checks: [
+        "-bugprone-argument-comment",
+        "-bugprone-branch-clone",
+        "-bugprone-macro-parentheses",
+        "-bugprone-misplaced-widening-cast",
+        "-bugprone-signed-char-misuse",
+        "-bugprone-sizeof-expression",
+        "-cert-dcl50-cpp",
+        "-cert-err34-c",
+        "-cert-err52-cpp",
+        "-cert-str34-c",
+        "-clang-analyzer-optin.performance.Padding",
+        "-misc-unused-using-decls",
+        "-performance-for-range-copy",
+        "-performance-inefficient-string-concatenation",
+        "-performance-inefficient-vector-operation",
+        "-performance-no-automatic-move",
+        "-performance-unnecessary-copy-initialization",
+        "-performance-unnecessary-value-param",
+    ],
+    header_libs: ["libgtest_prod_headers"],
+    static_libs: [
+        "libbase",
+        "libgtest",
+    ],
+    // TODO(b/174366536): basic_stringbuf::overflow causes "ubsan: implicit-conversion"
+    // sanitize: {
+    //     integer_overflow: true,
+    //     misc_undefined: ["integer"],
+    // },
+    target: {
+        windows: {
+            enabled: true,
+        },
+        host: {
+            cflags: [
+                "-O0",
+                "-g",
+            ],
+        },
+    },
+    product_variables: {
+        platform_sdk_version: {
+            cflags: ["-DPLATFORM_SDK_VERSION=%d"],
+        },
+    },
+    defaults_visibility: [":__subpackages__"],
+}
+
+// Logic shared between aidl and its unittests
+cc_library_static {
+    name: "libaidl-common",
+    defaults: ["aidl_defaults"],
+    host_supported: true,
+
+    srcs: [
+        "aidl_checkapi.cpp",
+        "aidl_const_expressions.cpp",
+        "aidl_dumpapi.cpp",
+        "aidl_language_l.ll",
+        "aidl_language_y.yy",
+        "aidl_language.cpp",
+        "aidl_to_common.cpp",
+        "aidl_to_cpp_common.cpp",
+        "aidl_to_cpp.cpp",
+        "aidl_to_java.cpp",
+        "aidl_to_ndk.cpp",
+        "aidl_to_rust.cpp",
+        "aidl_typenames.cpp",
+        "aidl.cpp",
+        "ast_java.cpp",
+        "check_valid.cpp",
+        "code_writer.cpp",
+        "comments.cpp",
+        "diagnostics.cpp",
+        "generate_aidl_mappings.cpp",
+        "generate_cpp.cpp",
+        "generate_cpp_analyzer.cpp",
+        "generate_java_binder.cpp",
+        "generate_java.cpp",
+        "generate_ndk.cpp",
+        "generate_rust.cpp",
+        "import_resolver.cpp",
+        "io_delegate.cpp",
+        "location.cpp",
+        "logging.cpp",
+        "options.cpp",
+        "parser.cpp",
+        "permission.cpp",
+        "preprocess.cpp",
+    ],
+    yacc: {
+        gen_location_hh: true,
+        gen_position_hh: true,
+    },
+    visibility: [":__subpackages__"],
+}
+
+// aidl executable
+cc_binary_host {
+    name: "aidl",
+    defaults: ["aidl_defaults"],
+    srcs: ["main.cpp"],
+    static_libs: [
+        "libaidl-common",
+        "libbase",
+        "liblog",
+    ],
+}
+
+// aidl-cpp legacy executable, please use 'aidl' instead
+cc_binary_host {
+    name: "aidl-cpp",
+    defaults: ["aidl_defaults"],
+    srcs: ["main.cpp"],
+    cflags: ["-DAIDL_CPP_BUILD"],
+    static_libs: [
+        "libaidl-common",
+        "libbase",
+        "liblog",
+    ],
+}
+
+// Unit tests
+cc_test {
+    name: "aidl_unittests",
+    host_supported: true,
+
+    test_suites: ["general-tests"],
+
+    cflags: [
+        "-Wall",
+        "-Wextra",
+        "-Werror",
+        "-g",
+    ],
+
+    tidy_timeout_srcs: [
+        "aidl_unittest.cpp",
+        "options_unittest.cpp",
+    ],
+
+    srcs: [
+        "aidl_unittest.cpp",
+        "ast_java_unittest.cpp",
+        "code_writer_unittest.cpp",
+        "diagnostics_unittest.cpp",
+        "generate_cpp_unittest.cpp",
+        "io_delegate_unittest.cpp",
+        "options_unittest.cpp",
+        "tests/fake_io_delegate.cpp",
+        "tests/main.cpp",
+        "tests/test_util.cpp",
+    ],
+
+    static_libs: [
+        "libaidl-common",
+        "libbase",
+        "libcutils",
+        "libgmock",
+        "liblog",
+    ],
+
+    target: {
+        host: {
+            sanitize: {
+                address: true,
+            },
+        },
+    },
+
+    required: ["aidl-golden-test-build-hook"],
+}
+
+cc_fuzz {
+    name: "aidl_parser_fuzzer",
+    host_supported: true,
+    dictionary: "tests/aidl_parser_fuzzer.dict",
+    corpus: [
+        "tests/corpus/*",
+    ],
+
+    fuzz_config: {
+        cc: [
+            "aidl-bugs@google.com",
+        ],
+        triage_assignee: "smoreland@google.com",
+    },
+
+    srcs: [
+        "tests/aidl_parser_fuzzer.cpp",
+        "tests/fake_io_delegate.cpp",
+        "tests/test_util.cpp",
+    ],
+    static_libs: [
+        "libaidl-common",
+        "libbase",
+        "libcutils",
+        "libgtest",
+        "liblog",
+    ],
+    // Enable this to show additional information about what is being parsed during fuzzing.
+    // cflags: ["-DFUZZ_LOG"],
+}
+
+//
+// Integration testing of generated AIDL code.
+//
+
+python_test_host {
+    name: "aidl_integration_test",
+    main: "tests/aidl_integration_test.py",
+    srcs: ["tests/aidl_integration_test.py"],
+    test_config: "tests/aidl_integration_test.xml",
+    data: [
+        ":aidl_test_java_client",
+        ":aidl_test_java_service",
+        ":aidl_test_java_client_sdk1",
+        ":aidl_test_java_service_sdk1",
+        ":aidl_test_java_client_sdk29",
+        ":aidl_test_java_service_sdk29",
+        ":aidl_test_java_client_permission",
+        ":aidl_test_java_service_permission",
+    ],
+    data_device_bins_both: [
+        "aidl_test_client",
+        "aidl_test_v1_client",
+        "aidl_test_service",
+        "aidl_test_client_ndk",
+        "aidl_test_service_ndk",
+        "aidl_test_rust_client",
+        "aidl_test_rust_service",
+        "aidl_test_rust_service_async",
+    ],
+    test_suites: ["general-tests"],
+    test_options: {
+        unit_test: false,
+    },
+}
+
+cc_defaults {
+    name: "aidl_test_defaults",
+    cflags: [
+        "-Wall",
+        "-Wextra",
+        "-Werror",
+    ],
+    shared_libs: [
+        "libbase",
+        "libbinder",
+        "liblog",
+        "libutils",
+    ],
+    compile_multilib: "both",
+    multilib: {
+        lib32: {
+            suffix: "32",
+        },
+        lib64: {
+            suffix: "64",
+        },
+    },
+    test_suites: ["general-tests"],
+}
+
+// Header-only library used for atrace in platform NDK builds
+cc_library_headers {
+    name: "libandroid_aidltrace",
+    host_supported: true,
+    vendor_available: true,
+    export_include_dirs: ["trace"],
+    apex_available: [
+        "//apex_available:platform",
+        "//apex_available:anyapex",
+    ],
+}
+
+// TODO: switch to aidl-test-interface
+filegroup {
+    name: "libaidl-integration-test-files",
+    srcs: [
+        "tests/android/aidl/tests/ArrayOfInterfaces.aidl",
+        "tests/android/aidl/tests/BackendType.aidl",
+        "tests/android/aidl/tests/ByteEnum.aidl",
+        "tests/android/aidl/tests/CircularParcelable.aidl",
+        "tests/android/aidl/tests/ConstantExpressionEnum.aidl",
+        "tests/android/aidl/tests/DeprecatedEnum.aidl",
+        "tests/android/aidl/tests/DeprecatedParcelable.aidl",
+        "tests/android/aidl/tests/GenericStructuredParcelable.aidl",
+        "tests/android/aidl/tests/FixedSize.aidl",
+        "tests/android/aidl/tests/ICircular.aidl",
+        "tests/android/aidl/tests/IDeprecated.aidl",
+        "tests/android/aidl/tests/INamedCallback.aidl",
+        "tests/android/aidl/tests/INewName.aidl",
+        "tests/android/aidl/tests/IOldName.aidl",
+        "tests/android/aidl/tests/ITestService.aidl",
+        "tests/android/aidl/tests/IntEnum.aidl",
+        "tests/android/aidl/tests/ListOfInterfaces.aidl",
+        "tests/android/aidl/tests/LongEnum.aidl",
+        "tests/android/aidl/tests/OtherParcelableForToString.aidl",
+        "tests/android/aidl/tests/ParcelableForToString.aidl",
+        "tests/android/aidl/tests/RecursiveList.aidl",
+        "tests/android/aidl/tests/StructuredParcelable.aidl",
+        "tests/android/aidl/tests/Union.aidl",
+        "tests/android/aidl/tests/UnionWithFd.aidl",
+        "tests/android/aidl/tests/extension/*.aidl",
+        "tests/android/aidl/tests/nested/*.aidl",
+        "tests/android/aidl/tests/unions/*.aidl",
+    ],
+    path: "tests",
+}
+
+// TODO: switch to aidl-test-interface now that we can add library deps to aidl_interface
+filegroup {
+    name: "libaidl-integration-cpp-java-test-files",
+    srcs: [
+        "tests/android/aidl/tests/BadParcelable.aidl",
+        "tests/android/aidl/tests/ICppJavaTests.aidl",
+        "tests/android/aidl/tests/SimpleParcelable.aidl",
+    ],
+    path: "tests",
+}
+
+// TODO: switch to aidl-test-interface
+filegroup {
+    name: "libaidl-integration-permission-test-files",
+    srcs: [
+        "tests/android/aidl/tests/permission/**/*.aidl",
+    ],
+    path: "tests",
+}
+
+aidl_interface {
+    name: "aidl-test-versioned-interface",
+    local_include_dir: "tests/versioned",
+    flags: ["-Werror"],
+    srcs: [
+        "tests/versioned/**/*.aidl",
+    ],
+
+    backend: {
+        java: {
+            gen_rpc: true,
+        },
+        rust: {
+            enabled: true,
+        },
+    },
+    versions_with_info: [
+        {
+            version: "1",
+            imports: [],
+        },
+        {
+            version: "2",
+            imports: [],
+        },
+        {
+            version: "3",
+            imports: [],
+        },
+
+    ],
+    frozen: true,
+
+}
+
+cc_library_static {
+    name: "libaidl-integration-test",
+    defaults: ["aidl_test_defaults"],
+    aidl: {
+        generate_traces: true,
+        export_aidl_headers: true,
+        local_include_dirs: ["tests"],
+        include_dirs: [
+            "frameworks/native/aidl/binder",
+        ],
+    },
+    srcs: [
+        ":libaidl-integration-test-files",
+        ":libaidl-integration-cpp-java-test-files",
+        "tests/bad_parcelable.cpp",
+        "tests/simple_parcelable.cpp",
+    ],
+}
+
+cc_test {
+    name: "aidl_test_service",
+    gtest: false,
+    defaults: ["aidl_test_defaults"],
+    static_libs: [
+        "libaidl-integration-test",
+        "libcutils",
+        // service uses the old version
+        "aidl-test-versioned-interface-V1-cpp",
+        "aidl_test_loggable_interface-cpp",
+        "aidl-test-fixedsizearray-cpp",
+        "android.aidl.test.trunk-V2-cpp",
+    ],
+    srcs: ["tests/aidl_test_service.cpp"],
+}
+
+cc_test {
+    name: "aidl_test_service_ndk",
+    gtest: false,
+    defaults: ["aidl_test_defaults"],
+    shared_libs: [
+        "libbinder_ndk",
+        "libcutils",
+    ],
+    static_libs: [
+        // service uses the old version
+        "aidl-test-versioned-interface-V1-ndk",
+        "aidl-test-interface-ndk",
+        "aidl_test_loggable_interface-ndk",
+        "aidl-test-fixedsizearray-ndk",
+        "android.aidl.test.trunk-V2-ndk",
+    ],
+    srcs: ["tests/aidl_test_service_ndk.cpp"],
+}
+
+cc_test {
+    name: "aidl_test_client",
+    defaults: ["aidl_test_defaults"],
+    static_libs: [
+        "libaidl-integration-test",
+        "libcutils",
+        "libgmock",
+        //  client uses the latest version
+        "aidl-test-versioned-interface-V2-cpp",
+        "aidl_test_loggable_interface-cpp",
+        "aidl-test-fixedsizearray-cpp",
+        "android.aidl.test.trunk-V2-cpp",
+    ],
+    product_variables: {
+        release_aidl_use_unfrozen: {
+            cflags: ["-DAIDL_USE_UNFROZEN"],
+        },
+    },
+    tidy_timeout_srcs: [
+        "tests/aidl_test_client_parcelables.cpp",
+        "tests/aidl_test_client_primitives.cpp",
+    ],
+    srcs: [
+        "tests/aidl_test_client.cpp",
+        "tests/aidl_test_client_builtin_transactions.cpp",
+        "tests/aidl_test_client_file_descriptors.cpp",
+        "tests/aidl_test_client_parcelables.cpp",
+        "tests/aidl_test_client_nullables.cpp",
+        "tests/aidl_test_client_primitives.cpp",
+        "tests/aidl_test_client_utf8_strings.cpp",
+        "tests/aidl_test_client_service_exceptions.cpp",
+        "tests/aidl_test_client_defaultimpl.cpp",
+        "tests/aidl_test_client_delegate.cpp",
+        "tests/aidl_test_client_versioned_interface.cpp",
+        "tests/aidl_test_client_renamed_interface.cpp",
+        "tests/aidl_test_client_loggable_interface.cpp",
+        "tests/aidl_test_client_nested.cpp",
+        "tests/aidl_test_client_trunk_stable.cpp",
+    ],
+    cflags: ["-DAIDL_USE_V2_INTERFACE"],
+}
+
+cc_test {
+    name: "aidl_test_v1_client",
+    defaults: ["aidl_test_defaults"],
+    static_libs: [
+        "libaidl-integration-test",
+        "libcutils",
+        "libgmock",
+        "android.aidl.test.trunk-V1-cpp",
+    ],
+    product_variables: {
+        release_aidl_use_unfrozen: {
+            cflags: ["-DAIDL_USE_UNFROZEN"],
+        },
+    },
+    srcs: [
+        "tests/aidl_test_client_trunk_stable.cpp",
+        "tests/aidl_test_client.cpp",
+    ],
+}
+
+cc_test {
+    name: "aidl_test_client_ndk",
+    defaults: ["aidl_test_defaults"],
+    static_libs: [
+        "libcutils",
+        "libgmock",
+        //  client uses the latest version
+        "aidl-test-versioned-interface-V2-ndk",
+        "aidl-test-interface-ndk",
+        "aidl_test_loggable_interface-ndk",
+        "aidl-test-fixedsizearray-ndk",
+        "android.aidl.test.trunk-V2-ndk",
+    ],
+    shared_libs: [
+        "libbinder_ndk",
+    ],
+    product_variables: {
+        release_aidl_use_unfrozen: {
+            cflags: ["-DAIDL_USE_UNFROZEN"],
+        },
+    },
+    srcs: [
+        "tests/aidl_test_client_ndk_delegate.cpp",
+        "tests/aidl_test_client_ndk_loggable_interface.cpp",
+        "tests/aidl_test_client_ndk_nested.cpp",
+        "tests/aidl_test_client_ndk_nullables.cpp",
+        "tests/aidl_test_client_ndk_parcelables.cpp",
+        "tests/aidl_test_client_ndk_primitives_test.cpp",
+        "tests/aidl_test_client_ndk_strings_test.cpp",
+        "tests/aidl_test_client_ndk_versioned_interface.cpp",
+        "tests/aidl_test_client_ndk_trunk_stable.cpp",
+    ],
+}
+
+aidl_interface {
+    name: "aidl-test-fixedsizearray",
+    srcs: ["tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl"],
+    local_include_dir: "tests",
+    unstable: true,
+    backend: {
+        cpp: {
+            enabled: true,
+        },
+        java: {
+            enabled: true,
+        },
+        ndk: {
+            enabled: true,
+        },
+        rust: {
+            enabled: true,
+        },
+    },
+}
+
+java_defaults {
+    name: "aidl_test_java_integration_defaults",
+    platform_apis: true,
+    // Turn off Java optimization tools to speed up our test iterations.
+    optimize: {
+        enabled: false,
+    },
+    dex_preopt: {
+        enabled: false,
+    },
+    static_libs: [
+        "androidx.test.core",
+        "androidx.test.runner",
+    ],
+    aidl: {
+        include_dirs: [
+            "frameworks/native/aidl/binder",
+        ],
+    },
+    test_suites: ["general-tests"],
+}
+
+java_defaults {
+    name: "aidl_test_java_defaults",
+    defaults: ["aidl_test_java_integration_defaults"],
+    static_libs: [
+        "aidl_test_nonvintf_parcelable-V1-java",
+        "aidl_test_unstable_parcelable-java",
+        "aidl_test_vintf_parcelable-V1-java",
+        "aidl-test-fixedsizearray-java",
+        // TODO: remove once Android migrates to JUnit 4.12,
+        // which provides assertThrows
+        "testng",
+    ],
+    srcs: [
+        "tests/android/aidl/tests/*.aidl",
+        "tests/android/aidl/tests/generic/*.aidl",
+        "tests/android/aidl/tests/immutable/*.aidl",
+        "tests/android/aidl/tests/map/*.aidl",
+        "tests/android/aidl/tests/extension/*.aidl",
+        "tests/android/aidl/tests/nested/*.aidl",
+        "tests/android/aidl/tests/unions/*.aidl",
+        "tests/java/src/android/aidl/tests/BadParcelable.java",
+        "tests/java/src/android/aidl/tests/SimpleParcelable.java",
+        "tests/java/src/android/aidl/tests/generic/Pair.java",
+    ],
+    aidl: {
+        include_dirs: [
+            "system/tools/aidl/tests/",
+        ],
+        generate_traces: true,
+    },
+}
+
+java_test {
+    name: "aidl_test_java_client",
+    defaults: ["aidl_test_java_defaults"],
+    static_libs: [
+        // client uses the new version
+        "aidl-test-versioned-interface-V3-java",
+        "android.aidl.test.trunk-V2-java"
+    ],
+    // tests are included in defaults
+    srcs: [
+        "tests/java/src/android/aidl/tests/MapTests.java",
+        "tests/java/src/android/aidl/tests/TestServiceClient.java",
+        "tests/java/src/android/aidl/tests/JavaOnlyImmutableAnnotationTests.java",
+        "tests/java/src/android/aidl/tests/AidlJavaTests.java",
+        "tests/java/src/android/aidl/tests/BuiltInTests.java",
+        "tests/java/src/android/aidl/tests/DelegatorTests.java",
+        "tests/java/src/android/aidl/tests/GenericTests.java",
+        "tests/java/src/android/aidl/tests/NestedTypesTests.java",
+        "tests/java/src/android/aidl/tests/TestVersionedInterface.java",
+        "tests/java/src/android/aidl/tests/TrunkStableTests.java",
+        "tests/java/src/android/aidl/tests/UnionTests.java",
+        "tests/java/src/android/aidl/tests/ExtensionTests.java",
+        "tests/java/src/android/aidl/tests/NullableTests.java",
+        "tests/java/src/android/aidl/tests/VintfTests.java",
+    ],
+    data: [
+        ":cts-dalvik-device-test-runner",
+    ],
+}
+
+java_test {
+    name: "aidl_test_java_service",
+    defaults: ["aidl_test_java_defaults"],
+    static_libs: [
+        // service uses the old version
+        "aidl-test-versioned-interface-V1-java",
+        "android.aidl.test.trunk-V2-java"
+    ],
+    srcs: [
+        "tests/java/src/android/aidl/service/**/*.java",
+    ],
+    data: [
+        ":cts-dalvik-device-test-runner",
+    ],
+}
+
+filegroup {
+    name: "aidl-for-sdkversion-tests",
+    srcs: [
+        "tests/java/src/android/aidl/sdkversion/ITestService.aidl",
+    ],
+    path: "tests/java/src",
+}
+
+java_defaults {
+    name: "aidl_test_java_sdkversion_defaults",
+    defaults: ["aidl_test_java_integration_defaults"],
+    srcs: [
+        ":aidl-for-sdkversion-tests",
+    ],
+}
+
+java_test {
+    name: "aidl_test_java_client_sdk29",
+    defaults: ["aidl_test_java_sdkversion_defaults"],
+    min_sdk_version: "29",
+    data: [
+        ":cts-dalvik-device-test-runner",
+    ],
+    srcs: [
+        "tests/java/src/android/aidl/sdkversion/tests/*.java",
+    ],
+}
+
+java_test {
+    name: "aidl_test_java_service_sdk29",
+    defaults: ["aidl_test_java_sdkversion_defaults"],
+    min_sdk_version: "29",
+    srcs: [
+        "tests/java/src/android/aidl/sdkversion/service/*.java",
+    ],
+    data: [
+        ":cts-dalvik-device-test-runner",
+    ],
+}
+
+java_test {
+    name: "aidl_test_java_client_sdk1",
+    defaults: ["aidl_test_java_sdkversion_defaults"],
+    min_sdk_version: "1",
+    srcs: [
+        "tests/java/src/android/aidl/sdkversion/tests/*.java",
+    ],
+    data: [
+        ":cts-dalvik-device-test-runner",
+    ],
+}
+
+java_test {
+    name: "aidl_test_java_service_sdk1",
+    defaults: ["aidl_test_java_sdkversion_defaults"],
+    min_sdk_version: "1",
+    data: [
+        ":cts-dalvik-device-test-runner",
+    ],
+    srcs: [
+        "tests/java/src/android/aidl/sdkversion/service/*.java",
+    ],
+}
+
+java_test {
+    name: "aidl_test_java_client_permission",
+    defaults: ["aidl_test_java_integration_defaults"],
+    static_libs: [
+        "aidl-test-interface-permission-java",
+        "frameworks-base-testutils",
+    ],
+    srcs: [
+        "tests/java/src/android/aidl/permission/tests/*.java",
+        "tests/java/src/android/aidl/permission/service/*.java",
+    ],
+    data: [
+        ":cts-dalvik-device-test-runner",
+    ],
+}
+
+java_test {
+    name: "aidl_test_java_service_permission",
+    defaults: ["aidl_test_java_integration_defaults"],
+    static_libs: [
+        "aidl-test-interface-permission-java",
+        "frameworks-base-testutils",
+    ],
+    data: [
+        ":cts-dalvik-device-test-runner",
+    ],
+    srcs: [
+        "tests/java/src/android/aidl/permission/service/*.java",
+    ],
+}
+
+//
+// "Golden" test of compiler output
+//
+
+sh_binary_host {
+    name: "aidl-golden-test",
+    src: "tests/golden_test.sh",
+}
+
+genrule {
+    name: "aidl-golden-test-build-hook-gen",
+    tools: ["aidl-golden-test"],
+
+    product_variables: {
+        release_aidl_use_unfrozen: {
+            cmd: "AIDL_USE_UNFROZEN=true $(location aidl-golden-test) check && " +
+                "echo 'int main(){return 0;}' > $(genDir)/TODO_b_37575883.cpp",
+        },
+    },
+
+    cmd: "AIDL_USE_UNFROZEN=false $(location aidl-golden-test) check && " +
+        "echo 'int main(){return 0;}' > $(genDir)/TODO_b_37575883.cpp",
+    srcs: [
+        // warning: keep this list up to date with tests/golden_test.sh
+        ":aidl-test-interface-cpp-source",
+        ":aidl-test-interface-java-source",
+        ":aidl-test-versioned-interface-V1-cpp-source",
+        ":aidl-test-versioned-interface-V1-java-source",
+        ":aidl-test-versioned-interface-V1-ndk-source",
+        ":aidl-test-versioned-interface-V1-rust-source",
+        ":aidl-test-versioned-interface-V2-cpp-source",
+        ":aidl-test-versioned-interface-V2-java-source",
+        ":aidl-test-versioned-interface-V2-ndk-source",
+        ":aidl-test-versioned-interface-V2-rust-source",
+        ":aidl-test-versioned-interface-V3-cpp-source",
+        ":aidl-test-versioned-interface-V3-java-source",
+        ":aidl-test-versioned-interface-V3-ndk-source",
+        ":aidl-test-versioned-interface-V3-rust-source",
+        ":aidl-test-interface-ndk-source",
+        ":aidl-test-interface-rust-source",
+        ":aidl_test_loggable_interface-cpp-source",
+        ":aidl_test_loggable_interface-java-source",
+        ":aidl_test_loggable_interface-ndk-source",
+        ":aidl-test-interface-permission-java-source",
+        ":aidl-test-fixedsizearray-cpp-source",
+        ":aidl-test-fixedsizearray-java-source",
+        ":aidl-test-fixedsizearray-ndk-source",
+        ":aidl-test-fixedsizearray-rust-source",
+        ":aidl-test-interface-cpp-analyzer-source",
+        ":android.aidl.test.trunk-V1-cpp-source",
+        ":android.aidl.test.trunk-V2-cpp-source",
+        ":android.aidl.test.trunk-V1-ndk-source",
+        ":android.aidl.test.trunk-V2-ndk-source",
+        ":android.aidl.test.trunk-V1-java-source",
+        ":android.aidl.test.trunk-V2-java-source",
+        ":android.aidl.test.trunk-V1-rust-source",
+        ":android.aidl.test.trunk-V2-rust-source",
+        "tests/golden_output/**/*",
+    ],
+    out: ["TODO_b_37575883.cpp"],
+}
+
+cc_test_host {
+    name: "aidl-golden-test-build-hook",
+    generated_sources: ["aidl-golden-test-build-hook-gen"],
+    gtest: false,
+}
+
+//
+// Testing generation of logs
+//
+
+aidl_interface {
+    name: "aidl_test_loggable_interface",
+    unstable: true,
+    local_include_dir: "tests",
+    flags: ["-Werror"],
+    srcs: [
+        "tests/android/aidl/loggable/ILoggableInterface.aidl",
+        "tests/android/aidl/loggable/Data.aidl",
+        "tests/android/aidl/loggable/Enum.aidl",
+        "tests/android/aidl/loggable/Union.aidl",
+    ],
+    gen_trace: true,
+    backend: {
+        cpp: {
+            gen_log: true,
+        },
+        ndk: {
+            gen_log: true,
+        },
+        java: {
+            platform_apis: true,
+        },
+    },
+}
+
+aidl_interface {
+    name: "aidl-test-interface",
+    unstable: true,
+    flags: ["-Werror"],
+    srcs: [":libaidl-integration-test-files"],
+    local_include_dir: "tests",
+    backend: {
+        cpp: {
+        },
+        java: {
+            platform_apis: true,
+        },
+        rust: {
+            enabled: true,
+        },
+        ndk: {
+            apps_enabled: false,
+        },
+    },
+}
+
+aidl_interface {
+    name: "aidl-test-interface-permission",
+    unstable: true,
+    flags: ["-Werror"],
+    srcs: [":libaidl-integration-permission-test-files"],
+    include_dirs: [
+        "frameworks/base/core/java",
+    ],
+    local_include_dir: "tests",
+    backend: {
+        cpp: {
+            enabled: false,
+        },
+        java: {
+            platform_apis: true,
+        },
+        rust: {
+            enabled: false,
+        },
+        ndk: {
+            enabled: false,
+        },
+    },
+}
+
+//
+// Rust tests
+//
+
+rust_test {
+    name: "aidl_test_rust_client",
+    srcs: [
+        "tests/rust/test_client.rs",
+    ],
+    rustlibs: [
+        "aidl-test-interface-rust",
+        "aidl-test-versioned-interface-V2-rust",
+        "aidl_test_nonvintf_parcelable-V1-rust",
+        "aidl_test_unstable_parcelable-rust",
+        "aidl_test_vintf_parcelable-V1-rust",
+        "aidl-test-fixedsizearray-rust",
+        "android.aidl.test.trunk-V2-rust",
+        "liblibc",
+        // We need to import binder_rs directly
+        // for a few internal types like Parcel
+        // and traits like Parcelable
+        "libbinder_rs",
+    ],
+    prefer_rlib: true,
+    compile_multilib: "both",
+    multilib: {
+        lib32: {
+            suffix: "32",
+        },
+        lib64: {
+            suffix: "64",
+        },
+    },
+    test_suites: ["general-tests"],
+}
+
+rust_test {
+    name: "aidl_test_rust_service",
+    test_harness: false,
+    srcs: [
+        "tests/rust/test_service.rs",
+    ],
+    rustlibs: [
+        "aidl-test-interface-rust",
+        "aidl-test-versioned-interface-V1-rust",
+        "aidl-test-fixedsizearray-rust",
+        "android.aidl.test.trunk-V2-rust",
+        "liblibc",
+    ],
+    prefer_rlib: true,
+    compile_multilib: "both",
+    multilib: {
+        lib32: {
+            suffix: "32",
+        },
+        lib64: {
+            suffix: "64",
+        },
+    },
+    test_suites: ["general-tests"],
+}
+
+rust_test {
+    name: "aidl_test_rust_service_async",
+    test_harness: false,
+    srcs: [
+        "tests/rust/test_service_async.rs",
+    ],
+    rustlibs: [
+        "aidl-test-interface-rust",
+        "aidl-test-versioned-interface-V1-rust",
+        "aidl-test-fixedsizearray-rust",
+        "android.aidl.test.trunk-V2-rust",
+        "liblibc",
+        "libbinder_tokio_rs",
+        "libtokio",
+    ],
+    proc_macros: ["libasync_trait"],
+    prefer_rlib: true,
+    compile_multilib: "both",
+    multilib: {
+        lib32: {
+            suffix: "32",
+        },
+        lib64: {
+            suffix: "64",
+        },
+    },
+    test_suites: ["general-tests"],
+}
+
+cc_library_static {
+    name: "aidl-analyzer-main",
+    host_supported: true,
+    vendor_available: true,
+    shared_libs: [
+        "libbase",
+        "libbinder",
+    ],
+    srcs: [
+        "analyzer/analyzerMain.cpp",
+        "analyzer/Analyzer.cpp",
+    ],
+    export_include_dirs: ["analyzer/include"],
+}
+
+cc_binary {
+    name: "record_binder",
+    whole_static_libs: ["aidl-analyzer-main"],
+    shared_libs: [
+        "libbase",
+        "libbinder",
+        "libutils",
+    ],
+}
diff --git a/NOTICE b/NOTICE
new file mode 100644
index 0000000..c5b1efa
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,190 @@
+
+   Copyright (c) 2005-2008, The Android Open Source Project
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..df4dc33
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,9 @@
+# Bug component: 655781
+
+devinmoore@google.com
+elsk@google.com
+jiyong@google.com
+jooyung@google.com
+malchev@google.com
+smoreland@google.com
+vmarko@google.com
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
new file mode 100644
index 0000000..0114731
--- /dev/null
+++ b/PREUPLOAD.cfg
@@ -0,0 +1,11 @@
+[Options]
+ignore_merged_commits = true
+
+[Builtin Hooks]
+clang_format = true
+gofmt = true
+aidl_format = true
+rustfmt = true
+
+[Builtin Hooks Options]
+rustfmt = --config-path=rustfmt.toml
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..02409cb
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+Documentation for this project is currently maintained here:
+
+https://source.android.com/devices/architecture/aidl/overview
diff --git a/TEST_MAPPING b/TEST_MAPPING
new file mode 100644
index 0000000..b4837f8
--- /dev/null
+++ b/TEST_MAPPING
@@ -0,0 +1,43 @@
+{
+  "presubmit": [
+    {
+      "name": "aidl_unittests"
+    },
+    {
+      "name": "aidl_integration_test"
+    },
+    {
+      "name": "aidl_lazy_test"
+    },
+    {
+      "name": "CtsNdkBinderTestCases"
+    },
+    {
+      "name": "hal_implementation_test"
+    },
+    {
+      "name": "resolv_integration_test"
+    },
+    {
+      "name": "FrameworksTelephonyTests",
+      "options": [
+        {
+          "include-filter": "com.android.internal.telephony.ServiceStateTrackerTest"
+        }
+      ]
+    },
+    {
+      "name": "EnforcePermissionTests"
+    }
+  ],
+  "imports": [
+    {
+      "path": "frameworks/native/libs/binder"
+    }
+  ],
+  "auto-presubmit": [
+    {
+      "name": "hal_implementation_test"
+    }
+  ]
+}
diff --git a/aidl-format.sh b/aidl-format.sh
new file mode 100755
index 0000000..1c081bd
--- /dev/null
+++ b/aidl-format.sh
@@ -0,0 +1,192 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2020 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -e
+
+clang_format=clang-format
+
+# future considerations:
+# - could we make this work with git-clang-format instead?
+# - should we have our own formatter?
+
+function _aidl-format() (
+    # Find .aidl-format file to use. The file is located in one of the parent
+    # directories of the source file
+    function find-aidl-format-style() {
+        local path="$1"
+        while [[ "$path" != / ]];
+        do
+            if find "$path" -maxdepth 1 -mindepth 1 -name .aidl-format | grep "."; then
+                return
+            fi
+            path="$(readlink -f "$path"/..)"
+        done
+    }
+
+    # Do a "reversible" conversion of the input file so that it is more friendly
+    # to clang-format. For example 'oneway interface Foo{}' is not recognized as
+    # an interface. Convert it to 'interface __aidl_oneway__ Foo{}'.
+    function prepare() {
+      # oneway interface Foo {} is not correctly recognized as an interface by
+      # clang-format. Change it to interface __aidl_oneway__ Foo {}.
+      sed -i -E 's/oneway[[:space:]]+interface/interface\ __aidl_oneway__/g' "$1"
+
+      # When a declaration becomes too long, clang-format splits the declaration
+      # into multiple lines. In doing so, annotations that are at the front of
+      # the declaration are always split. i.e.
+      #
+      # @utf8InCpp @nullable void foo(int looooooo....ong, int looo....ong);
+      #
+      # becomes
+      #
+      # @utf8InCpp
+      # @nullable
+      # void foo(int loooooo...ong,
+      #     int looo.....ong);
+      #
+      # This isn't desirable for utf8InCpp and nullable annotations which are
+      # semantically tagged to the type, not the member (field/method). We want
+      # to have the annotations in the same line as the type that they actually
+      # annotate. i.e.
+      #
+      # @utf8InCpp @nullable void foo(int looo....ong,
+      #     int looo.....ong);
+      #
+      # To do so, the annotations are temporarily replaced with tokens that are
+      # not annotations.
+      sed -i -E 's/@utf8InCpp/__aidl_utf8inCpp__/g' "$1"
+      sed -i -E 's/@nullable/__aidl_nullable__/g' "$1"
+    }
+
+    function apply-clang-format() {
+      local input="$1"
+      local style="$2"
+      local temp="$(mktemp)"
+      local styletext="$([ -f "$style" ] && cat "$style" | tr '\n' ',' 2> /dev/null)"
+      cat "$input" | $clang_format \
+        --style='{BasedOnStyle: Google,
+        ColumnLimit: 100,
+        IndentWidth: 4,
+        ContinuationIndentWidth: 8, '"${styletext}"'}' \
+        --assume-filename=${input%.*}.java \
+        > "$temp"
+      mv "$temp" "$input"
+    }
+
+    # clang-format is good, but doesn't perfectly fit to our needs. Fix the
+    # minor mismatches manually.
+    function fixup() {
+      # Revert the changes done during the prepare call. Notice that the
+      # original tokens (@utf8InCpp, etc.) are shorter than the temporary tokens
+      # (__aidl_utf8InCpp, etc.). This can make the output text length shorter
+      # than the specified column limit. We can try to reduce the undesirable
+      # effect by keeping the tokens to have similar lengths, but that seems to
+      # be an overkill at this moment. We can revisit this when this becomes a
+      # real problem.
+      sed -i -E 's/interface\ __aidl_oneway__/oneway\ interface/g' "$1"
+      sed -i -E 's/__aidl_utf8inCpp__/@utf8InCpp/g' "$1"
+      sed -i -E 's/__aidl_nullable__/@nullable/g' "$1"
+
+      # clang-format adds space around "=" in annotation parameters. e.g.
+      # @Anno(a = 100). The following awk script removes the spaces back.
+      # @Anno(a = 1, b = 2) @Anno(c = 3, d = 4) int foo = 3; becomes
+      # @Anno(a=1, b=2) @Anno(c=3, d=4) int foo = 3;
+      # [^@,=] ensures that the match doesn't cross the characters, otherwise
+      # "a = 1, b = 2" would match only once and will become "a = 1, b=2".
+      awk -i inplace \
+        '/@[^@]+\(.*=.*\)/ { # matches a line having @anno(param = val) \
+              print(gensub(/([^@,=]+) = ([^@,=]+|"[^"]*")/, "\\1=\\2", "g", $0)); \
+              done=1;\
+        } \
+        {if (!done) {print($0);} done=0;}' "$1"
+    }
+
+    function format-one() {
+      local mode="$1"
+      local input="$2"
+      local style="$3"
+      local output="$(mktemp)"
+
+      cp "$input" "$output"
+      prepare "$output"
+      apply-clang-format "$output" "$style"
+      fixup "$output"
+
+      if [ $mode = "diff" ]; then
+        diff "$input" "$output" || (
+          echo "You can try to fix this by running:"
+          echo "$0 -w <file>"
+          echo ""
+        )
+        rm "$output"
+      elif [ $mode = "write" ]; then
+        if diff -q "$output" "$input" >/dev/null; then
+            rm "$output"
+        else
+            mv "$output" "$input"
+        fi
+      elif [ $mode = "print" ]; then
+        cat "$output"
+        rm "$output"
+      fi
+    }
+
+    function show-help-and-exit() {
+      echo "Usage: $0 [options] [path...]"
+      echo "  -d: display diff instead of the formatted result"
+      echo "  -w: rewrite the result back to the source file, instead of stdout"
+      echo "  -h: show this help message"
+      echo "  --clang-format-path <PATH>: set the path to the clang-format to <PATH>"
+      echo "  [path...]: source files. if none, input is read from stdin"
+      exit 1
+    }
+
+    local mode=print
+    while [ $# -gt 0 ]; do
+      case "$1" in
+        -d) mode=diff; shift;;
+        -w) mode=write; shift;;
+        -h) show-help-and-exit;;
+	--clang-format-path) clang_format="$2"; shift 2;;
+	*) break;;
+      esac
+    done
+
+    if [ $# -lt 1 ]; then
+      if [ $mode = "write" ]; then
+        echo "-w not supported when input is stdin"
+        exit 1
+      fi
+      local input="$(mktemp)"
+      cat /dev/stdin > "$input"
+      local style="$(pwd)/.aidl-format"
+      format-one $mode "$input" "$style"
+      rm "$input"
+    else
+      for file in "$@"
+      do
+        if [ ! -f "$file" ]; then
+          echo "$file": no such file
+          exit 1
+        fi
+        local style="$(find-aidl-format-style $(dirname "$filename"))"
+        format-one $mode "$file" "$style"
+      done
+    fi
+)
+
+
+_aidl-format "$@"
diff --git a/aidl.cpp b/aidl.cpp
new file mode 100644
index 0000000..a4abaed
--- /dev/null
+++ b/aidl.cpp
@@ -0,0 +1,953 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl.h"
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <algorithm>
+#include <iostream>
+#include <map>
+#include <memory>
+
+#ifdef _WIN32
+#include <io.h>
+#include <direct.h>
+#include <sys/stat.h>
+#endif
+
+#include <android-base/strings.h>
+
+#include "aidl_checkapi.h"
+#include "aidl_dumpapi.h"
+#include "aidl_language.h"
+#include "aidl_typenames.h"
+#include "check_valid.h"
+#include "generate_aidl_mappings.h"
+#include "generate_cpp.h"
+#include "generate_cpp_analyzer.h"
+#include "generate_java.h"
+#include "generate_ndk.h"
+#include "generate_rust.h"
+#include "import_resolver.h"
+#include "logging.h"
+#include "options.h"
+#include "os.h"
+#include "parser.h"
+#include "preprocess.h"
+
+#ifndef O_BINARY
+#  define O_BINARY  0
+#endif
+
+using android::base::Error;
+using android::base::Join;
+using android::base::Result;
+using android::base::Split;
+using std::set;
+using std::string;
+using std::unique_ptr;
+using std::unordered_set;
+using std::vector;
+
+namespace android {
+namespace aidl {
+namespace {
+
+// Copied from android.is.IBinder.[FIRST|LAST]_CALL_TRANSACTION
+const int kFirstCallTransaction = 1;
+const int kLastCallTransaction = 0x00ffffff;
+
+// Following IDs are all offsets from  kFirstCallTransaction
+
+// IDs for meta transactions. Most of the meta transactions are implemented in
+// the framework side (Binder.java or Binder.cpp). But these are the ones that
+// are auto-implemented by the AIDL compiler.
+const int kFirstMetaMethodId = kLastCallTransaction - kFirstCallTransaction;
+const int kGetInterfaceVersionId = kFirstMetaMethodId;
+const int kGetInterfaceHashId = kFirstMetaMethodId - 1;
+// Additional meta transactions implemented by AIDL should use
+// kFirstMetaMethodId -1, -2, ...and so on.
+
+// Reserve 100 IDs for meta methods, which is more than enough. If we don't reserve,
+// in the future, a newly added meta transaction ID will have a chance to
+// collide with the user-defined methods that were added in the past. So,
+// let's prevent users from using IDs in this range from the beginning.
+const int kLastMetaMethodId = kFirstMetaMethodId - 99;
+
+// Range of IDs that is allowed for user-defined methods.
+const int kMinUserSetMethodId = 0;
+const int kMaxUserSetMethodId = kLastMetaMethodId - 1;
+
+bool check_filename(const std::string& filename, const Options& options, const AidlDefinedType& defined_type) {
+    const char* p;
+    string expected;
+    string fn;
+    size_t len;
+    bool valid = false;
+
+    if (!IoDelegate::GetAbsolutePath(filename, &fn)) {
+      return false;
+    }
+
+    const std::string package = defined_type.GetPackage();
+    if (!package.empty()) {
+        expected = package;
+        expected += '.';
+    }
+
+    len = expected.length();
+    for (size_t i=0; i<len; i++) {
+        if (expected[i] == '.') {
+            expected[i] = OS_PATH_SEPARATOR;
+        }
+    }
+
+    const std::string name = defined_type.GetName();
+    expected.append(name, 0, name.find('.'));
+
+    expected += ".aidl";
+
+    len = fn.length();
+    valid = (len >= expected.length());
+
+    if (valid) {
+        p = fn.c_str() + (len - expected.length());
+
+#ifdef _WIN32
+        if (OS_PATH_SEPARATOR != '/') {
+            // Input filename under cygwin most likely has / separators
+            // whereas the expected string uses \\ separators. Adjust
+            // them accordingly.
+          for (char *c = const_cast<char *>(p); *c; ++c) {
+                if (*c == '/') *c = OS_PATH_SEPARATOR;
+            }
+        }
+#endif
+
+        // aidl assumes case-insensitivity on Mac Os and Windows.
+#if defined(__linux__)
+        valid = (expected == p);
+#else
+        valid = !strcasecmp(expected.c_str(), p);
+#endif
+    }
+
+    if (!valid) {
+      AIDL_ERROR(defined_type) << name << " should be declared in a file called " << expected;
+      return false;
+    }
+
+    // Make sure that base directory of this AIDL file is one of the import directories. Base
+    // directory of an AIDL file `some/dir/package/name/Iface.aidl` is defined as `some/dir` if the
+    // package name is `package.name` and the type name is `Iface`. This check is needed because the
+    // build system that invokes this aidl compiler doesn't have knowledge about what the package
+    // name is for a given aidl file; because the build system doesn't parse the file. The only hint
+    // that user can give to the build system is the import path. In the above case, by specifying
+    // the import path to be `some/dir/`, the build system can know that the package name is what
+    // follows the import path: `package.name`.
+    // This is not used when the user has specified the exact output file path though.
+    if (options.OutputFile().empty()) {
+      std::string_view basedir(filename);
+      basedir.remove_suffix(expected.length());
+      if (basedir.empty()) {
+        basedir = "./";
+      }
+      const std::set<std::string>& i = options.ImportDirs();
+      if (std::find_if(i.begin(), i.end(), [&basedir](const std::string& i) {
+            return basedir == i;
+      }) == i.end()) {
+        AIDL_ERROR(defined_type) << "directory " << basedir << " is not found in any of the import paths:\n - " <<
+          base::Join(options.ImportDirs(), "\n - ");
+        return false;
+      }
+    }
+
+    // All checks passed
+    return true;
+}
+
+bool write_dep_file(const Options& options, const AidlDefinedType& defined_type,
+                    const vector<string>& imports, const IoDelegate& io_delegate,
+                    const string& input_file, const string& output_file) {
+  string dep_file_name = options.DependencyFile();
+  if (dep_file_name.empty() && options.AutoDepFile()) {
+    dep_file_name = output_file + ".d";
+  }
+
+  if (dep_file_name.empty()) {
+    return true;  // nothing to do
+  }
+
+  CodeWriterPtr writer = io_delegate.GetCodeWriter(dep_file_name);
+  if (!writer) {
+    AIDL_ERROR(dep_file_name) << "Could not open dependency file.";
+    return false;
+  }
+
+  vector<string> source_aidl = {input_file};
+  for (const auto& import : imports) {
+    source_aidl.push_back(import);
+  }
+
+  // Encode that the output file depends on aidl input files.
+  if (defined_type.AsUnstructuredParcelable() != nullptr &&
+      options.TargetLanguage() == Options::Language::JAVA) {
+    // Legacy behavior. For parcelable declarations in Java, don't emit output file as
+    // the dependency target. b/141372861
+    writer->Write(" : \\\n");
+  } else {
+    writer->Write("%s : \\\n", output_file.c_str());
+  }
+  writer->Write("  %s", Join(source_aidl, " \\\n  ").c_str());
+  writer->Write("\n");
+
+  if (!options.DependencyFileNinja()) {
+    writer->Write("\n");
+    // Output "<input_aidl_file>: " so make won't fail if the input .aidl file
+    // has been deleted, moved or renamed in incremental build.
+    for (const auto& src : source_aidl) {
+      writer->Write("%s :\n", src.c_str());
+    }
+  }
+
+  if (options.IsCppOutput()) {
+    if (!options.DependencyFileNinja()) {
+      using ::android::aidl::cpp::ClassNames;
+      using ::android::aidl::cpp::HeaderFile;
+      vector<string> headers;
+      for (ClassNames c : {ClassNames::CLIENT, ClassNames::SERVER, ClassNames::RAW}) {
+        headers.push_back(options.OutputHeaderDir() +
+                          HeaderFile(defined_type, c, false /* use_os_sep */));
+      }
+
+      writer->Write("\n");
+
+      // Generated headers also depend on the source aidl files.
+      writer->Write("%s : \\\n    %s\n", Join(headers, " \\\n    ").c_str(),
+                    Join(source_aidl, " \\\n    ").c_str());
+    }
+  }
+
+  return true;
+}
+
+// Returns the path to the destination file of `defined_type`.
+string GetOutputFilePath(const Options& options, const AidlDefinedType& defined_type) {
+  string result = options.OutputDir();
+
+  // add the package
+  string package = defined_type.GetPackage();
+  if (!package.empty()) {
+    for (auto& c : package) {
+      if (c == '.') {
+        c = OS_PATH_SEPARATOR;
+      }
+    }
+    result += package;
+    result += OS_PATH_SEPARATOR;
+  }
+
+  // add the filename
+  result += defined_type.GetName();
+  if (options.TargetLanguage() == Options::Language::JAVA) {
+    result += ".java";
+  } else if (options.IsCppOutput()) {
+    result += ".cpp";
+  } else if (options.TargetLanguage() == Options::Language::RUST) {
+    result += ".rs";
+  } else {
+    AIDL_FATAL("Unknown target language");
+    return "";
+  }
+
+  return result;
+}
+
+bool CheckAndAssignMethodIDs(const std::vector<std::unique_ptr<AidlMethod>>& items) {
+  // Check whether there are any methods with manually assigned id's and any
+  // that are not. Either all method id's must be manually assigned or all of
+  // them must not. Also, check for uplicates of user set ID's and that the
+  // ID's are within the proper bounds.
+  set<int> usedIds;
+  bool hasUnassignedIds = false;
+  bool hasAssignedIds = false;
+  int newId = kMinUserSetMethodId;
+  for (const auto& item : items) {
+    // However, meta transactions that are added by the AIDL compiler are
+    // exceptions. They have fixed IDs but allowed to be with user-defined
+    // methods having auto-assigned IDs. This is because the Ids of the meta
+    // transactions must be stable during the entire lifetime of an interface.
+    // In other words, their IDs must be the same even when new user-defined
+    // methods are added.
+    if (!item->IsUserDefined()) {
+      continue;
+    }
+    if (item->HasId()) {
+      hasAssignedIds = true;
+    } else {
+      item->SetId(newId++);
+      hasUnassignedIds = true;
+    }
+
+    if (hasAssignedIds && hasUnassignedIds) {
+      AIDL_ERROR(item) << "You must either assign id's to all methods or to none of them.";
+      return false;
+    }
+
+    // Ensure that the user set id is not duplicated.
+    if (usedIds.find(item->GetId()) != usedIds.end()) {
+      // We found a duplicate id, so throw an error.
+      AIDL_ERROR(item) << "Found duplicate method id (" << item->GetId() << ") for method "
+                       << item->GetName();
+      return false;
+    }
+    usedIds.insert(item->GetId());
+
+    // Ensure that the user set id is within the appropriate limits
+    if (item->GetId() < kMinUserSetMethodId || item->GetId() > kMaxUserSetMethodId) {
+      AIDL_ERROR(item) << "Found out of bounds id (" << item->GetId() << ") for method "
+                       << item->GetName() << ". Value for id must be between "
+                       << kMinUserSetMethodId << " and " << kMaxUserSetMethodId << " inclusive.";
+      return false;
+    }
+  }
+
+  return true;
+}
+
+bool ValidateAnnotationContext(const AidlDocument& doc) {
+  struct AnnotationValidator : AidlVisitor {
+    bool success = true;
+
+    void Check(const AidlAnnotatable& annotatable, AidlAnnotation::TargetContext context) {
+      for (const auto& annot : annotatable.GetAnnotations()) {
+        if (!annot->CheckContext(context)) {
+          success = false;
+        }
+      }
+    }
+    void Visit(const AidlInterface& m) override {
+      Check(m, AidlAnnotation::CONTEXT_TYPE_INTERFACE);
+    }
+    void Visit(const AidlParcelable& m) override {
+      Check(m, AidlAnnotation::CONTEXT_TYPE_UNSTRUCTURED_PARCELABLE);
+    }
+    void Visit(const AidlStructuredParcelable& m) override {
+      Check(m, AidlAnnotation::CONTEXT_TYPE_STRUCTURED_PARCELABLE);
+    }
+    void Visit(const AidlEnumDeclaration& m) override {
+      Check(m, AidlAnnotation::CONTEXT_TYPE_ENUM);
+    }
+    void Visit(const AidlUnionDecl& m) override { Check(m, AidlAnnotation::CONTEXT_TYPE_UNION); }
+    void Visit(const AidlMethod& m) override {
+      Check(m.GetType(), AidlAnnotation::CONTEXT_TYPE_SPECIFIER | AidlAnnotation::CONTEXT_METHOD);
+      for (const auto& arg : m.GetArguments()) {
+        Check(arg->GetType(), AidlAnnotation::CONTEXT_TYPE_SPECIFIER);
+      }
+    }
+    void Visit(const AidlConstantDeclaration& m) override {
+      Check(m.GetType(), AidlAnnotation::CONTEXT_TYPE_SPECIFIER | AidlAnnotation::CONTEXT_CONST);
+    }
+    void Visit(const AidlVariableDeclaration& m) override {
+      Check(m.GetType(), AidlAnnotation::CONTEXT_TYPE_SPECIFIER | AidlAnnotation::CONTEXT_FIELD);
+    }
+    void Visit(const AidlTypeSpecifier& m) override {
+      // nested generic type parameters are checked as well
+      if (m.IsGeneric()) {
+        for (const auto& tp : m.GetTypeParameters()) {
+          Check(*tp, AidlAnnotation::CONTEXT_TYPE_SPECIFIER);
+        }
+      }
+    }
+  };
+
+  AnnotationValidator validator;
+  VisitTopDown(validator, doc);
+  return validator.success;
+}
+
+bool ValidateHeaders(Options::Language language, const AidlDocument& doc) {
+  typedef std::string (AidlParcelable::*GetHeader)() const;
+
+  struct HeaderVisitor : AidlVisitor {
+    bool success = true;
+    const char* str = nullptr;
+    GetHeader getHeader = nullptr;
+
+    void check(const AidlParcelable& p) {
+      if ((p.*getHeader)().empty()) {
+        AIDL_ERROR(p) << "Unstructured parcelable \"" << p.GetName() << "\" must have " << str
+                      << " defined.";
+        success = false;
+      }
+    }
+
+    void Visit(const AidlParcelable& p) override { check(p); }
+    void Visit(const AidlTypeSpecifier& m) override {
+      auto type = m.GetDefinedType();
+      if (type) {
+        auto unstructured = type->AsUnstructuredParcelable();
+        if (unstructured) check(*unstructured);
+      }
+    }
+  };
+
+  if (language == Options::Language::CPP) {
+    HeaderVisitor validator;
+    validator.str = "cpp_header";
+    validator.getHeader = &AidlParcelable::GetCppHeader;
+    VisitTopDown(validator, doc);
+    return validator.success;
+  } else if (language == Options::Language::NDK) {
+    HeaderVisitor validator;
+    validator.str = "ndk_header";
+    validator.getHeader = &AidlParcelable::GetNdkHeader;
+    VisitTopDown(validator, doc);
+    return validator.success;
+  } else if (language == Options::Language::RUST) {
+    HeaderVisitor validator;
+    validator.str = "rust_type";
+    validator.getHeader = &AidlParcelable::GetRustType;
+    VisitTopDown(validator, doc);
+    return validator.success;
+  }
+  return true;
+}
+
+}  // namespace
+
+namespace internals {
+
+// WARNING: options are passed here and below, but only the file contents should determine
+// what is generated for portability.
+AidlError load_and_validate_aidl(const std::string& input_file_name, const Options& options,
+                                 const IoDelegate& io_delegate, AidlTypenames* typenames,
+                                 vector<string>* imported_files) {
+  AidlError err = AidlError::OK;
+
+  //////////////////////////////////////////////////////////////////////////
+  // Loading phase
+  //////////////////////////////////////////////////////////////////////////
+
+  // Parse the main input file
+  const AidlDocument* document = Parser::Parse(input_file_name, io_delegate, *typenames);
+  if (document == nullptr) {
+    return AidlError::PARSE_ERROR;
+  }
+  int num_top_level_decls = 0;
+  for (const auto& type : document->DefinedTypes()) {
+    if (type->AsUnstructuredParcelable() == nullptr) {
+      num_top_level_decls++;
+      if (num_top_level_decls > 1) {
+        AIDL_ERROR(*type) << "You must declare only one type per file.";
+        return AidlError::BAD_TYPE;
+      }
+    }
+  }
+
+  // Import the preprocessed file
+  for (const string& filename : options.PreprocessedFiles()) {
+    auto preprocessed = Parser::Parse(filename, io_delegate, *typenames, /*is_preprocessed=*/true);
+    if (!preprocessed) {
+      return AidlError::BAD_PRE_PROCESSED_FILE;
+    }
+  }
+
+  // Find files to import and parse them
+  vector<string> import_paths;
+  ImportResolver import_resolver{io_delegate, input_file_name, options.ImportDirs()};
+  for (const auto& import : document->Imports()) {
+    if (typenames->IsIgnorableImport(import)) {
+      // There are places in the Android tree where an import doesn't resolve,
+      // but we'll pick the type up through the preprocessed types.
+      // This seems like an error, but legacy support demands we support it...
+      continue;
+    }
+    string import_path = import_resolver.FindImportFile(import);
+    if (import_path.empty()) {
+      err = AidlError::BAD_IMPORT;
+      continue;
+    }
+
+    import_paths.emplace_back(import_path);
+
+    auto imported_doc = Parser::Parse(import_path, io_delegate, *typenames);
+    if (imported_doc == nullptr) {
+      AIDL_ERROR(import_path) << "error while importing " << import_path << " for " << import;
+      err = AidlError::BAD_IMPORT;
+      continue;
+    }
+  }
+  if (err != AidlError::OK) {
+    return err;
+  }
+
+  TypeResolver resolver = [&](const AidlDefinedType* scope, AidlTypeSpecifier* type) {
+    // resolve with already loaded types
+    if (type->Resolve(*typenames, scope)) {
+      return true;
+    }
+    const string import_path = import_resolver.FindImportFile(scope->ResolveName(type->GetName()));
+    if (import_path.empty()) {
+      return false;
+    }
+    import_paths.push_back(import_path);
+    auto imported_doc = Parser::Parse(import_path, io_delegate, *typenames);
+    if (imported_doc == nullptr) {
+      AIDL_ERROR(import_path) << "error while importing " << import_path << " for " << import_path;
+      return false;
+    }
+
+    // now, try to resolve it again
+    if (!type->Resolve(*typenames, scope)) {
+      AIDL_ERROR(type) << "Can't resolve " << type->GetName();
+      return false;
+    }
+    return true;
+  };
+
+  // Resolve the unresolved references
+  if (!ResolveReferences(*document, resolver)) {
+    return AidlError::BAD_TYPE;
+  }
+
+  if (!typenames->Autofill()) {
+    return AidlError::BAD_TYPE;
+  }
+
+  //////////////////////////////////////////////////////////////////////////
+  // Validation phase
+  //////////////////////////////////////////////////////////////////////////
+
+  const auto& types = document->DefinedTypes();
+  const int num_defined_types = types.size();
+  for (const auto& defined_type : types) {
+    AIDL_FATAL_IF(defined_type == nullptr, document);
+
+    // Ensure type is exactly one of the following:
+    AidlInterface* interface = defined_type->AsInterface();
+    AidlStructuredParcelable* parcelable = defined_type->AsStructuredParcelable();
+    AidlParcelable* unstructured_parcelable = defined_type->AsUnstructuredParcelable();
+    AidlEnumDeclaration* enum_decl = defined_type->AsEnumDeclaration();
+    AidlUnionDecl* union_decl = defined_type->AsUnionDeclaration();
+    AIDL_FATAL_IF(
+        !!interface + !!parcelable + !!unstructured_parcelable + !!enum_decl + !!union_decl != 1,
+        defined_type);
+
+    // Ensure that foo.bar.IFoo is defined in <some_path>/foo/bar/IFoo.aidl
+    if (num_defined_types == 1 && !check_filename(input_file_name, options, *defined_type)) {
+      return AidlError::BAD_PACKAGE;
+    }
+
+    {
+      bool valid_type = true;
+
+      if (!defined_type->CheckValid(*typenames)) {
+        valid_type = false;
+      }
+
+      if (!defined_type->LanguageSpecificCheckValid(options.TargetLanguage())) {
+        valid_type = false;
+      }
+
+      if (!valid_type) {
+        return AidlError::BAD_TYPE;
+      }
+    }
+
+    if (unstructured_parcelable != nullptr) {
+      auto lang = options.TargetLanguage();
+      bool isStable = unstructured_parcelable->IsStableApiParcelable(lang);
+      if (options.IsStructured() && !isStable) {
+        AIDL_ERROR(unstructured_parcelable)
+            << "Cannot declare unstructured parcelable in a --structured interface. Parcelable "
+               "must be defined in AIDL directly.";
+        return AidlError::NOT_STRUCTURED;
+      }
+      if (options.FailOnParcelable() || lang == Options::Language::NDK ||
+          lang == Options::Language::RUST) {
+        AIDL_ERROR(unstructured_parcelable)
+            << "Refusing to generate code with unstructured parcelables. Declared parcelables "
+               "should be in their own file and/or cannot be used with --structured interfaces.";
+        return AidlError::FOUND_PARCELABLE;
+      }
+    }
+
+    if (defined_type->IsVintfStability()) {
+      bool success = true;
+      if (options.GetStability() != Options::Stability::VINTF) {
+        AIDL_ERROR(defined_type)
+            << "Must compile @VintfStability type w/ aidl_interface 'stability: \"vintf\"'";
+        success = false;
+      }
+      if (!options.IsStructured()) {
+        AIDL_ERROR(defined_type)
+            << "Must compile @VintfStability type w/ aidl_interface --structured";
+        success = false;
+      }
+      if (!success) return AidlError::NOT_STRUCTURED;
+    }
+  }
+
+  // We only want to mutate the types defined in this AIDL file or subtypes. We can't
+  // use IterateTypes, as this will re-mutate types that have already been loaded
+  // when AidlTypenames is re-used (such as in dump API).
+  class MetaMethodVisitor : public AidlVisitor {
+   public:
+    MetaMethodVisitor(const Options* options, const AidlTypenames* typenames)
+        : mOptions(options), mTypenames(typenames) {}
+    virtual void Visit(const AidlInterface& const_interface) {
+      // TODO: we do not have mutable visitor infrastructure.
+      AidlInterface* interface = const_cast<AidlInterface*>(&const_interface);
+      if (mOptions->Version() > 0) {
+        auto ret = mTypenames->MakeResolvedType(AIDL_LOCATION_HERE, "int", false);
+        vector<unique_ptr<AidlArgument>>* args = new vector<unique_ptr<AidlArgument>>();
+        auto method = std::make_unique<AidlMethod>(AIDL_LOCATION_HERE, false, ret.release(),
+                                                   "getInterfaceVersion", args, Comments{},
+                                                   kGetInterfaceVersionId);
+        interface->AddMethod(std::move(method));
+      }
+      // add the meta-method 'string getInterfaceHash()' if hash is specified.
+      if (!mOptions->Hash().empty()) {
+        auto ret = mTypenames->MakeResolvedType(AIDL_LOCATION_HERE, "String", false);
+        vector<unique_ptr<AidlArgument>>* args = new vector<unique_ptr<AidlArgument>>();
+        auto method =
+            std::make_unique<AidlMethod>(AIDL_LOCATION_HERE, false, ret.release(),
+                                         kGetInterfaceHash, args, Comments{}, kGetInterfaceHashId);
+        interface->AddMethod(std::move(method));
+      }
+    }
+
+   private:
+    const Options* mOptions;
+    const AidlTypenames* mTypenames;
+  };
+  MetaMethodVisitor meta_method_visitor(&options, typenames);
+  for (const auto& defined_type : types) {
+    VisitTopDown(meta_method_visitor, *defined_type);
+  }
+
+  typenames->IterateTypes([&](const AidlDefinedType& type) {
+    const AidlInterface* interface = type.AsInterface();
+    if (interface == nullptr) return;
+    if (!CheckAndAssignMethodIDs(interface->GetMethods())) {
+      err = AidlError::BAD_METHOD_ID;
+    }
+  });
+  if (err != AidlError::OK) {
+    return err;
+  }
+
+  for (const auto& doc : typenames->AllDocuments()) {
+    VisitTopDown([](const AidlNode& n) { n.MarkVisited(); }, *doc);
+  }
+
+  if (!CheckValid(*document, options)) {
+    return AidlError::BAD_TYPE;
+  }
+
+  if (!ValidateAnnotationContext(*document)) {
+    return AidlError::BAD_TYPE;
+  }
+
+  if (!ValidateHeaders(options.TargetLanguage(), *document)) {
+    return AidlError::BAD_TYPE;
+  }
+
+  if (!Diagnose(*document, options.GetDiagnosticMapping())) {
+    return AidlError::BAD_TYPE;
+  }
+
+  typenames->IterateTypes([&](const AidlDefinedType& type) {
+    if (!type.LanguageSpecificCheckValid(options.TargetLanguage())) {
+      err = AidlError::BAD_TYPE;
+    }
+
+    bool isStable = type.IsStableApiParcelable(options.TargetLanguage());
+
+    if (options.IsStructured() && type.AsUnstructuredParcelable() != nullptr && !isStable) {
+      err = AidlError::NOT_STRUCTURED;
+      AIDL_ERROR(type) << type.GetCanonicalName()
+                       << " is not structured, but this is a structured interface in "
+                       << to_string(options.TargetLanguage());
+    }
+    if (options.GetStability() == Options::Stability::VINTF && !type.IsVintfStability() &&
+        !isStable) {
+      err = AidlError::NOT_STRUCTURED;
+      AIDL_ERROR(type) << type.GetCanonicalName()
+                       << " does not have VINTF level stability (marked @VintfStability), but this "
+                          "interface requires it in "
+                       << to_string(options.TargetLanguage());
+    }
+
+    // Ensure that untyped List/Map is not used in a parcelable, a union and a stable interface.
+
+    std::function<void(const AidlTypeSpecifier&, const AidlNode*)> check_untyped_container =
+        [&err, &check_untyped_container](const AidlTypeSpecifier& type, const AidlNode* node) {
+          if (type.IsGeneric()) {
+            std::for_each(type.GetTypeParameters().begin(), type.GetTypeParameters().end(),
+                          [&node, &check_untyped_container](auto& nested) {
+                            check_untyped_container(*nested, node);
+                          });
+            return;
+          }
+          if (type.GetName() == "List" || type.GetName() == "Map") {
+            err = AidlError::BAD_TYPE;
+            AIDL_ERROR(node)
+                << "Encountered an untyped List or Map. The use of untyped List/Map is prohibited "
+                << "because it is not guaranteed that the objects in the list are recognizable in "
+                << "the receiving side. Consider switching to an array or a generic List/Map.";
+          }
+        };
+
+    if (type.AsInterface() && options.IsStructured()) {
+      for (const auto& method : type.GetMethods()) {
+        check_untyped_container(method->GetType(), method.get());
+        for (const auto& arg : method->GetArguments()) {
+          check_untyped_container(arg->GetType(), method.get());
+        }
+      }
+    }
+    for (const auto& field : type.GetFields()) {
+      check_untyped_container(field->GetType(), field.get());
+    }
+  });
+
+  if (err != AidlError::OK) {
+    return err;
+  }
+
+  if (imported_files != nullptr) {
+    *imported_files = import_paths;
+  }
+
+  return AidlError::OK;
+}
+
+void markNewAdditions(AidlTypenames& typenames, const AidlTypenames& previous_typenames) {
+  for (const AidlDefinedType* type : typenames.AllDefinedTypes()) {
+    const AidlDefinedType* previous_type = nullptr;
+    for (const AidlDefinedType* previous : previous_typenames.AllDefinedTypes()) {
+      if (type->GetCanonicalName() == previous->GetCanonicalName()) {
+        previous_type = previous;
+      }
+    }
+    if (previous_type == nullptr) {
+      // This is a new type for this version.
+      continue;
+    }
+    if (type->AsInterface()) {
+      for (const std::unique_ptr<AidlMethod>& member : type->AsInterface()->GetMethods()) {
+        if (!member->IsUserDefined()) continue;
+        bool found = false;
+        for (const std::unique_ptr<AidlMethod>& previous_member : previous_type->GetMethods()) {
+          if (previous_member->GetName() == member->GetName()) {
+            found = true;
+          }
+        }
+        if (!found) member->MarkNew();
+      }
+    } else if (type->AsStructuredParcelable() || type->AsUnionDeclaration()) {
+      for (const std::unique_ptr<AidlVariableDeclaration>& member : type->GetFields()) {
+        if (!member->IsUserDefined()) continue;
+        bool found = false;
+        for (const std::unique_ptr<AidlVariableDeclaration>& previous_member :
+             previous_type->GetFields()) {
+          if (previous_member->GetName() == member->GetName()) {
+            found = true;
+          }
+        }
+        if (!found) member->MarkNew();
+      }
+    } else if (type->AsEnumDeclaration() || type->AsUnstructuredParcelable()) {
+      // We have nothing to do for these types
+    } else {
+      AIDL_FATAL(type) << "Unexpected type when looking for new members";
+    }
+  }
+}
+
+} // namespace internals
+
+bool compile_aidl(const Options& options, const IoDelegate& io_delegate) {
+  const Options::Language lang = options.TargetLanguage();
+
+  // load the previously frozen version if it exists
+  Result<AidlTypenames> previous_typenames_result;
+  if (options.IsLatestUnfrozenVersion()) {
+    // TODO(b/292005937) Once LoadApiDump can handle the OS_PATH_SEPARATOR at
+    // the end of PreviousApiDir, we can stop passing in a substr without it.
+    AIDL_FATAL_IF(options.PreviousApiDir().back() != OS_PATH_SEPARATOR, "Expecting a separator");
+    previous_typenames_result =
+        LoadApiDump(options.WithNoWarnings().WithoutVersion().AsPreviousVersion(), io_delegate,
+                    options.PreviousApiDir().substr(0, options.PreviousApiDir().size() - 1));
+    if (!previous_typenames_result.ok()) {
+      AIDL_ERROR(options.PreviousApiDir())
+          << "Failed to load api dump for '" << options.PreviousApiDir()
+          << "'. Error: " << previous_typenames_result.error().message();
+      return false;
+    }
+  }
+
+  for (const string& input_file : options.InputFiles()) {
+    AidlTypenames typenames;
+
+    vector<string> imported_files;
+
+    AidlError aidl_err = internals::load_and_validate_aidl(input_file, options, io_delegate,
+                                                           &typenames, &imported_files);
+    if (aidl_err != AidlError::OK) {
+      return false;
+    }
+
+    if (options.IsLatestUnfrozenVersion()) {
+      internals::markNewAdditions(typenames, previous_typenames_result.value());
+    }
+
+    for (const auto& defined_type : typenames.MainDocument().DefinedTypes()) {
+      AIDL_FATAL_IF(defined_type == nullptr, input_file);
+
+      string output_file_name = options.OutputFile();
+      // if needed, generate the output file name from the base folder
+      if (output_file_name.empty() && !options.OutputDir().empty()) {
+        output_file_name = GetOutputFilePath(options, *defined_type);
+        if (output_file_name.empty()) {
+          return false;
+        }
+      }
+
+      if (!write_dep_file(options, *defined_type, imported_files, io_delegate, input_file,
+                          output_file_name)) {
+        return false;
+      }
+
+      bool success = false;
+      if (lang == Options::Language::CPP) {
+        success =
+            cpp::GenerateCpp(output_file_name, options, typenames, *defined_type, io_delegate);
+      } else if (lang == Options::Language::NDK) {
+        ndk::GenerateNdk(output_file_name, options, typenames, *defined_type, io_delegate);
+        success = true;
+      } else if (lang == Options::Language::JAVA) {
+        if (defined_type->AsUnstructuredParcelable() != nullptr) {
+          // Legacy behavior. For parcelable declarations in Java, don't generate output file.
+          success = true;
+        } else {
+          java::GenerateJava(output_file_name, options, typenames, *defined_type, io_delegate);
+          success = true;
+        }
+      } else if (lang == Options::Language::RUST) {
+        rust::GenerateRust(output_file_name, options, typenames, *defined_type, io_delegate);
+        success = true;
+      } else if (lang == Options::Language::CPP_ANALYZER) {
+        success = cpp::GenerateCppAnalyzer(output_file_name, options, typenames, *defined_type,
+                                           io_delegate);
+      } else {
+        AIDL_FATAL(input_file) << "Should not reach here.";
+      }
+      if (!success) {
+        return false;
+      }
+    }
+  }
+  return true;
+}
+
+bool dump_mappings(const Options& options, const IoDelegate& io_delegate) {
+  android::aidl::mappings::SignatureMap all_mappings;
+  for (const string& input_file : options.InputFiles()) {
+    AidlTypenames typenames;
+    vector<string> imported_files;
+
+    AidlError aidl_err = internals::load_and_validate_aidl(input_file, options, io_delegate,
+                                                           &typenames, &imported_files);
+    if (aidl_err != AidlError::OK) {
+      return false;
+    }
+    for (const auto& defined_type : typenames.MainDocument().DefinedTypes()) {
+      auto mappings = mappings::generate_mappings(defined_type.get());
+      all_mappings.insert(mappings.begin(), mappings.end());
+    }
+  }
+  std::stringstream mappings_str;
+  for (const auto& mapping : all_mappings) {
+    mappings_str << mapping.first << "\n" << mapping.second << "\n";
+  }
+  auto code_writer = io_delegate.GetCodeWriter(options.OutputFile());
+  code_writer->Write("%s", mappings_str.str().c_str());
+  return true;
+}
+
+int aidl_entry(const Options& options, const IoDelegate& io_delegate) {
+  AidlErrorLog::clearError();
+  AidlNode::ClearUnvisitedNodes();
+
+  bool success = false;
+  if (options.Ok()) {
+    switch (options.GetTask()) {
+      case Options::Task::HELP:
+        success = true;
+        break;
+      case Options::Task::COMPILE:
+        success = android::aidl::compile_aidl(options, io_delegate);
+        break;
+      case Options::Task::PREPROCESS:
+        success = android::aidl::Preprocess(options, io_delegate);
+        break;
+      case Options::Task::DUMP_API:
+        success = android::aidl::dump_api(options, io_delegate);
+        break;
+      case Options::Task::CHECK_API:
+        success = android::aidl::check_api(options, io_delegate);
+        break;
+      case Options::Task::DUMP_MAPPINGS:
+        success = android::aidl::dump_mappings(options, io_delegate);
+        break;
+      default:
+        AIDL_FATAL(AIDL_LOCATION_HERE)
+            << "Unrecognized task: " << static_cast<size_t>(options.GetTask());
+    }
+  } else {
+    AIDL_ERROR(options.GetErrorMessage()) << options.GetUsage();
+  }
+
+  const bool reportedError = AidlErrorLog::hadError();
+  AIDL_FATAL_IF(success == reportedError, AIDL_LOCATION_HERE)
+      << "Compiler returned success " << success << " but did" << (reportedError ? "" : " not")
+      << " emit error logs";
+
+  if (success) {
+    auto locations = AidlNode::GetLocationsOfUnvisitedNodes();
+    if (!locations.empty()) {
+      for (const auto& location : locations) {
+        AIDL_ERROR(location) << "AidlNode at location was not visited!";
+      }
+      AIDL_FATAL(AIDL_LOCATION_HERE)
+          << "The AIDL AST was not processed fully. Please report an issue.";
+    }
+  }
+
+  return success ? 0 : 1;
+}
+
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl.h b/aidl.h
new file mode 100644
index 0000000..2d15c06
--- /dev/null
+++ b/aidl.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <limits>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "aidl_language.h"
+#include "import_resolver.h"
+#include "io_delegate.h"
+#include "options.h"
+
+namespace android {
+namespace aidl {
+
+enum class AidlError {
+  UNKOWN = std::numeric_limits<int32_t>::min(),
+  BAD_PRE_PROCESSED_FILE,
+  PARSE_ERROR,
+  FOUND_PARCELABLE,
+  BAD_PACKAGE,
+  BAD_IMPORT,
+  BAD_TYPE,
+  BAD_METHOD_ID,
+  GENERATION_ERROR,
+  BAD_INPUT,
+  NOT_STRUCTURED,
+
+  OK = 0,
+};
+
+bool compile_aidl(const Options& options, const IoDelegate& io_delegate);
+bool dump_mappings(const Options& options, const IoDelegate& io_delegate);
+
+// main entry point to AIDL
+int aidl_entry(const Options& options, const IoDelegate& io_delegate);
+
+const char kPreamble[] =
+    R"(///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+)";
+
+const string kGetInterfaceVersion("getInterfaceVersion");
+const string kGetInterfaceHash("getInterfaceHash");
+
+namespace internals {
+
+AidlError load_and_validate_aidl(const std::string& input_file_name, const Options& options,
+                                 const IoDelegate& io_delegate, AidlTypenames* typenames,
+                                 vector<string>* imported_files);
+
+} // namespace internals
+
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_api/aidl-test-versioned-interface/1/.hash b/aidl_api/aidl-test-versioned-interface/1/.hash
new file mode 100644
index 0000000..dfdb249
--- /dev/null
+++ b/aidl_api/aidl-test-versioned-interface/1/.hash
@@ -0,0 +1,2 @@
+f211f7823c8279224434f5b9a0b095c1f5ebfc15
+9e7be1859820c59d9d55dd133e71a3687b5d2e5b
diff --git a/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl b/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
new file mode 100644
index 0000000..f0ee62e
--- /dev/null
+++ b/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
@@ -0,0 +1,21 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.versioned.tests;
+union BazUnion {
+  int intNum;
+}
diff --git a/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl b/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
new file mode 100644
index 0000000..da1c01b
--- /dev/null
+++ b/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
@@ -0,0 +1,20 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.versioned.tests;
+parcelable Foo {
+}
diff --git a/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl b/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
new file mode 100644
index 0000000..cbf37e8
--- /dev/null
+++ b/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.versioned.tests;
+interface IFooInterface {
+  void originalApi();
+  @utf8InCpp String acceptUnionAndReturnString(in android.aidl.versioned.tests.BazUnion u);
+  @SuppressWarnings(value={"inout-parameter"}) int ignoreParcelablesAndRepeatInt(in android.aidl.versioned.tests.Foo inFoo, inout android.aidl.versioned.tests.Foo inoutFoo, out android.aidl.versioned.tests.Foo outFoo, int value);
+  int returnsLengthOfFooArray(in android.aidl.versioned.tests.Foo[] foos);
+}
diff --git a/aidl_api/aidl-test-versioned-interface/2/.hash b/aidl_api/aidl-test-versioned-interface/2/.hash
new file mode 100644
index 0000000..5cd45f5
--- /dev/null
+++ b/aidl_api/aidl-test-versioned-interface/2/.hash
@@ -0,0 +1 @@
+da8c4bc94ca7feff0e0a65563a466787698b5891
diff --git a/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl b/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
new file mode 100644
index 0000000..154b59c
--- /dev/null
+++ b/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.versioned.tests;
+union BazUnion {
+  int intNum;
+  long longNum;
+}
diff --git a/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl b/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
new file mode 100644
index 0000000..bd8beb6
--- /dev/null
+++ b/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
@@ -0,0 +1,21 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.versioned.tests;
+parcelable Foo {
+  int intDefault42 = 42;
+}
diff --git a/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl b/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
new file mode 100644
index 0000000..303d01d
--- /dev/null
+++ b/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
@@ -0,0 +1,25 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.versioned.tests;
+interface IFooInterface {
+  void originalApi();
+  @utf8InCpp String acceptUnionAndReturnString(in android.aidl.versioned.tests.BazUnion u);
+  @SuppressWarnings(value={"inout-parameter"}) int ignoreParcelablesAndRepeatInt(in android.aidl.versioned.tests.Foo inFoo, inout android.aidl.versioned.tests.Foo inoutFoo, out android.aidl.versioned.tests.Foo outFoo, int value);
+  int returnsLengthOfFooArray(in android.aidl.versioned.tests.Foo[] foos);
+  void newApi();
+}
diff --git a/aidl_api/aidl-test-versioned-interface/3/.hash b/aidl_api/aidl-test-versioned-interface/3/.hash
new file mode 100644
index 0000000..de1b53f
--- /dev/null
+++ b/aidl_api/aidl-test-versioned-interface/3/.hash
@@ -0,0 +1 @@
+70d76c61eb0c82288e924862c10b910d1b7d8cf8
diff --git a/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl b/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
new file mode 100644
index 0000000..668973f
--- /dev/null
+++ b/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
@@ -0,0 +1,23 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.versioned.tests;
+union BazUnion {
+  int intNum;
+  long longNum;
+}
diff --git a/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl b/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
new file mode 100644
index 0000000..7e5e4df
--- /dev/null
+++ b/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
@@ -0,0 +1,23 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.versioned.tests;
+@JavaSuppressLint(value={"NewApi"})
+parcelable Foo {
+  int intDefault42 = 42;
+}
diff --git a/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl b/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
new file mode 100644
index 0000000..7e4be6e
--- /dev/null
+++ b/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
@@ -0,0 +1,27 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.versioned.tests;
+@JavaDelegator
+interface IFooInterface {
+  void originalApi();
+  @utf8InCpp String acceptUnionAndReturnString(in android.aidl.versioned.tests.BazUnion u);
+  @SuppressWarnings(value={"inout-parameter"}) int ignoreParcelablesAndRepeatInt(in android.aidl.versioned.tests.Foo inFoo, inout android.aidl.versioned.tests.Foo inoutFoo, out android.aidl.versioned.tests.Foo outFoo, int value);
+  int returnsLengthOfFooArray(in android.aidl.versioned.tests.Foo[] foos);
+  void newApi();
+}
diff --git a/aidl_api/aidl-test-versioned-interface/current/android/aidl/versioned/tests/BazUnion.aidl b/aidl_api/aidl-test-versioned-interface/current/android/aidl/versioned/tests/BazUnion.aidl
new file mode 100644
index 0000000..668973f
--- /dev/null
+++ b/aidl_api/aidl-test-versioned-interface/current/android/aidl/versioned/tests/BazUnion.aidl
@@ -0,0 +1,23 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.versioned.tests;
+union BazUnion {
+  int intNum;
+  long longNum;
+}
diff --git a/aidl_api/aidl-test-versioned-interface/current/android/aidl/versioned/tests/Foo.aidl b/aidl_api/aidl-test-versioned-interface/current/android/aidl/versioned/tests/Foo.aidl
new file mode 100644
index 0000000..68364d8
--- /dev/null
+++ b/aidl_api/aidl-test-versioned-interface/current/android/aidl/versioned/tests/Foo.aidl
@@ -0,0 +1,23 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.versioned.tests;
+@JavaSuppressLint(value={"NewApi"})
+parcelable Foo {
+    int intDefault42 = 42;
+}
diff --git a/aidl_api/aidl-test-versioned-interface/current/android/aidl/versioned/tests/IFooInterface.aidl b/aidl_api/aidl-test-versioned-interface/current/android/aidl/versioned/tests/IFooInterface.aidl
new file mode 100644
index 0000000..602c892
--- /dev/null
+++ b/aidl_api/aidl-test-versioned-interface/current/android/aidl/versioned/tests/IFooInterface.aidl
@@ -0,0 +1,31 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.versioned.tests;
+@JavaDelegator
+interface IFooInterface {
+    void originalApi();
+    @utf8InCpp String acceptUnionAndReturnString(
+            in android.aidl.versioned.tests.BazUnion u);
+    @SuppressWarnings(value={"inout-parameter"})
+    int ignoreParcelablesAndRepeatInt(in android.aidl.versioned.tests.Foo inFoo,
+            inout android.aidl.versioned.tests.Foo inoutFoo,
+            out android.aidl.versioned.tests.Foo outFoo, int value);
+    int returnsLengthOfFooArray(in android.aidl.versioned.tests.Foo[] foos);
+    void newApi();
+}
diff --git a/aidl_checkapi.cpp b/aidl_checkapi.cpp
new file mode 100644
index 0000000..0103dc1
--- /dev/null
+++ b/aidl_checkapi.cpp
@@ -0,0 +1,549 @@
+/*
+ * Copyright (C) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl.h"
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include <android-base/result.h>
+#include <android-base/strings.h>
+#include <gtest/gtest.h>
+
+#include "aidl_dumpapi.h"
+#include "aidl_language.h"
+#include "import_resolver.h"
+#include "logging.h"
+#include "options.h"
+
+namespace android {
+namespace aidl {
+
+using android::base::Error;
+using android::base::Result;
+using android::base::StartsWith;
+using std::map;
+using std::set;
+using std::string;
+using std::vector;
+
+static std::string Dump(const AidlDefinedType& type) {
+  string code;
+  CodeWriterPtr out = CodeWriter::ForString(&code);
+  DumpVisitor visitor(*out, /*inline_constants=*/true);
+  type.DispatchVisit(visitor);
+  out->Close();
+  return code;
+}
+
+// Uses each type's Dump() and GTest utility(EqHelper).
+static bool CheckEquality(const AidlDefinedType& older, const AidlDefinedType& newer) {
+  using testing::internal::EqHelper;
+  auto older_file = older.GetLocation().GetFile();
+  auto newer_file = newer.GetLocation().GetFile();
+  auto result = EqHelper::Compare(older_file.data(), newer_file.data(), Dump(older), Dump(newer));
+  if (!result) {
+    AIDL_ERROR(newer) << result.failure_message();
+  }
+  return result;
+}
+
+static vector<string> get_strict_annotations(const AidlAnnotatable& node) {
+  // This must be symmetrical (if you can add something, you must be able to
+  // remove it). The reason is that we have no way of knowing which interface a
+  // server serves and which interface a client serves (e.g. a callback
+  // interface). Note that this is being overly lenient. It makes sense for
+  // newer code to start accepting nullable things. However, here, we don't know
+  // if the client of an interface or the server of an interface is newer.
+  //
+  // Here are two examples to demonstrate this:
+  // - a new implementation might change so that it no longer returns null
+  // values (remove @nullable)
+  // - a new implementation might start accepting null values (add @nullable)
+  //
+  // AidlAnnotation::Type::SENSITIVE_DATA could be ignored for backwards
+  // compatibility, but is not. It should retroactively be applied to the
+  // older versions of the interface. When doing that, we need
+  // to add the new hash to the older versions after the change using
+  // tools/aidl/build/hash_gen.sh.
+  static const set<AidlAnnotation::Type> kIgnoreAnnotations{
+      AidlAnnotation::Type::NULLABLE,
+      // @JavaDerive doesn't affect read/write
+      AidlAnnotation::Type::JAVA_DERIVE,
+      AidlAnnotation::Type::JAVA_DEFAULT,
+      AidlAnnotation::Type::JAVA_DELEGATOR,
+      AidlAnnotation::Type::JAVA_ONLY_IMMUTABLE,
+      AidlAnnotation::Type::JAVA_PASSTHROUGH,
+      AidlAnnotation::Type::JAVA_SUPPRESS_LINT,
+      // @RustDerive doesn't affect read/write
+      AidlAnnotation::Type::RUST_DERIVE,
+      AidlAnnotation::Type::SUPPRESS_WARNINGS,
+  };
+  vector<string> annotations;
+  for (const auto& annotation : node.GetAnnotations()) {
+    if (kIgnoreAnnotations.find(annotation->GetType()) != kIgnoreAnnotations.end()) {
+      continue;
+    }
+    auto annotation_string = annotation->ToString();
+    // adding @Deprecated (with optional args) is okay
+    if (StartsWith(annotation_string, "@JavaPassthrough(annotation=\"@Deprecated")) {
+      continue;
+    }
+    annotations.push_back(annotation_string);
+  }
+  return annotations;
+}
+
+static bool have_compatible_annotations(const AidlAnnotatable& older,
+                                        const AidlAnnotatable& newer) {
+  vector<string> olderAnnotations = get_strict_annotations(older);
+  vector<string> newerAnnotations = get_strict_annotations(newer);
+  sort(olderAnnotations.begin(), olderAnnotations.end());
+  sort(newerAnnotations.begin(), newerAnnotations.end());
+  if (olderAnnotations != newerAnnotations) {
+    const string from = older.ToString().empty() ? "(empty)" : older.ToString();
+    const string to = newer.ToString().empty() ? "(empty)" : newer.ToString();
+    AIDL_ERROR(newer) << "Changed annotations: " << from << " to " << to;
+    return false;
+  }
+  return true;
+}
+
+static bool are_compatible_types(const AidlTypeSpecifier& older, const AidlTypeSpecifier& newer) {
+  bool compatible = true;
+  if (older.Signature() != newer.Signature()) {
+    AIDL_ERROR(newer) << "Type changed: " << older.Signature() << " to " << newer.Signature()
+                      << ".";
+    compatible = false;
+  }
+  compatible &= have_compatible_annotations(older, newer);
+  return compatible;
+}
+
+static bool are_compatible_constants(const AidlDefinedType& older, const AidlDefinedType& newer) {
+  bool compatible = true;
+
+  map<string, AidlConstantDeclaration*> new_constdecls;
+  for (const auto& c : newer.GetConstantDeclarations()) {
+    new_constdecls[c->GetName()] = &*c;
+  }
+
+  for (const auto& old_c : older.GetConstantDeclarations()) {
+    const auto found = new_constdecls.find(old_c->GetName());
+    if (found == new_constdecls.end()) {
+      AIDL_ERROR(old_c) << "Removed constant declaration: " << older.GetCanonicalName() << "."
+                        << old_c->GetName();
+      compatible = false;
+      continue;
+    }
+
+    const auto new_c = found->second;
+    compatible &= are_compatible_types(old_c->GetType(), new_c->GetType());
+
+    const string old_value = old_c->ValueString(AidlConstantValueDecorator);
+    const string new_value = new_c->ValueString(AidlConstantValueDecorator);
+    if (old_value != new_value) {
+      AIDL_ERROR(newer) << "Changed constant value: " << older.GetCanonicalName() << "."
+                        << old_c->GetName() << " from " << old_value << " to " << new_value << ".";
+      compatible = false;
+    }
+  }
+  return compatible;
+}
+
+static bool are_compatible_interfaces(const AidlInterface& older, const AidlInterface& newer) {
+  bool compatible = true;
+
+  map<string, AidlMethod*> new_methods;
+  for (const auto& m : newer.AsInterface()->GetMethods()) {
+    new_methods.emplace(m->Signature(), m.get());
+  }
+
+  for (const auto& old_m : older.AsInterface()->GetMethods()) {
+    const auto found = new_methods.find(old_m->Signature());
+    if (found == new_methods.end()) {
+      AIDL_ERROR(old_m) << "Removed or changed method: " << older.GetCanonicalName() << "."
+                        << old_m->Signature();
+      compatible = false;
+      continue;
+    }
+
+    // Compare IDs to detect method reordering. IDs are assigned by their
+    // textual order, so if there is an ID mismatch, that means reordering
+    // has happened.
+    const auto new_m = found->second;
+
+    if (old_m->IsOneway() != new_m->IsOneway()) {
+      AIDL_ERROR(new_m) << "Oneway attribute " << (old_m->IsOneway() ? "removed" : "added") << ": "
+                        << older.GetCanonicalName() << "." << old_m->Signature();
+      compatible = false;
+    }
+
+    if (old_m->GetId() != new_m->GetId()) {
+      AIDL_ERROR(new_m) << "Transaction ID changed: " << older.GetCanonicalName() << "."
+                        << old_m->Signature() << " is changed from " << old_m->GetId() << " to "
+                        << new_m->GetId() << ".";
+      compatible = false;
+    }
+
+    compatible &= are_compatible_types(old_m->GetType(), new_m->GetType());
+
+    const auto& old_args = old_m->GetArguments();
+    const auto& new_args = new_m->GetArguments();
+    // this is guaranteed because arguments are part of AidlMethod::Signature()
+    AIDL_FATAL_IF(old_args.size() != new_args.size(), old_m);
+    for (size_t i = 0; i < old_args.size(); i++) {
+      const AidlArgument& old_a = *(old_args.at(i));
+      const AidlArgument& new_a = *(new_args.at(i));
+      compatible &= are_compatible_types(old_a.GetType(), new_a.GetType());
+
+      if (old_a.GetDirection() != new_a.GetDirection()) {
+        AIDL_ERROR(new_m) << "Direction changed: " << old_a.GetDirectionSpecifier() << " to "
+                          << new_a.GetDirectionSpecifier() << ".";
+        compatible = false;
+      }
+    }
+  }
+
+  compatible = are_compatible_constants(older, newer) && compatible;
+
+  return compatible;
+}
+
+static bool HasZeroEnumerator(const AidlEnumDeclaration& enum_decl) {
+  return std::any_of(enum_decl.GetEnumerators().begin(), enum_decl.GetEnumerators().end(),
+                     [&](const unique_ptr<AidlEnumerator>& enumerator) {
+                       return enumerator->GetValue()->ValueString(
+                                  enum_decl.GetBackingType(), AidlConstantValueDecorator) == "0";
+                     });
+}
+
+static bool EvaluatesToZero(const AidlEnumDeclaration& enum_decl, const AidlConstantValue* value) {
+  if (value == nullptr) return true;
+  return value->ValueString(enum_decl.GetBackingType(), AidlConstantValueDecorator) == "0";
+}
+
+static bool are_compatible_parcelables(const AidlDefinedType& older, const AidlTypenames&,
+                                       const AidlDefinedType& newer,
+                                       const AidlTypenames& new_types) {
+  const auto& old_fields = older.GetFields();
+  const auto& new_fields = newer.GetFields();
+  if (old_fields.size() > new_fields.size()) {
+    // you can add new fields only at the end
+    AIDL_ERROR(newer) << "Number of fields in " << older.GetCanonicalName() << " is reduced from "
+                      << old_fields.size() << " to " << new_fields.size() << ".";
+    return false;
+  }
+  if (newer.IsFixedSize() && old_fields.size() != new_fields.size()) {
+    AIDL_ERROR(newer) << "Number of fields in " << older.GetCanonicalName() << " is changed from "
+                      << old_fields.size() << " to " << new_fields.size()
+                      << ". This is an incompatible change for FixedSize types.";
+    return false;
+  }
+
+  // android.net.UidRangeParcel should be frozen to prevent breakage in legacy (b/186720556)
+  if (older.GetCanonicalName() == "android.net.UidRangeParcel" &&
+      old_fields.size() != new_fields.size()) {
+    AIDL_ERROR(newer) << "Number of fields in " << older.GetCanonicalName() << " is changed from "
+                      << old_fields.size() << " to " << new_fields.size()
+                      << ". But it is forbidden because of legacy support.";
+    return false;
+  }
+
+  bool compatible = true;
+  for (size_t i = 0; i < old_fields.size(); i++) {
+    const auto& old_field = old_fields.at(i);
+    const auto& new_field = new_fields.at(i);
+    compatible &= are_compatible_types(old_field->GetType(), new_field->GetType());
+
+    const string old_value = old_field->ValueString(AidlConstantValueDecorator);
+    const string new_value = new_field->ValueString(AidlConstantValueDecorator);
+    if (old_value == new_value) {
+      continue;
+    }
+    // For enum type fields, we accept setting explicit default value which is "zero"
+    auto enum_decl = new_types.GetEnumDeclaration(new_field->GetType());
+    if (old_value == "" && enum_decl && EvaluatesToZero(*enum_decl, new_field->GetDefaultValue())) {
+      continue;
+    }
+
+    AIDL_ERROR(new_field) << "Changed default value: " << old_value << " to " << new_value << ".";
+    compatible = false;
+  }
+
+  // Reordering of fields is an incompatible change.
+  for (size_t i = 0; i < new_fields.size(); i++) {
+    const auto& new_field = new_fields.at(i);
+    auto found = std::find_if(old_fields.begin(), old_fields.end(), [&new_field](const auto& f) {
+      return new_field->GetName() == f->GetName();
+    });
+    if (found != old_fields.end()) {
+      size_t old_index = std::distance(old_fields.begin(), found);
+      if (old_index != i) {
+        AIDL_ERROR(new_field) << "Reordered " << new_field->GetName() << " from " << old_index
+                              << " to " << i << ".";
+        compatible = false;
+      }
+    }
+  }
+
+  // New fields must have default values.
+  if (older.AsUnionDeclaration() == nullptr) {
+    for (size_t i = old_fields.size(); i < new_fields.size(); i++) {
+      const auto& new_field = new_fields.at(i);
+      if (new_field->HasUsefulDefaultValue()) {
+        continue;
+      }
+
+      // enum can't be nullable, but it's okay if it has 0 as a valid enumerator.
+      if (const auto& enum_decl = new_types.GetEnumDeclaration(new_field->GetType());
+          enum_decl != nullptr) {
+        if (HasZeroEnumerator(*enum_decl)) {
+          continue;
+        }
+
+        // TODO(b/142893595): Rephrase the message: "provide a default value or make sure ..."
+        AIDL_ERROR(new_field) << "Field '" << new_field->GetName() << "' of enum '"
+                              << enum_decl->GetName()
+                              << "' can't be initialized as '0'. Please make sure '"
+                              << enum_decl->GetName() << "' has '0' as a valid value.";
+        compatible = false;
+        continue;
+      }
+
+      // Old API versions may suffer from the issue presented here. There is
+      // only a finite number in Android, which we must allow indefinitely.
+      struct HistoricalException {
+        std::string canonical;
+        std::string field;
+      };
+      static std::vector<HistoricalException> exceptions = {
+          {"android.net.DhcpResultsParcelable", "serverHostName"},
+          {"android.net.ResolverParamsParcel", "resolverOptions"},
+      };
+      bool excepted = false;
+      for (const HistoricalException& exception : exceptions) {
+        if (older.GetCanonicalName() == exception.canonical &&
+            new_field->GetName() == exception.field) {
+          excepted = true;
+          break;
+        }
+      }
+      if (excepted) continue;
+
+      AIDL_ERROR(new_field)
+          << "Field '" << new_field->GetName()
+          << "' does not have a useful default in some backends. Please either provide a default "
+             "value for this field or mark the field as @nullable. This value or a null value will "
+             "be used automatically when an old version of this parcelable is sent to a process "
+             "which understands a new version of this parcelable. In order to make sure your code "
+             "continues to be backwards compatible, make sure the default or null value does not "
+             "cause a semantic change to this parcelable.";
+      compatible = false;
+    }
+  }
+
+  compatible = are_compatible_constants(older, newer) && compatible;
+
+  return compatible;
+}
+
+static bool are_compatible_enums(const AidlEnumDeclaration& older,
+                                 const AidlEnumDeclaration& newer) {
+  std::map<std::string, const AidlConstantValue*> old_enum_map;
+  for (const auto& enumerator : older.GetEnumerators()) {
+    old_enum_map[enumerator->GetName()] = enumerator->GetValue();
+  }
+  std::map<std::string, const AidlConstantValue*> new_enum_map;
+  for (const auto& enumerator : newer.GetEnumerators()) {
+    new_enum_map[enumerator->GetName()] = enumerator->GetValue();
+  }
+
+  bool compatible = true;
+  for (const auto& [name, value] : old_enum_map) {
+    if (new_enum_map.find(name) == new_enum_map.end()) {
+      AIDL_ERROR(newer) << "Removed enumerator from " << older.GetCanonicalName() << ": " << name;
+      compatible = false;
+      continue;
+    }
+    const string old_value =
+        old_enum_map[name]->ValueString(older.GetBackingType(), AidlConstantValueDecorator);
+    const string new_value =
+        new_enum_map[name]->ValueString(newer.GetBackingType(), AidlConstantValueDecorator);
+    if (old_value != new_value) {
+      AIDL_ERROR(newer) << "Changed enumerator value: " << older.GetCanonicalName() << "::" << name
+                        << " from " << old_value << " to " << new_value << ".";
+      compatible = false;
+    }
+  }
+  return compatible;
+}
+
+Result<AidlTypenames> LoadApiDump(const Options& options, const IoDelegate& io_delegate,
+                                  const std::string& dir) {
+  Result<std::vector<std::string>> dir_files = io_delegate.ListFiles(dir);
+  if (!dir_files.ok()) {
+    AIDL_ERROR(dir) << dir_files.error();
+    return Error();
+  }
+
+  AidlTypenames typenames;
+  for (const auto& file : *dir_files) {
+    if (!android::base::EndsWith(file, ".aidl")) continue;
+    // current "dir" is added to "imports" so that referenced.aidl files in the current
+    // module are available when resolving references.
+    if (internals::load_and_validate_aidl(file, options.PlusImportDir(dir), io_delegate, &typenames,
+                                          nullptr /* imported_files */) != AidlError::OK) {
+      AIDL_ERROR(file) << "Failed to read.";
+      return Error();
+    }
+  }
+
+  return typenames;
+}
+
+bool check_api(const Options& options, const IoDelegate& io_delegate) {
+  AIDL_FATAL_IF(!options.IsStructured(), AIDL_LOCATION_HERE);
+  AIDL_FATAL_IF(options.InputFiles().size() != 2, AIDL_LOCATION_HERE)
+      << "--checkapi requires two inputs "
+      << "but got " << options.InputFiles().size();
+  auto old_tns = LoadApiDump(options, io_delegate, options.InputFiles().at(0));
+  if (!old_tns.ok()) {
+    return false;
+  }
+  auto new_tns = LoadApiDump(options, io_delegate, options.InputFiles().at(1));
+  if (!new_tns.ok()) {
+    return false;
+  }
+
+  const Options::CheckApiLevel level = options.GetCheckApiLevel();
+
+  // We don't check impoted types.
+  auto get_types_in = [](const AidlTypenames& tns, const std::string& location) {
+    std::vector<const AidlDefinedType*> types;
+    for (const auto& type : tns.AllDefinedTypes()) {
+      if (StartsWith(type->GetLocation().GetFile(), location)) {
+        types.push_back(type);
+      }
+    }
+    return types;
+  };
+  std::vector<const AidlDefinedType*> old_types =
+      get_types_in(*old_tns, options.InputFiles().at(0));
+  std::vector<const AidlDefinedType*> new_types =
+      get_types_in(*new_tns, options.InputFiles().at(1));
+
+  bool compatible = true;
+
+  if (level == Options::CheckApiLevel::EQUAL) {
+    std::set<string> old_type_names;
+    for (const auto t : old_types) {
+      old_type_names.insert(t->GetCanonicalName());
+    }
+    for (const auto new_type : new_types) {
+      const auto found = old_type_names.find(new_type->GetCanonicalName());
+      if (found == old_type_names.end()) {
+        AIDL_ERROR(new_type) << "Added type: " << new_type->GetCanonicalName();
+        compatible = false;
+        continue;
+      }
+    }
+  }
+
+  map<string, const AidlDefinedType*> new_map;
+  for (const auto t : new_types) {
+    new_map.emplace(t->GetCanonicalName(), t);
+  }
+
+  for (const auto old_type : old_types) {
+    const auto found = new_map.find(old_type->GetCanonicalName());
+    if (found == new_map.end()) {
+      AIDL_ERROR(old_type) << "Removed type: " << old_type->GetCanonicalName();
+      compatible = false;
+      continue;
+    }
+    const auto new_type = found->second;
+
+    if (level == Options::CheckApiLevel::EQUAL) {
+      if (!CheckEquality(*old_type, *new_type)) {
+        compatible = false;
+      }
+      continue;
+    }
+
+    if (!have_compatible_annotations(*old_type, *new_type)) {
+      compatible = false;
+    }
+    if (old_type->AsInterface() != nullptr) {
+      if (new_type->AsInterface() == nullptr) {
+        AIDL_ERROR(new_type) << "Type mismatch: " << old_type->GetCanonicalName()
+                             << " is changed from " << old_type->GetPreprocessDeclarationName()
+                             << " to " << new_type->GetPreprocessDeclarationName();
+        compatible = false;
+        continue;
+      }
+      compatible &=
+          are_compatible_interfaces(*(old_type->AsInterface()), *(new_type->AsInterface()));
+    } else if (old_type->AsStructuredParcelable() != nullptr) {
+      if (new_type->AsStructuredParcelable() == nullptr) {
+        AIDL_ERROR(new_type) << "Parcelable" << new_type->GetCanonicalName()
+                             << " is not structured. ";
+        compatible = false;
+        continue;
+      }
+      compatible &= are_compatible_parcelables(*(old_type->AsStructuredParcelable()), *old_tns,
+                                               *(new_type->AsStructuredParcelable()), *new_tns);
+    } else if (old_type->AsUnstructuredParcelable() != nullptr) {
+      // We could compare annotations or cpp_header/ndk_header here, but all these changes
+      // can be safe, and it's really up to the person making these changes to make sure
+      // they are safe. This is originally added for Android Studio. In the platform build
+      // system, this can never be reached because we build with '-b'
+
+      // ignore, do nothing
+    } else if (old_type->AsUnionDeclaration() != nullptr) {
+      if (new_type->AsUnionDeclaration() == nullptr) {
+        AIDL_ERROR(new_type) << "Type mismatch: " << old_type->GetCanonicalName()
+                             << " is changed from " << old_type->GetPreprocessDeclarationName()
+                             << " to " << new_type->GetPreprocessDeclarationName();
+        compatible = false;
+        continue;
+      }
+      compatible &= are_compatible_parcelables(*(old_type->AsUnionDeclaration()), *old_tns,
+                                               *(new_type->AsUnionDeclaration()), *new_tns);
+    } else if (old_type->AsEnumDeclaration() != nullptr) {
+      if (new_type->AsEnumDeclaration() == nullptr) {
+        AIDL_ERROR(new_type) << "Type mismatch: " << old_type->GetCanonicalName()
+                             << " is changed from " << old_type->GetPreprocessDeclarationName()
+                             << " to " << new_type->GetPreprocessDeclarationName();
+        compatible = false;
+        continue;
+      }
+      compatible &=
+          are_compatible_enums(*(old_type->AsEnumDeclaration()), *(new_type->AsEnumDeclaration()));
+    } else {
+      AIDL_ERROR(old_type) << "Unsupported declaration type "
+                           << old_type->GetPreprocessDeclarationName() << " for "
+                           << old_type->GetCanonicalName() << " API dump comparison";
+      compatible = false;
+    }
+  }
+
+  return compatible;
+}
+
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_checkapi.h b/aidl_checkapi.h
new file mode 100644
index 0000000..2291e33
--- /dev/null
+++ b/aidl_checkapi.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2018, The Android Open Source Project *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include "android-base/result.h"
+#include "io_delegate.h"
+#include "options.h"
+
+namespace android {
+namespace aidl {
+
+// Compare the two API dumps, which are given as input files, and test whether
+// the second API dump is backwards compatible with the first API dump.
+bool check_api(const Options& options, const IoDelegate& io_delegate);
+
+// load and validate an entire versioned aidl_api dump
+Result<AidlTypenames> LoadApiDump(const Options& options, const IoDelegate& io_delegate,
+                                  const std::string& dir);
+
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_const_expressions.cpp b/aidl_const_expressions.cpp
new file mode 100644
index 0000000..afab3a2
--- /dev/null
+++ b/aidl_const_expressions.cpp
@@ -0,0 +1,1178 @@
+/*
+ * Copyright (C) 2019, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl_language.h"
+#include "aidl_typenames.h"
+#include "logging.h"
+
+#include <stdlib.h>
+#include <algorithm>
+#include <iostream>
+#include <limits>
+#include <memory>
+
+#include <android-base/parsedouble.h>
+#include <android-base/parseint.h>
+#include <android-base/strings.h>
+
+using android::base::ConsumeSuffix;
+using android::base::EndsWith;
+using android::base::Join;
+using android::base::StartsWith;
+using std::string;
+using std::unique_ptr;
+using std::vector;
+
+template <typename T>
+constexpr int CLZ(T x) {
+  // __builtin_clz(0) is undefined
+  if (x == 0) return sizeof(T) * 8;
+  return (sizeof(T) == sizeof(uint64_t)) ? __builtin_clzl(x) : __builtin_clz(x);
+}
+
+template <typename T>
+class OverflowGuard {
+ public:
+  OverflowGuard(T value) : mValue(value) {}
+  bool Overflowed() const { return mOverflowed; }
+
+  T operator+() { return +mValue; }
+  T operator-() {
+    if (isMin()) {
+      mOverflowed = true;
+      return 0;
+    }
+    return -mValue;
+  }
+  T operator!() { return !mValue; }
+  T operator~() { return ~mValue; }
+
+  T operator+(T o) {
+    T out;
+    mOverflowed = __builtin_add_overflow(mValue, o, &out);
+    return out;
+  }
+  T operator-(T o) {
+    T out;
+    mOverflowed = __builtin_sub_overflow(mValue, o, &out);
+    return out;
+  }
+  T operator*(T o) {
+    T out;
+#ifdef _WIN32
+    // ___mulodi4 not on windows https://bugs.llvm.org/show_bug.cgi?id=46669
+    // we should still get an error here from ubsan, but the nice error
+    // is needed on linux for aidl_parser_fuzzer, where we are more
+    // concerned about overflows elsewhere in the compiler in addition to
+    // those in interfaces.
+    out = mValue * o;
+#else
+    mOverflowed = __builtin_mul_overflow(mValue, o, &out);
+#endif
+    return out;
+  }
+  T operator/(T o) {
+    if (o == 0 || (isMin() && o == -1)) {
+      mOverflowed = true;
+      return 0;
+    }
+    return static_cast<T>(mValue / o);
+  }
+  T operator%(T o) {
+    if (o == 0 || (isMin() && o == -1)) {
+      mOverflowed = true;
+      return 0;
+    }
+    return static_cast<T>(mValue % o);
+  }
+  T operator|(T o) { return mValue | o; }
+  T operator^(T o) { return mValue ^ o; }
+  T operator&(T o) { return mValue & o; }
+  T operator<(T o) { return mValue < o; }
+  T operator>(T o) { return mValue > o; }
+  T operator<=(T o) { return mValue <= o; }
+  T operator>=(T o) { return mValue >= o; }
+  T operator==(T o) { return mValue == o; }
+  T operator!=(T o) { return mValue != o; }
+  T operator>>(T o) {
+    if (o < 0 || o >= static_cast<T>(sizeof(T) * 8) || mValue < 0) {
+      mOverflowed = true;
+      return 0;
+    }
+    return static_cast<T>(mValue >> o);
+  }
+  T operator<<(T o) {
+    if (o < 0 || mValue < 0 || o > CLZ(mValue) || o >= static_cast<T>(sizeof(T) * 8)) {
+      mOverflowed = true;
+      return 0;
+    }
+    return static_cast<T>(mValue << o);
+  }
+  T operator||(T o) { return mValue || o; }
+  T operator&&(T o) { return mValue && o; }
+
+ private:
+  bool isMin() { return mValue == std::numeric_limits<T>::min(); }
+
+  T mValue;
+  bool mOverflowed = false;
+};
+
+template <typename T>
+bool processGuard(const OverflowGuard<T>& guard, const AidlConstantValue& context) {
+  if (guard.Overflowed()) {
+    AIDL_ERROR(context) << "Constant expression computation overflows.";
+    return false;
+  }
+  return true;
+}
+
+// TODO: factor out all these macros
+#define SHOULD_NOT_REACH() AIDL_FATAL(AIDL_LOCATION_HERE) << "Should not reach."
+#define OPEQ(__y__) (string(op_) == string(__y__))
+#define COMPUTE_UNARY(T, __op__)         \
+  if (op == string(#__op__)) {           \
+    OverflowGuard<T> guard(val);         \
+    *out = __op__ guard;                 \
+    return processGuard(guard, context); \
+  }
+#define COMPUTE_BINARY(T, __op__)        \
+  if (op == string(#__op__)) {           \
+    OverflowGuard<T> guard(lval);        \
+    *out = guard __op__ rval;            \
+    return processGuard(guard, context); \
+  }
+#define OP_IS_BIN_ARITHMETIC (OPEQ("+") || OPEQ("-") || OPEQ("*") || OPEQ("/") || OPEQ("%"))
+#define OP_IS_BIN_BITFLIP (OPEQ("|") || OPEQ("^") || OPEQ("&"))
+#define OP_IS_BIN_COMP \
+  (OPEQ("<") || OPEQ(">") || OPEQ("<=") || OPEQ(">=") || OPEQ("==") || OPEQ("!="))
+#define OP_IS_BIN_SHIFT (OPEQ(">>") || OPEQ("<<"))
+#define OP_IS_BIN_LOGICAL (OPEQ("||") || OPEQ("&&"))
+
+// NOLINT to suppress missing parentheses warnings about __def__.
+#define SWITCH_KIND(__cond__, __action__, __def__) \
+  switch (__cond__) {                              \
+    case Type::BOOLEAN:                            \
+      __action__(bool);                            \
+    case Type::INT8:                               \
+      __action__(int8_t);                          \
+    case Type::INT32:                              \
+      __action__(int32_t);                         \
+    case Type::INT64:                              \
+      __action__(int64_t);                         \
+    default:                                       \
+      __def__; /* NOLINT */                        \
+  }
+
+template <class T>
+bool handleUnary(const AidlConstantValue& context, const string& op, T val, int64_t* out) {
+  COMPUTE_UNARY(T, +)
+  COMPUTE_UNARY(T, -)
+  COMPUTE_UNARY(T, !)
+  COMPUTE_UNARY(T, ~)
+  AIDL_FATAL(context) << "Could not handleUnary for " << op << " " << val;
+  return false;
+}
+template <>
+bool handleUnary<bool>(const AidlConstantValue& context, const string& op, bool val, int64_t* out) {
+  COMPUTE_UNARY(bool, +)
+  COMPUTE_UNARY(bool, -)
+  COMPUTE_UNARY(bool, !)
+
+  if (op == "~") {
+    AIDL_ERROR(context) << "Bitwise negation of a boolean expression is always true.";
+    return false;
+  }
+  AIDL_FATAL(context) << "Could not handleUnary for " << op << " " << val;
+  return false;
+}
+
+template <class T>
+bool handleBinaryCommon(const AidlConstantValue& context, T lval, const string& op, T rval,
+                        int64_t* out) {
+  COMPUTE_BINARY(T, +)
+  COMPUTE_BINARY(T, -)
+  COMPUTE_BINARY(T, *)
+  COMPUTE_BINARY(T, /)
+  COMPUTE_BINARY(T, %)
+  COMPUTE_BINARY(T, |)
+  COMPUTE_BINARY(T, ^)
+  COMPUTE_BINARY(T, &)
+  // comparison operators: return 0 or 1 by nature.
+  COMPUTE_BINARY(T, ==)
+  COMPUTE_BINARY(T, !=)
+  COMPUTE_BINARY(T, <)
+  COMPUTE_BINARY(T, >)
+  COMPUTE_BINARY(T, <=)
+  COMPUTE_BINARY(T, >=)
+
+  AIDL_FATAL(context) << "Could not handleBinaryCommon for " << lval << " " << op << " " << rval;
+  return false;
+}
+
+template <class T>
+bool handleShift(const AidlConstantValue& context, T lval, const string& op, T rval, int64_t* out) {
+  // just cast rval to int64_t and it should fit.
+  COMPUTE_BINARY(T, >>)
+  COMPUTE_BINARY(T, <<)
+
+  AIDL_FATAL(context) << "Could not handleShift for " << lval << " " << op << " " << rval;
+  return false;
+}
+
+bool handleLogical(const AidlConstantValue& context, bool lval, const string& op, bool rval,
+                   int64_t* out) {
+  COMPUTE_BINARY(bool, ||);
+  COMPUTE_BINARY(bool, &&);
+
+  AIDL_FATAL(context) << "Could not handleLogical for " << lval << " " << op << " " << rval;
+  return false;
+}
+
+static bool isValidLiteralChar(char c) {
+  return !(c <= 0x1f ||  // control characters are < 0x20
+           c >= 0x7f ||  // DEL is 0x7f
+           c == '\\');   // Disallow backslashes for future proofing.
+}
+
+static std::string PrintCharLiteral(char c) {
+  std::ostringstream os;
+  switch (c) {
+    case '\0':
+      os << "\\0";
+      break;
+    case '\'':
+      os << "\\'";
+      break;
+    case '\\':
+      os << "\\\\";
+      break;
+    case '\a':
+      os << "\\a";
+      break;
+    case '\b':
+      os << "\\b";
+      break;
+    case '\f':
+      os << "\\f";
+      break;
+    case '\n':
+      os << "\\n";
+      break;
+    case '\r':
+      os << "\\r";
+      break;
+    case '\t':
+      os << "\\t";
+      break;
+    case '\v':
+      os << "\\v";
+      break;
+    default:
+      if (std::isprint(static_cast<unsigned char>(c))) {
+        os << c;
+      } else {
+        os << "\\x" << std::hex << std::uppercase << static_cast<int>(c);
+      }
+  }
+  return os.str();
+}
+
+bool ParseFloating(std::string_view sv, double* parsed) {
+  // float literal should be parsed successfully.
+  android::base::ConsumeSuffix(&sv, "f");
+  return android::base::ParseDouble(std::string(sv).data(), parsed);
+}
+
+bool ParseFloating(std::string_view sv, float* parsed) {
+  // we only care about float literal (with suffix "f").
+  if (!android::base::ConsumeSuffix(&sv, "f")) {
+    return false;
+  }
+  return android::base::ParseFloat(std::string(sv).data(), parsed);
+}
+
+bool AidlUnaryConstExpression::IsCompatibleType(Type type, const string& op) {
+  // Verify the unary type here
+  switch (type) {
+    case Type::BOOLEAN:  // fall-through
+    case Type::INT8:     // fall-through
+    case Type::INT32:    // fall-through
+    case Type::INT64:
+      return true;
+    case Type::FLOATING:
+      return (op == "+" || op == "-");
+    default:
+      return false;
+  }
+}
+
+bool AidlBinaryConstExpression::AreCompatibleTypes(Type t1, Type t2) {
+  switch (t1) {
+    case Type::ARRAY:
+      if (t2 == Type::ARRAY) {
+        return true;
+      }
+      break;
+    case Type::STRING:
+      if (t2 == Type::STRING) {
+        return true;
+      }
+      break;
+    case Type::BOOLEAN:  // fall-through
+    case Type::INT8:     // fall-through
+    case Type::INT32:    // fall-through
+    case Type::INT64:
+      switch (t2) {
+        case Type::BOOLEAN:  // fall-through
+        case Type::INT8:     // fall-through
+        case Type::INT32:    // fall-through
+        case Type::INT64:
+          return true;
+          break;
+        default:
+          break;
+      }
+      break;
+    default:
+      break;
+  }
+
+  return false;
+}
+
+// Returns the promoted kind for both operands
+AidlConstantValue::Type AidlBinaryConstExpression::UsualArithmeticConversion(Type left,
+                                                                             Type right) {
+  // These are handled as special cases
+  AIDL_FATAL_IF(left == Type::STRING || right == Type::STRING, AIDL_LOCATION_HERE);
+  AIDL_FATAL_IF(left == Type::FLOATING || right == Type::FLOATING, AIDL_LOCATION_HERE);
+
+  // Kinds in concern: bool, (u)int[8|32|64]
+  if (left == right) return left;  // easy case
+  if (left == Type::BOOLEAN) return right;
+  if (right == Type::BOOLEAN) return left;
+
+  return left < right ? right : left;
+}
+
+// Returns the promoted integral type where INT32 is the smallest type
+AidlConstantValue::Type AidlBinaryConstExpression::IntegralPromotion(Type in) {
+  return (Type::INT32 < in) ? in : Type::INT32;
+}
+
+AidlConstantValue* AidlConstantValue::Default(const AidlTypeSpecifier& specifier) {
+  AidlLocation location = specifier.GetLocation();
+
+  // allocation of int[0] is a bit wasteful in Java
+  if (specifier.IsArray()) {
+    return nullptr;
+  }
+
+  const std::string name = specifier.GetName();
+  if (name == "boolean") {
+    return Boolean(location, false);
+  }
+  if (name == "char") {
+    return Character(location, "'\\0'");  // literal to be used in backends
+  }
+  if (name == "byte" || name == "int" || name == "long") {
+    return Integral(location, "0");
+  }
+  if (name == "float") {
+    return Floating(location, "0.0f");
+  }
+  if (name == "double") {
+    return Floating(location, "0.0");
+  }
+  return nullptr;
+}
+
+AidlConstantValue* AidlConstantValue::Boolean(const AidlLocation& location, bool value) {
+  return new AidlConstantValue(location, Type::BOOLEAN, value ? "true" : "false");
+}
+
+AidlConstantValue* AidlConstantValue::Character(const AidlLocation& location,
+                                                const std::string& value) {
+  static const char* kZeroString = "'\\0'";
+
+  // We should have better supports for escapes in the future, but for now
+  // allow only what is needed for defaults.
+  if (value != kZeroString) {
+    AIDL_FATAL_IF(value.size() != 3 || value[0] != '\'' || value[2] != '\'', location) << value;
+
+    if (!isValidLiteralChar(value[1])) {
+      AIDL_ERROR(location) << "Invalid character literal " << PrintCharLiteral(value[1]);
+      return new AidlConstantValue(location, Type::ERROR, value);
+    }
+  }
+
+  return new AidlConstantValue(location, Type::CHARACTER, value);
+}
+
+AidlConstantValue* AidlConstantValue::Floating(const AidlLocation& location,
+                                               const std::string& value) {
+  return new AidlConstantValue(location, Type::FLOATING, value);
+}
+
+bool AidlConstantValue::IsHex(const string& value) {
+  return StartsWith(value, "0x") || StartsWith(value, "0X");
+}
+
+bool AidlConstantValue::ParseIntegral(const string& value, int64_t* parsed_value,
+                                      Type* parsed_type) {
+  if (parsed_value == nullptr || parsed_type == nullptr) {
+    return false;
+  }
+
+  std::string_view value_view = value;
+  const bool is_byte = ConsumeSuffix(&value_view, "u8");
+  const bool is_long = ConsumeSuffix(&value_view, "l") || ConsumeSuffix(&value_view, "L");
+  const std::string value_substr = std::string(value_view);
+
+  *parsed_value = 0;
+  *parsed_type = Type::ERROR;
+
+  if (is_byte && is_long) return false;
+
+  if (IsHex(value)) {
+    // AIDL considers 'const int foo = 0xffffffff' as -1, but if we want to
+    // handle that when computing constant expressions, then we need to
+    // represent 0xffffffff as a uint32_t. However, AIDL only has signed types;
+    // so we parse as an unsigned int when possible and then cast to a signed
+    // int. One example of this is in ICameraService.aidl where a constant int
+    // is used for bit manipulations which ideally should be handled with an
+    // unsigned int.
+    //
+    // Note, for historical consistency, we need to consider small hex values
+    // as an integral type. Recognizing them as INT8 could break some files,
+    // even though it would simplify this code.
+    if (is_byte) {
+      uint8_t raw_value8;
+      if (!android::base::ParseUint<uint8_t>(value_substr, &raw_value8)) {
+        return false;
+      }
+      *parsed_value = static_cast<int8_t>(raw_value8);
+      *parsed_type = Type::INT8;
+    } else if (uint32_t raw_value32;
+               !is_long && android::base::ParseUint<uint32_t>(value_substr, &raw_value32)) {
+      *parsed_value = static_cast<int32_t>(raw_value32);
+      *parsed_type = Type::INT32;
+    } else if (uint64_t raw_value64;
+               android::base::ParseUint<uint64_t>(value_substr, &raw_value64)) {
+      *parsed_value = static_cast<int64_t>(raw_value64);
+      *parsed_type = Type::INT64;
+    } else {
+      return false;
+    }
+    return true;
+  }
+
+  if (!android::base::ParseInt<int64_t>(value_substr, parsed_value)) {
+    return false;
+  }
+
+  if (is_byte) {
+    if (*parsed_value > UINT8_MAX || *parsed_value < 0) {
+      return false;
+    }
+    *parsed_value = static_cast<int8_t>(*parsed_value);
+    *parsed_type = Type::INT8;
+  } else if (is_long) {
+    *parsed_type = Type::INT64;
+  } else {
+    // guess literal type.
+    if (*parsed_value <= INT8_MAX && *parsed_value >= INT8_MIN) {
+      *parsed_type = Type::INT8;
+    } else if (*parsed_value <= INT32_MAX && *parsed_value >= INT32_MIN) {
+      *parsed_type = Type::INT32;
+    } else {
+      *parsed_type = Type::INT64;
+    }
+  }
+  return true;
+}
+
+AidlConstantValue* AidlConstantValue::Integral(const AidlLocation& location, const string& value) {
+  AIDL_FATAL_IF(value.empty(), location);
+
+  Type parsed_type;
+  int64_t parsed_value = 0;
+  bool success = ParseIntegral(value, &parsed_value, &parsed_type);
+  if (!success) {
+    return nullptr;
+  }
+
+  return new AidlConstantValue(location, parsed_type, parsed_value, value);
+}
+
+AidlConstantValue* AidlConstantValue::Array(
+    const AidlLocation& location, std::unique_ptr<vector<unique_ptr<AidlConstantValue>>> values) {
+  AIDL_FATAL_IF(values == nullptr, location);
+  // Reconstruct literal value
+  std::vector<std::string> str_values;
+  for (const auto& v : *values) {
+    str_values.push_back(v->value_);
+  }
+  return new AidlConstantValue(location, Type::ARRAY, std::move(values),
+                               "{" + Join(str_values, ", ") + "}");
+}
+
+AidlConstantValue* AidlConstantValue::String(const AidlLocation& location, const string& value) {
+  AIDL_FATAL_IF(value.size() == 0, "If this is unquoted, we need to update the index log");
+  AIDL_FATAL_IF(value[0] != '\"', "If this is unquoted, we need to update the index log");
+
+  for (size_t i = 0; i < value.length(); ++i) {
+    if (!isValidLiteralChar(value[i])) {
+      AIDL_ERROR(location) << "Found invalid character '" << value[i] << "' at index " << i - 1
+                           << " in string constant '" << value << "'";
+      return new AidlConstantValue(location, Type::ERROR, value);
+    }
+  }
+
+  return new AidlConstantValue(location, Type::STRING, value);
+}
+
+string AidlConstantValue::ValueString(const AidlTypeSpecifier& type,
+                                      const ConstantValueDecorator& decorator) const {
+  if (type.IsGeneric()) {
+    AIDL_ERROR(type) << "Generic type cannot be specified with a constant literal.";
+    return "";
+  }
+  if (!is_evaluated_) {
+    // TODO(b/142722772) CheckValid() should be called before ValueString()
+    bool success = CheckValid();
+    success &= evaluate();
+    if (!success) {
+      // the detailed error message shall be printed in evaluate
+      return "";
+    }
+  }
+  if (!is_valid_) {
+    AIDL_ERROR(this) << "Invalid constant value: " + value_;
+    return "";
+  }
+
+  const AidlDefinedType* defined_type = type.GetDefinedType();
+  if (defined_type && final_type_ != Type::ARRAY) {
+    const AidlEnumDeclaration* enum_type = defined_type->AsEnumDeclaration();
+    if (!enum_type) {
+      AIDL_ERROR(this) << "Invalid type (" << defined_type->GetCanonicalName()
+                       << ") for a const value (" << value_ << ")";
+      return "";
+    }
+    if (type_ != Type::REF) {
+      AIDL_ERROR(this) << "Invalid value (" << value_ << ") for enum "
+                       << enum_type->GetCanonicalName();
+      return "";
+    }
+    return decorator(type, value_);
+  }
+
+  const string& type_string = type.Signature();
+  int err = 0;
+
+  switch (final_type_) {
+    case Type::CHARACTER:
+      if (type_string == "char") {
+        return decorator(type, final_string_value_);
+      }
+      err = -1;
+      break;
+    case Type::STRING:
+      if (type_string == "String") {
+        return decorator(type, final_string_value_);
+      }
+      err = -1;
+      break;
+    case Type::BOOLEAN:  // fall-through
+    case Type::INT8:     // fall-through
+    case Type::INT32:    // fall-through
+    case Type::INT64:
+      if (type_string == "byte") {
+        if (final_value_ > INT8_MAX || final_value_ < INT8_MIN) {
+          err = -1;
+          break;
+        }
+        return decorator(type, std::to_string(static_cast<int8_t>(final_value_)));
+      } else if (type_string == "int") {
+        if (final_value_ > INT32_MAX || final_value_ < INT32_MIN) {
+          err = -1;
+          break;
+        }
+        return decorator(type, std::to_string(static_cast<int32_t>(final_value_)));
+      } else if (type_string == "long") {
+        return decorator(type, std::to_string(final_value_));
+      } else if (type_string == "boolean") {
+        return decorator(type, final_value_ ? "true" : "false");
+      }
+      err = -1;
+      break;
+    case Type::ARRAY: {
+      if (!type.IsArray()) {
+        err = -1;
+        break;
+      }
+      vector<string> value_strings;
+      value_strings.reserve(values_.size());
+      bool success = true;
+
+      for (const auto& value : values_) {
+        string value_string;
+        type.ViewAsArrayBase([&](const auto& base_type) {
+          value_string = value->ValueString(base_type, decorator);
+        });
+        if (value_string.empty()) {
+          success = false;
+          break;
+        }
+        value_strings.push_back(value_string);
+      }
+      if (!success) {
+        err = -1;
+        break;
+      }
+      if (type.IsFixedSizeArray()) {
+        auto size =
+            std::get<FixedSizeArray>(type.GetArray()).dimensions.front()->EvaluatedValue<int32_t>();
+        if (values_.size() != static_cast<size_t>(size)) {
+          AIDL_ERROR(this) << "Expected an array of " << size << " elements, but found one with "
+                           << values_.size() << " elements";
+          err = -1;
+          break;
+        }
+      }
+      return decorator(type, value_strings);
+    }
+    case Type::FLOATING: {
+      if (type_string == "double") {
+        double parsed_value;
+        if (!ParseFloating(value_, &parsed_value)) {
+          AIDL_ERROR(this) << "Could not parse " << value_;
+          err = -1;
+          break;
+        }
+        return decorator(type, std::to_string(parsed_value));
+      }
+      if (type_string == "float") {
+        float parsed_value;
+        if (!ParseFloating(value_, &parsed_value)) {
+          AIDL_ERROR(this) << "Could not parse " << value_;
+          err = -1;
+          break;
+        }
+        return decorator(type, std::to_string(parsed_value) + "f");
+      }
+      err = -1;
+      break;
+    }
+    default:
+      err = -1;
+      break;
+  }
+
+  AIDL_FATAL_IF(err == 0, this);
+  AIDL_ERROR(this) << "Invalid type specifier for " << ToString(final_type_) << ": " << type_string
+                   << " (" << value_ << ")";
+  return "";
+}
+
+bool AidlConstantValue::CheckValid() const {
+  // Nothing needs to be checked here. The constant value will be validated in
+  // the constructor or in the evaluate() function.
+  if (is_evaluated_) return is_valid_;
+
+  switch (type_) {
+    case Type::BOOLEAN:    // fall-through
+    case Type::INT8:       // fall-through
+    case Type::INT32:      // fall-through
+    case Type::INT64:      // fall-through
+    case Type::CHARACTER:  // fall-through
+    case Type::STRING:     // fall-through
+    case Type::REF:        // fall-through
+    case Type::FLOATING:   // fall-through
+    case Type::UNARY:      // fall-through
+    case Type::BINARY:
+      is_valid_ = true;
+      break;
+    case Type::ARRAY:
+      is_valid_ = true;
+      for (const auto& v : values_) is_valid_ &= v->CheckValid();
+      break;
+    case Type::ERROR:
+      return false;
+    default:
+      AIDL_FATAL(this) << "Unrecognized constant value type: " << ToString(type_);
+      return false;
+  }
+
+  return true;
+}
+
+bool AidlConstantValue::Evaluate() const {
+  if (CheckValid()) {
+    return evaluate();
+  } else {
+    return false;
+  }
+}
+
+bool AidlConstantValue::evaluate() const {
+  if (is_evaluated_) {
+    return is_valid_;
+  }
+  int err = 0;
+  is_evaluated_ = true;
+
+  switch (type_) {
+    case Type::ARRAY: {
+      Type array_type = Type::ERROR;
+      bool success = true;
+      for (const auto& value : values_) {
+        success = value->CheckValid();
+        if (success) {
+          success = value->evaluate();
+          if (!success) {
+            AIDL_ERROR(this) << "Invalid array element: " << value->value_;
+            break;
+          }
+          if (array_type == Type::ERROR) {
+            array_type = value->final_type_;
+          } else if (!AidlBinaryConstExpression::AreCompatibleTypes(array_type,
+                                                                    value->final_type_)) {
+            AIDL_ERROR(this) << "Incompatible array element type: " << ToString(value->final_type_)
+                             << ". Expecting type compatible with " << ToString(array_type);
+            success = false;
+            break;
+          }
+        } else {
+          break;
+        }
+      }
+      if (!success) {
+        err = -1;
+        break;
+      }
+      final_type_ = type_;
+      break;
+    }
+    case Type::BOOLEAN:
+      if ((value_ != "true") && (value_ != "false")) {
+        AIDL_ERROR(this) << "Invalid constant boolean value: " << value_;
+        err = -1;
+        break;
+      }
+      final_value_ = (value_ == "true") ? 1 : 0;
+      final_type_ = type_;
+      break;
+    case Type::INT8:   // fall-through
+    case Type::INT32:  // fall-through
+    case Type::INT64:
+      // Parsing happens in the constructor
+      final_type_ = type_;
+      break;
+    case Type::CHARACTER:  // fall-through
+    case Type::STRING:
+      final_string_value_ = value_;
+      final_type_ = type_;
+      break;
+    case Type::FLOATING:
+      // Just parse on the fly in ValueString
+      final_type_ = type_;
+      break;
+    default:
+      AIDL_FATAL(this) << "Unrecognized constant value type: " << ToString(type_);
+      err = -1;
+  }
+
+  return (err == 0) ? true : false;
+}
+
+string AidlConstantValue::ToString(Type type) {
+  switch (type) {
+    case Type::BOOLEAN:
+      return "a literal boolean";
+    case Type::INT8:
+      return "an int8 literal";
+    case Type::INT32:
+      return "an int32 literal";
+    case Type::INT64:
+      return "an int64 literal";
+    case Type::ARRAY:
+      return "a literal array";
+    case Type::CHARACTER:
+      return "a literal char";
+    case Type::STRING:
+      return "a literal string";
+    case Type::REF:
+      return "a reference";
+    case Type::FLOATING:
+      return "a literal float";
+    case Type::UNARY:
+      return "a unary expression";
+    case Type::BINARY:
+      return "a binary expression";
+    case Type::ERROR:
+      AIDL_FATAL(AIDL_LOCATION_HERE) << "aidl internal error: error type failed to halt program";
+      return "";
+    default:
+      AIDL_FATAL(AIDL_LOCATION_HERE)
+          << "aidl internal error: unknown constant type: " << static_cast<int>(type);
+      return "";  // not reached
+  }
+}
+
+AidlConstantReference::AidlConstantReference(const AidlLocation& location, const std::string& value)
+    : AidlConstantValue(location, Type::REF, value) {
+  const auto pos = value.find_last_of('.');
+  if (pos == string::npos) {
+    field_name_ = value;
+  } else {
+    ref_type_ = std::make_unique<AidlTypeSpecifier>(location, value.substr(0, pos),
+                                                    /*array=*/std::nullopt, /*type_params=*/nullptr,
+                                                    Comments{});
+    field_name_ = value.substr(pos + 1);
+  }
+}
+
+const AidlConstantValue* AidlConstantReference::Resolve(const AidlDefinedType* scope) const {
+  if (resolved_) return resolved_;
+
+  const AidlDefinedType* defined_type;
+  if (ref_type_) {
+    defined_type = ref_type_->GetDefinedType();
+  } else {
+    defined_type = scope;
+  }
+
+  if (!defined_type) {
+    // This can happen when "const reference" is used in an unsupported way,
+    // but missed in checks there. It works as a safety net.
+    AIDL_ERROR(*this) << "Can't resolve the reference (" << value_ << ")";
+    return nullptr;
+  }
+
+  if (auto enum_decl = defined_type->AsEnumDeclaration(); enum_decl) {
+    for (const auto& e : enum_decl->GetEnumerators()) {
+      if (e->GetName() == field_name_) {
+        return resolved_ = e->GetValue();
+      }
+    }
+  } else {
+    for (const auto& c : defined_type->GetConstantDeclarations()) {
+      if (c->GetName() == field_name_) {
+        return resolved_ = &c->GetValue();
+      }
+    }
+  }
+  AIDL_ERROR(*this) << "Can't find " << field_name_ << " in " << defined_type->GetName();
+  return nullptr;
+}
+
+bool AidlConstantReference::CheckValid() const {
+  if (is_evaluated_) return is_valid_;
+  AIDL_FATAL_IF(!resolved_, this) << "Should be resolved first: " << value_;
+  is_valid_ = resolved_->CheckValid();
+  return is_valid_;
+}
+
+bool AidlConstantReference::evaluate() const {
+  if (is_evaluated_) return is_valid_;
+  AIDL_FATAL_IF(!resolved_, this) << "Should be resolved first: " << value_;
+  is_evaluated_ = true;
+
+  resolved_->evaluate();
+  is_valid_ = resolved_->is_valid_;
+  final_type_ = resolved_->final_type_;
+  if (is_valid_) {
+    if (final_type_ == Type::STRING) {
+      final_string_value_ = resolved_->final_string_value_;
+    } else {
+      final_value_ = resolved_->final_value_;
+    }
+  }
+  return is_valid_;
+}
+
+bool AidlUnaryConstExpression::CheckValid() const {
+  if (is_evaluated_) return is_valid_;
+  AIDL_FATAL_IF(unary_ == nullptr, this);
+
+  is_valid_ = unary_->CheckValid();
+  if (!is_valid_) {
+    final_type_ = Type::ERROR;
+    return false;
+  }
+
+  return AidlConstantValue::CheckValid();
+}
+
+bool AidlUnaryConstExpression::evaluate() const {
+  if (is_evaluated_) {
+    return is_valid_;
+  }
+  is_evaluated_ = true;
+
+  // Recursively evaluate the expression tree
+  if (!unary_->is_evaluated_) {
+    // TODO(b/142722772) CheckValid() should be called before ValueString()
+    bool success = CheckValid();
+    success &= unary_->evaluate();
+    if (!success) {
+      is_valid_ = false;
+      return false;
+    }
+  }
+  if (!IsCompatibleType(unary_->final_type_, op_)) {
+    AIDL_ERROR(unary_) << "'" << op_ << "'"
+                       << " is not compatible with " << ToString(unary_->final_type_)
+                       << ": " + value_;
+    is_valid_ = false;
+    return false;
+  }
+  if (!unary_->is_valid_) {
+    AIDL_ERROR(unary_) << "Invalid constant unary expression: " + value_;
+    is_valid_ = false;
+    return false;
+  }
+  final_type_ = unary_->final_type_;
+
+  if (final_type_ == Type::FLOATING) {
+    // don't do anything here. ValueString() will handle everything.
+    is_valid_ = true;
+    return true;
+  }
+
+#define CASE_UNARY(__type__) \
+  return is_valid_ =         \
+             handleUnary(*this, op_, static_cast<__type__>(unary_->final_value_), &final_value_);
+
+  SWITCH_KIND(final_type_, CASE_UNARY, SHOULD_NOT_REACH(); final_type_ = Type::ERROR;
+              is_valid_ = false; return false;)
+}
+
+bool AidlBinaryConstExpression::CheckValid() const {
+  bool success = false;
+  if (is_evaluated_) return is_valid_;
+  AIDL_FATAL_IF(left_val_ == nullptr, this);
+  AIDL_FATAL_IF(right_val_ == nullptr, this);
+
+  success = left_val_->CheckValid();
+  if (!success) {
+    final_type_ = Type::ERROR;
+    AIDL_ERROR(this) << "Invalid left operand in binary expression: " + value_;
+  }
+
+  success = right_val_->CheckValid();
+  if (!success) {
+    AIDL_ERROR(this) << "Invalid right operand in binary expression: " + value_;
+    final_type_ = Type::ERROR;
+  }
+
+  if (final_type_ == Type::ERROR) {
+    is_valid_ = false;
+    return false;
+  }
+
+  is_valid_ = true;
+  return AidlConstantValue::CheckValid();
+}
+
+bool AidlBinaryConstExpression::evaluate() const {
+  if (is_evaluated_) {
+    return is_valid_;
+  }
+  is_evaluated_ = true;
+  AIDL_FATAL_IF(left_val_ == nullptr, this);
+  AIDL_FATAL_IF(right_val_ == nullptr, this);
+
+  // Recursively evaluate the binary expression tree
+  if (!left_val_->is_evaluated_ || !right_val_->is_evaluated_) {
+    // TODO(b/142722772) CheckValid() should be called before ValueString()
+    bool success = CheckValid();
+    success &= left_val_->evaluate();
+    success &= right_val_->evaluate();
+    if (!success) {
+      is_valid_ = false;
+      return false;
+    }
+  }
+  if (!left_val_->is_valid_ || !right_val_->is_valid_) {
+    is_valid_ = false;
+    return false;
+  }
+  is_valid_ = AreCompatibleTypes(left_val_->final_type_, right_val_->final_type_);
+  if (!is_valid_) {
+    AIDL_ERROR(this) << "Cannot perform operation '" << op_ << "' on "
+                     << ToString(right_val_->GetType()) << " and " << ToString(left_val_->GetType())
+                     << ".";
+    return false;
+  }
+
+  bool isArithmeticOrBitflip = OP_IS_BIN_ARITHMETIC || OP_IS_BIN_BITFLIP;
+
+  // Handle String case first
+  if (left_val_->final_type_ == Type::STRING) {
+    AIDL_FATAL_IF(right_val_->final_type_ != Type::STRING, this);
+    if (!OPEQ("+")) {
+      AIDL_ERROR(this) << "Only '+' is supported for strings, not '" << op_ << "'.";
+      final_type_ = Type::ERROR;
+      is_valid_ = false;
+      return false;
+    }
+
+    // Remove trailing " from lhs
+    const string& lhs = left_val_->final_string_value_;
+    if (lhs.back() != '"') {
+      AIDL_ERROR(this) << "'" << lhs << "' is missing a trailing quote.";
+      final_type_ = Type::ERROR;
+      is_valid_ = false;
+      return false;
+    }
+    const string& rhs = right_val_->final_string_value_;
+    // Remove starting " from rhs
+    if (rhs.front() != '"') {
+      AIDL_ERROR(this) << "'" << rhs << "' is missing a leading quote.";
+      final_type_ = Type::ERROR;
+      is_valid_ = false;
+      return false;
+    }
+
+    final_string_value_ = string(lhs.begin(), lhs.end() - 1).append(rhs.begin() + 1, rhs.end());
+    final_type_ = Type::STRING;
+    return true;
+  }
+
+  // CASE: + - *  / % | ^ & < > <= >= == !=
+  if (isArithmeticOrBitflip || OP_IS_BIN_COMP) {
+    // promoted kind for both operands.
+    Type promoted = UsualArithmeticConversion(IntegralPromotion(left_val_->final_type_),
+                                              IntegralPromotion(right_val_->final_type_));
+    // result kind.
+    final_type_ = isArithmeticOrBitflip
+                      ? promoted        // arithmetic or bitflip operators generates promoted type
+                      : Type::BOOLEAN;  // comparison operators generates bool
+
+#define CASE_BINARY_COMMON(__type__)                                                        \
+  return is_valid_ =                                                                        \
+             handleBinaryCommon(*this, static_cast<__type__>(left_val_->final_value_), op_, \
+                                static_cast<__type__>(right_val_->final_value_), &final_value_);
+
+    SWITCH_KIND(promoted, CASE_BINARY_COMMON, SHOULD_NOT_REACH(); final_type_ = Type::ERROR;
+                is_valid_ = false; return false;)
+  }
+
+  // CASE: << >>
+  string newOp = op_;
+  if (OP_IS_BIN_SHIFT) {
+    // promoted kind for both operands.
+    final_type_ = UsualArithmeticConversion(IntegralPromotion(left_val_->final_type_),
+                                            IntegralPromotion(right_val_->final_type_));
+    auto numBits = right_val_->final_value_;
+    if (numBits < 0) {
+      // shifting with negative number of bits is undefined in C. In AIDL it
+      // is defined as shifting into the other direction.
+      newOp = OPEQ("<<") ? ">>" : "<<";
+      numBits = -numBits;
+    }
+
+#define CASE_SHIFT(__type__)                                                                   \
+  return is_valid_ = handleShift(*this, static_cast<__type__>(left_val_->final_value_), newOp, \
+                                 static_cast<__type__>(numBits), &final_value_);
+
+    SWITCH_KIND(final_type_, CASE_SHIFT, SHOULD_NOT_REACH(); final_type_ = Type::ERROR;
+                is_valid_ = false; return false;)
+  }
+
+  // CASE: && ||
+  if (OP_IS_BIN_LOGICAL) {
+    final_type_ = Type::BOOLEAN;
+    // easy; everything is bool.
+    return handleLogical(*this, left_val_->final_value_, op_, right_val_->final_value_,
+                         &final_value_);
+  }
+
+  SHOULD_NOT_REACH();
+  is_valid_ = false;
+  return false;
+}
+
+// Constructor for integer(byte, int, long)
+// Keep parsed integer & literal
+AidlConstantValue::AidlConstantValue(const AidlLocation& location, Type parsed_type,
+                                     int64_t parsed_value, const string& checked_value)
+    : AidlNode(location),
+      type_(parsed_type),
+      value_(checked_value),
+      final_type_(parsed_type),
+      final_value_(parsed_value) {
+  AIDL_FATAL_IF(value_.empty() && type_ != Type::ERROR, location);
+  AIDL_FATAL_IF(type_ != Type::INT8 && type_ != Type::INT32 && type_ != Type::INT64, location);
+}
+
+// Constructor for non-integer(String, char, boolean, float, double)
+// Keep literal as it is. (e.g. String literal has double quotes at both ends)
+AidlConstantValue::AidlConstantValue(const AidlLocation& location, Type type,
+                                     const string& checked_value)
+    : AidlNode(location),
+      type_(type),
+      value_(checked_value),
+      final_type_(type) {
+  AIDL_FATAL_IF(value_.empty() && type_ != Type::ERROR, location);
+  switch (type_) {
+    case Type::INT8:
+    case Type::INT32:
+    case Type::INT64:
+    case Type::ARRAY:
+      AIDL_FATAL(this) << "Invalid type: " << ToString(type_);
+      break;
+    default:
+      break;
+  }
+}
+
+// Constructor for array
+AidlConstantValue::AidlConstantValue(const AidlLocation& location, Type type,
+                                     std::unique_ptr<vector<unique_ptr<AidlConstantValue>>> values,
+                                     const std::string& value)
+    : AidlNode(location),
+      type_(type),
+      values_(std::move(*values)),
+      value_(value),
+      is_valid_(false),
+      is_evaluated_(false),
+      final_type_(type) {
+  AIDL_FATAL_IF(type_ != Type::ARRAY, location);
+}
+
+AidlUnaryConstExpression::AidlUnaryConstExpression(const AidlLocation& location, const string& op,
+                                                   std::unique_ptr<AidlConstantValue> rval)
+    : AidlConstantValue(location, Type::UNARY, op + rval->value_),
+      unary_(std::move(rval)),
+      op_(op) {
+  final_type_ = Type::UNARY;
+}
+
+AidlBinaryConstExpression::AidlBinaryConstExpression(const AidlLocation& location,
+                                                     std::unique_ptr<AidlConstantValue> lval,
+                                                     const string& op,
+                                                     std::unique_ptr<AidlConstantValue> rval)
+    : AidlConstantValue(location, Type::BINARY, lval->value_ + op + rval->value_),
+      left_val_(std::move(lval)),
+      right_val_(std::move(rval)),
+      op_(op) {
+  final_type_ = Type::BINARY;
+}
diff --git a/aidl_dumpapi.cpp b/aidl_dumpapi.cpp
new file mode 100644
index 0000000..0095714
--- /dev/null
+++ b/aidl_dumpapi.cpp
@@ -0,0 +1,299 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl_dumpapi.h"
+
+#include <android-base/strings.h>
+
+#include "aidl.h"
+#include "logging.h"
+#include "os.h"
+
+using android::base::EndsWith;
+using android::base::Join;
+using android::base::Split;
+using std::string;
+using std::unique_ptr;
+
+namespace android {
+namespace aidl {
+
+static bool NeedsFinalValue(const AidlTypeSpecifier& type, const AidlConstantValue& c) {
+  // For enum types, use enumerator
+  if (auto defined_type = type.GetDefinedType();
+      defined_type && defined_type->AsEnumDeclaration()) {
+    return false;
+  }
+  // We need final value for constant expression which is not a single constant expression.
+  struct Visitor : AidlVisitor {
+    bool trivial = true;
+    void Visit(const AidlConstantReference&) override { trivial = false; }
+    void Visit(const AidlUnaryConstExpression&) override { trivial = false; }
+    void Visit(const AidlBinaryConstExpression&) override { trivial = false; }
+  } v;
+  c.DispatchVisit(v);
+  return !v.trivial;
+}
+
+void DumpVisitor::DumpType(const AidlDefinedType& dt, const string& type) {
+  if (!dt.IsUserDefined()) {
+    return;
+  }
+  DumpComments(dt);
+  DumpAnnotations(dt);
+  out << type << " " << dt.GetName();
+  if (auto generic_type = dt.AsParameterizable(); generic_type && generic_type->IsGeneric()) {
+    out << "<" << Join(generic_type->GetTypeParameters(), ", ") << ">";
+  }
+
+  if (dt.AsUnstructuredParcelable()) {
+    out << ";\n";
+    return;
+  }
+
+  out << " {\n";
+  out.Indent();
+  DumpMembers(dt);
+  out.Dedent();
+  out << "}\n";
+}
+
+void DumpVisitor::DumpMembers(const AidlDefinedType& dt) {
+  for (const auto& method : dt.GetMethods()) {
+    method->DispatchVisit(*this);
+  }
+  for (const auto& field : dt.GetFields()) {
+    field->DispatchVisit(*this);
+  }
+  for (const auto& constdecl : dt.GetConstantDeclarations()) {
+    constdecl->DispatchVisit(*this);
+  }
+  for (const auto& nested : dt.GetNestedTypes()) {
+    nested->DispatchVisit(*this);
+  }
+}
+
+// Dumps comment only if its has meaningful tags.
+void DumpVisitor::DumpComments(const AidlCommentable& c) {
+  const auto hidden = c.IsHidden();
+  const auto deprecated = FindDeprecated(c.GetComments());
+  if (hidden && !deprecated) {
+    // to pass --checkapi between the current and the tot in the mainline-prod branch
+    // emit @hide in a legacy dump style
+    out << "/* @hide */\n";
+  } else if (hidden || deprecated) {
+    out << "/**\n";
+    if (hidden) {
+      out << " * @hide\n";
+    }
+    if (deprecated) {
+      out << " * @deprecated " << deprecated->note << "\n";
+    }
+    out << " */\n";
+  }
+}
+
+void DumpVisitor::DumpAnnotations(const AidlAnnotatable& a) {
+  auto annotations = a.ToString();
+  if (!annotations.empty()) {
+    out << annotations << "\n";
+  }
+}
+
+void DumpVisitor::DumpConstantValue(const AidlTypeSpecifier& type, const AidlConstantValue& c) {
+  if (inline_constants) {
+    out << c.ValueString(type, AidlConstantValueDecorator);
+    return;
+  }
+  if (c.GetType() == AidlConstantValue::Type::ARRAY) {
+    type.ViewAsArrayBase([&](const auto& base_type) {
+      out << "{";
+      for (size_t i = 0; i < c.Size(); i++) {
+        if (i > 0) {
+          out << ", ";
+        }
+        DumpConstantValue(base_type, c.ValueAt(i));
+      }
+      out << "}";
+    });
+  } else {
+    c.DispatchVisit(*this);
+    // print final value as comment
+    if (NeedsFinalValue(type, c)) {
+      out << " /* " << c.ValueString(type, AidlConstantValueDecorator) << " */";
+    }
+  }
+}
+
+void DumpVisitor::Visit(const AidlInterface& t) {
+  DumpType(t, "interface");
+}
+
+void DumpVisitor::Visit(const AidlParcelable& t) {
+  DumpType(t, "parcelable");
+}
+
+void DumpVisitor::Visit(const AidlStructuredParcelable& t) {
+  DumpType(t, "parcelable");
+}
+
+void DumpVisitor::Visit(const AidlUnionDecl& t) {
+  DumpType(t, "union");
+}
+
+void DumpVisitor::Visit(const AidlEnumDeclaration& t) {
+  if (!t.IsUserDefined()) {
+    return;
+  }
+  DumpComments(t);
+  DumpAnnotations(t);
+  out << "enum " << t.GetName() << " {\n";
+  out.Indent();
+  for (const auto& e : t.GetEnumerators()) {
+    DumpComments(*e);
+    out << e->GetName();
+    if (e->IsValueUserSpecified() || inline_constants) {
+      out << " = ";
+      DumpConstantValue(t.GetBackingType(), *e->GetValue());
+    }
+    out << ",\n";
+  }
+  out.Dedent();
+  out << "}\n";
+}
+
+void DumpVisitor::Visit(const AidlMethod& m) {
+  if (!m.IsUserDefined()) {
+    return;
+  }
+  DumpComments(m);
+  out << m.ToString() << ";\n";
+}
+
+void DumpVisitor::Visit(const AidlVariableDeclaration& v) {
+  if (!v.IsUserDefined()) {
+    return;
+  }
+  DumpComments(v);
+  Visit(v.GetType());
+  if (v.IsDefaultUserSpecified()) {
+    out << " " << v.GetName() << " = ";
+    DumpConstantValue(v.GetType(), *v.GetDefaultValue());
+    out << ";\n";
+  } else {
+    out << " " << v.GetName() << ";\n";
+  }
+}
+
+void DumpVisitor::Visit(const AidlConstantDeclaration& c) {
+  if (!c.IsUserDefined()) {
+    return;
+  }
+  DumpComments(c);
+  out << "const ";
+  Visit(c.GetType());
+  out << " " << c.GetName() << " = ";
+  DumpConstantValue(c.GetType(), c.GetValue());
+  out << ";\n";
+}
+
+void DumpVisitor::Visit(const AidlTypeSpecifier& t) {
+  out << t.ToString();
+}
+
+// These Visit() methods are not invoked when inline_constants = true
+void DumpVisitor::Visit(const AidlConstantValue& c) {
+  AIDL_FATAL_IF(inline_constants, AIDL_LOCATION_HERE);
+  out << c.Literal();
+}
+
+void DumpVisitor::Visit(const AidlConstantReference& r) {
+  AIDL_FATAL_IF(inline_constants, AIDL_LOCATION_HERE);
+  if (auto& ref = r.GetRefType(); ref) {
+    ref->DispatchVisit(*this);
+    out << ".";
+  }
+  out << r.GetFieldName();
+}
+
+void DumpVisitor::Visit(const AidlBinaryConstExpression& b) {
+  AIDL_FATAL_IF(inline_constants, AIDL_LOCATION_HERE);
+  // TODO(b/262594867) put parentheses only when necessary
+  out << "(";
+  b.Left()->DispatchVisit(*this);
+  out << " " << b.Op() << " ";
+  b.Right()->DispatchVisit(*this);
+  out << ")";
+}
+
+void DumpVisitor::Visit(const AidlUnaryConstExpression& u) {
+  AIDL_FATAL_IF(inline_constants, AIDL_LOCATION_HERE);
+  // TODO(b/262594867) put parentheses only when necessary
+  out << "(";
+  out << u.Op();
+  u.Val()->DispatchVisit(*this);
+  out << ")";
+}
+
+static string GetApiDumpPathFor(const AidlDefinedType& defined_type, const Options& options) {
+  string package_as_path = Join(Split(defined_type.GetPackage(), "."), OS_PATH_SEPARATOR);
+  AIDL_FATAL_IF(options.OutputDir().empty() || options.OutputDir().back() != OS_PATH_SEPARATOR,
+                defined_type);
+  return options.OutputDir() + package_as_path + OS_PATH_SEPARATOR + defined_type.GetName() +
+         ".aidl";
+}
+
+static void DumpComments(CodeWriter& out, const Comments& comments) {
+  bool needs_newline = false;
+  for (const auto& c : comments) {
+    out << c.body;
+    needs_newline = !EndsWith(c.body, "\n");
+  }
+  if (needs_newline) {
+    out << "\n";
+  }
+}
+
+bool dump_api(const Options& options, const IoDelegate& io_delegate) {
+  for (const auto& file : options.InputFiles()) {
+    AidlTypenames typenames;
+    if (internals::load_and_validate_aidl(file, options, io_delegate, &typenames, nullptr) ==
+        AidlError::OK) {
+      const auto& doc = typenames.MainDocument();
+
+      for (const auto& type : doc.DefinedTypes()) {
+        unique_ptr<CodeWriter> writer =
+            io_delegate.GetCodeWriter(GetApiDumpPathFor(*type, options));
+        if (!options.DumpNoLicense()) {
+          // dump doc comments (license) as well for each type
+          DumpComments(*writer, doc.GetComments());
+        }
+        (*writer) << kPreamble;
+        if (!type->GetPackage().empty()) {
+          (*writer) << "package " << type->GetPackage() << ";\n";
+        }
+        DumpVisitor visitor(*writer, /*inline_constants=*/false);
+        type->DispatchVisit(visitor);
+      }
+    } else {
+      return false;
+    }
+  }
+  return true;
+}
+
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_dumpapi.h b/aidl_dumpapi.h
new file mode 100644
index 0000000..b4c146c
--- /dev/null
+++ b/aidl_dumpapi.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include "aidl_language.h"
+#include "code_writer.h"
+
+namespace android {
+namespace aidl {
+
+struct DumpVisitor : AidlVisitor {
+  CodeWriter& out;
+  bool inline_constants;
+  DumpVisitor(CodeWriter& out, bool inline_constants)
+      : out(out), inline_constants(inline_constants) {}
+
+  void DumpType(const AidlDefinedType& dt, const string& type);
+  void DumpMembers(const AidlDefinedType& dt);
+  void DumpComments(const AidlCommentable& c);
+  void DumpAnnotations(const AidlAnnotatable& a);
+  void DumpConstantValue(const AidlTypeSpecifier& type, const AidlConstantValue& c);
+
+  void Visit(const AidlInterface& t) override;
+  void Visit(const AidlParcelable& t) override;
+  void Visit(const AidlStructuredParcelable& t) override;
+  void Visit(const AidlUnionDecl& t) override;
+  void Visit(const AidlEnumDeclaration& t) override;
+  void Visit(const AidlMethod& m) override;
+  void Visit(const AidlVariableDeclaration& v) override;
+  void Visit(const AidlConstantDeclaration& c) override;
+  void Visit(const AidlTypeSpecifier& t) override;
+  void Visit(const AidlConstantValue& c) override;
+  void Visit(const AidlConstantReference& r) override;
+  void Visit(const AidlBinaryConstExpression& b) override;
+  void Visit(const AidlUnaryConstExpression& u) override;
+};
+
+bool dump_api(const Options& options, const IoDelegate& io_delegate);
+
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_language.cpp b/aidl_language.cpp
new file mode 100644
index 0000000..622eef9
--- /dev/null
+++ b/aidl_language.cpp
@@ -0,0 +1,1839 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl_language.h"
+#include "aidl_typenames.h"
+#include "parser.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <algorithm>
+#include <iostream>
+#include <set>
+#include <sstream>
+#include <string>
+#include <utility>
+
+#include <android-base/parsedouble.h>
+#include <android-base/parseint.h>
+#include <android-base/result.h>
+#include <android-base/strings.h>
+
+#include "aidl.h"
+#include "aidl_language_y.h"
+#include "comments.h"
+#include "logging.h"
+#include "permission.h"
+
+#ifdef _WIN32
+int isatty(int  fd)
+{
+    return (fd == 0);
+}
+#endif
+
+using android::aidl::IoDelegate;
+using android::base::Error;
+using android::base::Join;
+using android::base::Result;
+using android::base::Split;
+using std::cerr;
+using std::pair;
+using std::set;
+using std::string;
+using std::unique_ptr;
+using std::vector;
+
+namespace {
+bool IsJavaKeyword(const char* str) {
+  static const std::vector<std::string> kJavaKeywords{
+      "abstract", "assert", "boolean",    "break",     "byte",       "case",      "catch",
+      "char",     "class",  "const",      "continue",  "default",    "do",        "double",
+      "else",     "enum",   "extends",    "final",     "finally",    "float",     "for",
+      "goto",     "if",     "implements", "import",    "instanceof", "int",       "interface",
+      "long",     "native", "new",        "package",   "private",    "protected", "public",
+      "return",   "short",  "static",     "strictfp",  "super",      "switch",    "synchronized",
+      "this",     "throw",  "throws",     "transient", "try",        "void",      "volatile",
+      "while",    "true",   "false",      "null",
+  };
+  return std::find(kJavaKeywords.begin(), kJavaKeywords.end(), str) != kJavaKeywords.end();
+}
+}  // namespace
+
+AidlNode::~AidlNode() {
+  if (!visited_) {
+    unvisited_locations_.push_back(location_);
+  }
+}
+
+void AidlNode::ClearUnvisitedNodes() {
+  unvisited_locations_.clear();
+}
+
+const std::vector<AidlLocation>& AidlNode::GetLocationsOfUnvisitedNodes() {
+  return unvisited_locations_;
+}
+
+void AidlNode::MarkVisited() const {
+  visited_ = true;
+}
+
+AidlNode::AidlNode(const AidlLocation& location, const Comments& comments)
+    : location_(location), comments_(comments) {}
+
+std::string AidlNode::PrintLine() const {
+  std::stringstream ss;
+  ss << location_.file_ << ":" << location_.begin_.line;
+  return ss.str();
+}
+
+std::string AidlNode::PrintLocation() const {
+  std::stringstream ss;
+  ss << location_.file_ << ":" << location_.begin_.line << ":" << location_.begin_.column << ":"
+     << location_.end_.line << ":" << location_.end_.column;
+  return ss.str();
+}
+
+std::vector<AidlLocation> AidlNode::unvisited_locations_;
+
+static const AidlTypeSpecifier kStringType{AIDL_LOCATION_HERE, "String", /*array=*/std::nullopt,
+                                           nullptr, Comments{}};
+static const AidlTypeSpecifier kStringArrayType{AIDL_LOCATION_HERE, "String", DynamicArray{},
+                                                nullptr, Comments{}};
+static const AidlTypeSpecifier kIntType{AIDL_LOCATION_HERE, "int", /*array=*/std::nullopt, nullptr,
+                                        Comments{}};
+static const AidlTypeSpecifier kLongType{AIDL_LOCATION_HERE, "long", /*array=*/std::nullopt,
+                                         nullptr, Comments{}};
+static const AidlTypeSpecifier kBooleanType{AIDL_LOCATION_HERE, "boolean", /*array=*/std::nullopt,
+                                            nullptr, Comments{}};
+
+const std::vector<AidlAnnotation::Schema>& AidlAnnotation::AllSchemas() {
+  static const std::vector<Schema> kSchemas{
+      {AidlAnnotation::Type::NULLABLE,
+       "nullable",
+       CONTEXT_TYPE_SPECIFIER,
+       {{"heap", kBooleanType}}},
+      {AidlAnnotation::Type::UTF8_IN_CPP, "utf8InCpp", CONTEXT_TYPE_SPECIFIER, {}},
+      {AidlAnnotation::Type::SENSITIVE_DATA, "SensitiveData", CONTEXT_TYPE_INTERFACE, {}},
+      {AidlAnnotation::Type::VINTF_STABILITY, "VintfStability", CONTEXT_TYPE, {}},
+      {AidlAnnotation::Type::UNSUPPORTED_APP_USAGE,
+       "UnsupportedAppUsage",
+       CONTEXT_TYPE | CONTEXT_MEMBER,
+       {{"expectedSignature", kStringType},
+        {"implicitMember", kStringType},
+        {"maxTargetSdk", kIntType},
+        {"publicAlternatives", kStringType},
+        {"trackingBug", kLongType}}},
+      {AidlAnnotation::Type::JAVA_STABLE_PARCELABLE,
+       "JavaOnlyStableParcelable",
+       CONTEXT_TYPE_UNSTRUCTURED_PARCELABLE,
+       {}},
+      {AidlAnnotation::Type::NDK_STABLE_PARCELABLE,
+       "NdkOnlyStableParcelable",
+       CONTEXT_TYPE_UNSTRUCTURED_PARCELABLE,
+       {}},
+      {AidlAnnotation::Type::RUST_STABLE_PARCELABLE,
+       "RustOnlyStableParcelable",
+       CONTEXT_TYPE_UNSTRUCTURED_PARCELABLE,
+       {}},
+      {AidlAnnotation::Type::BACKING,
+       "Backing",
+       CONTEXT_TYPE_ENUM,
+       {{"type", kStringType, /* required= */ true}}},
+      {AidlAnnotation::Type::JAVA_PASSTHROUGH,
+       "JavaPassthrough",
+       CONTEXT_ALL,
+       {{"annotation", kStringType, /* required= */ true}},
+       /* repeatable= */ true},
+      {AidlAnnotation::Type::JAVA_DERIVE,
+       "JavaDerive",
+       CONTEXT_TYPE_STRUCTURED_PARCELABLE | CONTEXT_TYPE_UNION | CONTEXT_TYPE_ENUM,
+       {{"toString", kBooleanType}, {"equals", kBooleanType}}},
+      {AidlAnnotation::Type::JAVA_DEFAULT, "JavaDefault", CONTEXT_TYPE_INTERFACE, {}},
+      {AidlAnnotation::Type::JAVA_DELEGATOR, "JavaDelegator", CONTEXT_TYPE_INTERFACE, {}},
+      {AidlAnnotation::Type::JAVA_ONLY_IMMUTABLE,
+       "JavaOnlyImmutable",
+       CONTEXT_TYPE_STRUCTURED_PARCELABLE | CONTEXT_TYPE_UNION |
+           CONTEXT_TYPE_UNSTRUCTURED_PARCELABLE,
+       {}},
+      {AidlAnnotation::Type::JAVA_SUPPRESS_LINT,
+       "JavaSuppressLint",
+       CONTEXT_ALL,
+       {{"value", kStringArrayType, /* required= */ true}}},
+      {AidlAnnotation::Type::FIXED_SIZE,
+       "FixedSize",
+       CONTEXT_TYPE_STRUCTURED_PARCELABLE | CONTEXT_TYPE_UNION,
+       {}},
+      {AidlAnnotation::Type::DESCRIPTOR,
+       "Descriptor",
+       CONTEXT_TYPE_INTERFACE,
+       {{"value", kStringType, /* required= */ true}}},
+      {AidlAnnotation::Type::RUST_DERIVE,
+       "RustDerive",
+       CONTEXT_TYPE_STRUCTURED_PARCELABLE | CONTEXT_TYPE_UNION,
+       {{"Copy", kBooleanType},
+        {"Clone", kBooleanType},
+        {"PartialOrd", kBooleanType},
+        {"Ord", kBooleanType},
+        {"PartialEq", kBooleanType},
+        {"Eq", kBooleanType},
+        {"Hash", kBooleanType}}},
+      {AidlAnnotation::Type::SUPPRESS_WARNINGS,
+       "SuppressWarnings",
+       CONTEXT_TYPE | CONTEXT_MEMBER,
+       {{"value", kStringArrayType, /* required= */ true}}},
+      {AidlAnnotation::Type::PERMISSION_ENFORCE,
+       "EnforcePermission",
+       CONTEXT_TYPE_INTERFACE | CONTEXT_METHOD,
+       {{"value", kStringType}, {"anyOf", kStringArrayType}, {"allOf", kStringArrayType}}},
+      {AidlAnnotation::Type::PERMISSION_MANUAL,
+       "PermissionManuallyEnforced",
+       CONTEXT_TYPE_INTERFACE | CONTEXT_METHOD,
+       {}},
+      {AidlAnnotation::Type::PERMISSION_NONE,
+       "RequiresNoPermission",
+       CONTEXT_TYPE_INTERFACE | CONTEXT_METHOD,
+       {}},
+      {AidlAnnotation::Type::PROPAGATE_ALLOW_BLOCKING,
+       "PropagateAllowBlocking",
+       CONTEXT_METHOD,
+       {}},
+  };
+  return kSchemas;
+}
+
+std::string AidlAnnotation::TypeToString(Type type) {
+  for (const Schema& schema : AllSchemas()) {
+    if (type == schema.type) return schema.name;
+  }
+  AIDL_FATAL(AIDL_LOCATION_HERE) << "Unrecognized type: " << static_cast<size_t>(type);
+  __builtin_unreachable();
+}
+
+std::unique_ptr<AidlAnnotation> AidlAnnotation::Parse(
+    const AidlLocation& location, const string& name,
+    std::map<std::string, std::shared_ptr<AidlConstantValue>> parameter_list,
+    const Comments& comments) {
+  const Schema* schema = nullptr;
+  for (const Schema& a_schema : AllSchemas()) {
+    if (a_schema.name == name) {
+      schema = &a_schema;
+    }
+  }
+
+  if (schema == nullptr) {
+    std::ostringstream stream;
+    stream << "'" << name << "' is not a recognized annotation. ";
+    stream << "It must be one of:";
+    for (const Schema& s : AllSchemas()) {
+      stream << " " << s.name;
+    }
+    stream << ".";
+    AIDL_ERROR(location) << stream.str();
+    return {};
+  }
+
+  return std::unique_ptr<AidlAnnotation>(
+      new AidlAnnotation(location, *schema, std::move(parameter_list), comments));
+}
+
+AidlAnnotation::AidlAnnotation(const AidlLocation& location, const Schema& schema,
+                               std::map<std::string, std::shared_ptr<AidlConstantValue>> parameters,
+                               const Comments& comments)
+    : AidlNode(location, comments), schema_(schema), parameters_(std::move(parameters)) {}
+
+struct ConstReferenceFinder : AidlVisitor {
+  const AidlConstantReference* found = nullptr;
+  void Visit(const AidlConstantReference& ref) override {
+    if (!found) found = &ref;
+  }
+  static const AidlConstantReference* Find(const AidlConstantValue& c) {
+    ConstReferenceFinder finder;
+    VisitTopDown(finder, c);
+    return finder.found;
+  }
+};
+
+// Checks if annotation complies with the schema
+// - every parameter is known and has well-typed value.
+// - every required parameter is present.
+bool AidlAnnotation::CheckValid() const {
+  for (const auto& name_and_param : parameters_) {
+    const std::string& param_name = name_and_param.first;
+    const std::shared_ptr<AidlConstantValue>& param = name_and_param.second;
+
+    const ParamType* param_type = schema_.ParamType(param_name);
+    if (!param_type) {
+      std::ostringstream stream;
+      stream << "Parameter " << param_name << " not supported ";
+      stream << "for annotation " << GetName() << ". ";
+      stream << "It must be one of:";
+      for (const auto& param : schema_.parameters) {
+        stream << " " << param.name;
+      }
+      AIDL_ERROR(this) << stream.str();
+      return false;
+    }
+
+    const auto& found = ConstReferenceFinder::Find(*param);
+    if (found) {
+      AIDL_ERROR(found) << "Value must be a constant expression but contains reference to "
+                        << found->GetFieldName() << ".";
+      return false;
+    }
+
+    if (!param->CheckValid()) {
+      AIDL_ERROR(this) << "Invalid value for parameter " << param_name << " on annotation "
+                       << GetName() << ".";
+      return false;
+    }
+
+    const std::string param_value =
+        param->ValueString(param_type->type, AidlConstantValueDecorator);
+    // Assume error on empty string.
+    if (param_value == "") {
+      AIDL_ERROR(this) << "Invalid value for parameter " << param_name << " on annotation "
+                       << GetName() << ".";
+      return false;
+    }
+  }
+  bool success = true;
+  for (const auto& param : schema_.parameters) {
+    if (param.required && parameters_.count(param.name) == 0) {
+      AIDL_ERROR(this) << "Missing '" << param.name << "' on @" << GetName() << ".";
+      success = false;
+    }
+  }
+  if (!success) {
+    return false;
+  }
+  // For @Enforce annotations, validates the expression.
+  if (schema_.type == AidlAnnotation::Type::PERMISSION_ENFORCE) {
+    auto expr = EnforceExpression();
+    if (!expr.ok()) {
+      AIDL_ERROR(this) << "Unable to parse @EnforcePermission annotation: " << expr.error();
+      return false;
+    }
+  }
+  return true;
+}
+
+Result<unique_ptr<android::aidl::perm::Expression>> AidlAnnotation::EnforceExpression() const {
+  auto single = ParamValue<std::string>("value");
+  auto anyOf = ParamValue<std::vector<std::string>>("anyOf");
+  auto allOf = ParamValue<std::vector<std::string>>("allOf");
+  if (single.has_value()) {
+    return std::make_unique<android::aidl::perm::Expression>(single.value());
+  } else if (anyOf.has_value()) {
+    auto v = android::aidl::perm::AnyOf{anyOf.value()};
+    return std::make_unique<android::aidl::perm::Expression>(v);
+  } else if (allOf.has_value()) {
+    auto v = android::aidl::perm::AllOf{allOf.value()};
+    return std::make_unique<android::aidl::perm::Expression>(v);
+  }
+  return Error() << "No parameter for @EnforcePermission";
+}
+
+// Checks if the annotation is applicable to the current context.
+// For example, annotations like @VintfStability, @FixedSize is not applicable to AidlTypeSpecifier
+// nodes.
+bool AidlAnnotation::CheckContext(TargetContext context) const {
+  if (schema_.target_context & static_cast<uint32_t>(context)) {
+    return true;
+  }
+  const static map<TargetContext, string> context_name_map{
+      {CONTEXT_TYPE_INTERFACE, "interface"},
+      {CONTEXT_TYPE_ENUM, "enum"},
+      {CONTEXT_TYPE_STRUCTURED_PARCELABLE, "parcelable definition"},
+      {CONTEXT_TYPE_UNION, "union"},
+      {CONTEXT_TYPE_UNSTRUCTURED_PARCELABLE, "parcelable declaration"},
+      {CONTEXT_CONST, "constant"},
+      {CONTEXT_FIELD, "field"},
+      {CONTEXT_METHOD, "method"},
+      {CONTEXT_TYPE_SPECIFIER, "type"},
+  };
+  vector<string> available;
+  for (const auto& [context, name] : context_name_map) {
+    if (schema_.target_context & context) {
+      available.push_back(name);
+    }
+  }
+  AIDL_ERROR(this) << "@" << GetName()
+                   << " is not available. It can only annotate: " << Join(available, ", ") << ".";
+  return false;
+}
+
+std::map<std::string, std::string> AidlAnnotation::AnnotationParams(
+    const ConstantValueDecorator& decorator) const {
+  std::map<std::string, std::string> raw_params;
+  for (const auto& name_and_param : parameters_) {
+    const std::string& param_name = name_and_param.first;
+    const std::shared_ptr<AidlConstantValue>& param = name_and_param.second;
+    const ParamType* param_type = schema_.ParamType(param_name);
+    AIDL_FATAL_IF(!param_type, this);
+    raw_params.emplace(param_name, param->ValueString(param_type->type, decorator));
+  }
+  return raw_params;
+}
+
+std::string AidlAnnotation::ToString() const {
+  if (parameters_.empty()) {
+    return "@" + GetName();
+  } else {
+    vector<string> param_strings;
+    for (const auto& [name, value] : AnnotationParams(AidlConstantValueDecorator)) {
+      param_strings.emplace_back(name + "=" + value);
+    }
+    return "@" + GetName() + "(" + Join(param_strings, ", ") + ")";
+  }
+}
+
+void AidlAnnotation::TraverseChildren(std::function<void(const AidlNode&)> traverse) const {
+  for (const auto& [name, value] : parameters_) {
+    (void)name;
+    traverse(*value);
+  }
+}
+
+static const AidlAnnotation* GetAnnotation(
+    const vector<std::unique_ptr<AidlAnnotation>>& annotations, AidlAnnotation::Type type) {
+  for (const auto& a : annotations) {
+    if (a->GetType() == type) {
+      AIDL_FATAL_IF(a->Repeatable(), a)
+          << "Trying to get a single annotation when it is repeatable.";
+      return a.get();
+    }
+  }
+  return nullptr;
+}
+
+static const AidlAnnotation* GetScopedAnnotation(const AidlDefinedType& defined_type,
+                                                 AidlAnnotation::Type type) {
+  const AidlAnnotation* annotation = GetAnnotation(defined_type.GetAnnotations(), type);
+  if (annotation) {
+    return annotation;
+  }
+  const AidlDefinedType* enclosing_type = defined_type.GetParentType();
+  if (enclosing_type) {
+    return GetScopedAnnotation(*enclosing_type, type);
+  }
+  return nullptr;
+}
+
+AidlAnnotatable::AidlAnnotatable(const AidlLocation& location, const Comments& comments)
+    : AidlCommentable(location, comments) {}
+
+bool AidlAnnotatable::IsNullable() const {
+  return GetAnnotation(annotations_, AidlAnnotation::Type::NULLABLE);
+}
+
+bool AidlAnnotatable::IsHeapNullable() const {
+  auto annot = GetAnnotation(annotations_, AidlAnnotation::Type::NULLABLE);
+  if (annot) {
+    return annot->ParamValue<bool>("heap").value_or(false);
+  }
+  return false;
+}
+
+bool AidlAnnotatable::IsUtf8InCpp() const {
+  return GetAnnotation(annotations_, AidlAnnotation::Type::UTF8_IN_CPP);
+}
+
+bool AidlAnnotatable::IsSensitiveData() const {
+  return GetAnnotation(annotations_, AidlAnnotation::Type::SENSITIVE_DATA);
+}
+
+bool AidlAnnotatable::IsVintfStability() const {
+  auto defined_type = AidlCast<AidlDefinedType>(*this);
+  AIDL_FATAL_IF(!defined_type, *this) << "@VintfStability is not attached to a type";
+  return GetScopedAnnotation(*defined_type, AidlAnnotation::Type::VINTF_STABILITY);
+}
+
+bool AidlAnnotatable::IsJavaOnlyImmutable() const {
+  return GetAnnotation(annotations_, AidlAnnotation::Type::JAVA_ONLY_IMMUTABLE);
+}
+
+bool AidlAnnotatable::IsFixedSize() const {
+  return GetAnnotation(annotations_, AidlAnnotation::Type::FIXED_SIZE);
+}
+
+const AidlAnnotation* AidlAnnotatable::UnsupportedAppUsage() const {
+  return GetAnnotation(annotations_, AidlAnnotation::Type::UNSUPPORTED_APP_USAGE);
+}
+
+std::vector<std::string> AidlAnnotatable::RustDerive() const {
+  std::vector<std::string> ret;
+  if (const auto* ann = GetAnnotation(annotations_, AidlAnnotation::Type::RUST_DERIVE)) {
+    for (const auto& name_and_param : ann->AnnotationParams(AidlConstantValueDecorator)) {
+      if (name_and_param.second == "true") {
+        ret.push_back(name_and_param.first);
+      }
+    }
+  }
+  return ret;
+}
+
+const AidlAnnotation* AidlAnnotatable::BackingType() const {
+  return GetAnnotation(annotations_, AidlAnnotation::Type::BACKING);
+}
+
+std::vector<std::string> AidlAnnotatable::SuppressWarnings() const {
+  auto annot = GetAnnotation(annotations_, AidlAnnotation::Type::SUPPRESS_WARNINGS);
+  if (annot) {
+    auto names = annot->ParamValue<std::vector<std::string>>("value");
+    AIDL_FATAL_IF(!names.has_value(), this);
+    return std::move(names.value());
+  }
+  return {};
+}
+
+// Parses the @Enforce annotation expression.
+std::unique_ptr<android::aidl::perm::Expression> AidlAnnotatable::EnforceExpression() const {
+  auto annot = GetAnnotation(annotations_, AidlAnnotation::Type::PERMISSION_ENFORCE);
+  if (annot) {
+    auto perm_expr = annot->EnforceExpression();
+    if (!perm_expr.ok()) {
+      // This should have been caught during validation.
+      AIDL_FATAL(this) << "Unable to parse @EnforcePermission annotation: " << perm_expr.error();
+    }
+    return std::move(perm_expr.value());
+  }
+  return {};
+}
+
+bool AidlAnnotatable::IsPermissionManual() const {
+  return GetAnnotation(annotations_, AidlAnnotation::Type::PERMISSION_MANUAL);
+}
+
+bool AidlAnnotatable::IsPermissionNone() const {
+  return GetAnnotation(annotations_, AidlAnnotation::Type::PERMISSION_NONE);
+}
+
+bool AidlAnnotatable::IsPermissionAnnotated() const {
+  return IsPermissionNone() || IsPermissionManual() || EnforceExpression();
+}
+
+bool AidlAnnotatable::IsPropagateAllowBlocking() const {
+  return GetAnnotation(annotations_, AidlAnnotation::Type::PROPAGATE_ALLOW_BLOCKING);
+}
+
+bool AidlAnnotatable::IsStableApiParcelable(Options::Language lang) const {
+  if (lang == Options::Language::JAVA)
+    return GetAnnotation(annotations_, AidlAnnotation::Type::JAVA_STABLE_PARCELABLE);
+  if (lang == Options::Language::NDK)
+    return GetAnnotation(annotations_, AidlAnnotation::Type::NDK_STABLE_PARCELABLE);
+  if (lang == Options::Language::RUST)
+    return GetAnnotation(annotations_, AidlAnnotation::Type::RUST_STABLE_PARCELABLE);
+  return false;
+}
+
+bool AidlAnnotatable::JavaDerive(const std::string& method) const {
+  auto annotation = GetAnnotation(annotations_, AidlAnnotation::Type::JAVA_DERIVE);
+  if (annotation != nullptr) {
+    return annotation->ParamValue<bool>(method).value_or(false);
+  }
+  return false;
+}
+
+bool AidlAnnotatable::IsJavaDefault() const {
+  return GetAnnotation(annotations_, AidlAnnotation::Type::JAVA_DEFAULT);
+}
+
+bool AidlAnnotatable::IsJavaDelegator() const {
+  return GetAnnotation(annotations_, AidlAnnotation::Type::JAVA_DELEGATOR);
+}
+
+std::string AidlAnnotatable::GetDescriptor() const {
+  auto annotation = GetAnnotation(annotations_, AidlAnnotation::Type::DESCRIPTOR);
+  if (annotation != nullptr) {
+    return annotation->ParamValue<std::string>("value").value();
+  }
+  return "";
+}
+
+bool AidlAnnotatable::CheckValid(const AidlTypenames&) const {
+  for (const auto& annotation : GetAnnotations()) {
+    if (!annotation->CheckValid()) {
+      return false;
+    }
+  }
+
+  std::map<AidlAnnotation::Type, AidlLocation> declared;
+  for (const auto& annotation : GetAnnotations()) {
+    const auto& [iter, inserted] =
+        declared.emplace(annotation->GetType(), annotation->GetLocation());
+    if (!inserted && !annotation->Repeatable()) {
+      AIDL_ERROR(this) << "'" << annotation->GetName()
+                       << "' is repeated, but not allowed. Previous location: " << iter->second;
+      return false;
+    }
+  }
+
+  return true;
+}
+
+string AidlAnnotatable::ToString() const {
+  vector<string> ret;
+  for (const auto& a : annotations_) {
+    ret.emplace_back(a->ToString());
+  }
+  std::sort(ret.begin(), ret.end());
+  return Join(ret, " ");
+}
+
+AidlTypeSpecifier::AidlTypeSpecifier(const AidlLocation& location, const string& unresolved_name,
+                                     std::optional<ArrayType> array,
+                                     vector<unique_ptr<AidlTypeSpecifier>>* type_params,
+                                     const Comments& comments)
+    : AidlAnnotatable(location, comments),
+      AidlParameterizable<unique_ptr<AidlTypeSpecifier>>(type_params),
+      unresolved_name_(unresolved_name),
+      array_(std::move(array)),
+      split_name_(Split(unresolved_name, ".")) {}
+
+void AidlTypeSpecifier::ViewAsArrayBase(std::function<void(const AidlTypeSpecifier&)> func) const {
+  AIDL_FATAL_IF(!array_.has_value(), this);
+  // Declaring array of generic type cannot happen, it is grammar error.
+  AIDL_FATAL_IF(IsGeneric(), this);
+
+  bool is_mutated = mutated_;
+  mutated_ = true;
+  // mutate the array type to its base by removing a single dimension
+  // e.g.) T[] => T, T[N][M] => T[M] (note that, M is removed)
+  if (IsFixedSizeArray() && std::get<FixedSizeArray>(*array_).dimensions.size() > 1) {
+    auto& dimensions = std::get<FixedSizeArray>(*array_).dimensions;
+    auto dim = std::move(dimensions.front());
+    dimensions.erase(dimensions.begin());
+    func(*this);
+    dimensions.insert(dimensions.begin(), std::move(dim));
+  } else {
+    ArrayType array_type = std::move(array_.value());
+    array_ = std::nullopt;
+    func(*this);
+    array_ = std::move(array_type);
+  }
+  mutated_ = is_mutated;
+}
+
+bool AidlTypeSpecifier::MakeArray(ArrayType array_type) {
+  // T becomes T[] or T[N]
+  if (!IsArray()) {
+    array_ = std::move(array_type);
+    return true;
+  }
+  // T[N] becomes T[N][M]
+  if (auto fixed_size_array = std::get_if<FixedSizeArray>(&array_type);
+      fixed_size_array != nullptr && IsFixedSizeArray()) {
+    // concat dimensions
+    for (auto& dim : fixed_size_array->dimensions) {
+      std::get<FixedSizeArray>(*array_).dimensions.push_back(std::move(dim));
+    }
+    return true;
+  }
+  return false;
+}
+
+std::vector<int32_t> FixedSizeArray::GetDimensionInts() const {
+  std::vector<int32_t> ints;
+  for (const auto& dim : dimensions) {
+    ints.push_back(dim->EvaluatedValue<int32_t>());
+  }
+  return ints;
+}
+
+std::vector<int32_t> AidlTypeSpecifier::GetFixedSizeArrayDimensions() const {
+  AIDL_FATAL_IF(!IsFixedSizeArray(), "not a fixed-size array");
+  return std::get<FixedSizeArray>(GetArray()).GetDimensionInts();
+}
+
+string AidlTypeSpecifier::Signature() const {
+  string ret = GetName();
+  if (IsGeneric()) {
+    vector<string> arg_names;
+    for (const auto& ta : GetTypeParameters()) {
+      arg_names.emplace_back(ta->Signature());
+    }
+    ret += "<" + Join(arg_names, ",") + ">";
+  }
+  if (IsArray()) {
+    if (IsFixedSizeArray()) {
+      for (const auto& dim : GetFixedSizeArrayDimensions()) {
+        ret += "[" + std::to_string(dim) + "]";
+      }
+    } else {
+      ret += "[]";
+    }
+  }
+  return ret;
+}
+
+string AidlTypeSpecifier::ToString() const {
+  string ret = Signature();
+  string annotations = AidlAnnotatable::ToString();
+  if (annotations != "") {
+    ret = annotations + " " + ret;
+  }
+  return ret;
+}
+
+// When `scope` is specified, name is resolved first based on it.
+// `scope` can be null for built-in types and fully-qualified types.
+bool AidlTypeSpecifier::Resolve(const AidlTypenames& typenames, const AidlScope* scope) {
+  AIDL_FATAL_IF(IsResolved(), this);
+  std::string name = unresolved_name_;
+  if (scope) {
+    name = scope->ResolveName(name);
+  }
+  AidlTypenames::ResolvedTypename result = typenames.ResolveTypename(name);
+  if (result.is_resolved) {
+    fully_qualified_name_ = result.canonical_name;
+    split_name_ = Split(fully_qualified_name_, ".");
+    defined_type_ = result.defined_type;
+  }
+  return result.is_resolved;
+}
+
+const AidlDefinedType* AidlTypeSpecifier::GetDefinedType() const {
+  return defined_type_;
+}
+
+bool AidlTypeSpecifier::CheckValid(const AidlTypenames& typenames) const {
+  if (!AidlAnnotatable::CheckValid(typenames)) {
+    return false;
+  }
+  if (IsGeneric()) {
+    const auto& types = GetTypeParameters();
+    for (const auto& arg : types) {
+      if (!arg->CheckValid(typenames)) {
+        return false;
+      }
+    }
+
+    const string& type_name = GetName();
+    // TODO(b/136048684) Disallow to use primitive types only if it is List or Map.
+    if (type_name == "List" || type_name == "Map") {
+      if (std::any_of(types.begin(), types.end(), [&](auto& type_ptr) {
+            return !type_ptr->IsArray() &&
+                   (typenames.GetEnumDeclaration(*type_ptr) ||
+                    AidlTypenames::IsPrimitiveTypename(type_ptr->GetName()));
+          })) {
+        AIDL_ERROR(this) << "A generic type cannot have any primitive type parameters.";
+        return false;
+      }
+    }
+    const auto defined_type = typenames.TryGetDefinedType(type_name);
+    const auto parameterizable =
+        defined_type != nullptr ? defined_type->AsParameterizable() : nullptr;
+    const bool is_user_defined_generic_type =
+        parameterizable != nullptr && parameterizable->IsGeneric();
+    const size_t num_params = GetTypeParameters().size();
+    if (type_name == "List") {
+      if (num_params > 1) {
+        AIDL_ERROR(this) << "List can only have one type parameter, but got: '" << Signature()
+                         << "'";
+        return false;
+      }
+      static const char* kListUsage =
+          "List<T> supports interface/parcelable/union, String, IBinder, and ParcelFileDescriptor.";
+      const AidlTypeSpecifier& contained_type = *GetTypeParameters()[0];
+      if (contained_type.IsArray()) {
+        AIDL_ERROR(this) << "List of arrays is not supported. " << kListUsage;
+        return false;
+      }
+      const string& contained_type_name = contained_type.GetName();
+      if (AidlTypenames::IsBuiltinTypename(contained_type_name)) {
+        if (contained_type_name != "String" && contained_type_name != "IBinder" &&
+            contained_type_name != "ParcelFileDescriptor") {
+          AIDL_ERROR(this) << "List<" << contained_type_name << "> is not supported. "
+                           << kListUsage;
+          return false;
+        }
+      }
+    } else if (type_name == "Map") {
+      if (num_params != 0 && num_params != 2) {
+        AIDL_ERROR(this) << "Map must have 0 or 2 type parameters, but got "
+                         << "'" << Signature() << "'";
+        return false;
+      }
+      if (num_params == 2) {
+        const string& key_type = GetTypeParameters()[0]->Signature();
+        if (key_type != "String") {
+          AIDL_ERROR(this) << "The type of key in map must be String, but it is "
+                           << "'" << key_type << "'";
+          return false;
+        }
+      }
+    } else if (is_user_defined_generic_type) {
+      const size_t allowed = parameterizable->GetTypeParameters().size();
+      if (num_params != allowed) {
+        AIDL_ERROR(this) << type_name << " must have " << allowed << " type parameters, but got "
+                         << num_params;
+        return false;
+      }
+    } else {
+      AIDL_ERROR(this) << type_name << " is not a generic type.";
+      return false;
+    }
+  }
+
+  const bool is_generic_string_list = GetName() == "List" && IsGeneric() &&
+                                      GetTypeParameters().size() == 1 &&
+                                      GetTypeParameters()[0]->GetName() == "String";
+  if (IsUtf8InCpp() && (GetName() != "String" && !is_generic_string_list)) {
+    AIDL_ERROR(this) << "@utf8InCpp can only be used on String, String[], and List<String>.";
+    return false;
+  }
+
+  if (GetName() == "void") {
+    if (IsArray() || IsNullable() || IsUtf8InCpp()) {
+      AIDL_ERROR(this) << "void type cannot be an array or nullable or utf8 string";
+      return false;
+    }
+  }
+
+  if (IsArray()) {
+    if (GetName() == "ParcelableHolder" || GetName() == "List" || GetName() == "Map" ||
+        GetName() == "CharSequence") {
+      AIDL_ERROR(this) << "Arrays of " << GetName() << " are not supported.";
+      return false;
+    }
+  }
+
+  if (IsNullable()) {
+    if (AidlTypenames::IsPrimitiveTypename(GetName()) && !IsArray()) {
+      AIDL_ERROR(this) << "Primitive type cannot get nullable annotation";
+      return false;
+    }
+    const auto defined_type = typenames.TryGetDefinedType(GetName());
+    if (defined_type != nullptr && defined_type->AsEnumDeclaration() != nullptr && !IsArray()) {
+      AIDL_ERROR(this) << "Enum type cannot get nullable annotation";
+      return false;
+    }
+    if (GetName() == "ParcelableHolder") {
+      AIDL_ERROR(this) << "ParcelableHolder cannot be nullable.";
+      return false;
+    }
+    if (IsHeapNullable()) {
+      if (!defined_type || IsArray() || !defined_type->AsParcelable()) {
+        AIDL_ERROR(this) << "@nullable(heap=true) is available to parcelables.";
+        return false;
+      }
+    }
+  }
+
+  if (IsFixedSizeArray()) {
+    for (const auto& dim : std::get<FixedSizeArray>(GetArray()).dimensions) {
+      if (!dim->Evaluate()) {
+        return false;
+      }
+      if (dim->GetType() > AidlConstantValue::Type::INT32) {
+        AIDL_ERROR(this) << "Array size must be a positive number: " << dim->Literal();
+        return false;
+      }
+      auto value = dim->EvaluatedValue<int32_t>();
+      if (value < 0) {
+        AIDL_ERROR(this) << "Array size must be a positive number: " << value;
+        return false;
+      }
+    }
+  }
+  return true;
+}
+
+void AidlTypeSpecifier::TraverseChildren(std::function<void(const AidlNode&)> traverse) const {
+  AidlAnnotatable::TraverseChildren(traverse);
+  if (IsGeneric()) {
+    for (const auto& tp : GetTypeParameters()) {
+      traverse(*tp);
+    }
+  }
+  if (IsFixedSizeArray()) {
+    for (const auto& dim : std::get<FixedSizeArray>(GetArray()).dimensions) {
+      traverse(*dim);
+    }
+  }
+}
+
+std::string AidlConstantValueDecorator(
+    const AidlTypeSpecifier& type,
+    const std::variant<std::string, std::vector<std::string>>& raw_value) {
+  if (type.IsArray()) {
+    const auto& values = std::get<std::vector<std::string>>(raw_value);
+    return "{" + Join(values, ", ") + "}";
+  }
+  const std::string& value = std::get<std::string>(raw_value);
+  if (auto defined_type = type.GetDefinedType(); defined_type) {
+    auto enum_type = defined_type->AsEnumDeclaration();
+    AIDL_FATAL_IF(!enum_type, type) << "Invalid type for \"" << value << "\"";
+    return type.GetName() + "." + value.substr(value.find_last_of('.') + 1);
+  }
+  return value;
+}
+
+AidlVariableDeclaration::AidlVariableDeclaration(const AidlLocation& location,
+                                                 AidlTypeSpecifier* type, const std::string& name)
+    : AidlVariableDeclaration(location, type, name, AidlConstantValue::Default(*type)) {
+  default_user_specified_ = false;
+}
+
+AidlVariableDeclaration::AidlVariableDeclaration(const AidlLocation& location,
+                                                 AidlTypeSpecifier* type, const std::string& name,
+                                                 AidlConstantValue* default_value)
+    : AidlMember(location, type->GetComments()),
+      type_(type),
+      name_(name),
+      default_user_specified_(true),
+      default_value_(default_value) {}
+
+bool AidlVariableDeclaration::HasUsefulDefaultValue() const {
+  if (GetDefaultValue()) {
+    return true;
+  }
+  // null is accepted as a valid default value in all backends
+  if (GetType().IsNullable()) {
+    return true;
+  }
+  return false;
+}
+
+bool AidlVariableDeclaration::CheckValid(const AidlTypenames& typenames) const {
+  bool valid = true;
+  valid &= type_->CheckValid(typenames);
+
+  if (type_->GetName() == "void") {
+    AIDL_ERROR(this) << "Declaration " << name_
+                     << " is void, but declarations cannot be of void type.";
+    valid = false;
+  }
+
+  if (default_value_ == nullptr) return valid;
+  valid &= default_value_->CheckValid();
+
+  if (!valid) return false;
+
+  return !ValueString(AidlConstantValueDecorator).empty();
+}
+
+string AidlVariableDeclaration::GetCapitalizedName() const {
+  AIDL_FATAL_IF(name_.size() <= 0, *this) << "Name can't be empty.";
+  string str = name_;
+  str[0] = static_cast<char>(toupper(str[0]));
+  return str;
+}
+
+string AidlVariableDeclaration::ToString() const {
+  string ret = type_->ToString() + " " + name_;
+  if (default_value_ != nullptr && default_user_specified_) {
+    ret += " = " + ValueString(AidlConstantValueDecorator);
+  }
+  return ret;
+}
+
+string AidlVariableDeclaration::Signature() const {
+  return type_->Signature() + " " + name_;
+}
+
+std::string AidlVariableDeclaration::ValueString(const ConstantValueDecorator& decorator) const {
+  if (default_value_ != nullptr) {
+    return default_value_->ValueString(GetType(), decorator);
+  } else {
+    return "";
+  }
+}
+
+void AidlVariableDeclaration::TraverseChildren(
+    std::function<void(const AidlNode&)> traverse) const {
+  traverse(GetType());
+  if (auto default_value = GetDefaultValue(); default_value) {
+    traverse(*default_value);
+  }
+}
+
+AidlArgument::AidlArgument(const AidlLocation& location, AidlArgument::Direction direction,
+                           AidlTypeSpecifier* type, const std::string& name)
+    : AidlVariableDeclaration(location, type, name),
+      direction_(direction),
+      direction_specified_(true) {}
+
+AidlArgument::AidlArgument(const AidlLocation& location, AidlTypeSpecifier* type,
+                           const std::string& name)
+    : AidlVariableDeclaration(location, type, name),
+      direction_(AidlArgument::IN_DIR),
+      direction_specified_(false) {}
+
+static std::string to_string(AidlArgument::Direction direction) {
+  switch (direction) {
+    case AidlArgument::IN_DIR:
+      return "in";
+    case AidlArgument::OUT_DIR:
+      return "out";
+    case AidlArgument::INOUT_DIR:
+      return "inout";
+  }
+}
+
+string AidlArgument::GetDirectionSpecifier() const {
+  string ret;
+  if (direction_specified_) {
+    ret = to_string(direction_);
+  }
+  return ret;
+}
+
+string AidlArgument::ToString() const {
+  if (direction_specified_) {
+    return GetDirectionSpecifier() + " " + AidlVariableDeclaration::ToString();
+  } else {
+    return AidlVariableDeclaration::ToString();
+  }
+}
+
+static std::string FormatDirections(const std::set<AidlArgument::Direction>& directions) {
+  std::vector<std::string> out;
+  for (const auto& d : directions) {
+    out.push_back(to_string(d));
+  }
+
+  if (out.size() <= 1) {  // [] => "" or [A] => "A"
+    return Join(out, "");
+  } else if (out.size() == 2) {  // [A,B] => "A or B"
+    return Join(out, " or ");
+  } else {  // [A,B,C] => "A, B, or C"
+    out.back() = "or " + out.back();
+    return Join(out, ", ");
+  }
+}
+
+bool AidlArgument::CheckValid(const AidlTypenames& typenames) const {
+  if (!GetType().CheckValid(typenames)) {
+    return false;
+  }
+
+  const auto& aspect = typenames.GetArgumentAspect(GetType());
+
+  if (aspect.possible_directions.size() == 0) {
+    AIDL_ERROR(this) << aspect.name << " cannot be an argument type";
+    return false;
+  }
+
+  // when direction is not specified, "in" is assumed and should be the only possible direction
+  if (!DirectionWasSpecified() && aspect.possible_directions != std::set{AidlArgument::IN_DIR}) {
+    AIDL_ERROR(this) << "The direction of '" << GetName() << "' is not specified. " << aspect.name
+                     << " can be an " << FormatDirections(aspect.possible_directions)
+                     << " parameter.";
+    return false;
+  }
+
+  if (aspect.possible_directions.count(GetDirection()) == 0) {
+    AIDL_ERROR(this) << "'" << GetName() << "' can't be an " << GetDirectionSpecifier()
+                     << " parameter because " << aspect.name << " can only be an "
+                     << FormatDirections(aspect.possible_directions) << " parameter.";
+    return false;
+  }
+
+  return true;
+}
+
+bool AidlCommentable::IsHidden() const {
+  return android::aidl::HasHideInComments(GetComments());
+}
+
+bool AidlCommentable::IsDeprecated() const {
+  return android::aidl::FindDeprecated(GetComments()).has_value();
+}
+
+AidlMember::AidlMember(const AidlLocation& location, const Comments& comments)
+    : AidlAnnotatable(location, comments) {}
+
+AidlConstantDeclaration::AidlConstantDeclaration(const AidlLocation& location,
+                                                 AidlTypeSpecifier* type, const std::string& name,
+                                                 AidlConstantValue* value)
+    : AidlMember(location, type->GetComments()), type_(type), name_(name), value_(value) {}
+
+bool AidlConstantDeclaration::CheckValid(const AidlTypenames& typenames) const {
+  bool valid = true;
+  valid &= type_->CheckValid(typenames);
+  valid &= value_->CheckValid();
+  valid = valid && !ValueString(AidlConstantValueDecorator).empty();
+  if (!valid) return false;
+
+  const static set<string> kSupportedConstTypes = {"String", "byte",  "int",
+                                                   "long",   "float", "double"};
+  if (kSupportedConstTypes.find(type_->Signature()) == kSupportedConstTypes.end()) {
+    AIDL_ERROR(this) << "Constant of type " << type_->Signature() << " is not supported.";
+    return false;
+  }
+
+  return true;
+}
+
+string AidlConstantDeclaration::ToString() const {
+  return "const " + type_->ToString() + " " + name_ + " = " +
+         ValueString(AidlConstantValueDecorator);
+}
+
+string AidlConstantDeclaration::Signature() const {
+  return type_->Signature() + " " + name_;
+}
+
+AidlMethod::AidlMethod(const AidlLocation& location, bool oneway, AidlTypeSpecifier* type,
+                       const std::string& name, std::vector<std::unique_ptr<AidlArgument>>* args,
+                       const Comments& comments)
+    : AidlMethod(location, oneway, type, name, args, comments, 0) {
+  has_id_ = false;
+}
+
+AidlMethod::AidlMethod(const AidlLocation& location, bool oneway, AidlTypeSpecifier* type,
+                       const std::string& name, std::vector<std::unique_ptr<AidlArgument>>* args,
+                       const Comments& comments, int id)
+    : AidlMember(location, comments),
+      oneway_(oneway),
+      oneway_annotation_(oneway),
+      type_(type),
+      name_(name),
+      arguments_(std::move(*args)),
+      id_(id) {
+  has_id_ = true;
+  delete args;
+  for (const unique_ptr<AidlArgument>& a : arguments_) {
+    if (a->IsIn()) { in_arguments_.push_back(a.get()); }
+    if (a->IsOut()) { out_arguments_.push_back(a.get()); }
+  }
+}
+
+string AidlMethod::Signature() const {
+  vector<string> arg_signatures;
+  for (const auto& arg : GetArguments()) {
+    arg_signatures.emplace_back(arg->GetType().Signature());
+  }
+  return GetName() + "(" + Join(arg_signatures, ", ") + ")";
+}
+
+string AidlMethod::ToString() const {
+  vector<string> arg_strings;
+  for (const auto& arg : GetArguments()) {
+    arg_strings.emplace_back(arg->ToString());
+  }
+  string ret = (IsOneway() ? "oneway " : "") + GetType().ToString() + " " + GetName() + "(" +
+               Join(arg_strings, ", ") + ")";
+  if (HasId()) {
+    ret += " = " + std::to_string(GetId());
+  }
+  return ret;
+}
+
+bool AidlMethod::CheckValid(const AidlTypenames& typenames) const {
+  if (!GetType().CheckValid(typenames)) {
+    return false;
+  }
+
+  // TODO(b/156872582): Support it when ParcelableHolder supports every backend.
+  if (GetType().GetName() == "ParcelableHolder") {
+    AIDL_ERROR(this) << "ParcelableHolder cannot be a return type";
+    return false;
+  }
+  if (IsOneway() && GetType().GetName() != "void") {
+    AIDL_ERROR(this) << "oneway method '" << GetName() << "' cannot return a value";
+    return false;
+  }
+
+  set<string> argument_names;
+  for (const auto& arg : GetArguments()) {
+    auto it = argument_names.find(arg->GetName());
+    if (it != argument_names.end()) {
+      AIDL_ERROR(this) << "method '" << GetName() << "' has duplicate argument name '"
+                       << arg->GetName() << "'";
+      return false;
+    }
+    argument_names.insert(arg->GetName());
+
+    if (!arg->CheckValid(typenames)) {
+      return false;
+    }
+
+    if (IsOneway() && arg->IsOut()) {
+      AIDL_ERROR(this) << "oneway method '" << this->GetName() << "' cannot have out parameters";
+      return false;
+    }
+
+    // check that the name doesn't match a keyword
+    if (IsJavaKeyword(arg->GetName().c_str())) {
+      AIDL_ERROR(arg) << "Argument name is a Java or aidl keyword";
+      return false;
+    }
+
+    // Reserve a namespace for internal use
+    if (android::base::StartsWith(arg->GetName(), "_aidl")) {
+      AIDL_ERROR(arg) << "Argument name cannot begin with '_aidl'";
+      return false;
+    }
+
+    if (arg->GetType().GetName() == "void") {
+      AIDL_ERROR(arg->GetType()) << "'void' is an invalid type for the parameter '"
+                                 << arg->GetName() << "'";
+      return false;
+    }
+  }
+  return true;
+}
+
+AidlDefinedType::AidlDefinedType(const AidlLocation& location, const std::string& name,
+                                 const Comments& comments, const std::string& package,
+                                 std::vector<std::unique_ptr<AidlMember>>* members)
+    : AidlMember(location, comments), AidlScope(this), name_(name), package_(package) {
+  // adjust name/package when name is fully qualified (for preprocessed files)
+  if (package_.empty() && name_.find('.') != std::string::npos) {
+    // Note that this logic is absolutely wrong.  Given a parcelable
+    // org.some.Foo.Bar, the class name is Foo.Bar, but this code will claim that
+    // the class is just Bar.  However, this was the way it was done in the past.
+    //
+    // See b/17415692
+    auto pos = name.rfind('.');
+    // name is the last part.
+    name_ = name.substr(pos + 1);
+    // package is the initial parts (except the last).
+    package_ = name.substr(0, pos);
+  }
+  if (members) {
+    for (auto& m : *members) {
+      if (auto constant = AidlCast<AidlConstantDeclaration>(*m); constant) {
+        constants_.emplace_back(constant);
+      } else if (auto variable = AidlCast<AidlVariableDeclaration>(*m); variable) {
+        variables_.emplace_back(variable);
+      } else if (auto method = AidlCast<AidlMethod>(*m); method) {
+        methods_.emplace_back(method);
+      } else if (auto type = AidlCast<AidlDefinedType>(*m); type) {
+        type->SetEnclosingScope(this);
+        types_.emplace_back(type);
+      } else {
+        AIDL_FATAL(*m) << "Unknown member type.";
+      }
+      members_.push_back(m.release());
+    }
+    delete members;
+  }
+}
+
+bool AidlDefinedType::CheckValid(const AidlTypenames& typenames) const {
+  if (!AidlAnnotatable::CheckValid(typenames)) {
+    return false;
+  }
+  if (!CheckValidWithMembers(typenames)) {
+    return false;
+  }
+  return true;
+}
+
+std::string AidlDefinedType::GetCanonicalName() const {
+  if (auto parent = GetParentType(); parent) {
+    return parent->GetCanonicalName() + "." + GetName();
+  }
+  if (package_.empty()) {
+    return GetName();
+  }
+  return GetPackage() + "." + GetName();
+}
+
+bool AidlDefinedType::CheckValidWithMembers(const AidlTypenames& typenames) const {
+  bool success = true;
+
+  for (const auto& t : GetNestedTypes()) {
+    success = success && t->CheckValid(typenames);
+  }
+
+  if (auto parameterizable = AsParameterizable();
+      parameterizable && parameterizable->IsGeneric() && !GetNestedTypes().empty()) {
+    AIDL_ERROR(this) << "Generic types can't have nested types.";
+    return false;
+  }
+
+  std::set<std::string> nested_type_names;
+  for (const auto& t : GetNestedTypes()) {
+    bool duplicated = !nested_type_names.emplace(t->GetName()).second;
+    if (duplicated) {
+      AIDL_ERROR(t) << "Redefinition of '" << t->GetName() << "'.";
+      success = false;
+    }
+    // nested type can't have a parent name
+    if (t->GetName() == GetName()) {
+      AIDL_ERROR(t) << "Nested type '" << GetName() << "' has the same name as its parent.";
+      success = false;
+    }
+    // Having unstructured parcelables as nested types doesn't make sense because they are defined
+    // somewhere else in native languages (e.g. C++, Java...).
+    if (AidlCast<AidlParcelable>(*t)) {
+      AIDL_ERROR(t) << "'" << t->GetName()
+                    << "' is nested. Unstructured parcelables should be at the root scope.";
+      return false;
+    }
+  }
+
+  if (!TopologicalVisit(GetNestedTypes(), [](auto&) {})) {
+    AIDL_ERROR(this) << GetName()
+                     << " has nested types with cyclic references. C++ and NDK backends don't "
+                        "support cyclic references.";
+    return false;
+  }
+
+  for (const auto& v : GetFields()) {
+    const bool field_valid = v->CheckValid(typenames);
+    success = success && field_valid;
+  }
+
+  // field names should be unique
+  std::set<std::string> fieldnames;
+  for (const auto& v : GetFields()) {
+    bool duplicated = !fieldnames.emplace(v->GetName()).second;
+    if (duplicated) {
+      AIDL_ERROR(v) << "'" << GetName() << "' has duplicate field name '" << v->GetName() << "'";
+      success = false;
+    }
+  }
+
+  // immutable parcelables should have immutable fields.
+  if (IsJavaOnlyImmutable()) {
+    for (const auto& v : GetFields()) {
+      if (!typenames.CanBeJavaOnlyImmutable(v->GetType())) {
+        AIDL_ERROR(v) << "The @JavaOnlyImmutable '" << GetName() << "' has a "
+                      << "non-immutable field named '" << v->GetName() << "'.";
+        success = false;
+      }
+    }
+  }
+
+  // Rust derive fields must be transitive
+  const std::vector<std::string> rust_derives = RustDerive();
+  for (const auto& v : GetFields()) {
+    const AidlDefinedType* field = typenames.TryGetDefinedType(v->GetType().GetName());
+    if (!field) continue;
+
+    // could get this from CONTEXT_*, but we don't currently save this info when we validated
+    // contexts
+    if (!field->AsStructuredParcelable() && !field->AsUnionDeclaration()) continue;
+
+    auto subs = field->RustDerive();
+    for (const std::string& derive : rust_derives) {
+      if (std::find(subs.begin(), subs.end(), derive) == subs.end()) {
+        AIDL_ERROR(v) << "Field " << v->GetName() << " of type with @RustDerive " << derive
+                      << " also needs to derive this";
+        success = false;
+      }
+    }
+  }
+
+  set<string> constant_names;
+  for (const auto& constant : GetConstantDeclarations()) {
+    if (constant_names.count(constant->GetName()) > 0) {
+      AIDL_ERROR(constant) << "Found duplicate constant name '" << constant->GetName() << "'";
+      success = false;
+    }
+    constant_names.insert(constant->GetName());
+    success = success && constant->CheckValid(typenames);
+  }
+
+  return success;
+}
+
+bool AidlDefinedType::CheckValidForGetterNames() const {
+  bool success = true;
+  std::set<std::string> getters;
+  for (const auto& v : GetFields()) {
+    bool duplicated = !getters.emplace(v->GetCapitalizedName()).second;
+    if (duplicated) {
+      AIDL_ERROR(v) << "'" << GetName() << "' has duplicate field name '" << v->GetName()
+                    << "' after capitalizing the first letter";
+      success = false;
+    }
+  }
+  return success;
+}
+
+const AidlDefinedType* AidlDefinedType::GetParentType() const {
+  AIDL_FATAL_IF(GetEnclosingScope() == nullptr, this) << "Scope is not set.";
+  return AidlCast<AidlDefinedType>(GetEnclosingScope()->GetNode());
+}
+
+const AidlDefinedType* AidlDefinedType::GetRootType() const {
+  const AidlDefinedType* root = this;
+  for (auto parent = root->GetParentType(); parent; parent = parent->GetParentType()) {
+    root = parent;
+  }
+  return root;
+}
+
+// Resolve `name` in the current scope. If not found, delegate to the parent
+std::string AidlDefinedType::ResolveName(const std::string& name) const {
+  // For example, in the following, t1's type Baz means x.Foo.Bar.Baz
+  // while t2's type is y.Baz.
+  // package x;
+  // import y.Baz;
+  // parcelable Foo {
+  //   parcelable Bar {
+  //     enum Baz { ... }
+  //     Baz t1; // -> should be x.Foo.Bar.Baz
+  //   }
+  //   Baz t2; // -> should be y.Baz
+  //   Bar.Baz t3; // -> should be x.Foo.Bar.Baz
+  // }
+  AIDL_FATAL_IF(!GetEnclosingScope(), this)
+      << "Type should have an enclosing scope.(e.g. AidlDocument)";
+  if (AidlTypenames::IsBuiltinTypename(name)) {
+    return name;
+  }
+
+  const auto first_dot = name.find_first_of('.');
+  // For "Outer.Inner", we look up "Outer" in the import list.
+  const std::string class_name =
+      (first_dot == std::string::npos) ? name : name.substr(0, first_dot);
+  // Keep ".Inner", to make a fully-qualified name
+  const std::string nested_type = (first_dot == std::string::npos) ? "" : name.substr(first_dot);
+
+  // check if it is a nested type
+  for (const auto& type : GetNestedTypes()) {
+    if (type->GetName() == class_name) {
+      return type->GetCanonicalName() + nested_type;
+    }
+  }
+
+  return GetEnclosingScope()->ResolveName(name);
+}
+
+template <>
+const AidlDefinedType* AidlCast<AidlDefinedType>(const AidlNode& node) {
+  struct Visitor : AidlVisitor {
+    const AidlDefinedType* defined_type = nullptr;
+    void Visit(const AidlInterface& t) override { defined_type = &t; }
+    void Visit(const AidlEnumDeclaration& t) override { defined_type = &t; }
+    void Visit(const AidlStructuredParcelable& t) override { defined_type = &t; }
+    void Visit(const AidlUnionDecl& t) override { defined_type = &t; }
+    void Visit(const AidlParcelable& t) override { defined_type = &t; }
+  } v;
+  node.DispatchVisit(v);
+  return v.defined_type;
+}
+
+const AidlDocument& AidlDefinedType::GetDocument() const {
+  const AidlDefinedType* root = GetRootType();
+  auto scope = root->GetEnclosingScope();
+  AIDL_FATAL_IF(!scope, this) << "no scope defined.";
+  auto doc = AidlCast<AidlDocument>(scope->GetNode());
+  AIDL_FATAL_IF(!doc, this) << "root scope is not a document.";
+  return *doc;
+}
+
+AidlParcelable::AidlParcelable(const AidlLocation& location, const std::string& name,
+                               const std::string& package, const Comments& comments,
+                               const AidlUnstructuredHeaders& headers,
+                               std::vector<std::string>* type_params,
+                               std::vector<std::unique_ptr<AidlMember>>* members)
+    : AidlDefinedType(location, name, comments, package, members),
+      AidlParameterizable<std::string>(type_params),
+      headers_(headers) {
+  // Strip off quotation marks if we actually have headers.
+  if (headers_.cpp.length() >= 2) {
+    headers_.cpp = headers_.cpp.substr(1, headers_.cpp.length() - 2);
+  }
+  if (headers_.ndk.length() >= 2) {
+    headers_.ndk = headers_.ndk.substr(1, headers_.ndk.length() - 2);
+  }
+  if (headers_.rust_type.length() >= 2) {
+    headers_.rust_type = headers_.rust_type.substr(1, headers_.rust_type.length() - 2);
+  }
+}
+
+template <typename T>
+bool AidlParameterizable<T>::CheckValid() const {
+  return true;
+};
+
+template <>
+bool AidlParameterizable<std::string>::CheckValid() const {
+  if (!IsGeneric()) {
+    return true;
+  }
+  std::unordered_set<std::string> set(GetTypeParameters().begin(), GetTypeParameters().end());
+  if (set.size() != GetTypeParameters().size()) {
+    AIDL_ERROR(this->AsAidlNode()) << "Every type parameter should be unique.";
+    return false;
+  }
+  return true;
+}
+
+bool AidlParcelable::CheckValid(const AidlTypenames& typenames) const {
+  if (!AidlDefinedType::CheckValid(typenames)) {
+    return false;
+  }
+  if (!AidlParameterizable<std::string>::CheckValid()) {
+    return false;
+  }
+
+  bool success = true;
+  if (IsFixedSize()) {
+    for (const auto& v : GetFields()) {
+      if (!typenames.CanBeFixedSize(v->GetType())) {
+        AIDL_ERROR(v) << "The @FixedSize parcelable '" << this->GetName() << "' has a "
+                      << "non-fixed size field named " << v->GetName() << ".";
+        success = false;
+      }
+    }
+  }
+
+  return success;
+}
+
+AidlStructuredParcelable::AidlStructuredParcelable(
+    const AidlLocation& location, const std::string& name, const std::string& package,
+    const Comments& comments, std::vector<std::string>* type_params,
+    std::vector<std::unique_ptr<AidlMember>>* members)
+    : AidlParcelable(location, name, package, comments, {} /*headers*/, type_params, members) {}
+
+bool AidlStructuredParcelable::CheckValid(const AidlTypenames& typenames) const {
+  if (!AidlParcelable::CheckValid(typenames)) {
+    return false;
+  }
+
+  bool success = true;
+
+  if (IsJavaOnlyImmutable()) {
+    // Immutable parcelables provide getters
+    if (!CheckValidForGetterNames()) {
+      success = false;
+    }
+  }
+
+  return success;
+}
+
+// TODO: we should treat every backend all the same in future.
+bool AidlTypeSpecifier::LanguageSpecificCheckValid(Options::Language lang) const {
+  if (this->GetName() == "FileDescriptor" &&
+      (lang == Options::Language::NDK || lang == Options::Language::RUST)) {
+    AIDL_ERROR(this) << "FileDescriptor isn't supported by the " << to_string(lang) << " backend.";
+    return false;
+  }
+
+  if (lang != Options::Language::JAVA) {
+    if (this->GetName() == "List" && !this->IsGeneric()) {
+      AIDL_ERROR(this) << "Currently, only the Java backend supports non-generic List.";
+      return false;
+    }
+    if (this->GetName() == "Map" || this->GetName() == "CharSequence") {
+      AIDL_ERROR(this) << "Currently, only Java backend supports " << this->GetName() << ".";
+      return false;
+    }
+  }
+
+  return true;
+}
+
+// TODO: we should treat every backend all the same in future.
+bool AidlDefinedType::LanguageSpecificCheckValid(Options::Language lang) const {
+  struct Visitor : AidlVisitor {
+    Visitor(Options::Language lang) : lang(lang) {}
+    void Visit(const AidlTypeSpecifier& type) override {
+      success = success && type.LanguageSpecificCheckValid(lang);
+    }
+    Options::Language lang;
+    bool success = true;
+  } v(lang);
+  VisitTopDown(v, *this);
+  return v.success;
+}
+
+AidlEnumerator::AidlEnumerator(const AidlLocation& location, const std::string& name,
+                               AidlConstantValue* value, const Comments& comments)
+    : AidlCommentable(location, comments),
+      name_(name),
+      value_(value),
+      value_user_specified_(value != nullptr) {}
+
+bool AidlEnumerator::CheckValid(const AidlTypeSpecifier& enum_backing_type) const {
+  if (GetValue() == nullptr) {
+    return false;
+  }
+  if (!GetValue()->CheckValid()) {
+    return false;
+  }
+  if (GetValue()->ValueString(enum_backing_type, AidlConstantValueDecorator).empty()) {
+    AIDL_ERROR(this) << "Enumerator type differs from enum backing type.";
+    return false;
+  }
+  return true;
+}
+
+string AidlEnumerator::ValueString(const AidlTypeSpecifier& backing_type,
+                                   const ConstantValueDecorator& decorator) const {
+  return GetValue()->ValueString(backing_type, decorator);
+}
+
+AidlEnumDeclaration::AidlEnumDeclaration(const AidlLocation& location, const std::string& name,
+                                         std::vector<std::unique_ptr<AidlEnumerator>>* enumerators,
+                                         const std::string& package, const Comments& comments)
+    : AidlDefinedType(location, name, comments, package, nullptr),
+      enumerators_(std::move(*enumerators)) {
+  // Fill missing enumerator values with <prev + 1>
+  // This can't be done in Autofill() because type/ref resolution depends on this.
+  // For example, with enum E { A, B = A }, B's value 'A' is a reference which can't be
+  // resolved if A has no value set.
+  const AidlEnumerator* previous = nullptr;
+  for (const auto& enumerator : enumerators_) {
+    if (enumerator->GetValue() == nullptr) {
+      auto loc = enumerator->GetLocation();
+      if (previous == nullptr) {
+        enumerator->SetValue(
+            std::unique_ptr<AidlConstantValue>(AidlConstantValue::Integral(loc, "0")));
+      } else {
+        auto prev_value = std::make_unique<AidlConstantReference>(loc, previous->GetName());
+        enumerator->SetValue(std::make_unique<AidlBinaryConstExpression>(
+            loc, std::move(prev_value), "+",
+            std::unique_ptr<AidlConstantValue>(AidlConstantValue::Integral(loc, "1"))));
+      }
+    }
+    previous = enumerator.get();
+  }
+}
+
+bool AidlEnumDeclaration::Autofill(const AidlTypenames& typenames) {
+  if (auto annot = BackingType(); annot != nullptr) {
+    // Autofill() is called before the grand CheckValid(). But AidlAnnotation::ParamValue()
+    // calls AidlConstantValue::evaluate() which requires CheckValid() to be called before. So we
+    // need to call CheckValid().
+    if (!annot->CheckValid()) {
+      return false;
+    }
+    auto type = annot->ParamValue<std::string>("type").value();
+    backing_type_ = typenames.MakeResolvedType(annot->GetLocation(), type, false);
+  } else {
+    // Default to byte type for enums.
+    backing_type_ = typenames.MakeResolvedType(GetLocation(), "byte", false);
+  }
+
+  // we only support/test a few backing types, so make sure this is a supported
+  // one (otherwise boolean might work, which isn't supported/tested in all
+  // backends)
+  static std::set<string> kBackingTypes = {"byte", "int", "long"};
+  if (kBackingTypes.find(backing_type_->GetName()) == kBackingTypes.end()) {
+    AIDL_ERROR(this) << "Invalid backing type: " << backing_type_->GetName()
+                     << ". Backing type must be one of: " << Join(kBackingTypes, ", ");
+    return false;
+  }
+  return true;
+}
+
+bool AidlEnumDeclaration::CheckValid(const AidlTypenames& typenames) const {
+  if (!AidlDefinedType::CheckValid(typenames)) {
+    return false;
+  }
+  if (!GetMembers().empty()) {
+    AIDL_ERROR(this) << "Enum doesn't support fields/constants/methods.";
+    return false;
+  }
+  if (backing_type_ == nullptr) {
+    AIDL_ERROR(this) << "Enum declaration missing backing type.";
+    return false;
+  }
+  bool success = true;
+  for (const auto& enumerator : enumerators_) {
+    success = success && enumerator->CheckValid(GetBackingType());
+  }
+
+  return success;
+}
+
+AidlUnionDecl::AidlUnionDecl(const AidlLocation& location, const std::string& name,
+                             const std::string& package, const Comments& comments,
+                             std::vector<std::string>* type_params,
+                             std::vector<std::unique_ptr<AidlMember>>* members)
+    : AidlParcelable(location, name, package, comments, {} /*headers*/, type_params, members) {}
+
+bool AidlUnionDecl::CheckValid(const AidlTypenames& typenames) const {
+  // visit parents
+  if (!AidlParcelable::CheckValid(typenames)) {
+    return false;
+  }
+
+  // unions provide getters always
+  if (!CheckValidForGetterNames()) {
+    return false;
+  }
+
+  // now, visit self!
+  bool success = true;
+
+  // TODO(b/170807936) do we need to allow ParcelableHolder in union?
+  for (const auto& v : GetFields()) {
+    if (v->GetType().GetName() == "ParcelableHolder") {
+      AIDL_ERROR(*v) << "A union can't have a member of ParcelableHolder '" << v->GetName() << "'";
+      success = false;
+    }
+  }
+
+  if (GetFields().empty()) {
+    AIDL_ERROR(*this) << "The union '" << this->GetName() << "' has no fields.";
+    return false;
+  }
+
+  // first member should have useful default value (implicit or explicit)
+  const auto& first = GetFields()[0];
+  if (!first->HasUsefulDefaultValue()) {
+    // Most types can be initialized without a default value. For example,
+    // interface types are inherently nullable. But, enum types should have
+    // an explicit default value.
+    if (!first->GetType().IsArray() && typenames.GetEnumDeclaration(first->GetType())) {
+      AIDL_ERROR(first)
+          << "The union's first member should have a useful default value. Enum types can be "
+             "initialized with a reference. (e.g. ... = MyEnum.FOO;)";
+      return false;
+    }
+    // In Java, array types are initialized as null without a default value. To be sure that default
+    // initialized unions are accepted by other backends we require arrays also have a default
+    // value.
+    if (first->GetType().IsArray()) {
+      AIDL_ERROR(first)
+          << "The union's first member should have a useful default value. Arrays can be "
+             "initialized with values(e.g. ... = { values... };) or marked as @nullable.";
+      return false;
+    }
+  }
+
+  return success;
+}
+
+AidlInterface::AidlInterface(const AidlLocation& location, const std::string& name,
+                             const Comments& comments, bool oneway, const std::string& package,
+                             std::vector<std::unique_ptr<AidlMember>>* members)
+    : AidlDefinedType(location, name, comments, package, members), oneway_annotation_(oneway) {
+  for (auto& m : GetMethods()) {
+    m.get()->ApplyInterfaceOneway(oneway);
+  }
+}
+
+bool AidlInterface::CheckValid(const AidlTypenames& typenames) const {
+  if (!AidlDefinedType::CheckValid(typenames)) {
+    return false;
+  }
+  // Has to be a pointer due to deleting copy constructor. No idea why.
+  map<string, const AidlMethod*> method_names;
+  for (const auto& m : GetMethods()) {
+    if (!m->CheckValid(typenames)) {
+      return false;
+    }
+
+    auto it = method_names.find(m->GetName());
+    // prevent duplicate methods
+    if (it == method_names.end()) {
+      method_names[m->GetName()] = m.get();
+    } else {
+      AIDL_ERROR(m) << "attempt to redefine method " << m->GetName() << ":";
+      AIDL_ERROR(it->second) << "previously defined here.";
+      return false;
+    }
+
+    static set<string> reserved_methods{"asBinder()", "getInterfaceHash()", "getInterfaceVersion()",
+                                        "getTransactionName(int)"};
+
+    if (reserved_methods.find(m->Signature()) != reserved_methods.end()) {
+      AIDL_ERROR(m) << " method " << m->Signature() << " is reserved for internal use.";
+      return false;
+    }
+
+    if (!CheckValidPermissionAnnotations(*m.get())) {
+      return false;
+    }
+  }
+
+  return true;
+}
+
+bool AidlInterface::CheckValidPermissionAnnotations(const AidlMethod& m) const {
+  if (IsPermissionAnnotated() && m.GetType().IsPermissionAnnotated()) {
+    AIDL_ERROR(m) << "The interface " << GetName()
+                  << " uses a permission annotation but the method " << m.GetName()
+                  << " is also annotated.\n"
+                  << "Consider distributing the annotation to each method.";
+    return false;
+  }
+  return true;
+}
+
+bool AidlInterface::UsesPermissions() const {
+  if (EnforceExpression()) {
+    return true;
+  }
+  for (auto& m : GetMethods()) {
+    if (m->GetType().EnforceExpression()) {
+      return true;
+    }
+  }
+  return false;
+}
+
+std::string AidlInterface::GetDescriptor() const {
+  std::string annotatedDescriptor = AidlAnnotatable::GetDescriptor();
+  if (annotatedDescriptor != "") {
+    return annotatedDescriptor;
+  }
+  return GetCanonicalName();
+}
+
+AidlDocument::AidlDocument(const AidlLocation& location, const Comments& comments,
+                           std::vector<string> imports,
+                           std::vector<std::unique_ptr<AidlDefinedType>> defined_types,
+                           bool is_preprocessed)
+    : AidlCommentable(location, comments),
+      AidlScope(this),
+      imports_(std::move(imports)),
+      defined_types_(std::move(defined_types)),
+      is_preprocessed_(is_preprocessed) {
+  for (const auto& t : defined_types_) {
+    t->SetEnclosingScope(this);
+  }
+}
+
+// Resolves type name in the current document.
+// - built-in types
+// - imported types
+// - top-level type
+std::string AidlDocument::ResolveName(const std::string& name) const {
+  if (AidlTypenames::IsBuiltinTypename(name)) {
+    return name;
+  }
+
+  const auto first_dot = name.find_first_of('.');
+  // For "Outer.Inner", we look up "Outer" in the import list.
+  const std::string class_name =
+      (first_dot == std::string::npos) ? name : name.substr(0, first_dot);
+  // Keep ".Inner", to make a fully-qualified name
+  const std::string nested_type = (first_dot == std::string::npos) ? "" : name.substr(first_dot);
+
+  for (const auto& import : Imports()) {
+    if (SimpleName(import) == class_name) {
+      return import + nested_type;
+    }
+  }
+
+  // check if it is a top-level type.
+  for (const auto& type : DefinedTypes()) {
+    if (type->GetName() == class_name) {
+      return type->GetCanonicalName() + nested_type;
+    }
+  }
+
+  // name itself might be fully-qualified name.
+  return name;
+}
diff --git a/aidl_language.h b/aidl_language.h
new file mode 100644
index 0000000..f8bced7
--- /dev/null
+++ b/aidl_language.h
@@ -0,0 +1,1394 @@
+/*
+ * Copyright (C) 2019, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <memory>
+#include <regex>
+#include <string>
+#include <unordered_set>
+#include <variant>
+#include <vector>
+
+#include <android-base/result.h>
+#include <android-base/strings.h>
+
+#include "aidl_typenames.h"
+#include "code_writer.h"
+#include "comments.h"
+#include "diagnostics.h"
+#include "io_delegate.h"
+#include "location.h"
+#include "logging.h"
+#include "options.h"
+#include "permission.h"
+
+using android::aidl::AidlTypenames;
+using android::aidl::CodeWriter;
+using android::aidl::Comments;
+using android::aidl::Options;
+using android::base::Result;
+using std::shared_ptr;
+using std::string;
+using std::unique_ptr;
+using std::vector;
+class AidlNode;
+
+// helper to see if T is the same to one of Args types.
+template <typename T, typename... Args>
+struct is_one_of : std::false_type {};
+
+template <typename T, typename S, typename... Args>
+struct is_one_of<T, S, Args...> {
+  enum { value = std::is_same_v<T, S> || is_one_of<T, Args...>::value };
+};
+
+// helper to see if T is std::vector of something.
+template <typename>
+struct is_vector : std::false_type {};
+
+template <typename T>
+struct is_vector<std::vector<T>> : std::true_type {};
+
+// helper for static_assert(false)
+template <typename T>
+struct unsupported_type : std::false_type {};
+
+namespace android {
+namespace aidl {
+namespace mappings {
+std::string dump_location(const AidlNode& method);
+}  // namespace mappings
+namespace java {
+std::string dump_location(const AidlNode& method);
+}  // namespace java
+}  // namespace aidl
+}  // namespace android
+
+bool ParseFloating(std::string_view sv, double* parsed);
+bool ParseFloating(std::string_view sv, float* parsed);
+
+class AidlDocument;
+class AidlInterface;
+class AidlParcelable;
+class AidlStructuredParcelable;
+class AidlEnumDeclaration;
+class AidlUnionDecl;
+class AidlVariableDeclaration;
+class AidlConstantDeclaration;
+class AidlEnumerator;
+class AidlMethod;
+class AidlArgument;
+class AidlConstantValue;
+class AidlConstantReference;
+class AidlUnaryConstExpression;
+class AidlBinaryConstExpression;
+class AidlAnnotation;
+
+// Interface for visitors that can traverse AidlTraversable nodes.
+class AidlVisitor {
+ public:
+  virtual ~AidlVisitor() = default;
+  virtual void Visit(const AidlDocument&) {}
+  virtual void Visit(const AidlInterface&) {}
+  virtual void Visit(const AidlParcelable&) {}
+  virtual void Visit(const AidlStructuredParcelable&) {}
+  virtual void Visit(const AidlUnionDecl&) {}
+  virtual void Visit(const AidlEnumDeclaration&) {}
+  virtual void Visit(const AidlEnumerator&) {}
+  virtual void Visit(const AidlMethod&) {}
+  virtual void Visit(const AidlVariableDeclaration&) {}
+  virtual void Visit(const AidlConstantDeclaration&) {}
+  virtual void Visit(const AidlArgument&) {}
+  virtual void Visit(const AidlTypeSpecifier&) {}
+  virtual void Visit(const AidlConstantValue&) {}
+  virtual void Visit(const AidlConstantReference&) {}
+  virtual void Visit(const AidlUnaryConstExpression&) {}
+  virtual void Visit(const AidlBinaryConstExpression&) {}
+  virtual void Visit(const AidlAnnotation&) {}
+};
+
+class AidlScope {
+ public:
+  AidlScope(const AidlNode* self) : self_(self) {}
+  virtual ~AidlScope() = default;
+  virtual std::string ResolveName(const std::string& name) const = 0;
+  void SetEnclosingScope(const AidlScope* enclosing) {
+    AIDL_FATAL_IF(enclosing_, AIDL_LOCATION_HERE) << "SetEnclosingScope can be set only once.";
+    enclosing_ = enclosing;
+  }
+  const AidlScope* GetEnclosingScope() const { return enclosing_; }
+  const AidlNode& GetNode() const { return *self_; }
+
+ private:
+  const AidlNode* self_;
+  const AidlScope* enclosing_ = nullptr;
+};
+
+// Anything that is locatable in a .aidl file.
+class AidlNode {
+ public:
+  AidlNode(const AidlLocation& location, const Comments& comments = {});
+
+  virtual ~AidlNode();
+
+  AidlNode(AidlNode&) = delete;
+  AidlNode& operator=(AidlNode&) = delete;
+  AidlNode(AidlNode&&) = delete;
+  AidlNode& operator=(AidlNode&&) = delete;
+
+  // To be able to print AidlLocation
+  friend class AidlErrorLog;
+  friend std::string android::aidl::mappings::dump_location(const AidlNode&);
+  friend std::string android::aidl::java::dump_location(const AidlNode&);
+
+  const AidlLocation& GetLocation() const { return location_; }
+  virtual void TraverseChildren(std::function<void(const AidlNode&)> traverse) const = 0;
+  virtual void DispatchVisit(AidlVisitor&) const = 0;
+
+  const Comments& GetComments() const { return comments_; }
+  void SetComments(const Comments& comments) { comments_ = comments; }
+
+  static void ClearUnvisitedNodes();
+  static const std::vector<AidlLocation>& GetLocationsOfUnvisitedNodes();
+  void MarkVisited() const;
+  bool IsUserDefined() const { return !GetLocation().IsInternal(); }
+
+ private:
+  std::string PrintLine() const;
+  std::string PrintLocation() const;
+  const AidlLocation location_;
+  Comments comments_;
+
+  // make sure we are able to abort if types are not visited
+  mutable bool visited_ = false;
+  static std::vector<AidlLocation> unvisited_locations_;
+};
+
+// unique_ptr<AidlTypeSpecifier> for type arugment,
+// std::string for type parameter(T, U, and so on).
+template <typename T>
+class AidlParameterizable {
+ public:
+  AidlParameterizable(std::vector<T>* type_params) : type_params_(type_params) {}
+  virtual ~AidlParameterizable() = default;
+  bool IsGeneric() const { return type_params_ != nullptr; }
+  const std::vector<T>& GetTypeParameters() const { return *type_params_; }
+  bool CheckValid() const;
+
+  __attribute__((warn_unused_result)) bool SetTypeParameters(std::vector<T>* type_params) {
+    if (type_params_) return false;
+    type_params_.reset(type_params);
+    return true;
+  }
+
+  virtual const AidlNode& AsAidlNode() const = 0;
+
+ private:
+  unique_ptr<std::vector<T>> type_params_;
+  static_assert(std::is_same<T, unique_ptr<AidlTypeSpecifier>>::value ||
+                std::is_same<T, std::string>::value);
+};
+template <>
+bool AidlParameterizable<std::string>::CheckValid() const;
+
+class AidlCommentable : public AidlNode {
+ public:
+  AidlCommentable(const AidlLocation& location, const Comments& comments)
+      : AidlNode(location, comments) {}
+  virtual ~AidlCommentable() = default;
+
+  bool IsHidden() const;
+  bool IsDeprecated() const;
+};
+
+// Transforms a value string into a language specific form. Raw value as produced by
+// AidlConstantValue.
+using ConstantValueDecorator = std::function<std::string(
+    const AidlTypeSpecifier& type,
+    const std::variant<std::string, std::vector<std::string>>& raw_value)>;
+
+class AidlAnnotation : public AidlNode {
+ public:
+  enum class Type {
+    BACKING = 1,
+    JAVA_STABLE_PARCELABLE,
+    NDK_STABLE_PARCELABLE,
+    RUST_STABLE_PARCELABLE,
+    UNSUPPORTED_APP_USAGE,
+    VINTF_STABILITY,
+    NULLABLE,
+    UTF8_IN_CPP,
+    SENSITIVE_DATA,
+    JAVA_PASSTHROUGH,
+    JAVA_DERIVE,
+    JAVA_DEFAULT,
+    JAVA_DELEGATOR,
+    JAVA_ONLY_IMMUTABLE,
+    JAVA_SUPPRESS_LINT,
+    FIXED_SIZE,
+    DESCRIPTOR,
+    RUST_DERIVE,
+    SUPPRESS_WARNINGS,
+    PERMISSION_ENFORCE,
+    PERMISSION_NONE,
+    PERMISSION_MANUAL,
+    PROPAGATE_ALLOW_BLOCKING,
+  };
+
+  using TargetContext = uint16_t;
+  static constexpr TargetContext CONTEXT_TYPE_INTERFACE = 0x1 << 0;
+  static constexpr TargetContext CONTEXT_TYPE_ENUM = 0x1 << 1;
+  static constexpr TargetContext CONTEXT_TYPE_STRUCTURED_PARCELABLE = 0x1 << 2;
+  static constexpr TargetContext CONTEXT_TYPE_UNION = 0x1 << 3;
+  static constexpr TargetContext CONTEXT_TYPE_UNSTRUCTURED_PARCELABLE = 0x1 << 4;
+  static constexpr TargetContext CONTEXT_TYPE =
+      CONTEXT_TYPE_INTERFACE | CONTEXT_TYPE_ENUM | CONTEXT_TYPE_STRUCTURED_PARCELABLE |
+      CONTEXT_TYPE_UNION | CONTEXT_TYPE_UNSTRUCTURED_PARCELABLE;
+  static constexpr TargetContext CONTEXT_CONST = 0x1 << 5;
+  static constexpr TargetContext CONTEXT_FIELD = 0x1 << 6;
+  static constexpr TargetContext CONTEXT_METHOD = 0x1 << 7;
+  static constexpr TargetContext CONTEXT_MEMBER = CONTEXT_CONST | CONTEXT_FIELD | CONTEXT_METHOD;
+  static constexpr TargetContext CONTEXT_TYPE_SPECIFIER = 0x1 << 8;
+  static constexpr TargetContext CONTEXT_ALL =
+      CONTEXT_TYPE | CONTEXT_MEMBER | CONTEXT_TYPE_SPECIFIER;
+
+  static std::string TypeToString(Type type);
+
+  static std::unique_ptr<AidlAnnotation> Parse(
+      const AidlLocation& location, const string& name,
+      std::map<std::string, std::shared_ptr<AidlConstantValue>> parameter_list,
+      const Comments& comments);
+
+  virtual ~AidlAnnotation() = default;
+  bool CheckValid() const;
+  bool CheckContext(TargetContext context) const;
+  const string& GetName() const { return schema_.name; }
+  const Type& GetType() const { return schema_.type; }
+  bool Repeatable() const { return schema_.repeatable; }
+
+  // ToString is for dumping AIDL.
+  // Returns string representation of this annotation.
+  // e.g) "@RustDerive(Clone=true, Copy=true)"
+  string ToString() const;
+
+  template <typename T>
+  std::optional<T> ParamValue(const std::string& param_name) const;
+
+  std::map<std::string, std::string> AnnotationParams(
+      const ConstantValueDecorator& decorator) const;
+  void TraverseChildren(std::function<void(const AidlNode&)> traverse) const override;
+  void DispatchVisit(AidlVisitor& v) const override { v.Visit(*this); }
+
+  Result<unique_ptr<android::aidl::perm::Expression>> EnforceExpression() const;
+
+ private:
+  struct ParamType {
+    std::string name;
+    const AidlTypeSpecifier& type;
+    bool required = false;
+  };
+
+  struct Schema {
+    AidlAnnotation::Type type;
+    std::string name;
+    TargetContext target_context;
+    std::vector<ParamType> parameters;
+    bool repeatable = false;
+
+    const ParamType* ParamType(const std::string& name) const {
+      for (const auto& param : parameters) {
+        if (param.name == name) {
+          return &param;
+        }
+      }
+      return nullptr;
+    }
+  };
+
+  static const std::vector<Schema>& AllSchemas();
+
+  AidlAnnotation(const AidlLocation& location, const Schema& schema,
+                 std::map<std::string, std::shared_ptr<AidlConstantValue>> parameters,
+                 const Comments& comments);
+
+  const Schema& schema_;
+  std::map<std::string, std::shared_ptr<AidlConstantValue>> parameters_;
+};
+
+static inline bool operator<(const AidlAnnotation& lhs, const AidlAnnotation& rhs) {
+  return lhs.GetName() < rhs.GetName();
+}
+static inline bool operator==(const AidlAnnotation& lhs, const AidlAnnotation& rhs) {
+  return lhs.GetName() == rhs.GetName();
+}
+
+class AidlAnnotatable : public AidlCommentable {
+ public:
+  AidlAnnotatable(const AidlLocation& location, const Comments& comments);
+
+  virtual ~AidlAnnotatable() = default;
+
+  void Annotate(vector<std::unique_ptr<AidlAnnotation>>&& annotations) {
+    for (auto& annotation : annotations) {
+      annotations_.emplace_back(std::move(annotation));
+    }
+  }
+  bool IsNullable() const;
+  bool IsHeapNullable() const;
+  bool IsUtf8InCpp() const;
+  bool IsSensitiveData() const;
+  bool IsVintfStability() const;
+  bool IsJavaOnlyImmutable() const;
+  bool IsFixedSize() const;
+  bool IsStableApiParcelable(Options::Language lang) const;
+  bool JavaDerive(const std::string& method) const;
+  bool IsJavaDefault() const;
+  bool IsJavaDelegator() const;
+  std::string GetDescriptor() const;
+
+  const AidlAnnotation* UnsupportedAppUsage() const;
+  std::vector<std::string> RustDerive() const;
+  const AidlAnnotation* BackingType() const;
+  std::vector<std::string> SuppressWarnings() const;
+  std::unique_ptr<android::aidl::perm::Expression> EnforceExpression() const;
+  bool IsPermissionManual() const;
+  bool IsPermissionNone() const;
+  bool IsPermissionAnnotated() const;
+  bool IsPropagateAllowBlocking() const;
+
+  // ToString is for dumping AIDL.
+  // Returns string representation of annotations.
+  // e.g) "@JavaDerive(toString=true) @RustDerive(Clone=true, Copy=true)"
+  std::string ToString() const;
+
+  const vector<std::unique_ptr<AidlAnnotation>>& GetAnnotations() const { return annotations_; }
+  bool CheckValid(const AidlTypenames&) const;
+  void TraverseChildren(std::function<void(const AidlNode&)> traverse) const override {
+    for (const auto& annot : GetAnnotations()) {
+      traverse(*annot);
+    }
+  }
+
+ private:
+  vector<std::unique_ptr<AidlAnnotation>> annotations_;
+};
+
+// Represents `[]`
+struct DynamicArray {};
+// Represents `[N][M]..`
+struct FixedSizeArray {
+  FixedSizeArray(std::unique_ptr<AidlConstantValue> dim) { dimensions.push_back(std::move(dim)); }
+  std::vector<std::unique_ptr<AidlConstantValue>> dimensions;
+  std::vector<int32_t> GetDimensionInts() const;
+};
+// Represents `[]` or `[N]` part of type specifier
+using ArrayType = std::variant<DynamicArray, FixedSizeArray>;
+
+// AidlTypeSpecifier represents a reference to either a built-in type,
+// a defined type, or a variant (e.g., array of generic) of a type.
+class AidlTypeSpecifier final : public AidlAnnotatable,
+                                public AidlParameterizable<unique_ptr<AidlTypeSpecifier>> {
+ public:
+  AidlTypeSpecifier(const AidlLocation& location, const string& unresolved_name,
+                    std::optional<ArrayType> array,
+                    vector<unique_ptr<AidlTypeSpecifier>>* type_params, const Comments& comments);
+  virtual ~AidlTypeSpecifier() = default;
+
+  // View of this type which has one-less dimension(s).
+  // e.g.) T[] => T, T[N][M] => T[M]
+  void ViewAsArrayBase(std::function<void(const AidlTypeSpecifier&)> func) const;
+  // ViewAsArrayBase passes "mutated" type to its callback.
+  bool IsMutated() const { return mutated_; }
+
+  // Returns the full-qualified name of the base type.
+  // int -> int
+  // int[] -> int
+  // List<String> -> List
+  // IFoo -> foo.bar.IFoo (if IFoo is in package foo.bar)
+  const string& GetName() const {
+    if (IsResolved()) {
+      return fully_qualified_name_;
+    } else {
+      return GetUnresolvedName();
+    }
+  }
+
+  // ToString is for dumping AIDL.
+  // Returns string representation of this type specifier including annotations.
+  // This is "annotations type_name type_params? array_marker?".
+  // e.g) "@utf8InCpp String[]";
+  std::string ToString() const;
+
+  // Signature is for comparing AIDL types.
+  // Returns string representation of this type specifier.
+  // This is "type_name type_params? array_marker?".
+  // e.g.) "String[]" (even if it is annotated with @utf8InCpp)
+  std::string Signature() const;
+
+  const string& GetUnresolvedName() const { return unresolved_name_; }
+
+  const std::vector<std::string> GetSplitName() const { return split_name_; }
+
+  bool IsResolved() const { return fully_qualified_name_ != ""; }
+
+  bool IsArray() const { return array_.has_value(); }
+  bool IsDynamicArray() const {
+    return array_.has_value() && std::get_if<DynamicArray>(&*array_) != nullptr;
+  }
+  bool IsFixedSizeArray() const {
+    return array_.has_value() && std::get_if<FixedSizeArray>(&*array_) != nullptr;
+  }
+  std::vector<int32_t> GetFixedSizeArrayDimensions() const;
+
+  const ArrayType& GetArray() const {
+    AIDL_FATAL_IF(!array_.has_value(), this) << "GetArray() for non-array type";
+    return array_.value();
+  }
+
+  // Accept transitions from
+  //    T    to T[]
+  // or T    to T[N]
+  // or T[N] to T[N][M]
+  __attribute__((warn_unused_result)) bool MakeArray(ArrayType array_type);
+
+  // Resolve the base type name to a fully-qualified name. Return false if the
+  // resolution fails.
+  bool Resolve(const AidlTypenames& typenames, const AidlScope* scope);
+
+  bool CheckValid(const AidlTypenames& typenames) const;
+  bool LanguageSpecificCheckValid(Options::Language lang) const;
+  const AidlNode& AsAidlNode() const override { return *this; }
+
+  const AidlDefinedType* GetDefinedType() const;
+  void TraverseChildren(std::function<void(const AidlNode&)> traverse) const override;
+  void DispatchVisit(AidlVisitor& v) const override { v.Visit(*this); }
+
+ private:
+  const string unresolved_name_;
+  string fully_qualified_name_;
+  mutable std::optional<ArrayType> array_;
+  mutable bool mutated_ = false;  // ViewAsArrayBase() sets this as true to distinguish mutated one
+                                  // from the original type
+  vector<string> split_name_;
+  const AidlDefinedType* defined_type_ = nullptr;  // set when Resolve() for defined types
+};
+
+// Returns the universal value unaltered.
+std::string AidlConstantValueDecorator(
+    const AidlTypeSpecifier& type,
+    const std::variant<std::string, std::vector<std::string>>& raw_value);
+
+class AidlMember : public AidlAnnotatable {
+ public:
+  AidlMember(const AidlLocation& location, const Comments& comments);
+  virtual ~AidlMember() = default;
+
+  // non-copyable, non-movable
+  AidlMember(const AidlMember&) = delete;
+  AidlMember(AidlMember&&) = delete;
+  AidlMember& operator=(const AidlMember&) = delete;
+  AidlMember& operator=(AidlMember&&) = delete;
+  void MarkNew() { new_ = true; }
+  bool IsNew() const { return new_; }
+
+ private:
+  bool new_ = false;
+};
+
+// TODO: This class is used for method arguments and also parcelable fields,
+// and it should be split up since default values don't apply to method
+// arguments
+class AidlVariableDeclaration : public AidlMember {
+ public:
+  AidlVariableDeclaration(const AidlLocation& location, AidlTypeSpecifier* type,
+                          const std::string& name);
+  AidlVariableDeclaration(const AidlLocation& location, AidlTypeSpecifier* type,
+                          const std::string& name, AidlConstantValue* default_value);
+  virtual ~AidlVariableDeclaration() = default;
+
+  // non-copyable, non-movable
+  AidlVariableDeclaration(const AidlVariableDeclaration&) = delete;
+  AidlVariableDeclaration(AidlVariableDeclaration&&) = delete;
+  AidlVariableDeclaration& operator=(const AidlVariableDeclaration&) = delete;
+  AidlVariableDeclaration& operator=(AidlVariableDeclaration&&) = delete;
+
+  std::string GetName() const { return name_; }
+  std::string GetCapitalizedName() const;
+  const AidlTypeSpecifier& GetType() const { return *type_; }
+  // if this was constructed explicitly with a default value
+  bool IsDefaultUserSpecified() const { return default_user_specified_; }
+  // will return the default value this is constructed with or a default value
+  // if one is available
+  const AidlConstantValue* GetDefaultValue() const { return default_value_.get(); }
+  bool HasUsefulDefaultValue() const;
+
+  AidlTypeSpecifier* GetMutableType() { return type_.get(); }
+
+  bool CheckValid(const AidlTypenames& typenames) const;
+
+  // ToString is for dumping AIDL.
+  // Returns string representation of this variable decl including default value.
+  // This is "annotations type name default_value?".
+  // e.g) "@utf8InCpp String[] names = {"hello"}"
+  std::string ToString() const;
+
+  // Signature is for comparing AIDL types.
+  // Returns string representation of this variable decl.
+  // This is "type name".
+  // e.g) "String[] name" (even if it is annotated with @utf8InCpp and has a default value.)
+  std::string Signature() const;
+
+  std::string ValueString(const ConstantValueDecorator& decorator) const;
+
+  void TraverseChildren(std::function<void(const AidlNode&)> traverse) const override;
+  void DispatchVisit(AidlVisitor& v) const override { v.Visit(*this); }
+
+ private:
+  std::unique_ptr<AidlTypeSpecifier> type_;
+  std::string name_;
+  bool default_user_specified_;
+  std::unique_ptr<AidlConstantValue> default_value_;
+};
+
+class AidlArgument : public AidlVariableDeclaration {
+ public:
+  enum Direction { IN_DIR = 1, OUT_DIR = 2, INOUT_DIR = 3 };
+
+  AidlArgument(const AidlLocation& location, AidlArgument::Direction direction,
+               AidlTypeSpecifier* type, const std::string& name);
+  AidlArgument(const AidlLocation& location, AidlTypeSpecifier* type, const std::string& name);
+  virtual ~AidlArgument() = default;
+
+  // non-copyable, non-movable
+  AidlArgument(const AidlArgument&) = delete;
+  AidlArgument(AidlArgument&&) = delete;
+  AidlArgument& operator=(const AidlArgument&) = delete;
+  AidlArgument& operator=(AidlArgument&&) = delete;
+
+  Direction GetDirection() const { return direction_; }
+  bool IsOut() const { return direction_ & OUT_DIR; }
+  bool IsIn() const { return direction_ & IN_DIR; }
+  bool DirectionWasSpecified() const { return direction_specified_; }
+  string GetDirectionSpecifier() const;
+  bool CheckValid(const AidlTypenames& typenames) const;
+
+  // ToString is for dumping AIDL.
+  // Returns string representation of this argument including direction
+  // This is "direction annotations type name".
+  // e.g) "in @utf8InCpp String[] names"
+  std::string ToString() const;
+
+  void DispatchVisit(AidlVisitor& v) const override { v.Visit(*this); }
+
+ private:
+  Direction direction_;
+  bool direction_specified_;
+};
+
+struct ArgumentAspect {
+  std::string name;
+  std::set<AidlArgument::Direction> possible_directions;
+};
+
+class AidlUnaryConstExpression;
+class AidlBinaryConstExpression;
+class AidlConstantReference;
+
+class AidlConstantValue : public AidlNode {
+ public:
+  enum class Type {
+    // WARNING: Don't change this order! The order is used to determine type
+    // promotion during a binary expression.
+    BOOLEAN,
+    INT8,
+    INT32,
+    INT64,
+    ARRAY,
+    CHARACTER,
+    STRING,
+    REF,
+    FLOATING,
+    UNARY,
+    BINARY,
+    ERROR,
+  };
+
+  // Returns the evaluated value. T> should match to the actual type.
+  template <typename T>
+  T EvaluatedValue() const {
+    is_evaluated_ || (CheckValid() && evaluate());
+    AIDL_FATAL_IF(!is_valid_, this);
+
+    if constexpr (is_vector<T>::value) {
+      AIDL_FATAL_IF(final_type_ != Type::ARRAY, this);
+      T result;
+      for (const auto& v : values_) {
+        result.push_back(v->EvaluatedValue<typename T::value_type>());
+      }
+      return result;
+    } else if constexpr (is_one_of<T, float, double>::value) {
+      AIDL_FATAL_IF(final_type_ != Type::FLOATING, this);
+      T result;
+      AIDL_FATAL_IF(!ParseFloating(value_, &result), this);
+      return result;
+    } else if constexpr (std::is_same<T, std::string>::value) {
+      AIDL_FATAL_IF(final_type_ != Type::STRING, this);
+      return final_string_value_.substr(1, final_string_value_.size() - 2);  // unquote "
+    } else if constexpr (is_one_of<T, int8_t, int32_t, int64_t>::value) {
+      AIDL_FATAL_IF(final_type_ < Type::INT8 && final_type_ > Type::INT64, this);
+      return static_cast<T>(final_value_);
+    } else if constexpr (std::is_same<T, char16_t>::value) {
+      AIDL_FATAL_IF(final_type_ != Type::CHARACTER, this);
+      return final_string_value_.at(1);  // unquote '
+    } else if constexpr (std::is_same<T, bool>::value) {
+      static_assert(std::is_same<T, bool>::value, "..");
+      AIDL_FATAL_IF(final_type_ != Type::BOOLEAN, this);
+      return final_value_ != 0;
+    } else {
+      static_assert(unsupported_type<T>::value);
+    }
+  }
+
+  virtual ~AidlConstantValue() = default;
+
+  // non-copyable, non-movable
+  AidlConstantValue(const AidlConstantValue&) = delete;
+  AidlConstantValue(AidlConstantValue&&) = delete;
+  AidlConstantValue& operator=(const AidlConstantValue&) = delete;
+  AidlConstantValue& operator=(AidlConstantValue&&) = delete;
+
+  // creates default value, when one isn't specified
+  // nullptr if no default available
+  static AidlConstantValue* Default(const AidlTypeSpecifier& specifier);
+
+  static AidlConstantValue* Boolean(const AidlLocation& location, bool value);
+  static AidlConstantValue* Character(const AidlLocation& location, const std::string& value);
+  // example: 123, -5498, maybe any size
+  static AidlConstantValue* Integral(const AidlLocation& location, const std::string& value);
+  static AidlConstantValue* Floating(const AidlLocation& location, const std::string& value);
+  static AidlConstantValue* Array(const AidlLocation& location,
+                                  std::unique_ptr<vector<unique_ptr<AidlConstantValue>>> values);
+  // example: "\"asdf\""
+  static AidlConstantValue* String(const AidlLocation& location, const string& value);
+
+  Type GetType() const { return final_type_; }
+  const std::string& Literal() const { return value_; }
+
+  bool Evaluate() const;
+  virtual bool CheckValid() const;
+
+  // Raw value of type (currently valid in C++ and Java). Empty string on error.
+  string ValueString(const AidlTypeSpecifier& type, const ConstantValueDecorator& decorator) const;
+
+  void TraverseChildren(std::function<void(const AidlNode&)> traverse) const override {
+    if (type_ == Type::ARRAY) {
+      for (const auto& v : values_) {
+        traverse(*v);
+      }
+    }
+  }
+  void DispatchVisit(AidlVisitor& visitor) const override { visitor.Visit(*this); }
+  size_t Size() const { return values_.size(); }
+  const AidlConstantValue& ValueAt(size_t index) const { return *values_.at(index); }
+
+ private:
+  AidlConstantValue(const AidlLocation& location, Type parsed_type, int64_t parsed_value,
+                    const string& checked_value);
+  AidlConstantValue(const AidlLocation& location, Type type, const string& checked_value);
+  AidlConstantValue(const AidlLocation& location, Type type,
+                    std::unique_ptr<vector<unique_ptr<AidlConstantValue>>> values,
+                    const std::string& value);
+  static string ToString(Type type);
+  static bool ParseIntegral(const string& value, int64_t* parsed_value, Type* parsed_type);
+  static bool IsHex(const string& value);
+
+  virtual bool evaluate() const;
+
+  const Type type_ = Type::ERROR;
+  const vector<unique_ptr<AidlConstantValue>> values_;  // if type_ == ARRAY
+  const string value_;                                  // otherwise
+
+  // State for tracking evaluation of expressions
+  mutable bool is_valid_ = false;      // cache of CheckValid, but may be marked false in evaluate
+  mutable bool is_evaluated_ = false;  // whether evaluate has been called
+  mutable Type final_type_;
+  mutable int64_t final_value_;
+  mutable string final_string_value_ = "";
+
+  friend AidlUnaryConstExpression;
+  friend AidlBinaryConstExpression;
+  friend AidlConstantReference;
+};
+
+// Represents "<type>.<field>" which resolves to a constant which is one of
+// - constant declaration
+// - enumerator
+// When a <type> is missing, <field> is of the enclosing type.
+class AidlConstantReference : public AidlConstantValue {
+ public:
+  AidlConstantReference(const AidlLocation& location, const std::string& value);
+
+  const std::unique_ptr<AidlTypeSpecifier>& GetRefType() const { return ref_type_; }
+  const std::string& GetFieldName() const { return field_name_; }
+
+  bool CheckValid() const override;
+  void TraverseChildren(std::function<void(const AidlNode&)> traverse) const override {
+    if (ref_type_) {
+      traverse(*ref_type_);
+    }
+  }
+  void DispatchVisit(AidlVisitor& v) const override { v.Visit(*this); }
+  const AidlConstantValue* Resolve(const AidlDefinedType* scope) const;
+
+ private:
+  bool evaluate() const override;
+
+  std::unique_ptr<AidlTypeSpecifier> ref_type_;
+  std::string field_name_;
+  mutable const AidlConstantValue* resolved_ = nullptr;
+};
+
+class AidlUnaryConstExpression : public AidlConstantValue {
+ public:
+  AidlUnaryConstExpression(const AidlLocation& location, const string& op,
+                           std::unique_ptr<AidlConstantValue> rval);
+
+  static bool IsCompatibleType(Type type, const string& op);
+  bool CheckValid() const override;
+  void TraverseChildren(std::function<void(const AidlNode&)> traverse) const override {
+    traverse(*unary_);
+  }
+  void DispatchVisit(AidlVisitor& v) const override { v.Visit(*this); }
+  const std::unique_ptr<AidlConstantValue>& Val() const { return unary_; }
+  const std::string& Op() const { return op_; }
+
+ private:
+  bool evaluate() const override;
+
+  std::unique_ptr<AidlConstantValue> unary_;
+  const string op_;
+};
+
+class AidlBinaryConstExpression : public AidlConstantValue {
+ public:
+  AidlBinaryConstExpression(const AidlLocation& location, std::unique_ptr<AidlConstantValue> lval,
+                            const string& op, std::unique_ptr<AidlConstantValue> rval);
+
+  bool CheckValid() const override;
+
+  static bool AreCompatibleTypes(Type t1, Type t2);
+  // Returns the promoted kind for both operands
+  static Type UsualArithmeticConversion(Type left, Type right);
+  // Returns the promoted integral type where INT32 is the smallest type
+  static Type IntegralPromotion(Type in);
+  void TraverseChildren(std::function<void(const AidlNode&)> traverse) const override {
+    traverse(*left_val_);
+    traverse(*right_val_);
+  }
+  void DispatchVisit(AidlVisitor& v) const override { v.Visit(*this); }
+  const std::unique_ptr<AidlConstantValue>& Left() const { return left_val_; }
+  const std::unique_ptr<AidlConstantValue>& Right() const { return right_val_; }
+  const std::string& Op() const { return op_; }
+
+ private:
+  bool evaluate() const override;
+
+  std::unique_ptr<AidlConstantValue> left_val_;
+  std::unique_ptr<AidlConstantValue> right_val_;
+  const string op_;
+};
+
+struct AidlAnnotationParameter {
+  std::string name;
+  std::unique_ptr<AidlConstantValue> value;
+};
+
+class AidlConstantDeclaration : public AidlMember {
+ public:
+  AidlConstantDeclaration(const AidlLocation& location, AidlTypeSpecifier* specifier,
+                          const string& name, AidlConstantValue* value);
+  virtual ~AidlConstantDeclaration() = default;
+
+  // non-copyable, non-movable
+  AidlConstantDeclaration(const AidlConstantDeclaration&) = delete;
+  AidlConstantDeclaration(AidlConstantDeclaration&&) = delete;
+  AidlConstantDeclaration& operator=(const AidlConstantDeclaration&) = delete;
+  AidlConstantDeclaration& operator=(AidlConstantDeclaration&&) = delete;
+
+  const AidlTypeSpecifier& GetType() const { return *type_; }
+  AidlTypeSpecifier* GetMutableType() { return type_.get(); }
+  const string& GetName() const { return name_; }
+  const AidlConstantValue& GetValue() const { return *value_; }
+  bool CheckValid(const AidlTypenames& typenames) const;
+
+  // ToString is for dumping AIDL.
+  // Returns string representation of this const decl including a const value.
+  // This is "`const` annotations type name value".
+  // e.g) "const @utf8InCpp String[] names = { "hello" }"
+  string ToString() const;
+
+  // Signature is for comparing types.
+  // Returns string representation of this const decl.
+  // This is "direction annotations type name".
+  // e.g) "String[] names"
+  string Signature() const;
+
+  string ValueString(const ConstantValueDecorator& decorator) const {
+    return value_->ValueString(GetType(), decorator);
+  }
+
+  void TraverseChildren(std::function<void(const AidlNode&)> traverse) const override {
+    traverse(GetType());
+    traverse(GetValue());
+  }
+  void DispatchVisit(AidlVisitor& v) const override { v.Visit(*this); }
+
+ private:
+  const unique_ptr<AidlTypeSpecifier> type_;
+  const string name_;
+  unique_ptr<AidlConstantValue> value_;
+};
+
+class AidlMethod : public AidlMember {
+ public:
+  AidlMethod(const AidlLocation& location, bool oneway, AidlTypeSpecifier* type, const string& name,
+             vector<unique_ptr<AidlArgument>>* args, const Comments& comments);
+  AidlMethod(const AidlLocation& location, bool oneway, AidlTypeSpecifier* type, const string& name,
+             vector<unique_ptr<AidlArgument>>* args, const Comments& comments, int id);
+  virtual ~AidlMethod() = default;
+
+  // non-copyable, non-movable
+  AidlMethod(const AidlMethod&) = delete;
+  AidlMethod(AidlMethod&&) = delete;
+  AidlMethod& operator=(const AidlMethod&) = delete;
+  AidlMethod& operator=(AidlMethod&&) = delete;
+
+  bool CheckValid(const AidlTypenames&) const;
+  const AidlTypeSpecifier& GetType() const { return *type_; }
+  AidlTypeSpecifier* GetMutableType() { return type_.get(); }
+
+  // set if this method is part of an interface that is marked oneway
+  void ApplyInterfaceOneway(bool oneway) { oneway_ = oneway_ || oneway; }
+  bool IsOneway() const { return oneway_; }
+  bool HasOnewayAnnotation() const { return oneway_annotation_; }
+
+  const std::string& GetName() const { return name_; }
+  bool HasId() const { return has_id_; }
+  int GetId() const { return id_; }
+  void SetId(unsigned id) { id_ = id; }
+
+  const std::vector<std::unique_ptr<AidlArgument>>& GetArguments() const {
+    return arguments_;
+  }
+  // An inout parameter will appear in both GetInArguments()
+  // and GetOutArguments().  AidlMethod retains ownership of the argument
+  // pointers returned in this way.
+  const std::vector<const AidlArgument*>& GetInArguments() const {
+    return in_arguments_;
+  }
+  const std::vector<const AidlArgument*>& GetOutArguments() const {
+    return out_arguments_;
+  }
+
+  // ToString is for dumping AIDL.
+  // Returns string representation of this method including everything.
+  // This is "ret_type name ( arg_list ) = id".
+  // e.g) "boolean foo(int, @Nullable String) = 1"
+  std::string ToString() const;
+
+  // Signature is for comparing AIDL types.
+  // Returns string representation of this method's name & type.
+  // e.g) "foo(int, String)"
+  std::string Signature() const;
+
+  void TraverseChildren(std::function<void(const AidlNode&)> traverse) const override {
+    traverse(GetType());
+    for (const auto& a : GetArguments()) {
+      traverse(*a);
+    }
+  }
+  void DispatchVisit(AidlVisitor& v) const override { v.Visit(*this); }
+
+ private:
+  // oneway_ may be set by the method or the parent interface. If the interface is oneway,
+  // is also oneway. oneway_annotation_ may only be set on creation, and may not be overridden
+  // by the parent interface. It is used to detect redundant oneway annotations.
+  bool oneway_;
+  bool oneway_annotation_;
+  std::unique_ptr<AidlTypeSpecifier> type_;
+  std::string name_;
+  const std::vector<std::unique_ptr<AidlArgument>> arguments_;
+  std::vector<const AidlArgument*> in_arguments_;
+  std::vector<const AidlArgument*> out_arguments_;
+  bool has_id_;
+  int id_;
+};
+
+// AidlDefinedType represents either an interface, parcelable, or enum that is
+// defined in the source file.
+class AidlDefinedType : public AidlMember, public AidlScope {
+ public:
+  AidlDefinedType(const AidlLocation& location, const std::string& name, const Comments& comments,
+                  const std::string& package, std::vector<std::unique_ptr<AidlMember>>* members);
+  virtual ~AidlDefinedType() = default;
+
+  // non-copyable, non-movable
+  AidlDefinedType(const AidlDefinedType&) = delete;
+  AidlDefinedType(AidlDefinedType&&) = delete;
+  AidlDefinedType& operator=(const AidlDefinedType&) = delete;
+  AidlDefinedType& operator=(AidlDefinedType&&) = delete;
+
+  const std::string& GetName() const { return name_; };
+
+  std::string ResolveName(const std::string& name) const override;
+
+  /* dot joined package, example: "android.package.foo" */
+  std::string GetPackage() const { return package_; }
+  /* dot joined package and name, example: "android.package.foo.IBar" */
+  std::string GetCanonicalName() const;
+  std::vector<std::string> GetSplitPackage() const {
+    if (package_.empty()) return std::vector<std::string>();
+    return android::base::Split(package_, ".");
+  }
+  const AidlDocument& GetDocument() const;
+
+  virtual std::string GetPreprocessDeclarationName() const = 0;
+
+  virtual const AidlStructuredParcelable* AsStructuredParcelable() const { return nullptr; }
+  virtual const AidlParcelable* AsParcelable() const { return nullptr; }
+  virtual const AidlEnumDeclaration* AsEnumDeclaration() const { return nullptr; }
+  virtual const AidlUnionDecl* AsUnionDeclaration() const { return nullptr; }
+  virtual const AidlInterface* AsInterface() const { return nullptr; }
+  virtual const AidlParameterizable<std::string>* AsParameterizable() const { return nullptr; }
+  virtual bool CheckValid(const AidlTypenames& typenames) const;
+  bool LanguageSpecificCheckValid(Options::Language lang) const;
+  AidlStructuredParcelable* AsStructuredParcelable() {
+    return const_cast<AidlStructuredParcelable*>(
+        const_cast<const AidlDefinedType*>(this)->AsStructuredParcelable());
+  }
+  AidlParcelable* AsParcelable() {
+    return const_cast<AidlParcelable*>(const_cast<const AidlDefinedType*>(this)->AsParcelable());
+  }
+  AidlEnumDeclaration* AsEnumDeclaration() {
+    return const_cast<AidlEnumDeclaration*>(
+        const_cast<const AidlDefinedType*>(this)->AsEnumDeclaration());
+  }
+  AidlUnionDecl* AsUnionDeclaration() {
+    return const_cast<AidlUnionDecl*>(
+        const_cast<const AidlDefinedType*>(this)->AsUnionDeclaration());
+  }
+  AidlInterface* AsInterface() {
+    return const_cast<AidlInterface*>(const_cast<const AidlDefinedType*>(this)->AsInterface());
+  }
+
+  AidlParameterizable<std::string>* AsParameterizable() {
+    return const_cast<AidlParameterizable<std::string>*>(
+        const_cast<const AidlDefinedType*>(this)->AsParameterizable());
+  }
+
+  const AidlParcelable* AsUnstructuredParcelable() const {
+    if (this->AsStructuredParcelable() != nullptr) return nullptr;
+    if (this->AsUnionDeclaration() != nullptr) return nullptr;
+    return this->AsParcelable();
+  }
+  AidlParcelable* AsUnstructuredParcelable() {
+    return const_cast<AidlParcelable*>(
+        const_cast<const AidlDefinedType*>(this)->AsUnstructuredParcelable());
+  }
+  const AidlDefinedType* GetParentType() const;
+  const AidlDefinedType* GetRootType() const;
+  const std::vector<std::unique_ptr<AidlDefinedType>>& GetNestedTypes() const { return types_; }
+  const std::vector<std::unique_ptr<AidlVariableDeclaration>>& GetFields() const {
+    return variables_;
+  }
+  const std::vector<std::unique_ptr<AidlConstantDeclaration>>& GetConstantDeclarations() const {
+    return constants_;
+  }
+  const std::vector<std::unique_ptr<AidlMethod>>& GetMethods() const { return methods_; }
+  const std::vector<const AidlMember*>& GetMembers() const { return members_; }
+  void TraverseChildren(std::function<void(const AidlNode&)> traverse) const override {
+    AidlAnnotatable::TraverseChildren(traverse);
+    for (const auto c : GetMembers()) {
+      traverse(*c);
+    }
+  }
+
+  // Modifiers
+  void AddMethod(std::unique_ptr<AidlMethod> method) {
+    members_.push_back(method.get());
+    methods_.push_back(std::move(method));
+  }
+  void AddType(std::unique_ptr<AidlDefinedType> type) {
+    type->SetEnclosingScope(this);
+    members_.push_back(type.get());
+    types_.push_back(std::move(type));
+  }
+
+ protected:
+  // utility for subclasses with getter names
+  bool CheckValidForGetterNames() const;
+
+ private:
+  bool CheckValidWithMembers(const AidlTypenames& typenames) const;
+
+  std::string name_;
+  std::string package_;
+  std::vector<std::unique_ptr<AidlVariableDeclaration>> variables_;
+  std::vector<std::unique_ptr<AidlConstantDeclaration>> constants_;
+  std::vector<std::unique_ptr<AidlMethod>> methods_;
+  std::vector<std::unique_ptr<AidlDefinedType>> types_;
+  std::vector<const AidlMember*> members_;  // keep members in order of appearance.
+};
+
+struct AidlUnstructuredHeaders {
+  std::string cpp;
+  std::string ndk;
+  std::string rust_type;
+};
+
+class AidlParcelable : public AidlDefinedType, public AidlParameterizable<std::string> {
+ public:
+  AidlParcelable(const AidlLocation& location, const std::string& name, const std::string& package,
+                 const Comments& comments, const AidlUnstructuredHeaders& headers,
+                 std::vector<std::string>* type_params,
+                 std::vector<std::unique_ptr<AidlMember>>* members = nullptr);
+  virtual ~AidlParcelable() = default;
+
+  // non-copyable, non-movable
+  AidlParcelable(const AidlParcelable&) = delete;
+  AidlParcelable(AidlParcelable&&) = delete;
+  AidlParcelable& operator=(const AidlParcelable&) = delete;
+  AidlParcelable& operator=(AidlParcelable&&) = delete;
+
+  std::string GetCppHeader() const { return headers_.cpp; }
+  std::string GetNdkHeader() const { return headers_.ndk; }
+  std::string GetRustType() const { return headers_.rust_type; }
+
+  bool CheckValid(const AidlTypenames& typenames) const override;
+  const AidlParcelable* AsParcelable() const override { return this; }
+  const AidlParameterizable<std::string>* AsParameterizable() const override { return this; }
+  const AidlNode& AsAidlNode() const override { return *this; }
+  std::string GetPreprocessDeclarationName() const override { return "parcelable"; }
+
+  void DispatchVisit(AidlVisitor& v) const override { v.Visit(*this); }
+
+ private:
+  AidlUnstructuredHeaders headers_;
+};
+
+class AidlStructuredParcelable : public AidlParcelable {
+ public:
+  AidlStructuredParcelable(const AidlLocation& location, const std::string& name,
+                           const std::string& package, const Comments& comments,
+                           std::vector<std::string>* type_params,
+                           std::vector<std::unique_ptr<AidlMember>>* members);
+  virtual ~AidlStructuredParcelable() = default;
+
+  // non-copyable, non-movable
+  AidlStructuredParcelable(const AidlStructuredParcelable&) = delete;
+  AidlStructuredParcelable(AidlStructuredParcelable&&) = delete;
+  AidlStructuredParcelable& operator=(const AidlStructuredParcelable&) = delete;
+  AidlStructuredParcelable& operator=(AidlStructuredParcelable&&) = delete;
+
+  const AidlStructuredParcelable* AsStructuredParcelable() const override { return this; }
+  std::string GetPreprocessDeclarationName() const override { return "structured_parcelable"; }
+
+  bool CheckValid(const AidlTypenames& typenames) const override;
+  void DispatchVisit(AidlVisitor& v) const override { v.Visit(*this); }
+};
+
+class AidlEnumerator : public AidlCommentable {
+ public:
+  AidlEnumerator(const AidlLocation& location, const std::string& name, AidlConstantValue* value,
+                 const Comments& comments);
+  virtual ~AidlEnumerator() = default;
+
+  // non-copyable, non-movable
+  AidlEnumerator(const AidlEnumerator&) = delete;
+  AidlEnumerator(AidlEnumerator&&) = delete;
+  AidlEnumerator& operator=(const AidlEnumerator&) = delete;
+  AidlEnumerator& operator=(AidlEnumerator&&) = delete;
+
+  const std::string& GetName() const { return name_; }
+  AidlConstantValue* GetValue() const { return value_.get(); }
+  bool CheckValid(const AidlTypeSpecifier& enum_backing_type) const;
+
+  string ValueString(const AidlTypeSpecifier& backing_type,
+                     const ConstantValueDecorator& decorator) const;
+
+  void SetValue(std::unique_ptr<AidlConstantValue> value) { value_ = std::move(value); }
+  bool IsValueUserSpecified() const { return value_user_specified_; }
+
+  void TraverseChildren(std::function<void(const AidlNode&)> traverse) const override {
+    traverse(*value_);
+  }
+  void DispatchVisit(AidlVisitor& v) const override { v.Visit(*this); }
+
+ private:
+  const std::string name_;
+  unique_ptr<AidlConstantValue> value_;
+  const bool value_user_specified_;
+};
+
+class AidlEnumDeclaration : public AidlDefinedType {
+ public:
+  AidlEnumDeclaration(const AidlLocation& location, const string& name,
+                      std::vector<std::unique_ptr<AidlEnumerator>>* enumerators,
+                      const std::string& package, const Comments& comments);
+  virtual ~AidlEnumDeclaration() = default;
+
+  // non-copyable, non-movable
+  AidlEnumDeclaration(const AidlEnumDeclaration&) = delete;
+  AidlEnumDeclaration(AidlEnumDeclaration&&) = delete;
+  AidlEnumDeclaration& operator=(const AidlEnumDeclaration&) = delete;
+  AidlEnumDeclaration& operator=(AidlEnumDeclaration&&) = delete;
+
+  bool Autofill(const AidlTypenames&);
+  const AidlTypeSpecifier& GetBackingType() const { return *backing_type_; }
+  const std::vector<std::unique_ptr<AidlEnumerator>>& GetEnumerators() const {
+    return enumerators_;
+  }
+  bool CheckValid(const AidlTypenames& typenames) const override;
+  std::string GetPreprocessDeclarationName() const override { return "enum"; }
+
+  const AidlEnumDeclaration* AsEnumDeclaration() const override { return this; }
+
+  void TraverseChildren(std::function<void(const AidlNode&)> traverse) const override {
+    AidlDefinedType::TraverseChildren(traverse);
+    if (backing_type_) {
+      traverse(*backing_type_);
+    }
+    for (const auto& c : GetEnumerators()) {
+      traverse(*c);
+    }
+  }
+  void DispatchVisit(AidlVisitor& v) const override { v.Visit(*this); }
+
+ private:
+
+  const std::string name_;
+  const std::vector<std::unique_ptr<AidlEnumerator>> enumerators_;
+  std::unique_ptr<AidlTypeSpecifier> backing_type_;
+};
+
+class AidlUnionDecl : public AidlParcelable {
+ public:
+  AidlUnionDecl(const AidlLocation& location, const std::string& name, const std::string& package,
+                const Comments& comments, std::vector<std::string>* type_params,
+                std::vector<std::unique_ptr<AidlMember>>* members);
+  virtual ~AidlUnionDecl() = default;
+
+  // non-copyable, non-movable
+  AidlUnionDecl(const AidlUnionDecl&) = delete;
+  AidlUnionDecl(AidlUnionDecl&&) = delete;
+  AidlUnionDecl& operator=(const AidlUnionDecl&) = delete;
+  AidlUnionDecl& operator=(AidlUnionDecl&&) = delete;
+
+
+  const AidlNode& AsAidlNode() const override { return *this; }
+  bool CheckValid(const AidlTypenames& typenames) const override;
+  std::string GetPreprocessDeclarationName() const override { return "union"; }
+
+  const AidlUnionDecl* AsUnionDeclaration() const override { return this; }
+  void DispatchVisit(AidlVisitor& v) const override { v.Visit(*this); }
+};
+
+class AidlInterface final : public AidlDefinedType {
+ public:
+  AidlInterface(const AidlLocation& location, const std::string& name, const Comments& comments,
+                bool oneway, const std::string& package,
+                std::vector<std::unique_ptr<AidlMember>>* members);
+  virtual ~AidlInterface() = default;
+
+  // non-copyable, non-movable
+  AidlInterface(const AidlInterface&) = delete;
+  AidlInterface(AidlInterface&&) = delete;
+  AidlInterface& operator=(const AidlInterface&) = delete;
+  AidlInterface& operator=(AidlInterface&&) = delete;
+
+  const AidlInterface* AsInterface() const override { return this; }
+  std::string GetPreprocessDeclarationName() const override { return "interface"; }
+
+  bool CheckValid(const AidlTypenames& typenames) const override;
+  bool CheckValidPermissionAnnotations(const AidlMethod& m) const;
+  bool UsesPermissions() const;
+  std::string GetDescriptor() const;
+  void DispatchVisit(AidlVisitor& v) const override { v.Visit(*this); }
+  bool HasOnewayAnnotation() const { return oneway_annotation_; }
+
+ private:
+  bool oneway_annotation_;
+};
+
+inline std::string SimpleName(const std::string& qualified_name) {
+  return qualified_name.substr(qualified_name.rfind('.') + 1);
+}
+
+// AidlDocument models an AIDL file
+class AidlDocument : public AidlCommentable, public AidlScope {
+ public:
+  AidlDocument(const AidlLocation& location, const Comments& comments,
+               std::vector<std::string> imports,
+               std::vector<std::unique_ptr<AidlDefinedType>> defined_types, bool is_preprocessed);
+  ~AidlDocument() = default;
+
+  // non-copyable, non-movable
+  AidlDocument(const AidlDocument&) = delete;
+  AidlDocument(AidlDocument&&) = delete;
+  AidlDocument& operator=(const AidlDocument&) = delete;
+  AidlDocument& operator=(AidlDocument&&) = delete;
+
+  std::string ResolveName(const std::string& name) const override;
+  const std::vector<std::string>& Imports() const { return imports_; }
+  const std::vector<std::unique_ptr<AidlDefinedType>>& DefinedTypes() const {
+    return defined_types_;
+  }
+  bool IsPreprocessed() const { return is_preprocessed_; }
+
+  void TraverseChildren(std::function<void(const AidlNode&)> traverse) const override {
+    for (const auto& t : DefinedTypes()) {
+      traverse(*t);
+    }
+  }
+  void DispatchVisit(AidlVisitor& v) const override { v.Visit(*this); }
+
+ private:
+  const std::vector<std::string> imports_;
+  const std::vector<std::unique_ptr<AidlDefinedType>> defined_types_;
+  bool is_preprocessed_;
+};
+
+template <typename T>
+std::optional<T> AidlAnnotation::ParamValue(const std::string& param_name) const {
+  auto it = parameters_.find(param_name);
+  if (it == parameters_.end()) {
+    return std::nullopt;
+  }
+  return it->second->EvaluatedValue<T>();
+}
+
+// Utilities to make a visitor to visit AST tree in top-down order
+// Given:       foo
+//              / \
+//            bar baz
+// VisitTopDown(v, foo) makes v visit foo -> bar -> baz.
+inline void VisitTopDown(std::function<void(const AidlNode&)> v, const AidlNode& node) {
+  std::function<void(const AidlNode&)> top_down = [&](const AidlNode& n) {
+    v(n);
+    n.TraverseChildren(top_down);
+  };
+  top_down(node);
+}
+inline void VisitTopDown(AidlVisitor& v, const AidlNode& node) {
+  VisitTopDown([&](const AidlNode& n) { n.DispatchVisit(v); }, node);
+}
+
+// Utility to make a visitor to visit AST tree in bottom-up order
+// Given:       foo
+//              / \
+//            bar baz
+// VisitBottomUp(v, foo) makes v visit bar -> baz -> foo.
+inline void VisitBottomUp(AidlVisitor& v, const AidlNode& node) {
+  std::function<void(const AidlNode&)> bottom_up = [&](const AidlNode& n) {
+    n.TraverseChildren(bottom_up);
+    n.DispatchVisit(v);
+  };
+  bottom_up(node);
+}
+
+template <typename T>
+const T* AidlCast(const AidlNode& node) {
+  struct CastVisitor : AidlVisitor {
+    const T* cast = nullptr;
+    void Visit(const T& t) override { cast = &t; }
+  } visitor;
+  node.DispatchVisit(visitor);
+  return visitor.cast;
+}
+
+template <>
+const AidlDefinedType* AidlCast<AidlDefinedType>(const AidlNode& node);
+
+template <typename T>
+T* AidlCast(AidlNode& node) {
+  return const_cast<T*>(AidlCast<T>(const_cast<const AidlNode&>(node)));
+}
+
+template <typename AidlNodeType>
+vector<const AidlNodeType*> Collect(const AidlNode& root) {
+  vector<const AidlNodeType*> result;
+  std::function<void(const AidlNode&)> top_down = [&](const AidlNode& n) {
+    if (auto cast = AidlCast<AidlNodeType>(n); cast) {
+      result.push_back(cast);
+    }
+    n.TraverseChildren(top_down);
+  };
+  top_down(root);
+  return result;
+}
+
+template <typename VisitFn>
+bool TopologicalVisit(const vector<unique_ptr<AidlDefinedType>>& nested_types, VisitFn visit) {
+  // 1. Maps deeply nested types to one of nested_types
+  map<const AidlDefinedType*, const AidlDefinedType*> roots;
+  for (const auto& nested : nested_types) {
+    for (const auto& t : Collect<AidlDefinedType>(*nested)) {
+      roots[t] = nested.get();
+    }
+  }
+  // 2. Collect sibling types referenced within each nested type.
+  map<const AidlDefinedType*, vector<const AidlDefinedType*>> required_types;
+  for (const auto& nested : nested_types) {
+    for (const auto& t : Collect<AidlTypeSpecifier>(*nested)) {
+      if (auto defined_type = t->GetDefinedType(); defined_type) {
+        auto sibling = roots[defined_type];
+        if (sibling && sibling != nested.get()) {
+          required_types[nested.get()].push_back(sibling);
+        }
+      }
+    }
+  };
+  // 3. Run DFS
+  enum { NOT_STARTED = 0, STARTED = 1, FINISHED = 2 };
+  map<const AidlDefinedType*, int> visited;
+  std::function<bool(const AidlDefinedType&)> dfs = [&](const AidlDefinedType& type) {
+    if (visited[&type] == FINISHED) {
+      return true;
+    } else if (visited[&type] == STARTED) {
+      return false;
+    } else {
+      visited[&type] = STARTED;
+      // Visit every required dep first
+      for (const auto& dep_type : required_types[&type]) {
+        if (!dfs(*dep_type)) {
+          return false;
+        }
+      }
+      visited[&type] = FINISHED;
+      visit(type);
+      return true;
+    }
+  };
+
+  for (const auto& type : nested_types) {
+    if (!dfs(*type)) {
+      return false;
+    }
+  }
+
+  return true;
+}
diff --git a/aidl_language_l.ll b/aidl_language_l.ll
new file mode 100644
index 0000000..7d3d57b
--- /dev/null
+++ b/aidl_language_l.ll
@@ -0,0 +1,172 @@
+/*
+ * Copyright (C) 2016, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+%{
+#include <string.h>
+#include <stdlib.h>
+
+#include "aidl_language.h"
+#include "parser.h"
+#include "aidl_language_y.h"
+
+#ifndef YYSTYPE
+#define YYSTYPE yy::parser::semantic_type
+#endif
+
+#ifndef YYLTYPE
+#define YYLTYPE yy::parser::location_type
+#endif
+
+#define YY_USER_ACTION yylloc->columns(yyleng);
+%}
+
+%option noyywrap
+%option nounput
+%option noinput
+%option reentrant
+%option bison-bridge
+%option bison-locations
+
+%x LONG_COMMENT
+
+identifier  [_a-zA-Z][_a-zA-Z0-9]*
+whitespace  ([ \t\r]+)
+intvalue    [0-9]+[lL]?(u8)?
+hexvalue    0[x|X][0-9a-fA-F]+[lL]?(u8)?
+floatvalue  [0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?f?
+
+%%
+%{
+  /* This happens at every call to yylex (every time we receive one token) */
+  using android::aidl::Comments;
+  using android::aidl::Comment;
+  std::string extra_text;
+  Comments comments;
+  yylloc->step();
+%}
+
+\/\*                  { extra_text += yytext; BEGIN(LONG_COMMENT); }
+<LONG_COMMENT>\*+\/   { extra_text += yytext; yylloc->step(); BEGIN(INITIAL);
+                        comments.push_back({extra_text});
+                        extra_text.clear(); }
+<LONG_COMMENT>\*+     { extra_text += yytext; }
+<LONG_COMMENT>\n+     { extra_text += yytext; yylloc->lines(yyleng); }
+<LONG_COMMENT>[^*\n]+ { extra_text += yytext; }
+
+\"([^\"]|\\.)*\"      { yylval->token = new AidlToken(yytext, comments);
+                        return yy::parser::token::C_STR; }
+
+\/\/.*                { extra_text += yytext; extra_text += "\n";
+                        comments.push_back({extra_text});
+                        extra_text.clear(); }
+
+\n+                   { yylloc->lines(yyleng); yylloc->step(); }
+{whitespace}          {}
+<<EOF>>               { yyterminate(); }
+
+    /* symbols */
+"("                   { return('('); }
+")"                   { return(')'); }
+"<"                   { return('<'); }
+">"                   { return('>'); }
+"{"                   { return('{'); }
+"}"                   { return('}'); }
+"["                   { return('['); }
+"]"                   { return(']'); }
+":"                   { return(':'); }
+";"                   { return(';'); }
+","                   { return(','); }
+"."                   { return('.'); }
+"="                   { return('='); }
+"+"                   { return('+'); }
+"-"                   { return('-'); }
+"*"                   { return('*'); }
+"/"                   { return('/'); }
+"%"                   { return('%'); }
+"&"                   { return('&'); }
+"|"                   { return('|'); }
+"^"                   { return('^'); }
+"<<"                  { return(yy::parser::token::LSHIFT); }
+">>"                  { return(yy::parser::token::RSHIFT); }
+"&&"                  { return(yy::parser::token::LOGICAL_AND); }
+"||"                  { return(yy::parser::token::LOGICAL_OR);  }
+"!"                   { return('!'); }
+"~"                   { return('~'); }
+"<="                  { return(yy::parser::token::LEQ); }
+">="                  { return(yy::parser::token::GEQ); }
+"=="                  { return(yy::parser::token::EQUALITY); }
+"!="                  { return(yy::parser::token::NEQ); }
+
+    /* annotations */
+@{identifier}         { yylval->token = new AidlToken(yytext + 1, comments);
+                        return yy::parser::token::ANNOTATION;
+                      }
+
+    /* keywords */
+parcelable            { yylval->token = new AidlToken("parcelable", comments);
+                        return yy::parser::token::PARCELABLE;
+                      }
+import                { yylval->token = new AidlToken("import", comments);
+                        return yy::parser::token::IMPORT; }
+package               { yylval->token = new AidlToken("package", comments);
+                        return yy::parser::token::PACKAGE; }
+in                    { return yy::parser::token::IN; }
+out                   { return yy::parser::token::OUT; }
+inout                 { return yy::parser::token::INOUT; }
+cpp_header            { yylval->token = new AidlToken("cpp_header", comments);
+                        return yy::parser::token::CPP_HEADER; }
+ndk_header            { yylval->token = new AidlToken("ndk_header", comments);
+                        return yy::parser::token::NDK_HEADER; }
+rust_type            { yylval->token = new AidlToken("rust_type", comments);
+                        return yy::parser::token::RUST_TYPE; }
+const                 { yylval->token = new AidlToken("const", comments);
+                        return yy::parser::token::CONST; }
+true                  { return yy::parser::token::TRUE_LITERAL; }
+false                 { return yy::parser::token::FALSE_LITERAL; }
+
+interface             { yylval->token = new AidlToken("interface", comments);
+                        return yy::parser::token::INTERFACE;
+                      }
+oneway                { yylval->token = new AidlToken("oneway", comments);
+                        return yy::parser::token::ONEWAY;
+                      }
+enum                  { yylval->token = new AidlToken("enum", comments);
+                        return yy::parser::token::ENUM;
+                      }
+union                 { yylval->token = new AidlToken("union", comments);
+                        return yy::parser::token::UNION;
+                      }
+
+    /* scalars */
+{identifier}          { yylval->token = new AidlToken(yytext, comments);
+                        return yy::parser::token::IDENTIFIER;
+                      }
+'.'                   { yylval->token = new AidlToken(std::string(yytext, yyleng), comments);
+                        return yy::parser::token::CHARVALUE; }
+{intvalue}            { yylval->token = new AidlToken(yytext, comments);
+                        return yy::parser::token::INTVALUE; }
+{floatvalue}          { yylval->token = new AidlToken(yytext, comments);
+                        return yy::parser::token::FLOATVALUE; }
+{hexvalue}            { yylval->token = new AidlToken(yytext, comments);
+                        return yy::parser::token::HEXVALUE; }
+
+  /* lexical error! */
+.                     { return yy::parser::token::UNKNOWN; }
+
+%%
+
+// comment and whitespace handling
+// ================================================
diff --git a/aidl_language_y.yy b/aidl_language_y.yy
new file mode 100644
index 0000000..3f5df54
--- /dev/null
+++ b/aidl_language_y.yy
@@ -0,0 +1,854 @@
+/*
+ * Copyright (C) 2016, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+%{
+#include "aidl_language.h"
+#include "parser.h"
+#include "aidl_language_y.h"
+#include "logging.h"
+#include <android-base/parseint.h>
+#include <set>
+#include <map>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int yylex(yy::parser::semantic_type *, yy::parser::location_type *, void *);
+
+AidlLocation loc(const yy::parser::location_type& begin, const yy::parser::location_type& end) {
+  AIDL_FATAL_IF(begin.begin.filename != begin.end.filename, AIDL_LOCATION_HERE);
+  AIDL_FATAL_IF(begin.end.filename != end.begin.filename, AIDL_LOCATION_HERE);
+  AIDL_FATAL_IF(end.begin.filename != end.end.filename, AIDL_LOCATION_HERE);
+  AidlLocation::Point begin_point {
+    .line = begin.begin.line,
+    .column = begin.begin.column,
+  };
+  AidlLocation::Point end_point {
+    .line = end.end.line,
+    .column = end.end.column,
+  };
+  return AidlLocation(*begin.begin.filename, begin_point, end_point, AidlLocation::Source::EXTERNAL);
+}
+
+AidlLocation loc(const yy::parser::location_type& l) {
+  return loc(l, l);
+}
+
+#define lex_scanner ps->Scanner()
+
+%}
+
+%initial-action {
+    @$.begin.filename = @$.end.filename =
+        const_cast<std::string *>(&ps->FileName());
+}
+
+%parse-param { Parser* ps }
+%lex-param { void *lex_scanner }
+
+%glr-parser
+%skeleton "glr.cc"
+
+%expect-rr 0
+
+%define parse.error verbose
+%locations
+
+%union {
+    AidlToken* token;
+    char character;
+    std::string *str;
+    std::vector<std::unique_ptr<AidlToken>> *token_list;
+    AidlAnnotation* annotation;
+    AidlAnnotationParameter* param;
+    std::map<std::string, std::shared_ptr<AidlConstantValue>>* param_list;
+    std::vector<std::unique_ptr<AidlAnnotation>>* annotation_list;
+    AidlTypeSpecifier* type;
+    AidlArgument* arg;
+    AidlArgument::Direction direction;
+    AidlConstantValue* const_expr;
+    AidlEnumerator* enumerator;
+    std::vector<std::unique_ptr<AidlEnumerator>>* enumerators;
+    std::vector<std::unique_ptr<AidlConstantValue>>* constant_value_list;
+    std::vector<std::unique_ptr<AidlArgument>>* arg_list;
+    AidlVariableDeclaration* variable;
+    AidlMethod* method;
+    AidlMember* constant;
+    std::vector<std::unique_ptr<AidlMember>>* members;
+    AidlDefinedType* declaration;
+    std::vector<std::unique_ptr<AidlTypeSpecifier>>* type_args;
+    std::vector<std::string>* type_params;
+    std::vector<std::unique_ptr<AidlDefinedType>>* declarations;
+    AidlUnstructuredHeaders* unstructured_headers;
+}
+
+%destructor { } <direction>
+%destructor { delete ($$); } <*>
+
+%token<token> PACKAGE "package"
+%token<token> IMPORT "import"
+%token<token> ANNOTATION "annotation"
+%token<token> C_STR "string literal"
+%token<token> IDENTIFIER "identifier"
+%token<token> INTERFACE "interface"
+%token<token> PARCELABLE "parcelable"
+%token<token> ONEWAY "oneway"
+%token<token> ENUM "enum"
+%token<token> UNION "union"
+%token<token> CONST "const"
+
+%token<token> CHARVALUE "char literal"
+%token<token> FLOATVALUE "float literal"
+%token<token> HEXVALUE "hex literal"
+%token<token> INTVALUE "int literal"
+
+%token '(' ')' ',' '=' '[' ']' '.' '{' '}' ';'
+%token UNKNOWN "unrecognized character"
+%token<token> CPP_HEADER "cpp_header (which can also be used as an identifier)"
+%token<token> NDK_HEADER "ndk_header (which can also be used as an identifier)"
+%token<token> RUST_TYPE "rust_type (which can also be used as an identifier)"
+%token IN "in"
+%token INOUT "inout"
+%token OUT "out"
+%token TRUE_LITERAL "true"
+%token FALSE_LITERAL "false"
+
+/* Operator precedence and associativity, as per
+ * http://en.cppreference.com/w/cpp/language/operator_precedence */
+/* Precedence level 13 - 14, LTR, logical operators*/
+%left LOGICAL_OR
+%left LOGICAL_AND
+/* Precedence level 10 - 12, LTR, bitwise operators*/
+%left '|'
+%left '^'
+%left '&'
+/* Precedence level 9, LTR */
+%left EQUALITY NEQ
+/* Precedence level 8, LTR */
+%left '<' '>' LEQ GEQ
+/* Precedence level 7, LTR */
+%left LSHIFT RSHIFT
+/* Precedence level 6, LTR */
+%left '+' '-'
+/* Precedence level 5, LTR */
+%left '*' '/' '%'
+/* Precedence level 3, RTL; but we have to use %left here */
+%right UNARY_PLUS UNARY_MINUS  '!' '~'
+
+%type<declaration> decl
+%type<declaration> unannotated_decl
+%type<declaration> interface_decl
+%type<declaration> parcelable_decl
+%type<declaration> enum_decl
+%type<declaration> union_decl
+%type<members> parcelable_members interface_members
+%type<variable> variable_decl
+%type<type_params> optional_type_params
+%type<method> method_decl
+%type<constant> constant_decl
+%type<enumerator> enumerator
+%type<enumerators> enumerators enum_decl_body
+%type<param> parameter
+%type<param_list> parameter_list
+%type<param_list> parameter_non_empty_list
+%type<annotation> annotation
+%type<annotation_list>annotation_list
+%type<type> type
+%type<type> non_array_type
+%type<arg_list> arg_list arg_non_empty_list
+%type<arg> arg
+%type<direction> direction
+%type<type_args> type_args
+%type<type_params> type_params
+%type<const_expr> const_expr
+%type<constant_value_list> constant_value_list
+%type<constant_value_list> constant_value_non_empty_list
+%type<token_list> imports
+%type<declarations> decls
+%type<token> import identifier error qualified_name optional_package
+%type<unstructured_headers> optional_unstructured_headers
+
+%%
+
+document
+ : optional_package imports decls {
+    Comments comments;
+    if ($1) {
+      comments = $1->GetComments();
+    } else if (!$2->empty()) {
+      comments = $2->front()->GetComments();
+    }
+    std::vector<std::string> imports;
+    for (const auto& import : *$2) {
+      imports.push_back(import->GetText());
+    }
+    ps->MakeDocument(loc(@1), comments, std::move(imports), std::move(*$3));
+    delete $1;
+    delete $2;
+    delete $3;
+  }
+ ;
+
+/* A couple of tokens that are keywords elsewhere are identifiers when
+ * occurring in the identifier position. Therefore identifier is a
+ * non-terminal, which is either an IDENTIFIER token, or one of the
+ * aforementioned keyword tokens.
+ */
+identifier
+ : IDENTIFIER
+ | CPP_HEADER
+ | NDK_HEADER
+ | RUST_TYPE
+ ;
+
+optional_package
+ : {
+    $$ = nullptr;
+ }
+ | PACKAGE qualified_name ';' {
+    ps->SetPackage($2->GetText());
+    $$ = $1; // for comments
+    delete $2;
+  }
+ ;
+
+imports
+ : { $$ = new std::vector<std::unique_ptr<AidlToken>>(); }
+ | imports import
+  {
+    $$ = $1;
+    $$->emplace_back($2);
+  }
+
+import
+ : IMPORT qualified_name ';' {
+    // carry the comments before "import" token
+    $$ = new AidlToken($2->GetText(), $1->GetComments());
+    delete $1;
+    delete $2;
+  };
+
+qualified_name
+ : identifier {
+    $$ = $1;
+  }
+ | qualified_name '.' identifier
+  { $$ = $1;
+    $$->Append('.');
+    $$->Append($3->GetText());
+    delete $3;
+  };
+
+decls
+ : decl
+  { $$ = new std::vector<std::unique_ptr<AidlDefinedType>>();
+    if ($1 != nullptr) {
+      $$->emplace_back($1);
+    }
+  }
+ | decls decl
+  { $$ = $1;
+    if ($2 != nullptr) {
+      $$->emplace_back($2);
+    }
+  }
+
+decl
+ : annotation_list unannotated_decl
+   {
+    $$ = $2;
+
+    if ($1->size() > 0 && $$ != nullptr) {
+      // copy comments from annotation to decl
+      $$->SetComments($1->begin()->get()->GetComments());
+      $$->Annotate(std::move(*$1));
+    }
+
+    delete $1;
+   }
+ ;
+
+unannotated_decl
+ : parcelable_decl
+ | interface_decl
+ | enum_decl
+ | union_decl
+ ;
+
+type_params
+ : identifier {
+    $$ = new std::vector<std::string>();
+    $$->emplace_back($1->GetText());
+    delete $1;
+  }
+ | type_params ',' identifier {
+    $1->emplace_back($3->GetText());
+    $$ = $1;
+    delete $3;
+  };
+
+optional_type_params
+ : /* none */ { $$ = nullptr; }
+ | '<' type_params '>' {
+   $$ = $2;
+ };
+
+optional_unstructured_headers
+ : /* none */ { $$ = new AidlUnstructuredHeaders; }
+ | optional_unstructured_headers CPP_HEADER C_STR {
+     $$ = $1;
+     $$->cpp = $3->GetText();
+     delete $2;
+     delete $3;
+ }
+ | optional_unstructured_headers NDK_HEADER C_STR {
+     $$ = $1;
+     $$->ndk = $3->GetText();
+     delete $2;
+     delete $3;
+ }
+ | optional_unstructured_headers RUST_TYPE C_STR {
+     $$ = $1;
+     $$->rust_type = $3->GetText();
+     delete $2;
+     delete $3;
+ }
+ ;
+
+parcelable_decl
+ : PARCELABLE qualified_name optional_type_params optional_unstructured_headers ';' {
+    // No check for type name here. We allow nested types for unstructured parcelables.
+    $$ = new AidlParcelable(loc(@2), $2->GetText(), ps->Package(), $1->GetComments(), *$4, $3);
+    delete $1;
+    delete $2;
+    delete $4;
+ }
+ | PARCELABLE qualified_name optional_type_params '{' parcelable_members '}' {
+    ps->CheckValidTypeName(*$2, loc(@2));
+    $$ = new AidlStructuredParcelable(loc(@2), $2->GetText(), ps->Package(), $1->GetComments(), $3, $5);
+    delete $1;
+    delete $2;
+ }
+ | PARCELABLE error ';' {
+    ps->AddError();
+    $$ = nullptr;
+    delete $1;
+  };
+
+parcelable_members
+ : /* empty */ {
+    $$ = new std::vector<std::unique_ptr<AidlMember>>();
+  }
+ | parcelable_members variable_decl {
+    $1->emplace_back($2);
+    $$ = $1;
+  }
+ | parcelable_members constant_decl {
+    $1->emplace_back($2);
+    $$ = $1;
+  }
+ | parcelable_members decl {
+    if ($2) $1->emplace_back($2);  // decl may be nullptr on error
+    $$ = $1;
+  }
+ | parcelable_members error ';' {
+    ps->AddError();
+    $$ = $1;
+  };
+
+variable_decl
+ : type identifier ';' {
+   $$ = new AidlVariableDeclaration(loc(@2), $1, $2->GetText());
+   delete $2;
+ }
+ | type identifier '=' const_expr ';' {
+   // TODO(b/123321528): Support enum type default assignments (TestEnum foo = TestEnum.FOO).
+   $$ = new AidlVariableDeclaration(loc(@2), $1, $2->GetText(),  $4);
+   delete $2;
+ }
+ ;
+
+interface_decl
+ : INTERFACE qualified_name ';' {
+    ps->CheckValidTypeName(*$2, loc(@2));
+    $$ = new AidlInterface(loc(@1), $2->GetText(), $1->GetComments(), false, ps->Package(), nullptr);
+    delete $1;
+    delete $2;
+  }
+ | INTERFACE qualified_name '{' interface_members '}' {
+    ps->CheckValidTypeName(*$2, loc(@2));
+    $$ = new AidlInterface(loc(@1), $2->GetText(), $1->GetComments(), false, ps->Package(), $4);
+    delete $1;
+    delete $2;
+  }
+ | ONEWAY INTERFACE qualified_name '{' interface_members '}' {
+    ps->CheckValidTypeName(*$3, loc(@3));
+    $$ = new AidlInterface(loc(@2), $3->GetText(), $1->GetComments(), true, ps->Package(), $5);
+    delete $1;
+    delete $2;
+    delete $3;
+  }
+ | INTERFACE error '{' interface_members '}' {
+    ps->AddError();
+    $$ = nullptr;
+    delete $1;
+    delete $4;
+  };
+
+interface_members
+ :
+  { $$ = new std::vector<std::unique_ptr<AidlMember>>(); }
+ | interface_members method_decl
+  { $1->push_back(std::unique_ptr<AidlMember>($2)); $$ = $1; }
+ | interface_members constant_decl
+  { $1->push_back(std::unique_ptr<AidlMember>($2)); $$ = $1; }
+ | interface_members decl
+  {
+    if ($2) $1->emplace_back($2);  // decl may be nullptr on error
+    $$ = $1;
+  }
+ | interface_members error ';' {
+    ps->AddError();
+    $$ = $1;
+  };
+
+const_expr
+ : TRUE_LITERAL { $$ = AidlConstantValue::Boolean(loc(@1), true); }
+ | FALSE_LITERAL { $$ = AidlConstantValue::Boolean(loc(@1), false); }
+ | CHARVALUE {
+    $$ = AidlConstantValue::Character(loc(@1), $1->GetText());
+    delete $1;
+  }
+ | INTVALUE {
+    $$ = AidlConstantValue::Integral(loc(@1), $1->GetText());
+    if ($$ == nullptr) {
+      AIDL_ERROR(loc(@1)) << "Could not parse integer: "
+                << $1->GetText();
+      ps->AddError();
+      $$ = AidlConstantValue::Integral(loc(@1), "0");
+    }
+    delete $1;
+  }
+ | FLOATVALUE {
+    $$ = AidlConstantValue::Floating(loc(@1), $1->GetText());
+    delete $1;
+  }
+ | HEXVALUE {
+    $$ = AidlConstantValue::Integral(loc(@1), $1->GetText());
+    if ($$ == nullptr) {
+      AIDL_ERROR(loc(@1)) << "Could not parse hexvalue: "
+                << $1->GetText();
+      ps->AddError();
+      $$ = AidlConstantValue::Integral(loc(@1), "0");
+    }
+    delete $1;
+  }
+ | C_STR {
+    $$ = AidlConstantValue::String(loc(@1), $1->GetText());
+    delete $1;
+  }
+ | qualified_name {
+    $$ = new AidlConstantReference(loc(@1), $1->GetText());
+    delete $1;
+ }
+ | '{' constant_value_list '}' {
+    $$ = AidlConstantValue::Array(loc(@1), std::unique_ptr<vector<unique_ptr<AidlConstantValue>>>($2));
+  }
+ | const_expr LOGICAL_OR const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), "||", std::unique_ptr<AidlConstantValue>($3));
+  }
+ | const_expr LOGICAL_AND const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), "&&", std::unique_ptr<AidlConstantValue>($3));
+  }
+ | const_expr '|' const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), "|" , std::unique_ptr<AidlConstantValue>($3));
+  }
+ | const_expr '^' const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), "^" , std::unique_ptr<AidlConstantValue>($3));
+  }
+ | const_expr '&' const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), "&" , std::unique_ptr<AidlConstantValue>($3));
+  }
+ | const_expr EQUALITY const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), "==", std::unique_ptr<AidlConstantValue>($3));
+  }
+ | const_expr NEQ const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), "!=", std::unique_ptr<AidlConstantValue>($3));
+  }
+ | const_expr '<' const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), "<" , std::unique_ptr<AidlConstantValue>($3));
+  }
+ | const_expr '>' const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), ">" , std::unique_ptr<AidlConstantValue>($3));
+  }
+ | const_expr LEQ const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), "<=", std::unique_ptr<AidlConstantValue>($3));
+  }
+ | const_expr GEQ const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), ">=", std::unique_ptr<AidlConstantValue>($3));
+  }
+ | const_expr LSHIFT const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), "<<", std::unique_ptr<AidlConstantValue>($3));
+  }
+ | const_expr RSHIFT const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), ">>", std::unique_ptr<AidlConstantValue>($3));
+  }
+ | const_expr '+' const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), "+" , std::unique_ptr<AidlConstantValue>($3));
+  }
+ | const_expr '-' const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), "-" , std::unique_ptr<AidlConstantValue>($3));
+  }
+ | const_expr '*' const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), "*" , std::unique_ptr<AidlConstantValue>($3));
+  }
+ | const_expr '/' const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), "/" , std::unique_ptr<AidlConstantValue>($3));
+  }
+ | const_expr '%' const_expr {
+    $$ = new AidlBinaryConstExpression(loc(@1), std::unique_ptr<AidlConstantValue>($1), "%" , std::unique_ptr<AidlConstantValue>($3));
+  }
+ | '+' const_expr %prec UNARY_PLUS  {
+    $$ = new AidlUnaryConstExpression(loc(@1), "+", std::unique_ptr<AidlConstantValue>($2));
+  }
+ | '-' const_expr %prec UNARY_MINUS {
+    $$ = new AidlUnaryConstExpression(loc(@1), "-", std::unique_ptr<AidlConstantValue>($2));
+  }
+ | '!' const_expr {
+    $$ = new AidlUnaryConstExpression(loc(@1), "!", std::unique_ptr<AidlConstantValue>($2));
+  }
+ | '~' const_expr {
+    $$ = new AidlUnaryConstExpression(loc(@1), "~", std::unique_ptr<AidlConstantValue>($2));
+  }
+ | '(' const_expr ')'
+  {
+    $$ = $2;
+  }
+ | '(' error ')'
+   {
+     AIDL_ERROR(loc(@1)) << "invalid const expression within parenthesis";
+     ps->AddError();
+     // to avoid segfaults
+     $$ = AidlConstantValue::Integral(loc(@1), "0");
+   }
+ ;
+
+constant_value_list
+ : /* empty */ {
+    $$ = new std::vector<std::unique_ptr<AidlConstantValue>>;
+ }
+ | constant_value_non_empty_list {
+    $$ = $1;
+ }
+ | constant_value_non_empty_list  ',' {
+    $$ = $1;
+ }
+ ;
+
+constant_value_non_empty_list
+ : const_expr {
+    $$ = new std::vector<std::unique_ptr<AidlConstantValue>>;
+    $$->push_back(std::unique_ptr<AidlConstantValue>($1));
+ }
+ | constant_value_non_empty_list ',' const_expr {
+    $$ = $1;
+    $$->push_back(std::unique_ptr<AidlConstantValue>($3));
+ }
+ ;
+
+constant_decl
+ : annotation_list CONST type identifier '=' const_expr ';' {
+    if ($1->size() > 0) {
+      $3->SetComments($1->begin()->get()->GetComments());
+    } else {
+      $3->SetComments($2->GetComments());
+    }
+    // TODO(b/151102494) do not merge annotations.
+    $3->Annotate(std::move(*$1));
+    $$ = new AidlConstantDeclaration(loc(@4), $3, $4->GetText(), $6);
+    delete $1;
+    delete $2;
+    delete $4;
+   }
+ ;
+
+enumerator
+ : identifier '=' const_expr {
+    $$ = new AidlEnumerator(loc(@1), $1->GetText(), $3, $1->GetComments());
+    delete $1;
+   }
+ | identifier {
+    $$ = new AidlEnumerator(loc(@1), $1->GetText(), nullptr, $1->GetComments());
+    delete $1;
+   }
+ ;
+
+enumerators
+ : enumerator {
+    $$ = new std::vector<std::unique_ptr<AidlEnumerator>>();
+    $$->push_back(std::unique_ptr<AidlEnumerator>($1));
+   }
+ | enumerators ',' enumerator {
+    $1->push_back(std::unique_ptr<AidlEnumerator>($3));
+    $$ = $1;
+   }
+ ;
+
+enum_decl_body
+ : '{' enumerators '}' { $$ = $2; }
+ | '{' enumerators ',' '}' { $$ = $2; }
+ ;
+
+enum_decl
+ : ENUM qualified_name enum_decl_body {
+    ps->CheckValidTypeName(*$2, loc(@2));
+    $$ = new AidlEnumDeclaration(loc(@2), $2->GetText(), $3, ps->Package(), $1->GetComments());
+    delete $1;
+    delete $2;
+    delete $3;
+   }
+ ;
+
+union_decl
+ : UNION qualified_name optional_type_params '{' parcelable_members '}' {
+    ps->CheckValidTypeName(*$2, loc(@2));
+    $$ = new AidlUnionDecl(loc(@2), $2->GetText(), ps->Package(), $1->GetComments(), $3, $5);
+    delete $1;
+    delete $2;
+  }
+ ;
+
+method_decl
+ : type identifier '(' arg_list ')' ';' {
+    $$ = new AidlMethod(loc(@2), false, $1, $2->GetText(), $4, $1->GetComments());
+    delete $2;
+  }
+ | annotation_list ONEWAY type identifier '(' arg_list ')' ';' {
+    const auto& comments = ($1->size() > 0) ? $1->begin()->get()->GetComments() : $2->GetComments();
+    $$ = new AidlMethod(loc(@4), true, $3, $4->GetText(), $6, comments);
+    $3->Annotate(std::move(*$1));
+    delete $1;
+    delete $2;
+    delete $4;
+  }
+ | type identifier '(' arg_list ')' '=' INTVALUE ';' {
+    int32_t serial = 0;
+    if (!android::base::ParseInt($7->GetText(), &serial)) {
+        AIDL_ERROR(loc(@7)) << "Could not parse int value: " << $7->GetText();
+        ps->AddError();
+    }
+    $$ = new AidlMethod(loc(@2), false, $1, $2->GetText(), $4, $1->GetComments(), serial);
+    delete $2;
+    delete $7;
+  }
+ | annotation_list ONEWAY type identifier '(' arg_list ')' '=' INTVALUE ';' {
+    const auto& comments = ($1->size() > 0) ? $1->begin()->get()->GetComments() : $2->GetComments();
+    int32_t serial = 0;
+    if (!android::base::ParseInt($9->GetText(), &serial)) {
+        AIDL_ERROR(loc(@9)) << "Could not parse int value: " << $9->GetText();
+        ps->AddError();
+    }
+    $$ = new AidlMethod(loc(@4), true, $3, $4->GetText(), $6, comments, serial);
+    $3->Annotate(std::move(*$1));
+    delete $1;
+    delete $2;
+    delete $4;
+    delete $9;
+  };
+
+arg_non_empty_list
+ : arg {
+    $$ = new std::vector<std::unique_ptr<AidlArgument>>();
+    $$->push_back(std::unique_ptr<AidlArgument>($1));
+  }
+ | arg_non_empty_list ',' arg {
+    $$ = $1;
+    $$->push_back(std::unique_ptr<AidlArgument>($3));
+  };
+
+arg_list
+ : /*empty*/
+   { $$ = new std::vector<std::unique_ptr<AidlArgument>>(); }
+ | arg_non_empty_list { $$ = $1; }
+ ;
+
+arg
+ : direction type identifier {
+    $$ = new AidlArgument(loc(@3), $1, $2, $3->GetText());
+    delete $3;
+  }
+ | type identifier {
+    $$ = new AidlArgument(loc(@2), $1, $2->GetText());
+    delete $2;
+  };
+
+non_array_type
+ : annotation_list qualified_name {
+    $$ = new AidlTypeSpecifier(loc(@2), $2->GetText(), /*array=*/std::nullopt, nullptr, $2->GetComments());
+    if (!$1->empty()) {
+      $$->SetComments($1->begin()->get()->GetComments());
+      $$->Annotate(std::move(*$1));
+    }
+    delete $1;
+    delete $2;
+  }
+ | non_array_type '<' type_args '>' {
+    ps->SetTypeParameters($1, $3);
+    $$ = $1;
+  }
+ | non_array_type '<' non_array_type '<' type_args RSHIFT {
+    ps->SetTypeParameters($3, $5);
+    auto params = new std::vector<std::unique_ptr<AidlTypeSpecifier>>();
+    params->emplace_back($3);
+    ps->SetTypeParameters($1, params);
+    $$ = $1;
+  }
+ | non_array_type '<' type_args ',' non_array_type '<' type_args RSHIFT {
+    ps->SetTypeParameters($5, $7);
+    $3->emplace_back($5);
+    ps->SetTypeParameters($1, $3);
+    $$ = $1;
+  };
+
+type
+ : non_array_type
+ | type annotation_list '[' ']' {
+    if (!$2->empty()) {
+      AIDL_ERROR(loc(@2)) << "Annotations for arrays are not supported.";
+      ps->AddError();
+    }
+    if (!$1->MakeArray(DynamicArray{})) {
+      AIDL_ERROR(loc(@1)) << "Multi-dimensional arrays must be fixed size.";
+      ps->AddError();
+    }
+    $$ = $1;
+    delete $2;
+  }
+ | type annotation_list '[' const_expr ']' {
+    if (!$2->empty()) {
+      AIDL_ERROR(loc(@2)) << "Annotations for arrays are not supported.";
+      ps->AddError();
+    }
+    if (!$1->MakeArray(FixedSizeArray{std::unique_ptr<AidlConstantValue>($4)})) {
+      AIDL_ERROR(loc(@1)) << "Multi-dimensional arrays must be fixed size.";
+      ps->AddError();
+    }
+    $$ = $1;
+    delete $2;
+  }
+ ;
+
+type_args
+ : type {
+    if (!$1->GetAnnotations().empty()) {
+      AIDL_ERROR(loc(@1)) << "Annotations for type arguments are not supported.";
+      ps->AddError();
+    }
+    $$ = new std::vector<std::unique_ptr<AidlTypeSpecifier>>();
+    $$->emplace_back($1);
+  }
+ | type_args ',' type {
+    $1->emplace_back($3);
+    $$ = $1;
+  };
+
+annotation_list
+ :
+  { $$ = new std::vector<std::unique_ptr<AidlAnnotation>>(); }
+ | annotation_list annotation
+  {
+    if ($2 != nullptr) {
+      $1->emplace_back(std::unique_ptr<AidlAnnotation>($2));
+    }
+    $$ = $1;
+  };
+
+parameter
+  : identifier '=' const_expr {
+    $$ = new AidlAnnotationParameter{$1->GetText(), std::unique_ptr<AidlConstantValue>($3)};
+    delete $1;
+  };
+
+parameter_list
+  : /*empty*/{
+    $$ = new std::map<std::string, std::shared_ptr<AidlConstantValue>>();
+  }
+  | parameter_non_empty_list  {
+    $$ = $1;
+  };
+
+parameter_non_empty_list
+  : parameter {
+    $$ = new std::map<std::string, std::shared_ptr<AidlConstantValue>>();
+    $$->emplace(std::move($1->name), $1->value.release());
+    delete $1;
+  }
+  | parameter_non_empty_list ',' parameter {
+    $$ = $1;
+    if ($$->find($3->name) != $$->end()) {
+      AIDL_ERROR(loc(@3)) << "Trying to redefine parameter " << $3->name << ".";
+      ps->AddError();
+    }
+    $$->emplace(std::move($3->name), std::move($3->value));
+    delete $3;
+  };
+
+annotation
+ : ANNOTATION {
+    // release() returns nullptr if unique_ptr is empty.
+    $$ = AidlAnnotation::Parse(loc(@1), $1->GetText(), {}, $1->GetComments()).release();
+    if (!$$) {
+      ps->AddError();
+    }
+    delete $1;
+  }
+ | ANNOTATION '(' const_expr ')' {
+    auto value = std::shared_ptr<AidlConstantValue>($3);
+    std::map<std::string, std::shared_ptr<AidlConstantValue>> parameter_list {{"value" , value}};
+    $$ = AidlAnnotation::Parse(loc(@1, @4), $1->GetText(), std::move(parameter_list), $1->GetComments()).release();
+    if (!$$) {
+      ps->AddError();
+    }
+    delete $1;
+  }
+ | ANNOTATION '(' parameter_list ')' {
+    // release() returns nullptr if unique_ptr is empty.
+    $$ = AidlAnnotation::Parse(loc(@1, @4), $1->GetText(), std::move(*$3), $1->GetComments()).release();
+    if (!$$) {
+      ps->AddError();
+    }
+    delete $1;
+    delete $3;
+  }
+ ;
+
+direction
+ : IN
+  { $$ = AidlArgument::IN_DIR; }
+ | OUT
+  { $$ = AidlArgument::OUT_DIR; }
+ | INOUT
+  { $$ = AidlArgument::INOUT_DIR; };
+
+%%
+
+#include <ctype.h>
+#include <stdio.h>
+
+void yy::parser::error(const yy::parser::location_type& l, const std::string& errstr) {
+  AIDL_ERROR(loc(l)) << errstr;
+  // parser will return error value
+}
diff --git a/aidl_to_common.cpp b/aidl_to_common.cpp
new file mode 100644
index 0000000..8345bb9
--- /dev/null
+++ b/aidl_to_common.cpp
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl_to_common.h"
+
+namespace android {
+namespace aidl {
+
+bool ShouldForceDowngradeFor(CommunicationSide e) {
+  return kDowngradeCommunicationBitmap & static_cast<int>(e);
+}
+
+void GenerateAutoGenHeader(CodeWriter& out, const Options& options) {
+  out << "/*\n";
+  out << " * This file is auto-generated.  DO NOT MODIFY.\n";
+  out << " * Using: " << options.RawArgs() << "\n";
+  out << " */\n";
+}
+
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_to_common.h b/aidl_to_common.h
new file mode 100644
index 0000000..93f6a87
--- /dev/null
+++ b/aidl_to_common.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2023, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <string>
+
+#include "aidl_language.h"
+#include "code_writer.h"
+#include "options.h"
+
+// This is used to help generate code targeting to any language
+
+namespace android {
+namespace aidl {
+
+enum class CommunicationSide {
+  WRITE = 0x1,
+  READ = 0x2,
+  BOTH = WRITE | READ,
+};
+
+constexpr int kDowngradeCommunicationBitmap = static_cast<int>(CommunicationSide::BOTH);
+
+// This is used when adding the trunk stable downgrade to unfrozen interfaces.
+// The kDowngradeCommunicationBitmap constant can be used to only modify one side of
+// the generated interface libraries so we can make sure both sides are forced
+// to behave like the previous unfrozen version.
+// BOTH is standard operating config, but can be switched for testing.
+bool ShouldForceDowngradeFor(CommunicationSide e);
+
+// currently relies on all backends having the same comment style, but we
+// could take a comment type argument in the future
+void GenerateAutoGenHeader(CodeWriter& out, const Options& options);
+
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_to_cpp.cpp b/aidl_to_cpp.cpp
new file mode 100644
index 0000000..aab0024
--- /dev/null
+++ b/aidl_to_cpp.cpp
@@ -0,0 +1,359 @@
+/*
+ * Copyright (C) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl_to_cpp.h"
+#include "aidl_to_cpp_common.h"
+#include "aidl_language.h"
+#include "logging.h"
+
+#include <android-base/stringprintf.h>
+#include <android-base/strings.h>
+
+#include <functional>
+#include <unordered_map>
+
+using android::base::Join;
+using android::base::Split;
+using android::base::StringPrintf;
+using std::ostringstream;
+
+namespace android {
+namespace aidl {
+namespace cpp {
+
+namespace {
+
+std::string RawParcelMethod(const AidlTypeSpecifier& type, const AidlTypenames& typenames,
+                            bool readMethod) {
+  static map<string, string> kBuiltin = {
+      {"byte", "Byte"},
+      {"boolean", "Bool"},
+      {"char", "Char"},
+      {"double", "Double"},
+      {"FileDescriptor", "UniqueFileDescriptor"},
+      {"float", "Float"},
+      {"IBinder", "StrongBinder"},
+      {"int", "Int32"},
+      {"long", "Int64"},
+      {"ParcelFileDescriptor", "Parcelable"},
+      {"String", "String16"},
+      {"ParcelableHolder", "Parcelable"},
+  };
+
+  static map<string, string> kBuiltinVector = {
+      {"FileDescriptor", "UniqueFileDescriptorVector"},
+      {"double", "DoubleVector"},
+      {"char", "CharVector"},
+      {"boolean", "BoolVector"},
+      {"byte", "ByteVector"},
+      {"float", "FloatVector"},
+      {"IBinder", "StrongBinderVector"},
+      {"String", "String16Vector"},
+      {"int", "Int32Vector"},
+      {"long", "Int64Vector"},
+      {"ParcelFileDescriptor", "ParcelableVector"},
+  };
+
+  const bool nullable = type.IsNullable();
+  const bool isVector = type.IsArray() || typenames.IsList(type);
+  const bool utf8 = type.IsUtf8InCpp();
+
+  if (type.IsFixedSizeArray()) {
+    return "FixedArray";
+  }
+
+  if (auto enum_decl = typenames.GetEnumDeclaration(type); enum_decl != nullptr) {
+    if (isVector) {
+      return "EnumVector";
+    } else {
+      return RawParcelMethod(enum_decl->GetBackingType(), typenames, readMethod);
+    }
+  }
+
+  if (isVector) {
+    string element_name;
+    if (typenames.IsList(type)) {
+      AIDL_FATAL_IF(type.GetTypeParameters().size() != 1, type);
+      element_name = type.GetTypeParameters().at(0)->GetName();
+    } else {
+      element_name = type.GetName();
+    }
+    if (kBuiltinVector.find(element_name) != kBuiltinVector.end()) {
+      AIDL_FATAL_IF(!AidlTypenames::IsBuiltinTypename(element_name), type);
+      if (utf8) {
+        AIDL_FATAL_IF(element_name != "String", type);
+        return readMethod ? "Utf8VectorFromUtf16Vector" : "Utf8VectorAsUtf16Vector";
+      }
+      return kBuiltinVector[element_name];
+    }
+    auto definedType = typenames.TryGetDefinedType(element_name);
+    if (definedType != nullptr && definedType->AsInterface() != nullptr) {
+      return "StrongBinderVector";
+    }
+    return "ParcelableVector";
+  }
+
+  const string& type_name = type.GetName();
+  if (kBuiltin.find(type_name) != kBuiltin.end()) {
+    AIDL_FATAL_IF(!AidlTypenames::IsBuiltinTypename(type_name), type);
+    if (type_name == "IBinder" && nullable && readMethod) {
+      return "NullableStrongBinder";
+    }
+    if (type_name == "ParcelFileDescriptor" && nullable && !readMethod) {
+      return "NullableParcelable";
+    }
+    if (utf8) {
+      AIDL_FATAL_IF(type_name != "String", type);
+      return readMethod ? "Utf8FromUtf16" : "Utf8AsUtf16";
+    }
+    return kBuiltin[type_name];
+  }
+
+  AIDL_FATAL_IF(AidlTypenames::IsBuiltinTypename(type.GetName()), type);
+  auto definedType = typenames.TryGetDefinedType(type.GetName());
+  // The type must be either primitive or interface or parcelable,
+  // so it cannot be nullptr.
+  AIDL_FATAL_IF(definedType == nullptr, type) << type.GetName() << " is not found.";
+
+  if (definedType->AsInterface() != nullptr) {
+    if (nullable && readMethod) {
+      return "NullableStrongBinder";
+    }
+    return "StrongBinder";
+  }
+
+  // Parcelable
+  if (nullable && !readMethod) {
+    return "NullableParcelable";
+  }
+  return "Parcelable";
+}
+
+std::string GetRawCppName(const AidlTypeSpecifier& type) {
+  return "::" + Join(type.GetSplitName(), "::");
+}
+
+std::string WrapIfNullable(const std::string type_str, const AidlTypeSpecifier& raw_type,
+                           const AidlTypenames& typenames) {
+  const auto& type = typenames.IsList(raw_type) ? (*raw_type.GetTypeParameters().at(0)) : raw_type;
+
+  if (raw_type.IsNullable() && !AidlTypenames::IsPrimitiveTypename(type.GetName()) &&
+      type.GetName() != "IBinder" && typenames.GetEnumDeclaration(type) == nullptr) {
+    if (raw_type.IsHeapNullable()) {
+      return "::std::unique_ptr<" + type_str + ">";
+    }
+    return "::std::optional<" + type_str + ">";
+  }
+  return type_str;
+}
+
+std::string GetCppName(const AidlTypeSpecifier& raw_type, const AidlTypenames& typenames) {
+  // map from AIDL built-in type name to the corresponding Cpp type name
+  static map<string, string> m = {
+      {"boolean", "bool"},
+      {"byte", "int8_t"},
+      {"char", "char16_t"},
+      {"double", "double"},
+      {"FileDescriptor", "::android::base::unique_fd"},
+      {"float", "float"},
+      {"IBinder", "::android::sp<::android::IBinder>"},
+      {"int", "int32_t"},
+      {"long", "int64_t"},
+      {"ParcelFileDescriptor", "::android::os::ParcelFileDescriptor"},
+      {"String", "::android::String16"},
+      {"void", "void"},
+      {"ParcelableHolder", "::android::os::ParcelableHolder"},
+  };
+  AIDL_FATAL_IF(typenames.IsList(raw_type) && raw_type.GetTypeParameters().size() != 1, raw_type);
+  const auto& type = typenames.IsList(raw_type) ? (*raw_type.GetTypeParameters().at(0)) : raw_type;
+  const string& aidl_name = type.GetName();
+  if (m.find(aidl_name) != m.end()) {
+    AIDL_FATAL_IF(!AidlTypenames::IsBuiltinTypename(aidl_name), raw_type);
+    if (aidl_name == "byte" && type.IsArray()) {
+      return "uint8_t";
+    } else if (raw_type.IsUtf8InCpp()) {
+      AIDL_FATAL_IF(aidl_name != "String", type);
+      return WrapIfNullable("::std::string", raw_type, typenames);
+    }
+    return WrapIfNullable(m[aidl_name], raw_type, typenames);
+  }
+  auto definedType = typenames.TryGetDefinedType(type.GetName());
+  if (definedType != nullptr && definedType->AsInterface() != nullptr) {
+    return "::android::sp<" + GetRawCppName(type) + ">";
+  }
+  auto cpp_name = GetRawCppName(type);
+  if (type.IsGeneric()) {
+    std::vector<std::string> type_params;
+    for (const auto& parameter : type.GetTypeParameters()) {
+      type_params.push_back(CppNameOf(*parameter, typenames));
+    }
+    cpp_name += "<" + base::Join(type_params, ", ") + ">";
+  }
+  return WrapIfNullable(cpp_name, raw_type, typenames);
+}
+}  // namespace
+std::string ConstantValueDecorator(
+    const AidlTypeSpecifier& type,
+    const std::variant<std::string, std::vector<std::string>>& raw_value) {
+  return CppConstantValueDecorator(type, raw_value, /*is_ndk=*/false);
+};
+
+std::string GetTransactionIdFor(const std::string& clazz, const AidlMethod& method) {
+  return clazz + "::TRANSACTION_" + method.GetName();
+}
+
+std::string CppNameOf(const AidlTypeSpecifier& type, const AidlTypenames& typenames) {
+  // get base type's cpp_name with nullable processed.
+  std::string cpp_name = GetCppName(type, typenames);
+
+  if (type.IsArray() || typenames.IsList(type)) {
+    if (type.IsFixedSizeArray()) {
+      auto dimensions = type.GetFixedSizeArrayDimensions();
+      for (auto it = rbegin(dimensions), end = rend(dimensions); it != end; it++) {
+        cpp_name = "std::array<" + cpp_name + ", " + std::to_string(*it) + ">";
+      }
+    } else {
+      cpp_name = "::std::vector<" + cpp_name + ">";
+    }
+
+    // wrap nullable again because @nullable applies to BOTH array type(outermost type) AND base
+    // type(innermost type)
+    if (type.IsHeapNullable()) {
+      cpp_name = "::std::unique_ptr<" + cpp_name + ">";
+    } else if (type.IsNullable()) {
+      cpp_name = "::std::optional<" + cpp_name + ">";
+    }
+  }
+  return cpp_name;
+}
+
+bool IsNonCopyableType(const AidlTypeSpecifier& type, const AidlTypenames& typenames) {
+  if (type.IsArray() || typenames.IsList(type)) {
+    return false;
+  }
+
+  const std::string cpp_name = GetCppName(type, typenames);
+  if (cpp_name == "::android::base::unique_fd") {
+    return true;
+  }
+  return false;
+}
+
+std::string ParcelReadMethodOf(const AidlTypeSpecifier& type, const AidlTypenames& typenames) {
+  return "read" + RawParcelMethod(type, typenames, true /* readMethod */);
+}
+
+std::string ParcelReadCastOf(const AidlTypeSpecifier& type, const AidlTypenames& typenames,
+                             const std::string& variable_name) {
+  if (auto enum_decl = typenames.GetEnumDeclaration(type);
+      enum_decl != nullptr && !type.IsArray()) {
+    return StringPrintf("reinterpret_cast<%s *>(%s)",
+                        CppNameOf(enum_decl->GetBackingType(), typenames).c_str(),
+                        variable_name.c_str());
+  }
+
+  return variable_name;
+}
+
+std::string ParcelWriteMethodOf(const AidlTypeSpecifier& type, const AidlTypenames& typenames) {
+  return "write" + RawParcelMethod(type, typenames, false /* readMethod */);
+}
+
+std::string ParcelWriteCastOf(const AidlTypeSpecifier& type, const AidlTypenames& typenames,
+                              const std::string& variable_name) {
+  if (auto enum_decl = typenames.GetEnumDeclaration(type);
+      enum_decl != nullptr && !type.IsArray()) {
+    return StringPrintf("static_cast<%s>(%s)",
+                        CppNameOf(enum_decl->GetBackingType(), typenames).c_str(),
+                        variable_name.c_str());
+  }
+  return variable_name;
+}
+
+// Add includes for a type ref. Note that this is non-recursive.
+void AddHeaders(const AidlTypeSpecifier& type, const AidlTypenames& typenames,
+                std::set<std::string>* headers) {
+  if (type.IsArray()) {
+    if (type.IsFixedSizeArray()) {
+      headers->insert("array");
+    } else {
+      headers->insert("vector");
+    }
+  }
+  if (type.IsNullable()) {
+    if (type.GetName() != "IBinder") {
+      headers->insert("optional");
+    }
+  }
+  if (typenames.IsList(type)) {
+    headers->insert("vector");
+    return;
+  }
+  if (type.GetName() == "String") {
+    if (type.IsUtf8InCpp()) {
+      headers->insert("string");
+    } else {
+      headers->insert("utils/String16.h");
+    }
+    return;
+  }
+  if (type.GetName() == "IBinder") {
+    headers->insert("binder/IBinder.h");
+    return;
+  }
+  if (type.GetName() == "FileDescriptor") {
+    headers->insert("android-base/unique_fd.h");
+    return;
+  }
+  if (type.GetName() == "ParcelFileDescriptor") {
+    headers->insert("binder/ParcelFileDescriptor.h");
+    return;
+  }
+  if (type.GetName() == "ParcelableHolder") {
+    headers->insert("binder/ParcelableHolder.h");
+    return;
+  }
+
+  static const std::set<string> need_cstdint{"byte", "int", "long"};
+  if (need_cstdint.find(type.GetName()) != need_cstdint.end()) {
+    headers->insert("cstdint");
+    return;
+  }
+
+  if (AidlTypenames::IsPrimitiveTypename(type.GetName())) {
+    return;
+  }
+
+  auto defined_type = typenames.TryGetDefinedType(type.GetName());
+  AIDL_FATAL_IF(defined_type == nullptr, type) << "Unexpected type: " << type.GetName();
+
+  headers->insert(CppHeaderForType(*defined_type));
+}
+
+std::string CppHeaderForType(const AidlDefinedType& defined_type) {
+  // Unstructured parcelable should set its cpp_header. use it.
+  if (auto unstructured = AidlCast<AidlParcelable>(defined_type); unstructured) {
+    const std::string cpp_header = unstructured->GetCppHeader();
+    AIDL_FATAL_IF(cpp_header.empty(), unstructured)
+        << "Parcelable " << unstructured->GetCanonicalName() << " has no cpp_header defined.";
+    return cpp_header;
+  }
+  return HeaderFile(defined_type, ClassNames::RAW, /*use_os_sep=*/false);
+}
+
+}  // namespace cpp
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_to_cpp.h b/aidl_to_cpp.h
new file mode 100644
index 0000000..73b79bb
--- /dev/null
+++ b/aidl_to_cpp.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include "aidl_language.h"
+
+namespace android {
+namespace aidl {
+namespace cpp {
+
+// This header provides functions that translate AIDL things to cpp things.
+
+std::string ConstantValueDecorator(
+    const AidlTypeSpecifier& type,
+    const std::variant<std::string, std::vector<std::string>>& raw_value);
+
+struct CodeGeneratorContext {
+  CodeWriter& writer;
+
+  const AidlTypenames& types;
+  const AidlTypeSpecifier& type;  // an argument or return type to generate code for
+  const string name;              // name of the variable for the argument or the return value
+  const bool isPointer;           // whether the variable 'name' is a pointer or not
+};
+
+std::string GetTransactionIdFor(const std::string& clazz, const AidlMethod& method);
+
+std::string CppNameOf(const AidlTypeSpecifier& type, const AidlTypenames& typenames);
+
+bool IsNonCopyableType(const AidlTypeSpecifier& type, const AidlTypenames& typenames);
+
+// Returns the name of the Parcel method suitable for reading data of the
+// given type.
+std::string ParcelReadMethodOf(const AidlTypeSpecifier& type, const AidlTypenames& typenames);
+
+// Returns the potentially-cast representation of the provided variable name,
+// suitable for being passed to a method from ParcelReadMethodOf.
+std::string ParcelReadCastOf(const AidlTypeSpecifier& type, const AidlTypenames& typenames,
+                             const std::string& variable_name);
+
+// Returns the name of the Parcel method suitable for writing data of the
+// given type.
+std::string ParcelWriteMethodOf(const AidlTypeSpecifier& type, const AidlTypenames& typenames);
+
+// Returns the potentially-cast representation of the provided variable name,
+// suitable for being passed to a method from ParcelWriteMethodOf.
+std::string ParcelWriteCastOf(const AidlTypeSpecifier& type, const AidlTypenames& typenames,
+                              const std::string& variable_name);
+
+void AddHeaders(const AidlTypeSpecifier& type, const AidlTypenames& typenames,
+                std::set<std::string>* headers);
+
+std::string CppHeaderForType(const AidlDefinedType& defined_type);
+}  // namespace cpp
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_to_cpp_common.cpp b/aidl_to_cpp_common.cpp
new file mode 100644
index 0000000..55b5cab
--- /dev/null
+++ b/aidl_to_cpp_common.cpp
@@ -0,0 +1,875 @@
+/*
+ * Copyright (C) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "aidl_to_cpp_common.h"
+
+#include <android-base/format.h>
+#include <android-base/stringprintf.h>
+#include <android-base/strings.h>
+
+#include <limits>
+#include <set>
+#include <unordered_map>
+
+#include "comments.h"
+#include "logging.h"
+#include "os.h"
+
+using ::android::base::Join;
+using ::android::base::Split;
+
+namespace android {
+namespace aidl {
+namespace cpp {
+
+char kTransactionLogStruct[] = R"(struct TransactionLog {
+  double duration_ms;
+  std::string interface_name;
+  std::string method_name;
+  const void* proxy_address;
+  const void* stub_address;
+  std::vector<std::pair<std::string, std::string>> input_args;
+  std::vector<std::pair<std::string, std::string>> output_args;
+  std::string result;
+  std::string exception_message;
+  int32_t exception_code;
+  int32_t transaction_error;
+  int32_t service_specific_error_code;
+};
+)";
+
+bool HasDeprecatedField(const AidlParcelable& parcelable) {
+  return std::any_of(parcelable.GetFields().begin(), parcelable.GetFields().end(),
+                     [](const auto& field) { return field->IsDeprecated(); });
+}
+
+string ClassName(const AidlDefinedType& defined_type, ClassNames type) {
+  if (type == ClassNames::MAYBE_INTERFACE && defined_type.AsInterface()) {
+    type = ClassNames::INTERFACE;
+  }
+  string base_name = defined_type.GetName();
+  if (base_name.length() >= 2 && base_name[0] == 'I' && isupper(base_name[1])) {
+    base_name = base_name.substr(1);
+  }
+
+  switch (type) {
+    case ClassNames::CLIENT:
+      return "Bp" + base_name;
+    case ClassNames::SERVER:
+      return "Bn" + base_name;
+    case ClassNames::INTERFACE:
+      return "I" + base_name;
+    case ClassNames::DEFAULT_IMPL:
+      return "I" + base_name + "Default";
+    case ClassNames::BASE:
+      return base_name;
+    case ClassNames::DELEGATOR_IMPL:
+      return "I" + base_name + "Delegator";
+    case ClassNames::RAW:
+      [[fallthrough]];
+    default:
+      return defined_type.GetName();
+  }
+}
+
+std::string HeaderFile(const AidlDefinedType& defined_type, ClassNames class_type,
+                       bool use_os_sep) {
+  // For a nested type, we need to include its top-most parent type's header.
+  const AidlDefinedType* toplevel = &defined_type;
+  for (auto parent = toplevel->GetParentType(); parent;) {
+    // When including the parent's header, it should be always RAW
+    class_type = ClassNames::RAW;
+    toplevel = parent;
+    parent = toplevel->GetParentType();
+  }
+  AIDL_FATAL_IF(toplevel->GetParentType() != nullptr, defined_type)
+      << "Can't find a top-level decl";
+
+  char separator = (use_os_sep) ? OS_PATH_SEPARATOR : '/';
+  vector<string> paths = toplevel->GetSplitPackage();
+  paths.push_back(ClassName(*toplevel, class_type));
+  return Join(paths, separator) + ".h";
+}
+
+// Ensures that output_file is  <out_dir>/<packagename>/<typename>.cpp
+bool ValidateOutputFilePath(const string& output_file, const Options& options,
+                            const AidlDefinedType& defined_type) {
+  const auto& out_dir =
+      !options.OutputDir().empty() ? options.OutputDir() : options.OutputHeaderDir();
+  if (output_file.empty() || !android::base::StartsWith(output_file, out_dir)) {
+    // If output_file is not set (which happens in the unit tests) or is outside of out_dir, we can
+    // help but accepting it, because the path is what the user has requested.
+    return true;
+  }
+
+  string canonical_name = defined_type.GetCanonicalName();
+  std::replace(canonical_name.begin(), canonical_name.end(), '.', OS_PATH_SEPARATOR);
+  const string expected = out_dir + canonical_name + ".cpp";
+  if (expected != output_file) {
+    AIDL_ERROR(defined_type) << "Output file is expected to be at " << expected << ", but is "
+                             << output_file << ".\n If this is an Android platform "
+                             << "build, consider providing the input AIDL files using a filegroup "
+                             << "with `path:\"<base>\"` so that the AIDL files are located at "
+                             << "<base>/<packagename>/<typename>.aidl.";
+    return false;
+  }
+  return true;
+}
+
+void EnterNamespace(CodeWriter& out, const AidlDefinedType& defined_type) {
+  const std::vector<std::string> packages = defined_type.GetSplitPackage();
+  for (const std::string& package : packages) {
+    out << "namespace " << package << " {\n";
+  }
+}
+void LeaveNamespace(CodeWriter& out, const AidlDefinedType& defined_type) {
+  const std::vector<std::string> packages = defined_type.GetSplitPackage();
+  for (auto it = packages.rbegin(); it != packages.rend(); ++it) {
+    out << "}  // namespace " << *it << "\n";
+  }
+}
+
+string BuildVarName(const AidlArgument& a) {
+  string prefix = "out_";
+  if (a.GetDirection() & AidlArgument::IN_DIR) {
+    prefix = "in_";
+  }
+  return prefix + a.GetName();
+}
+
+void WriteLogForArgument(CodeWriter& w, const AidlArgument& a, bool is_server,
+                         const string& log_var, bool is_ndk) {
+  const string var_name = is_server || is_ndk ? BuildVarName(a) : a.GetName();
+  const bool is_pointer = a.IsOut() && !is_server;
+  const string value_expr = (is_pointer ? "*" : "") + var_name;
+  w << log_var
+    << ".emplace_back(\"" + var_name + "\", ::android::internal::ToString(" + value_expr + "));\n";
+}
+
+const string GenLogBeforeExecute(const string className, const AidlMethod& method, bool isServer,
+                                 bool isNdk) {
+  string code;
+  CodeWriterPtr writer = CodeWriter::ForString(&code);
+  (*writer) << className << "::TransactionLog _transaction_log;\n";
+
+  (*writer) << "if (" << className << "::logFunc != nullptr) {\n";
+  (*writer).Indent();
+
+  for (const auto& a : method.GetInArguments()) {
+    WriteLogForArgument(*writer, *a, isServer, "_transaction_log.input_args", isNdk);
+  }
+
+  (*writer).Dedent();
+  (*writer) << "}\n";
+
+  (*writer) << "auto _log_start = std::chrono::steady_clock::now();\n";
+  writer->Close();
+  return code;
+}
+
+const string GenLogAfterExecute(const string className, const AidlInterface& interface,
+                                const AidlMethod& method, const string& statusVarName,
+                                const string& returnVarName, bool isServer, bool isNdk) {
+  string code;
+  CodeWriterPtr writer = CodeWriter::ForString(&code);
+
+  (*writer) << "if (" << className << "::logFunc != nullptr) {\n";
+  (*writer).Indent();
+  const auto address = (isNdk && isServer) ? "_aidl_impl.get()" : "static_cast<const void*>(this)";
+  (*writer) << "auto _log_end = std::chrono::steady_clock::now();\n";
+  (*writer) << "_transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end "
+               "- _log_start).count();\n";
+  (*writer) << "_transaction_log.interface_name = \"" << interface.GetCanonicalName() << "\";\n";
+  (*writer) << "_transaction_log.method_name = \"" << method.GetName() << "\";\n";
+  (*writer) << "_transaction_log.stub_address = " << (isServer ? address : "nullptr") << ";\n";
+  (*writer) << "_transaction_log.proxy_address = " << (isServer ? "nullptr" : address) << ";\n";
+
+  if (isNdk) {
+    (*writer) << "_transaction_log.exception_code = AStatus_getExceptionCode(" << statusVarName
+              << ".get());\n";
+    (*writer) << "_transaction_log.exception_message = AStatus_getMessage(" << statusVarName
+              << ".get());\n";
+    (*writer) << "_transaction_log.transaction_error = AStatus_getStatus(" << statusVarName
+              << ".get());\n";
+    (*writer) << "_transaction_log.service_specific_error_code = AStatus_getServiceSpecificError("
+              << statusVarName << ".get());\n";
+  } else {
+    (*writer) << "_transaction_log.exception_code = " << statusVarName << ".exceptionCode();\n";
+    (*writer) << "_transaction_log.exception_message = " << statusVarName
+              << ".exceptionMessage();\n";
+    (*writer) << "_transaction_log.transaction_error = " << statusVarName
+              << ".transactionError();\n";
+    (*writer) << "_transaction_log.service_specific_error_code = " << statusVarName
+              << ".serviceSpecificErrorCode();\n";
+  }
+
+  for (const auto& a : method.GetOutArguments()) {
+    WriteLogForArgument(*writer, *a, isServer, "_transaction_log.output_args", isNdk);
+  }
+
+  if (method.GetType().GetName() != "void") {
+    const string expr = (isServer ? "" : "*") + returnVarName;
+    (*writer) << "_transaction_log.result = ::android::internal::ToString(" << expr << ");\n";
+  }
+
+  // call the user-provided function with the transaction log object
+  (*writer) << className << "::logFunc(_transaction_log);\n";
+
+  (*writer).Dedent();
+  (*writer) << "}\n";
+
+  writer->Close();
+  return code;
+}
+
+// Returns Parent1::Parent2::Self. Namespaces are not included.
+string GetQualifiedName(const AidlDefinedType& type, ClassNames class_names) {
+  string q_name = ClassName(type, class_names);
+  for (auto parent = type.GetParentType(); parent; parent = parent->GetParentType()) {
+    q_name = ClassName(*parent, ClassNames::MAYBE_INTERFACE) + "::" + q_name;
+  }
+  return q_name;
+}
+
+// Generates enum's class declaration. This should be called in a proper scope. For example, in its
+// namespace or parent type.
+void GenerateEnumClassDecl(CodeWriter& out, const AidlEnumDeclaration& enum_decl,
+                           const std::string& backing_type, ConstantValueDecorator decorator) {
+  out << "enum class";
+  GenerateDeprecated(out, enum_decl);
+  out << " " << enum_decl.GetName() << " : " << backing_type << " {\n";
+  out.Indent();
+  for (const auto& enumerator : enum_decl.GetEnumerators()) {
+    out << enumerator->GetName();
+    GenerateDeprecated(out, *enumerator);
+    out << " = " << enumerator->ValueString(enum_decl.GetBackingType(), decorator) << ",\n";
+  }
+  out.Dedent();
+  out << "};\n";
+}
+
+static bool IsEnumDeprecated(const AidlEnumDeclaration& enum_decl) {
+  if (enum_decl.IsDeprecated()) {
+    return true;
+  }
+  for (const auto& e : enum_decl.GetEnumerators()) {
+    if (e->IsDeprecated()) {
+      return true;
+    }
+  }
+  return false;
+}
+
+// enum_values template value is defined in its own namespace (android::internal or ndk::internal),
+// so the enum_decl type should be fully qualified.
+std::string GenerateEnumValues(const AidlEnumDeclaration& enum_decl,
+                               const std::vector<std::string>& enclosing_namespaces_of_enum_decl) {
+  const auto fq_name =
+      Join(Append(enclosing_namespaces_of_enum_decl, enum_decl.GetSplitPackage()), "::") +
+      "::" + GetQualifiedName(enum_decl);
+  const auto size = enum_decl.GetEnumerators().size();
+  std::ostringstream code;
+  code << "#pragma clang diagnostic push\n";
+  code << "#pragma clang diagnostic ignored \"-Wc++17-extensions\"\n";
+  if (IsEnumDeprecated(enum_decl)) {
+    code << "#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n";
+  }
+  code << "template <>\n";
+  code << "constexpr inline std::array<" << fq_name << ", " << size << ">";
+  code << " enum_values<" << fq_name << "> = {\n";
+  for (const auto& enumerator : enum_decl.GetEnumerators()) {
+    code << "  " << fq_name << "::" << enumerator->GetName() << ",\n";
+  }
+  code << "};\n";
+  code << "#pragma clang diagnostic pop\n";
+  return code.str();
+}
+
+// toString(enum_type) is defined in the same namespace of the type.
+// So, if enum_decl is nested in parent type(s), it should be qualified with parent type(s).
+std::string GenerateEnumToString(const AidlEnumDeclaration& enum_decl,
+                                 const std::string& backing_type) {
+  const auto q_name = GetQualifiedName(enum_decl);
+  std::ostringstream code;
+  bool is_enum_deprecated = IsEnumDeprecated(enum_decl);
+  if (is_enum_deprecated) {
+    code << "#pragma clang diagnostic push\n";
+    code << "#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n";
+  }
+  code << "[[nodiscard]] static inline std::string toString(" + q_name + " val) {\n";
+  code << "  switch(val) {\n";
+  std::set<std::string> unique_cases;
+  for (const auto& enumerator : enum_decl.GetEnumerators()) {
+    std::string c = enumerator->ValueString(enum_decl.GetBackingType(), AidlConstantValueDecorator);
+    // Only add a case if its value has not yet been used in the switch
+    // statement. C++ does not allow multiple cases with the same value, but
+    // enums does allow this. In this scenario, the first declared
+    // enumerator with the given value is printed.
+    if (unique_cases.count(c) == 0) {
+      unique_cases.insert(c);
+      code << "  case " << q_name << "::" << enumerator->GetName() << ":\n";
+      code << "    return \"" << enumerator->GetName() << "\";\n";
+    }
+  }
+  code << "  default:\n";
+  code << "    return std::to_string(static_cast<" << backing_type << ">(val));\n";
+  code << "  }\n";
+  code << "}\n";
+  if (is_enum_deprecated) {
+    code << "#pragma clang diagnostic pop\n";
+  }
+  return code.str();
+}
+
+std::string TemplateDecl(const AidlParcelable& defined_type) {
+  std::string decl = "";
+  if (defined_type.IsGeneric()) {
+    std::vector<std::string> template_params;
+    for (const auto& parameter : defined_type.GetTypeParameters()) {
+      template_params.push_back(parameter);
+    }
+    decl = base::StringPrintf("template <typename %s>\n",
+                              base::Join(template_params, ", typename ").c_str());
+  }
+  return decl;
+}
+
+void GenerateParcelableComparisonOperators(CodeWriter& out, const AidlParcelable& parcelable) {
+  std::set<string> operators{"<", ">", "==", ">=", "<=", "!="};
+
+  if (parcelable.AsUnionDeclaration() && parcelable.IsFixedSize()) {
+    auto name = parcelable.GetName();
+    auto max_tag = parcelable.GetFields().back()->GetName();
+    auto min_tag = parcelable.GetFields().front()->GetName();
+    auto tmpl = R"--(static int _cmp(const {name}& _lhs, const {name}& _rhs) {{
+  return _cmp_value(_lhs.getTag(), _rhs.getTag()) || _cmp_value_at<{max_tag}>(_lhs, _rhs);
+}}
+template <Tag _Tag>
+static int _cmp_value_at(const {name}& _lhs, const {name}& _rhs) {{
+  if constexpr (_Tag == {min_tag}) {{
+    return _cmp_value(_lhs.get<_Tag>(), _rhs.get<_Tag>());
+  }} else {{
+    return (_lhs.getTag() == _Tag)
+      ? _cmp_value(_lhs.get<_Tag>(), _rhs.get<_Tag>())
+      : _cmp_value_at<static_cast<Tag>(static_cast<size_t>(_Tag)-1)>(_lhs, _rhs);
+  }}
+}}
+template <typename _Type>
+static int _cmp_value(const _Type& _lhs, const _Type& _rhs) {{
+  return (_lhs == _rhs) ? 0 : (_lhs < _rhs) ? -1 : 1;
+}}
+)--";
+    out << fmt::format(tmpl, fmt::arg("name", name), fmt::arg("min_tag", min_tag),
+                       fmt::arg("max_tag", max_tag));
+    for (const auto& op : operators) {
+      out << "inline bool operator" << op << "(const " << name << "&_rhs) const {\n";
+      out << "  return _cmp(*this, _rhs) " << op << " 0;\n";
+      out << "}\n";
+    }
+    return;
+  }
+
+  bool is_empty = false;
+
+  auto comparable = [&](const string& prefix) {
+    vector<string> fields;
+    if (auto p = parcelable.AsStructuredParcelable(); p != nullptr) {
+      is_empty = p->GetFields().empty();
+      for (const auto& f : p->GetFields()) {
+        fields.push_back(prefix + f->GetName());
+      }
+      return "std::tie(" + Join(fields, ", ") + ")";
+    } else if (auto p = parcelable.AsUnionDeclaration(); p != nullptr) {
+      return prefix + "_value";
+    } else {
+      AIDL_FATAL(parcelable) << "Unknown paracelable type";
+    }
+  };
+
+  string lhs = comparable("");
+  string rhs = comparable("rhs.");
+  for (const auto& op : operators) {
+    out << "inline bool operator" << op << "(const " << parcelable.GetName() << "&"
+        << (is_empty ? "" : " rhs") << ") const {\n"
+        << "  return " << lhs << " " << op << " " << rhs << ";\n"
+        << "}\n";
+  }
+  out << "\n";
+}
+
+// Output may look like:
+// inline std::string toString() const {
+//   std::ostringstream os;
+//   os << "MyData{";
+//   os << "field1: " << field1;
+//   os << ", field2: " << v.field2;
+//   ...
+//   os << "}";
+//   return os.str();
+// }
+void GenerateToString(CodeWriter& out, const AidlStructuredParcelable& parcelable) {
+  out << "inline std::string toString() const {\n";
+  out.Indent();
+  out << "std::ostringstream os;\n";
+  out << "os << \"" << parcelable.GetName() << "{\";\n";
+  bool first = true;
+  for (const auto& f : parcelable.GetFields()) {
+    if (first) {
+      out << "os << \"";
+      first = false;
+    } else {
+      out << "os << \", ";
+    }
+    out << f->GetName() << ": \" << ::android::internal::ToString(" << f->GetName() << ");\n";
+  }
+  out << "os << \"}\";\n";
+  out << "return os.str();\n";
+  out.Dedent();
+  out << "}\n";
+}
+
+// Output may look like:
+// inline std::string toString() const {
+//   std::ostringstream os;
+//   os << "MyData{";
+//   switch (v.getTag()) {
+//   case MyData::field: os << "field: " << v.get<MyData::field>(); break;
+//   ...
+//   }
+//   os << "}";
+//   return os.str();
+// }
+void GenerateToString(CodeWriter& out, const AidlUnionDecl& parcelable) {
+  out << "inline std::string toString() const {\n";
+  out.Indent();
+  out << "std::ostringstream os;\n";
+  out << "os << \"" + parcelable.GetName() + "{\";\n";
+  out << "switch (getTag()) {\n";
+  for (const auto& f : parcelable.GetFields()) {
+    const string tag = f->GetName();
+    out << "case " << tag << ": os << \"" << tag << ": \" << "
+        << "::android::internal::ToString(get<" + tag + ">()); break;\n";
+  }
+  out << "}\n";
+  out << "os << \"}\";\n";
+  out << "return os.str();\n";
+  out.Dedent();
+  out << "}\n";
+}
+
+std::string GetDeprecatedAttribute(const AidlCommentable& type) {
+  if (auto deprecated = FindDeprecated(type.GetComments()); deprecated.has_value()) {
+    if (deprecated->note.empty()) {
+      return "__attribute__((deprecated))";
+    }
+    return "__attribute__((deprecated(" + QuotedEscape(deprecated->note) + ")))";
+  }
+  return "";
+}
+
+size_t AlignmentOf(const AidlTypeSpecifier& type, const AidlTypenames& typenames) {
+  static map<string, size_t> alignment = {
+      {"boolean", 1}, {"byte", 1}, {"char", 2}, {"double", 8},
+      {"float", 4},   {"int", 4},  {"long", 8},
+  };
+
+  string name = type.GetName();
+  if (auto enum_decl = typenames.GetEnumDeclaration(type); enum_decl) {
+    name = enum_decl->GetBackingType().GetName();
+  }
+  // default to 0 for parcelable types
+  return alignment[name];
+}
+
+std::set<std::string> UnionWriter::GetHeaders(const AidlUnionDecl& decl) {
+  std::set<std::string> union_headers = {
+      "cassert",      // __assert for logging
+      "type_traits",  // std::is_same_v
+      "utility",      // std::mode/forward for value
+      "variant",      // union's impl
+  };
+  if (decl.IsFixedSize()) {
+    union_headers.insert("tuple");  // fixed-sized union's typelist
+  }
+  return union_headers;
+}
+
+// fixed-sized union class looks like:
+// class Union {
+// public:
+//   enum Tag : uint8_t {
+//     field1 = 0,
+//     field2,
+//   };
+//  ... methods ...
+// private:
+//   Tag _tag;
+//   union {
+//     type1 field1;
+//     type2 field2;
+//   } _value;
+// };
+
+void UnionWriter::PrivateFields(CodeWriter& out) const {
+  if (decl.IsFixedSize()) {
+    AIDL_FATAL_IF(decl.GetFields().empty(), decl) << "Union '" << decl.GetName() << "' is empty.";
+    const auto& first_field = decl.GetFields()[0];
+    const auto& default_name = first_field->GetName();
+    const auto& default_value = name_of(first_field->GetType(), typenames) + "(" +
+                                first_field->ValueString(decorator) + ")";
+
+    out << "Tag _tag = " << default_name << ";\n";
+    out << "union _value_t {\n";
+    out.Indent();
+    out << "_value_t() {}\n";
+    out << "~_value_t() {}\n";
+    for (const auto& f : decl.GetFields()) {
+      const auto& fn = f->GetName();
+      out << name_of(f->GetType(), typenames) << " " << fn;
+      if (decl.IsFixedSize()) {
+        int alignment = AlignmentOf(f->GetType(), typenames);
+        if (alignment > 0) {
+          out << " __attribute__((aligned (" << std::to_string(alignment) << ")))";
+        }
+      }
+      if (fn == default_name) {
+        out << " = " << default_value;
+      }
+      out << ";\n";
+    }
+    out.Dedent();
+    out << "} _value;\n";
+  } else {
+    vector<string> field_types;
+    for (const auto& f : decl.GetFields()) {
+      field_types.push_back(name_of(f->GetType(), typenames));
+    }
+    out << "std::variant<" + Join(field_types, ", ") + "> _value;\n";
+  }
+}
+
+void UnionWriter::PublicFields(CodeWriter& out) const {
+  out << "// Expose tag symbols for legacy code\n";
+  for (const auto& f : decl.GetFields()) {
+    out << "static const inline Tag";
+    GenerateDeprecated(out, *f);
+    out << " " << f->GetName() << " = Tag::" << f->GetName() << ";\n";
+  }
+
+  const auto& name = decl.GetName();
+
+  if (decl.IsFixedSize()) {
+    vector<string> field_types;
+    for (const auto& f : decl.GetFields()) {
+      field_types.push_back(name_of(f->GetType(), typenames));
+    }
+    auto typelist = Join(field_types, ", ");
+    auto tmpl = R"--(
+template <Tag _Tag>
+using _at = typename std::tuple_element<static_cast<size_t>(_Tag), std::tuple<{typelist}>>::type;
+template <Tag _Tag, typename _Type>
+static {name} make(_Type&& _arg) {{
+  {name} _inst;
+  _inst.set<_Tag>(std::forward<_Type>(_arg));
+  return _inst;
+}}
+constexpr Tag getTag() const {{
+  return _tag;
+}}
+template <Tag _Tag>
+const _at<_Tag>& get() const {{
+  if (_Tag != _tag) {{ __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }}
+  return *(_at<_Tag>*)(&_value);
+}}
+template <Tag _Tag>
+_at<_Tag>& get() {{
+  if (_Tag != _tag) {{ __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }}
+  return *(_at<_Tag>*)(&_value);
+}}
+template <Tag _Tag, typename _Type>
+void set(_Type&& _arg) {{
+  _tag = _Tag;
+  get<_Tag>() = std::forward<_Type>(_arg);
+}}
+)--";
+    out << fmt::format(tmpl, fmt::arg("name", name), fmt::arg("typelist", typelist));
+  } else {
+    AIDL_FATAL_IF(decl.GetFields().empty(), decl) << "Union '" << name << "' is empty.";
+    const auto& first_field = decl.GetFields()[0];
+    const auto& default_name = first_field->GetName();
+    const auto& default_value = name_of(first_field->GetType(), typenames) + "(" +
+                                first_field->ValueString(decorator) + ")";
+
+    auto tmpl = R"--(
+template<typename _Tp>
+static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, {name}>;
+
+{name}() : _value(std::in_place_index<static_cast<size_t>({default_name})>, {default_value}) {{ }}
+
+template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+// NOLINTNEXTLINE(google-explicit-constructor)
+constexpr {name}(_Tp&& _arg)
+    : _value(std::forward<_Tp>(_arg)) {{}}
+
+template <size_t _Np, typename... _Tp>
+constexpr explicit {name}(std::in_place_index_t<_Np>, _Tp&&... _args)
+    : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {{}}
+
+template <Tag _tag, typename... _Tp>
+static {name} make(_Tp&&... _args) {{
+  return {name}(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+}}
+
+template <Tag _tag, typename _Tp, typename... _Up>
+static {name} make(std::initializer_list<_Tp> _il, _Up&&... _args) {{
+  return {name}(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+}}
+
+Tag getTag() const {{
+  return static_cast<Tag>(_value.index());
+}}
+
+template <Tag _tag>
+const auto& get() const {{
+  if (getTag() != _tag) {{ __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }}
+  return std::get<static_cast<size_t>(_tag)>(_value);
+}}
+
+template <Tag _tag>
+auto& get() {{
+  if (getTag() != _tag) {{ __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }}
+  return std::get<static_cast<size_t>(_tag)>(_value);
+}}
+
+template <Tag _tag, typename... _Tp>
+void set(_Tp&&... _args) {{
+  _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+}}
+
+)--";
+    out << fmt::format(tmpl, fmt::arg("name", name), fmt::arg("default_name", default_name),
+                       fmt::arg("default_value", default_value));
+  }
+}
+
+void UnionWriter::ReadFromParcel(CodeWriter& out, const ParcelWriterContext& ctx) const {
+  // Even though @FixedSize union may use a smaller type than int32_t, we need to read/write it
+  // as if it is int32_t for compatibility with other bckends.
+  auto tag_type = typenames.MakeResolvedType(AIDL_LOCATION_HERE, "int", /* is_array= */ false);
+
+  const string tag = "_aidl_tag";
+  const string value = "_aidl_value";
+  const string status = "_aidl_ret_status";
+
+  auto read_var = [&](const string& var, const AidlTypeSpecifier& type) {
+    out << fmt::format("{} {};\n", name_of(type, typenames), var);
+    out << fmt::format("if (({} = ", status);
+    ctx.read_func(out, var, type);
+    out << fmt::format(") != {}) return {};\n", ctx.status_ok, status);
+  };
+
+  out << fmt::format("{} {};\n", ctx.status_type, status);
+  read_var(tag, *tag_type);
+  out << fmt::format("switch (static_cast<Tag>({})) {{\n", tag);
+  for (const auto& variable : decl.GetFields()) {
+    out << fmt::format("case {}: {{\n", variable->GetName());
+    out.Indent();
+    if (variable->IsNew()) {
+      out << fmt::format("if (true) return {};\n", ctx.status_bad);
+    }
+    const auto& type = variable->GetType();
+    read_var(value, type);
+    out << fmt::format("if constexpr (std::is_trivially_copyable_v<{}>) {{\n",
+                       name_of(type, typenames));
+    out.Indent();
+    out << fmt::format("set<{}>({});\n", variable->GetName(), value);
+    out.Dedent();
+    out << "} else {\n";
+    out.Indent();
+    // Even when the `if constexpr` is false, the compiler runs the tidy check for the
+    // next line, which doesn't make sense. Silence the check for the unreachable code.
+    out << "// NOLINTNEXTLINE(performance-move-const-arg)\n";
+    out << fmt::format("set<{}>(std::move({}));\n", variable->GetName(), value);
+    out.Dedent();
+    out << "}\n";
+    out << fmt::format("return {}; }}\n", ctx.status_ok);
+    out.Dedent();
+  }
+  out << "}\n";
+  out << fmt::format("return {};\n", ctx.status_bad);
+}
+
+void UnionWriter::WriteToParcel(CodeWriter& out, const ParcelWriterContext& ctx) const {
+  // Even though @FixedSize union may use a smaller type than int32_t, we need to read/write it
+  // as if it is int32_t for compatibility with other bckends.
+  auto tag_type = typenames.MakeResolvedType(AIDL_LOCATION_HERE, "int", /* is_array= */ false);
+
+  const string tag = "_aidl_tag";
+  const string value = "_aidl_value";
+  const string status = "_aidl_ret_status";
+
+  out << fmt::format("{} {} = ", ctx.status_type, status);
+  ctx.write_func(out, "static_cast<int32_t>(getTag())", *tag_type);
+  out << ";\n";
+  out << fmt::format("if ({} != {}) return {};\n", status, ctx.status_ok, status);
+  out << "switch (getTag()) {\n";
+  for (const auto& variable : decl.GetFields()) {
+    if (variable->IsDeprecated()) {
+      out << "#pragma clang diagnostic push\n";
+      out << "#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n";
+    }
+    if (variable->IsNew()) {
+      out << fmt::format("case {}: return true ? {} : ", variable->GetName(), ctx.status_bad);
+    } else {
+      out << fmt::format("case {}: return ", variable->GetName());
+    }
+    ctx.write_func(out, "get<" + variable->GetName() + ">()", variable->GetType());
+    out << ";\n";
+    if (variable->IsDeprecated()) {
+      out << "#pragma clang diagnostic pop\n";
+    }
+  }
+  out << "}\n";
+  out << "__assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, \"can't reach here\");\n";
+}
+
+std::string CppConstantValueDecorator(
+    const AidlTypeSpecifier& type,
+    const std::variant<std::string, std::vector<std::string>>& raw_value, bool is_ndk) {
+  if (type.IsArray()) {
+    auto values = std::get<std::vector<std::string>>(raw_value);
+    // Hexadecimal literals for byte arrays should be casted to uint8_t
+    if (type.GetName() == "byte" &&
+        std::any_of(values.begin(), values.end(),
+                    [](const auto& value) { return !value.empty() && value[0] == '-'; })) {
+      for (auto& value : values) {
+        // cast only if necessary
+        if (value[0] == '-') {
+          value = "uint8_t(" + value + ")";
+        }
+      }
+    }
+    std::string value = "{" + Join(values, ", ") + "}";
+
+    if (type.IsFixedSizeArray()) {
+      // For arrays, use double braces because arrays can be nested.
+      //  e.g.) array<array<int, 2>, 3> ints = {{ {{1,2}}, {{3,4}}, {{5,6}} }};
+      // Vectors might need double braces, but since we don't have nested vectors (yet)
+      // single brace would work even for optional vectors.
+      value = "{" + value + "}";
+    }
+
+    if (!type.IsMutated() && type.IsNullable()) {
+      // For outermost std::optional<>, we need an additional brace pair to initialize its value.
+      value = "{" + value + "}";
+    }
+    return value;
+  }
+
+  const std::string& value = std::get<std::string>(raw_value);
+  if (AidlTypenames::IsBuiltinTypename(type.GetName())) {
+    if (type.GetName() == "boolean") {
+      return value;
+    } else if (type.GetName() == "byte") {
+      return value;
+    } else if (type.GetName() == "char") {
+      // TODO: consider 'L'-prefix for wide char literal
+      return value;
+    } else if (type.GetName() == "double") {
+      return value;
+    } else if (type.GetName() == "float") {
+      return value;  // value has 'f' suffix
+    } else if (type.GetName() == "int") {
+      return value;
+    } else if (type.GetName() == "long") {
+      return value + "L";
+    } else if (type.GetName() == "String") {
+      if (is_ndk || type.IsUtf8InCpp()) {
+        return value;
+      } else {
+        return "::android::String16(" + value + ")";
+      }
+    }
+    AIDL_FATAL(type) << "Unknown built-in type: " << type.GetName();
+  }
+
+  auto defined_type = type.GetDefinedType();
+  AIDL_FATAL_IF(!defined_type, type) << "Invalid type for \"" << value << "\"";
+  auto enum_type = defined_type->AsEnumDeclaration();
+  AIDL_FATAL_IF(!enum_type, type) << "Invalid type for \"" << value << "\"";
+
+  auto cpp_type_name = "::" + Join(Split(enum_type->GetCanonicalName(), "."), "::");
+  if (is_ndk) {
+    cpp_type_name = "::aidl" + cpp_type_name;
+  }
+  return cpp_type_name + "::" + value.substr(value.find_last_of('.') + 1);
+}
+
+// Collect all forward declarations for the type's interface header.
+// Nested types are visited as well via VisitTopDown.
+void GenerateForwardDecls(CodeWriter& out, const AidlDefinedType& root_type, bool is_ndk) {
+  struct Visitor : AidlVisitor {
+    using PackagePath = std::vector<std::string>;
+    struct ClassDeclInfo {
+      std::string template_decl;
+    };
+    std::map<PackagePath, std::map<std::string, ClassDeclInfo>> classes;
+    // Collect class names for each interface or parcelable type
+    void Visit(const AidlTypeSpecifier& type) override {
+      const auto defined_type = type.GetDefinedType();
+      if (defined_type && !defined_type->GetParentType()) {
+        // Forward declarations are not supported for nested types
+        auto package = defined_type->GetSplitPackage();
+        if (defined_type->AsInterface() != nullptr) {
+          auto name = ClassName(*defined_type, ClassNames::INTERFACE);
+          classes[package][std::move(name)] = ClassDeclInfo();
+        } else if (auto* p = defined_type->AsStructuredParcelable(); p != nullptr) {
+          auto name = defined_type->GetName();
+          ClassDeclInfo info;
+          info.template_decl = TemplateDecl(*p);
+          classes[package][std::move(name)] = std::move(info);
+        }
+      }
+    }
+  } v;
+  VisitTopDown(v, root_type);
+
+  if (v.classes.empty()) {
+    return;
+  }
+
+  for (const auto& it : v.classes) {
+    auto package = it.first;
+    auto& classes = it.second;
+
+    if (is_ndk) {
+      package.insert(package.begin(), "aidl");
+    }
+
+    std::string namespace_name = Join(package, "::");
+    if (!namespace_name.empty()) {
+      out << "namespace " << namespace_name << " {\n";
+    }
+    for (const auto& [name, info] : classes) {
+      out << info.template_decl << "class " << name << ";\n";
+    }
+    if (!namespace_name.empty()) {
+      out << "}  // namespace " << namespace_name << "\n";
+    }
+  }
+}
+}  // namespace cpp
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_to_cpp_common.h b/aidl_to_cpp_common.h
new file mode 100644
index 0000000..94904cc
--- /dev/null
+++ b/aidl_to_cpp_common.h
@@ -0,0 +1,164 @@
+/*
+ * Copyright (C) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <functional>
+#include <string>
+#include <type_traits>
+
+#include "aidl_language.h"
+
+// This is used to help generate code targetting C++ (the language) whether using the libbinder or
+// libbinder_ndk backend.
+
+namespace android {
+namespace aidl {
+namespace cpp {
+
+extern char kTransactionLogStruct[];
+
+// These roughly correspond to the various class names in the C++ hierarchy:
+enum class ClassNames {
+  BASE,             // Foo (not a real class, but useful in some circumstances).
+  CLIENT,           // BpFoo
+  SERVER,           // BnFoo
+  INTERFACE,        // IFoo
+  DEFAULT_IMPL,     // IFooDefault
+  RAW,              // (as shown in the file)
+  DELEGATOR_IMPL,   // IFooDelegator
+  MAYBE_INTERFACE,  // == INTERFACE for AidlInterface, == RAW for other types
+};
+
+string ClassName(const AidlDefinedType& defined_type, ClassNames type);
+
+// Return the alignment of known types and enum backing types.
+// If the alignment is unknown, or it is a FizedSize parcelable with its
+// own guaranteed alignment(so it does not need to be specified), 0 will be
+// returned.
+size_t AlignmentOf(const AidlTypeSpecifier& type, const AidlTypenames& typenames);
+
+// Generate the relative path to a header file.  If |use_os_sep| we'll use the
+// operating system specific path separator rather than C++'s expected '/' when
+// including headers.
+std::string HeaderFile(const AidlDefinedType& defined_type, ClassNames class_type,
+                       bool use_os_sep = true);
+
+bool ValidateOutputFilePath(const string& output_file, const Options& options,
+                            const AidlDefinedType& defined_type);
+
+void EnterNamespace(CodeWriter& out, const AidlDefinedType& defined_type);
+void LeaveNamespace(CodeWriter& out, const AidlDefinedType& defined_type);
+
+string BuildVarName(const AidlArgument& a);
+const string GenLogBeforeExecute(const string className, const AidlMethod& method, bool isServer,
+                                 bool isNdk);
+const string GenLogAfterExecute(const string className, const AidlInterface& interface,
+                                const AidlMethod& method, const string& statusVarName,
+                                const string& returnVarName, bool isServer, bool isNdk);
+
+template <typename T, typename = std::enable_if_t<std::is_copy_constructible_v<T>>>
+std::vector<T> Append(std::vector<T> as, const std::vector<T>& bs) {
+  as.insert(as.end(), bs.begin(), bs.end());
+  return as;
+}
+
+template <typename T>
+std::vector<T> Append(std::vector<T>&& as, std::vector<T>&& bs) {
+  std::vector<T> appended = std::move(as);
+  std::copy(std::move_iterator(bs.begin()), std::move_iterator(bs.end()),
+            std::back_inserter(appended));
+  return appended;
+}
+
+// Returns Parent1::Parent2::Self. Namespaces are not included.
+std::string GetQualifiedName(const AidlDefinedType& type, ClassNames name = ClassNames::RAW);
+
+void GenerateEnumClassDecl(CodeWriter& out, const AidlEnumDeclaration& enum_decl,
+                           const std::string& backing_type, ::ConstantValueDecorator decorator);
+std::string GenerateEnumToString(const AidlEnumDeclaration& enum_decl,
+                                 const std::string& backing_type);
+std::string GenerateEnumValues(const AidlEnumDeclaration& enum_decl,
+                               const std::vector<std::string>& enclosing_namespaces_of_enum_decl);
+std::string TemplateDecl(const AidlParcelable& defined_type);
+
+void GenerateParcelableComparisonOperators(CodeWriter& out, const AidlParcelable& parcelable);
+
+void GenerateToString(CodeWriter& out, const AidlStructuredParcelable& parcelable);
+void GenerateToString(CodeWriter& out, const AidlUnionDecl& parcelable);
+
+std::string GetDeprecatedAttribute(const AidlCommentable& type);
+
+template <typename Stream>
+void GenerateDeprecated(Stream& out, const AidlCommentable& type) {
+  if (auto deprecated = GetDeprecatedAttribute(type); !deprecated.empty()) {
+    out << " " + deprecated;
+  }
+}
+
+struct ParcelWriterContext {
+  string status_type;
+  string status_ok;
+  string status_bad;
+  std::function<void(CodeWriter& out, const std::string& var, const AidlTypeSpecifier& type)>
+      read_func;
+  std::function<void(CodeWriter& out, const std::string& value, const AidlTypeSpecifier& type)>
+      write_func;
+};
+
+struct UnionWriter {
+  const AidlUnionDecl& decl;
+  const AidlTypenames& typenames;
+  const std::function<std::string(const AidlTypeSpecifier&, const AidlTypenames&)> name_of;
+  const ::ConstantValueDecorator& decorator;
+
+  static std::set<std::string> GetHeaders(const AidlUnionDecl&);
+
+  void PrivateFields(CodeWriter& out) const;
+  void PublicFields(CodeWriter& out) const;
+  void ReadFromParcel(CodeWriter& out, const ParcelWriterContext&) const;
+  void WriteToParcel(CodeWriter& out, const ParcelWriterContext&) const;
+};
+
+std::string CppConstantValueDecorator(
+    const AidlTypeSpecifier& type,
+    const std::variant<std::string, std::vector<std::string>>& raw_value, bool is_ndk);
+
+void GenerateForwardDecls(CodeWriter& out, const AidlDefinedType& root_type, bool is_ndk);
+
+struct ClangDiagnosticIgnoreDeprecated {
+  CodeWriter& out;
+  bool deprecated;
+  ClangDiagnosticIgnoreDeprecated(CodeWriter& out, bool deprecated)
+      : out(out), deprecated(deprecated) {
+    // enter
+    if (deprecated) {
+      out << "#pragma clang diagnostic push\n";
+      out << "#pragma clang diagnostic ignored \"-Wdeprecated-declarations\"\n";
+    }
+  }
+  ~ClangDiagnosticIgnoreDeprecated() {
+    // exit
+    if (deprecated) {
+      out << "#pragma clang diagnostic pop\n";
+    }
+  }
+};
+
+bool HasDeprecatedField(const AidlParcelable& parcelable);
+}  // namespace cpp
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_to_java.cpp b/aidl_to_java.cpp
new file mode 100644
index 0000000..acbe6fe
--- /dev/null
+++ b/aidl_to_java.cpp
@@ -0,0 +1,1000 @@
+/*
+ * Copyright (C) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl_to_java.h"
+#include "aidl_language.h"
+#include "aidl_typenames.h"
+#include "logging.h"
+
+#include <android-base/strings.h>
+
+#include <functional>
+#include <iostream>
+#include <map>
+#include <string>
+#include <vector>
+
+namespace android {
+namespace aidl {
+namespace java {
+
+using android::base::Join;
+
+using std::function;
+using std::map;
+using std::string;
+using std::vector;
+
+std::string ConstantValueDecorator(
+    const AidlTypeSpecifier& type,
+    const std::variant<std::string, std::vector<std::string>>& raw_value) {
+  if (type.IsArray()) {
+    const auto& values = std::get<std::vector<std::string>>(raw_value);
+    return "{" + Join(values, ", ") + "}";
+  }
+  const std::string& value = std::get<std::string>(raw_value);
+  if (type.GetName() == "long") {
+    return value + "L";
+  }
+  if (auto defined_type = type.GetDefinedType(); defined_type) {
+    auto enum_type = defined_type->AsEnumDeclaration();
+    AIDL_FATAL_IF(!enum_type, type) << "Invalid type for \"" << value << "\"";
+    return type.GetName() + "." + value.substr(value.find_last_of('.') + 1);
+  }
+  return value;
+};
+
+const string& JavaNameOf(const AidlTypeSpecifier& aidl, bool instantiable = false,
+                         bool boxing = false) {
+  AIDL_FATAL_IF(!aidl.IsResolved(), aidl) << aidl.ToString();
+
+  if (instantiable) {
+    // An instantiable type is used in only out type(not even inout type),
+    // And instantiable type has to be either the type in List, Map, ParcelFileDescriptor or
+    // user-defined type.
+
+    static map<string, string> instantiable_m = {
+        {"List", "java.util.ArrayList"},
+        {"Map", "java.util.HashMap"},
+        {"ParcelFileDescriptor", "android.os.ParcelFileDescriptor"},
+    };
+    const string& aidl_name = aidl.GetName();
+
+    if (instantiable_m.find(aidl_name) != instantiable_m.end()) {
+      return instantiable_m[aidl_name];
+    }
+  }
+
+  // map from AIDL built-in type name to the corresponding Java type name
+  static map<string, string> m = {
+      {"void", "void"},
+      {"boolean", "boolean"},
+      {"byte", "byte"},
+      {"char", "char"},
+      {"int", "int"},
+      {"long", "long"},
+      {"float", "float"},
+      {"double", "double"},
+      {"String", "java.lang.String"},
+      {"List", "java.util.List"},
+      {"Map", "java.util.Map"},
+      {"IBinder", "android.os.IBinder"},
+      {"FileDescriptor", "java.io.FileDescriptor"},
+      {"CharSequence", "java.lang.CharSequence"},
+      {"ParcelFileDescriptor", "android.os.ParcelFileDescriptor"},
+      {"ParcelableHolder", "android.os.ParcelableHolder"},
+  };
+
+  // map from primitive types to the corresponding boxing types
+  static map<string, string> boxing_types = {
+      {"void", "Void"},   {"boolean", "Boolean"}, {"byte", "Byte"},   {"char", "Character"},
+      {"int", "Integer"}, {"long", "Long"},       {"float", "Float"}, {"double", "Double"},
+  };
+
+  // Enums in Java are represented by their backing type when
+  // referenced in parcelables, methods, etc.
+  const auto defined_type = aidl.GetDefinedType();
+  if (defined_type && defined_type->AsEnumDeclaration()) {
+    const auto enum_decl = defined_type->AsEnumDeclaration();
+    const string& backing_type_name = enum_decl->GetBackingType().GetName();
+    AIDL_FATAL_IF(m.find(backing_type_name) == m.end(), enum_decl);
+    AIDL_FATAL_IF(!AidlTypenames::IsBuiltinTypename(backing_type_name), enum_decl);
+    if (boxing) {
+      return boxing_types[backing_type_name];
+    } else {
+      return m[backing_type_name];
+    }
+  }
+
+  const string& aidl_name = aidl.GetName();
+  if (boxing && AidlTypenames::IsPrimitiveTypename(aidl_name)) {
+    // Every primitive type must have the corresponding boxing type
+    AIDL_FATAL_IF(boxing_types.find(aidl_name) == m.end(), aidl);
+    return boxing_types[aidl_name];
+  }
+  if (m.find(aidl_name) != m.end()) {
+    AIDL_FATAL_IF(!AidlTypenames::IsBuiltinTypename(aidl_name), aidl);
+    return m[aidl_name];
+  } else {
+    // 'foo.bar.IFoo' in AIDL maps to 'foo.bar.IFoo' in Java
+    return aidl_name;
+  }
+}
+
+namespace {
+string JavaSignatureOfInternal(const AidlTypeSpecifier& aidl, bool instantiable, bool omit_array,
+                               bool boxing) {
+  string ret = JavaNameOf(aidl, instantiable, boxing && !aidl.IsArray());
+  if (aidl.IsGeneric()) {
+    vector<string> arg_names;
+    for (const auto& ta : aidl.GetTypeParameters()) {
+      arg_names.emplace_back(JavaSignatureOfInternal(*ta, /*instantiable=*/false,
+                                                     /*omit_array=*/false, /*boxing=*/true));
+    }
+    ret += "<" + Join(arg_names, ",") + ">";
+  }
+  if (aidl.IsArray() && !omit_array) {
+    if (aidl.IsFixedSizeArray()) {
+      ret += Join(std::vector<std::string>(aidl.GetFixedSizeArrayDimensions().size(), "[]"), "");
+    } else {
+      ret += "[]";
+    }
+  }
+  return ret;
+}
+
+// Returns the name of the backing type for the specified type.
+// Note: Do not use the result in the generated code! It's supposed to be used as a key.
+// This returns type names as used in AIDL, not a Java signature.
+// For enums, this is the enum's backing type.
+// For all other types, this is the type itself.
+string AidlBackingTypeName(const AidlTypeSpecifier& type) {
+  string type_name;
+  const auto defined_type = type.GetDefinedType();
+  if (defined_type && defined_type->AsEnumDeclaration()) {
+    const AidlEnumDeclaration* enum_decl = defined_type->AsEnumDeclaration();
+    type_name = enum_decl->GetBackingType().GetName();
+  } else {
+    type_name = type.GetName();
+  }
+  if (type.IsArray()) {
+    if (type.IsFixedSizeArray()) {
+      for (const auto& dim : type.GetFixedSizeArrayDimensions()) {
+        type_name += "[" + std::to_string(dim) + "]";
+      }
+    } else {
+      type_name += "[]";
+    }
+  }
+  return type_name;
+}
+
+}  // namespace
+
+string JavaSignatureOf(const AidlTypeSpecifier& aidl) {
+  return JavaSignatureOfInternal(aidl, /*instantiable=*/false, /*omit_array=*/false,
+                                 /*boxing=*/false);
+}
+
+// Used for "new" expression. Ignore arrays because "new" expression handles it.
+string InstantiableJavaSignatureOf(const AidlTypeSpecifier& aidl) {
+  return JavaSignatureOfInternal(aidl, /*instantiable=*/true, /*omit_array=*/true,
+                                 /*boxing=*/false);
+}
+
+string JavaBoxingTypeOf(const AidlTypeSpecifier& aidl) {
+  AIDL_FATAL_IF(!AidlTypenames::IsPrimitiveTypename(aidl.GetName()), aidl);
+  return JavaSignatureOfInternal(aidl, /*instantiable=*/false, /*omit_array=*/false,
+                                 /*boxing=*/true);
+}
+
+string DefaultJavaValueOf(const AidlTypeSpecifier& aidl) {
+  static map<string, string> m = {
+      {"boolean", "false"}, {"byte", "0"},     {"char", R"('\u0000')"}, {"int", "0"},
+      {"long", "0L"},       {"float", "0.0f"}, {"double", "0.0d"},
+  };
+
+  const string name = AidlBackingTypeName(aidl);
+  AIDL_FATAL_IF(name == "void", aidl);
+
+  if (!aidl.IsArray() && m.find(name) != m.end()) {
+    AIDL_FATAL_IF(!AidlTypenames::IsBuiltinTypename(name), aidl);
+    return m[name];
+  } else {
+    return "null";
+  }
+}
+
+typedef void (*ParcelHelperGenerator)(CodeWriter&, const Options&);
+
+static void GenerateTypedObjectHelper(CodeWriter& out, const Options&) {
+  // Note that the name is inconsistent here because Parcel.java defines readTypedObject as if it
+  // "creates" a new value from a parcel. "in-place" read function is not necessary because
+  // user-defined parcelable defines its readFromParcel.
+  out << R"(static private <T> T readTypedObject(
+    android.os.Parcel parcel,
+    android.os.Parcelable.Creator<T> c) {
+  if (parcel.readInt() != 0) {
+      return c.createFromParcel(parcel);
+  } else {
+      return null;
+  }
+}
+static private <T extends android.os.Parcelable> void writeTypedObject(
+    android.os.Parcel parcel, T value, int parcelableFlags) {
+  if (value != null) {
+    parcel.writeInt(1);
+    value.writeToParcel(parcel, parcelableFlags);
+  } else {
+    parcel.writeInt(0);
+  }
+}
+)";
+}
+
+static void GenerateTypedListHelper(CodeWriter& out, const Options& options) {
+  out << R"(static private <T extends android.os.Parcelable> void writeTypedList(
+    android.os.Parcel parcel, java.util.List<T> value, int parcelableFlags) {
+  if (value == null) {
+    parcel.writeInt(-1);
+  } else {
+    int N = value.size();
+    int i = 0;
+    parcel.writeInt(N);
+    while (i < N) {
+)";
+
+  if (options.GetMinSdkVersion() < 23u) {
+    out << "writeTypedObject(parcel, value.get(i), parcelableFlags);";
+  } else {
+    out << "parcel.writeTypedObject(value.get(i), parcelableFlags);";
+  }
+
+  out << R"(
+      i++;
+    }
+  }
+}
+)";
+}
+
+void GenerateParcelHelpers(CodeWriter& out, const AidlDefinedType& defined_type,
+                           const AidlTypenames& typenames, const Options& options) {
+  // root-level type contains all necessary helpers
+  if (defined_type.GetParentType()) {
+    return;
+  }
+  // visits method parameters and parcelable fields to collect types which
+  // requires read/write/create helpers.
+  struct Visitor : AidlVisitor {
+    const AidlTypenames& typenames;
+    const Options& options;
+    set<ParcelHelperGenerator> helpers;
+    Visitor(const AidlTypenames& typenames, const Options& options)
+        : typenames(typenames), options(options) {}
+    void Visit(const AidlTypeSpecifier& type) override {
+      auto name = type.GetName();
+      if (auto defined_type = type.GetDefinedType(); defined_type) {
+        if (defined_type->AsParcelable() != nullptr && !type.IsArray()) {
+          // TypedObjects are supported since 23. So we don't need helpers.
+          if (options.GetMinSdkVersion() < 23u) {
+            helpers.insert(&GenerateTypedObjectHelper);
+          }
+        }
+      } else {
+        // There's parcelable-like built-in types as well.
+        if (name == "ParcelFileDescriptor" || name == "CharSequence") {
+          if (!type.IsArray()) {
+            // TypedObjects are supported since 23. So we don't need helpers.
+            if (options.GetMinSdkVersion() < 23u) {
+              helpers.insert(&GenerateTypedObjectHelper);
+            }
+          }
+        }
+
+        if (name == "List" && type.IsGeneric()) {
+          const auto& element_name = type.GetTypeParameters()[0]->GetName();
+          if (typenames.IsParcelable(element_name) && options.GetMinSdkVersion() <= 33u) {
+            helpers.insert(&GenerateTypedListHelper);
+          }
+        }
+      }
+    }
+  } v{typenames, options};
+
+  VisitTopDown(v, defined_type);
+  if (!v.helpers.empty()) {
+    // Nested class (_Parcel) is used to contain static helper methods because some targets are
+    // still using Java 7 which doesn't allow interfaces to have static methods.
+    // Helpers shouldn't bother API checks, but in case where AIDL types are not marked `@hide`
+    // explicitly marks the helper class as @hide.
+    out << "/** @hide */\n";
+    out << "static class _Parcel {\n";
+    out.Indent();
+    for (const auto& helper : v.helpers) {
+      helper(out, options);
+    }
+    out.Dedent();
+    out << "}\n";
+  }
+}
+
+void WriteToParcelFor(const CodeGeneratorContext& c) {
+  static map<string, function<void(const CodeGeneratorContext&)>> method_map{
+      {"boolean",
+       [](const CodeGeneratorContext& c) {
+         if (c.min_sdk_version >= 29u) {
+           c.writer << c.parcel << ".writeBoolean(" << c.var << ");\n";
+         } else {
+           c.writer << c.parcel << ".writeInt(((" << c.var << ")?(1):(0)));\n";
+         }
+       }},
+      {"boolean[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeBooleanArray(" << c.var << ");\n";
+       }},
+      {"byte",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeByte(" << c.var << ");\n";
+       }},
+      {"byte[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeByteArray(" << c.var << ");\n";
+       }},
+      {"char",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeInt(((int)" << c.var << "));\n";
+       }},
+      {"char[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeCharArray(" << c.var << ");\n";
+       }},
+      {"int",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeInt(" << c.var << ");\n";
+       }},
+      {"int[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeIntArray(" << c.var << ");\n";
+       }},
+      {"long",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeLong(" << c.var << ");\n";
+       }},
+      {"long[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeLongArray(" << c.var << ");\n";
+       }},
+      {"float",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeFloat(" << c.var << ");\n";
+       }},
+      {"float[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeFloatArray(" << c.var << ");\n";
+       }},
+      {"double",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeDouble(" << c.var << ");\n";
+       }},
+      {"double[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeDoubleArray(" << c.var << ");\n";
+       }},
+      {"String",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeString(" << c.var << ");\n";
+       }},
+      {"String[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeStringArray(" << c.var << ");\n";
+       }},
+      {"List",
+       [](const CodeGeneratorContext& c) {
+         if (c.type.IsGeneric()) {
+           AIDL_FATAL_IF(c.type.GetTypeParameters().size() != 1, c.type);
+           const auto& element_type = *c.type.GetTypeParameters().at(0);
+           const auto& element_type_name = element_type.GetName();
+           if (element_type_name == "String") {
+             c.writer << c.parcel << ".writeStringList(" << c.var << ");\n";
+           } else if (element_type_name == "IBinder") {
+             c.writer << c.parcel << ".writeBinderList(" << c.var << ");\n";
+           } else if (c.typenames.IsParcelable(element_type_name)) {
+             if (c.min_sdk_version > 33u) {
+               c.writer << c.parcel << ".writeTypedList(" << c.var << ", " << c.write_to_parcel_flag
+                        << ");\n";
+             } else {
+               c.writer << "_Parcel.writeTypedList(" << c.parcel << ", " << c.var << ", "
+                        << c.write_to_parcel_flag << ");\n";
+             }
+           } else if (c.typenames.GetInterface(element_type)) {
+             c.writer << c.parcel << ".writeInterfaceList(" << c.var << ");\n";
+           } else {
+             AIDL_FATAL(c.type) << "write: NOT IMPLEMENTED for " << element_type_name;
+           }
+         } else {
+           c.writer << c.parcel << ".writeList(" << c.var << ");\n";
+         }
+       }},
+      {"Map",
+       [](const CodeGeneratorContext& c) {
+         if (c.type.IsGeneric()) {
+           c.writer << "if (" << c.var << " == null) {\n";
+           c.writer.Indent();
+           c.writer << c.parcel << ".writeInt(-1);\n";
+           c.writer.Dedent();
+           c.writer << "} else {\n";
+           c.writer.Indent();
+           c.writer << c.parcel << ".writeInt(" << c.var << ".size());\n";
+           c.writer << c.var << ".forEach((k, v) -> {\n";
+           c.writer.Indent();
+           c.writer << c.parcel << ".writeString(k);\n";
+
+           CodeGeneratorContext value_context{
+               c.writer,
+               c.typenames,
+               *c.type.GetTypeParameters()[1].get(),
+               c.parcel,
+               "v",
+               c.min_sdk_version,
+               c.write_to_parcel_flag,
+               c.is_classloader_created,
+           };
+           WriteToParcelFor(value_context);
+           c.writer.Dedent();
+           c.writer << "});\n";
+
+           c.writer.Dedent();
+           c.writer << "}\n";
+         } else {
+           c.writer << c.parcel << ".writeMap(" << c.var << ");\n";
+         }
+       }},
+      {"IBinder",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeStrongBinder(" << c.var << ");\n";
+       }},
+      {"IBinder[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeBinderArray(" << c.var << ");\n";
+       }},
+      {"FileDescriptor",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeRawFileDescriptor(" << c.var << ");\n";
+       }},
+      {"FileDescriptor[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeRawFileDescriptorArray(" << c.var << ");\n";
+       }},
+      {"ParcelFileDescriptor",
+       [](const CodeGeneratorContext& c) {
+         if (c.min_sdk_version >= 23u) {
+           c.writer << c.parcel << ".writeTypedObject(" << c.var << ", " << c.write_to_parcel_flag
+                    << ");\n";
+         } else {
+           c.writer << "_Parcel.writeTypedObject(" << c.parcel << ", " << c.var << ", "
+                    << c.write_to_parcel_flag << ");\n";
+         }
+       }},
+      {"ParcelFileDescriptor[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeTypedArray(" << c.var << ", " << c.write_to_parcel_flag
+                  << ");\n";
+       }},
+      {"CharSequence",
+       [](const CodeGeneratorContext& c) {
+         // TextUtils.writeToParcel does not accept null. So, we need to handle
+         // the case here.
+         c.writer << "if (" << c.var << "!=null) {\n";
+         c.writer.Indent();
+         c.writer << c.parcel << ".writeInt(1);\n";
+         c.writer << "android.text.TextUtils.writeToParcel(" << c.var << ", " << c.parcel << ", "
+                  << c.write_to_parcel_flag << ");\n";
+         c.writer.Dedent();
+         c.writer << "}\n";
+         c.writer << "else {\n";
+         c.writer.Indent();
+         c.writer << c.parcel << ".writeInt(0);\n";
+         c.writer.Dedent();
+         c.writer << "}\n";
+       }},
+      {"ParcelableHolder",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".writeTypedObject(" << c.var << ", 0);\n";
+       }},
+  };
+  const string type_name = AidlBackingTypeName(c.type);
+  const auto found = method_map.find(type_name);
+  if (found != method_map.end()) {
+    found->second(c);
+  } else if (c.type.IsFixedSizeArray()) {
+    std::vector<std::string> args = {c.var, c.write_to_parcel_flag};
+    for (auto dim : c.type.GetFixedSizeArrayDimensions()) {
+      args.push_back(std::to_string(dim));
+    }
+    c.writer << c.parcel << ".writeFixedArray(" << Join(args, ", ") << ");\n";
+  } else {
+    const AidlDefinedType* t = c.typenames.TryGetDefinedType(c.type.GetName());
+    AIDL_FATAL_IF(t == nullptr, c.type) << "Unknown type: " << c.type.GetName();
+    if (t->AsInterface() != nullptr) {
+      if (c.type.IsArray()) {
+        c.writer << c.parcel << ".writeInterfaceArray(" << c.var << ");\n";
+      } else {
+        c.writer << c.parcel << ".writeStrongInterface(" << c.var << ");\n";
+      }
+    } else if (t->AsParcelable() != nullptr) {
+      if (c.type.IsArray()) {
+        c.writer << c.parcel << ".writeTypedArray(" << c.var << ", " << c.write_to_parcel_flag
+                 << ");\n";
+      } else {
+        if (c.min_sdk_version >= 23u) {
+          c.writer << c.parcel << ".writeTypedObject(" << c.var << ", " << c.write_to_parcel_flag
+                   << ");\n";
+        } else {
+          c.writer << "_Parcel.writeTypedObject(" << c.parcel << ", " << c.var << ", "
+                   << c.write_to_parcel_flag << ");\n";
+        }
+      }
+    }
+  }
+}
+
+// Ensures that a variable is initialized to refer to the classloader
+// of the current object and returns the name of the variable.
+static string EnsureAndGetClassloader(CodeGeneratorContext& c) {
+  AIDL_FATAL_IF(c.is_classloader_created == nullptr, AIDL_LOCATION_HERE);
+  if (!*(c.is_classloader_created)) {
+    c.writer << "java.lang.ClassLoader cl = "
+             << "(java.lang.ClassLoader)this.getClass().getClassLoader();\n";
+    *(c.is_classloader_created) = true;
+  }
+  return "cl";
+}
+
+bool CreateFromParcelFor(const CodeGeneratorContext& c) {
+  static map<string, function<void(const CodeGeneratorContext&)>> method_map{
+      {"boolean",
+       [](const CodeGeneratorContext& c) {
+         if (c.min_sdk_version >= 29u) {
+           c.writer << c.var << " = " << c.parcel << ".readBoolean();\n";
+         } else {
+           c.writer << c.var << " = (0!=" << c.parcel << ".readInt());\n";
+         }
+       }},
+      {"boolean[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".createBooleanArray();\n";
+       }},
+      {"byte",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".readByte();\n";
+       }},
+      {"byte[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".createByteArray();\n";
+       }},
+      {"char",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = (char)" << c.parcel << ".readInt();\n";
+       }},
+      {"char[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".createCharArray();\n";
+       }},
+      {"int",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".readInt();\n";
+       }},
+      {"int[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".createIntArray();\n";
+       }},
+      {"long",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".readLong();\n";
+       }},
+      {"long[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".createLongArray();\n";
+       }},
+      {"float",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".readFloat();\n";
+       }},
+      {"float[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".createFloatArray();\n";
+       }},
+      {"double",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".readDouble();\n";
+       }},
+      {"double[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".createDoubleArray();\n";
+       }},
+      {"String",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".readString();\n";
+       }},
+      {"String[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".createStringArray();\n";
+       }},
+      {"List",
+       [](const CodeGeneratorContext& c) {
+         if (c.type.IsGeneric()) {
+           AIDL_FATAL_IF(c.type.GetTypeParameters().size() != 1, c.type);
+           const auto& element_type = *c.type.GetTypeParameters().at(0);
+           const auto& element_type_name = element_type.GetName();
+           if (element_type_name == "String") {
+             c.writer << c.var << " = " << c.parcel << ".createStringArrayList();\n";
+           } else if (element_type_name == "IBinder") {
+             c.writer << c.var << " = " << c.parcel << ".createBinderArrayList();\n";
+           } else if (c.typenames.IsParcelable(element_type_name)) {
+             c.writer << c.var << " = " << c.parcel << ".createTypedArrayList("
+                      << JavaNameOf(element_type) << ".CREATOR);\n";
+           } else if (c.typenames.GetInterface(element_type)) {
+             auto as_interface = element_type_name + ".Stub::asInterface";
+             c.writer << c.var << " = " << c.parcel << ".createInterfaceArrayList(" << as_interface
+                      << ");\n";
+           } else {
+             AIDL_FATAL(c.type) << "create: NOT IMPLEMENTED for " << element_type_name;
+           }
+         } else {
+           const string classloader = EnsureAndGetClassloader(const_cast<CodeGeneratorContext&>(c));
+           c.writer << c.var << " = " << c.parcel << ".readArrayList(" << classloader << ");\n";
+         }
+       }},
+      {"Map",
+       [](const CodeGeneratorContext& c) {
+         if (c.type.IsGeneric()) {
+           c.writer << "{\n";
+           c.writer.Indent();
+           c.writer << "int N = " << c.parcel << ".readInt();\n";
+           c.writer << c.var << " = N < 0 ? null : new java.util.HashMap<>();\n";
+
+           auto creator = JavaNameOf(*(c.type.GetTypeParameters().at(1))) + ".CREATOR";
+           c.writer << "java.util.stream.IntStream.range(0, N).forEach(i -> {\n";
+           c.writer.Indent();
+           c.writer << "String k = " << c.parcel << ".readString();\n";
+           c.writer << JavaSignatureOf(*(c.type.GetTypeParameters().at(1))) << " v;\n";
+           CodeGeneratorContext value_context{
+               c.writer,
+               c.typenames,
+               *c.type.GetTypeParameters()[1].get(),
+               c.parcel,
+               "v",
+               c.min_sdk_version,
+               c.write_to_parcel_flag,
+               c.is_classloader_created,
+           };
+           CreateFromParcelFor(value_context);
+           c.writer << c.var << ".put(k, v);\n";
+
+           c.writer.Dedent();
+           c.writer << "});\n";
+
+           c.writer.Dedent();
+           c.writer << "}\n";
+         } else {
+           const string classloader = EnsureAndGetClassloader(const_cast<CodeGeneratorContext&>(c));
+           c.writer << c.var << " = " << c.parcel << ".readHashMap(" << classloader << ");\n";
+         }
+       }},
+      {"IBinder",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".readStrongBinder();\n";
+       }},
+      {"IBinder[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".createBinderArray();\n";
+       }},
+      {"FileDescriptor",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".readRawFileDescriptor();\n";
+       }},
+      {"FileDescriptor[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel << ".createRawFileDescriptorArray();\n";
+       }},
+      {"ParcelFileDescriptor",
+       [](const CodeGeneratorContext& c) {
+         if (c.min_sdk_version >= 23u) {
+           c.writer << c.var << " = " << c.parcel
+                    << ".readTypedObject(android.os.ParcelFileDescriptor.CREATOR);\n";
+         } else {
+           c.writer << c.var << " = _Parcel.readTypedObject(" << c.parcel
+                    << ", android.os.ParcelFileDescriptor.CREATOR);\n";
+         }
+       }},
+      {"ParcelFileDescriptor[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.var << " = " << c.parcel
+                  << ".createTypedArray(android.os.ParcelFileDescriptor.CREATOR);\n";
+       }},
+      {"CharSequence",
+       [](const CodeGeneratorContext& c) {
+         if (c.min_sdk_version >= 23u) {
+           c.writer << c.var << " = " << c.parcel
+                    << ".readTypedObject(android.text.TextUtils.CHAR_SEQUENCE_CREATOR);\n";
+         } else {
+           c.writer << c.var << " = _Parcel.readTypedObject(" << c.parcel
+                    << ", android.text.TextUtils.CHAR_SEQUENCE_CREATOR);\n";
+         }
+       }},
+      {"ParcelableHolder",
+       [](const CodeGeneratorContext& c) {
+         c.writer << "if ((0!=" << c.parcel << ".readInt())) {\n";
+         c.writer.Indent();
+         c.writer << c.var << ".readFromParcel(" << c.parcel << ");\n";
+         c.writer.Dedent();
+         c.writer << "}\n";
+       }},
+  };
+  const auto found = method_map.find(AidlBackingTypeName(c.type));
+  if (found != method_map.end()) {
+    found->second(c);
+  } else if (c.type.IsFixedSizeArray()) {
+    std::vector<std::string> args = {JavaSignatureOf(c.type) + ".class"};
+    if (c.typenames.IsParcelable(c.type.GetName())) {
+      args.push_back(JavaNameOf(c.type) + ".CREATOR");
+    } else if (c.typenames.GetInterface(c.type)) {
+      args.push_back(c.type.GetName() + ".Stub::asInterface");
+    }
+    for (auto dim : c.type.GetFixedSizeArrayDimensions()) {
+      args.push_back(std::to_string(dim));
+    }
+    c.writer << c.var << " = " << c.parcel << ".createFixedArray(" << Join(args, ", ") << ");\n";
+  } else {
+    const AidlDefinedType* t = c.typenames.TryGetDefinedType(c.type.GetName());
+    AIDL_FATAL_IF(t == nullptr, c.type) << "Unknown type: " << c.type.GetName();
+    if (t->AsInterface() != nullptr) {
+      auto name = c.type.GetName();
+      if (c.type.IsArray()) {
+        auto new_array = name + "[]::new";
+        auto as_interface = name + ".Stub::asInterface";
+        c.writer << c.var << " = " << c.parcel << ".createInterfaceArray(" << new_array << ", "
+                 << as_interface << ");\n";
+      } else {
+        c.writer << c.var << " = " << name << ".Stub.asInterface(" << c.parcel
+                 << ".readStrongBinder());\n";
+      }
+    } else if (t->AsParcelable() != nullptr) {
+      if (c.type.IsArray()) {
+        c.writer << c.var << " = " << c.parcel << ".createTypedArray(" << JavaNameOf(c.type)
+                 << ".CREATOR);\n";
+      } else {
+        if (c.min_sdk_version >= 23u) {
+          c.writer << c.var << " = " << c.parcel << ".readTypedObject(" << c.type.GetName()
+                   << ".CREATOR);\n";
+        } else {
+          c.writer << c.var << " = _Parcel.readTypedObject(" << c.parcel << ", " << c.type.GetName()
+                   << ".CREATOR);\n";
+        }
+      }
+    }
+  }
+  return true;
+}
+
+bool ReadFromParcelFor(const CodeGeneratorContext& c) {
+  static map<string, function<void(const CodeGeneratorContext&)>> method_map{
+      {"boolean[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".readBooleanArray(" << c.var << ");\n";
+       }},
+      {"byte[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".readByteArray(" << c.var << ");\n";
+       }},
+      {"char[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".readCharArray(" << c.var << ");\n";
+       }},
+      {"int[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".readIntArray(" << c.var << ");\n";
+       }},
+      {"long[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".readLongArray(" << c.var << ");\n";
+       }},
+      {"float[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".readFloatArray(" << c.var << ");\n";
+       }},
+      {"double[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".readDoubleArray(" << c.var << ");\n";
+       }},
+      {"String[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".readStringArray(" << c.var << ");\n";
+       }},
+      {"List",
+       [](const CodeGeneratorContext& c) {
+         if (c.type.IsGeneric()) {
+           AIDL_FATAL_IF(c.type.GetTypeParameters().size() != 1, c.type);
+           const auto& element_type = *c.type.GetTypeParameters().at(0);
+           const auto& element_type_name = element_type.GetName();
+           if (element_type_name == "String") {
+             c.writer << c.parcel << ".readStringList(" << c.var << ");\n";
+           } else if (element_type_name == "IBinder") {
+             c.writer << c.parcel << ".readBinderList(" << c.var << ");\n";
+           } else if (c.typenames.IsParcelable(element_type_name)) {
+             c.writer << c.parcel << ".readTypedList(" << c.var << ", "
+                      << JavaNameOf(*(c.type.GetTypeParameters().at(0))) << ".CREATOR);\n";
+           } else if (c.typenames.GetInterface(element_type)) {
+             auto as_interface = element_type_name + ".Stub::asInterface";
+             c.writer << c.parcel << ".readInterfaceList(" << c.var << ", " << as_interface
+                      << ");\n";
+           } else {
+             AIDL_FATAL(c.type) << "read: NOT IMPLEMENTED for " << element_type_name;
+           }
+         } else {
+           const string classloader = EnsureAndGetClassloader(const_cast<CodeGeneratorContext&>(c));
+           c.writer << c.parcel << ".readList(" << c.var << ", " << classloader << ");\n";
+         }
+       }},
+      {"Map",
+       [](const CodeGeneratorContext& c) {
+         if (c.type.IsGeneric()) {
+           c.writer << "if (" << c.var << " != null) " << c.var << ".clear();\n";
+           c.writer << "java.util.stream.IntStream.range(0, " << c.parcel
+                    << ".readInt()).forEach(i -> {\n";
+           c.writer.Indent();
+           c.writer << "String k = " << c.parcel << ".readString();\n";
+           c.writer << JavaSignatureOf(*(c.type.GetTypeParameters().at(1))) << " v;\n";
+           CodeGeneratorContext value_context{
+               c.writer,
+               c.typenames,
+               *c.type.GetTypeParameters()[1].get(),
+               c.parcel,
+               "v",
+               c.min_sdk_version,
+               c.write_to_parcel_flag,
+               c.is_classloader_created,
+           };
+           CreateFromParcelFor(value_context);
+           c.writer << c.var << ".put(k, v);\n";
+
+           c.writer.Dedent();
+           c.writer << "});\n";
+         } else {
+           const string classloader = EnsureAndGetClassloader(const_cast<CodeGeneratorContext&>(c));
+           c.writer << c.var << " = " << c.parcel << ".readHashMap(" << classloader << ");\n";
+         }
+       }},
+      {"IBinder[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".readBinderArray(" << c.var << ");\n";
+       }},
+      {"FileDescriptor[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".readRawFileDescriptorArray(" << c.var << ");\n";
+       }},
+      {"ParcelFileDescriptor",
+       [](const CodeGeneratorContext& c) {
+         c.writer << "if ((0!=" << c.parcel << ".readInt())) {\n";
+         c.writer.Indent();
+         c.writer << c.var << " = "
+                  << "android.os.ParcelFileDescriptor.CREATOR.createFromParcel(" << c.parcel
+                  << ");\n";
+         c.writer.Dedent();
+         c.writer << "}\n";
+       }},
+      {"ParcelFileDescriptor[]",
+       [](const CodeGeneratorContext& c) {
+         c.writer << c.parcel << ".readTypedArray(" << c.var
+                  << ", android.os.ParcelFileDescriptor.CREATOR);\n";
+       }},
+  };
+  const auto& found = method_map.find(AidlBackingTypeName(c.type));
+  if (found != method_map.end()) {
+    found->second(c);
+  } else if (c.type.IsFixedSizeArray()) {
+    std::vector<std::string> args = {c.var};
+    if (c.typenames.IsParcelable(c.type.GetName())) {
+      args.push_back(c.type.GetName() + ".CREATOR");
+    } else if (c.typenames.GetInterface(c.type)) {
+      args.push_back(c.type.GetName() + ".Stub::asInterface");
+    }
+    c.writer << c.parcel << ".readFixedArray(" << Join(args, ", ") << ");\n";
+  } else {
+    const AidlDefinedType* t = c.typenames.TryGetDefinedType(c.type.GetName());
+    AIDL_FATAL_IF(t == nullptr, c.type) << "Unknown type: " << c.type.GetName();
+    if (t->AsParcelable() != nullptr || t->AsUnionDeclaration() != nullptr) {
+      if (c.type.IsArray()) {
+        c.writer << c.parcel << ".readTypedArray(" << c.var << ", " << c.type.GetName()
+                 << ".CREATOR);\n";
+      } else {
+        c.writer << "if ((0!=" << c.parcel << ".readInt())) {\n";
+        c.writer.Indent();
+        c.writer << c.var << ".readFromParcel(" << c.parcel << ");\n";
+        c.writer.Dedent();
+        c.writer << "}\n";
+      }
+    } else if (t->AsInterface()) {
+      AIDL_FATAL_IF(!c.type.IsArray(), c.type) << "readFromParcel(interface) doesn't make sense.";
+      auto as_interface = c.type.GetName() + ".Stub::asInterface";
+      c.writer << c.parcel << ".readInterfaceArray(" << c.var << ", " << as_interface << ");\n";
+    }
+  }
+  return true;
+}
+
+void ToStringFor(const CodeGeneratorContext& c) {
+  // Use derived toString() for enum type annotated with @JavaDerive(toString=true)
+  if (auto t = c.type.GetDefinedType();
+      t != nullptr && t->AsEnumDeclaration() && t->JavaDerive("toString")) {
+    if (c.type.IsArray()) {
+      c.writer << c.type.GetName() << ".$.arrayToString(" << c.var << ")";
+    } else {
+      c.writer << c.type.GetName() << ".$.toString(" << c.var << ")";
+    }
+    return;
+  }
+
+  if (c.type.IsArray()) {
+    if (c.type.IsDynamicArray() || c.type.GetFixedSizeArrayDimensions().size() == 1) {
+      c.writer << "java.util.Arrays.toString(" << c.var << ")";
+    } else {
+      c.writer << "java.util.Arrays.deepToString(" << c.var << ")";
+    }
+    return;
+  }
+
+  const std::string name = c.type.GetName();
+
+  if (AidlTypenames::IsPrimitiveTypename(name)) {
+    c.writer << c.var;
+    return;
+  }
+
+  const AidlDefinedType* t = c.typenames.TryGetDefinedType(name);
+  if (t != nullptr && t->AsEnumDeclaration()) {
+    c.writer << c.var;
+    return;
+  }
+
+  // FileDescriptor doesn't have a good toString() impl.
+  if (name == "FileDescriptor") {
+    c.writer << c.var << " == null ? \"null\" : ";
+    c.writer << c.var << ".getInt$()";
+    return;
+  }
+
+  // Rest of the built-in types have reasonable toString() impls.
+  if (AidlTypenames::IsBuiltinTypename(name)) {
+    c.writer << "java.util.Objects.toString(" << c.var << ")";
+    return;
+  }
+
+  // For user-defined types, we also use toString() that we are generating here, but just make sure
+  // that they are actually user-defined types.
+  AIDL_FATAL_IF(t == nullptr, c.type) << "Unknown type";
+  if (t->AsInterface() != nullptr || t->AsParcelable() != nullptr) {
+    c.writer << "java.util.Objects.toString(" << c.var << ")";
+    return;
+  }
+
+  AIDL_FATAL(AIDL_LOCATION_HERE) << "Unhandled typename: " << name;
+}
+
+}  // namespace java
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_to_java.h b/aidl_to_java.h
new file mode 100644
index 0000000..aa1ee98
--- /dev/null
+++ b/aidl_to_java.h
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include "aidl_language.h"
+#include "aidl_typenames.h"
+
+#include <map>
+#include <memory>
+#include <set>
+#include <sstream>
+#include <string>
+#include <utility>
+#include <vector>
+
+namespace android {
+namespace aidl {
+namespace java {
+
+using std::map;
+using std::pair;
+using std::set;
+using std::string;
+using std::unique_ptr;
+using std::vector;
+
+// This header provides functions that translate AIDL things to Java things.
+
+std::string ConstantValueDecorator(
+    const AidlTypeSpecifier& type,
+    const std::variant<std::string, std::vector<std::string>>& raw_value);
+
+// Returns the Java type signature of the AIDL type spec
+// This includes generic type parameters with array modifiers.
+string JavaSignatureOf(const AidlTypeSpecifier& aidl);
+
+// Returns the Java boxing type of the AIDL type spec.
+// aidl type should be a primitive type.
+string JavaBoxingTypeOf(const AidlTypeSpecifier& aidl);
+
+// Returns the instantiable Jva type signature of the AIDL type spec
+// This includes generic type parameters, but excludes array modifiers.
+string InstantiableJavaSignatureOf(const AidlTypeSpecifier& aidl);
+
+// Returns the default Java value of the AIDL type spec
+string DefaultJavaValueOf(const AidlTypeSpecifier& aidl);
+
+// This carries information that is required to generate code for
+// marshalling and unmarshalling a method argument or a parcelable field
+struct CodeGeneratorContext {
+  CodeWriter& writer;  // CodeWriter::Write() is mutable
+  const AidlTypenames& typenames;
+  const AidlTypeSpecifier& type;
+  const string parcel;
+  const string var;
+  const uint32_t min_sdk_version;
+  // Set PARCELABLE_WRITE_RETURN_VALUE when the marshalled data will be returned to the client.
+  // This is given as a hint to the Parcelable that is being marshalled
+  // so that the Parcelable can release its resource after the marshalling
+  // is done.
+  const string write_to_parcel_flag;
+
+  // Most of the variables created by AIDL compiler are typed, i.e., the code
+  // knows exactly what type of object is in the parcel -- because the parcel
+  // itself is created by the code generated by AIDL compiler.
+  //
+  // However, for some collection types (List and Map for now), we write the
+  // elements in them untyped (object is flattened along with its type name)
+  // as the AIDL compiler does not know the type of the contained elements.
+  // So, when unmarshalling such collection, we need to provide a classloader
+  // from where the parcel can reflectively find a class object for
+  // the contained element.
+  //
+  // This field is a pointer to a boolean state variable that indicates whether
+  // the code for declaring and getting the classloader has been emitted or not.
+  // We emit the code at most once per an AIDL method, otherwise we are wasting
+  // time doing the same thing multiple time.
+  bool* const is_classloader_created;
+};
+
+// Writes code fragment that writes a variable to the parcel.
+void WriteToParcelFor(const CodeGeneratorContext& c);
+
+// Writes code fragment that reads data from the parcel into a variable. When
+// the variable type is array or List, the array or List is created.
+bool CreateFromParcelFor(const CodeGeneratorContext& c);
+
+// Writes code fragment that reads data from the parcel into an existing
+// array or a List.
+bool ReadFromParcelFor(const CodeGeneratorContext& c);
+
+// Writes an expression that returns the string representation of a field
+// in a parcelable
+void ToStringFor(const CodeGeneratorContext& c);
+
+// Generates create/read/write helper functions which are missing in Parcel.
+void GenerateParcelHelpers(CodeWriter& out, const AidlDefinedType& defined_type,
+                           const AidlTypenames& typenames, const Options& options);
+
+}  // namespace java
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_to_ndk.cpp b/aidl_to_ndk.cpp
new file mode 100644
index 0000000..f533c77
--- /dev/null
+++ b/aidl_to_ndk.cpp
@@ -0,0 +1,268 @@
+/*
+ * Copyright (C) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * limitations under the License.
+ */
+
+#include "aidl_to_ndk.h"
+#include "aidl_language.h"
+#include "aidl_to_cpp_common.h"
+#include "logging.h"
+#include "os.h"
+
+#include <android-base/stringprintf.h>
+#include <android-base/strings.h>
+
+#include <functional>
+
+using ::android::base::Join;
+using ::android::base::Split;
+
+namespace android {
+namespace aidl {
+namespace ndk {
+
+std::string NdkHeaderFile(const AidlDefinedType& defined_type, cpp::ClassNames name,
+                          bool use_os_sep) {
+  // Unstructured parcelable should set its ndk_header. use it.
+  if (auto unstructured = AidlCast<AidlParcelable>(defined_type); unstructured) {
+    AIDL_FATAL_IF(name != cpp::ClassNames::RAW, "unstructured parcelable should only use raw name");
+    const std::string ndk_header = unstructured->GetNdkHeader();
+    AIDL_FATAL_IF(ndk_header.empty(), unstructured)
+        << "Parcelable " << unstructured->GetCanonicalName() << " has no ndk_header defined.";
+    return ndk_header;
+  }
+
+  char seperator = (use_os_sep) ? OS_PATH_SEPARATOR : '/';
+  return std::string("aidl") + seperator + cpp::HeaderFile(defined_type, name, use_os_sep);
+}
+
+// This represents a type in AIDL (e.g. 'String' which can be referenced in multiple ways)
+struct TypeInfo {
+  // name of the type in C++ output
+  std::string cpp_name;
+  // whether to prefer 'value type' over 'const&'
+  bool value_is_cheap = false;
+};
+
+std::string ConstantValueDecorator(
+    const AidlTypeSpecifier& type,
+    const std::variant<std::string, std::vector<std::string>>& raw_value) {
+  return cpp::CppConstantValueDecorator(type, raw_value, /*is_ndk=*/true);
+};
+
+// map from AIDL built-in type name to the corresponding Ndk type info
+static map<std::string, TypeInfo> kNdkTypeInfoMap = {
+    {"void", {"void", true}},
+    {"boolean", {"bool", true}},
+    {"byte", {"int8_t", true}},
+    {"char", {"char16_t", true}},
+    {"int", {"int32_t", true}},
+    {"long", {"int64_t", true}},
+    {"float", {"float", true}},
+    {"double", {"double", true}},
+    {"String", {"std::string"}},
+    // TODO(b/136048684) {"Map", ""},
+    {"IBinder", {"::ndk::SpAIBinder"}},
+    {"ParcelFileDescriptor", {"::ndk::ScopedFileDescriptor"}},
+    {"ParcelableHolder", {"::ndk::AParcelableHolder"}},
+};
+
+static TypeInfo GetBaseTypeInfo(const AidlTypenames& types, const AidlTypeSpecifier& aidl) {
+  auto& aidl_name = aidl.GetName();
+
+  if (AidlTypenames::IsBuiltinTypename(aidl_name)) {
+    auto it = kNdkTypeInfoMap.find(aidl_name);
+    AIDL_FATAL_IF(it == kNdkTypeInfoMap.end(), aidl_name);
+    return it->second;
+  }
+  const AidlDefinedType* type = types.TryGetDefinedType(aidl_name);
+  AIDL_FATAL_IF(type == nullptr, aidl_name) << "Unrecognized type.";
+
+  if (const AidlInterface* intf = type->AsInterface(); intf != nullptr) {
+    const std::string clazz = NdkFullClassName(*intf, cpp::ClassNames::INTERFACE);
+    return TypeInfo{"std::shared_ptr<" + clazz + ">"};
+  } else if (const AidlParcelable* parcelable = type->AsParcelable(); parcelable != nullptr) {
+    std::string clazz = NdkFullClassName(*parcelable, cpp::ClassNames::RAW);
+    std::string template_params = "";
+    if (aidl.IsGeneric()) {
+      std::vector<std::string> type_params;
+      for (const auto& parameter : aidl.GetTypeParameters()) {
+        type_params.push_back(NdkNameOf(types, *parameter, StorageMode::STACK));
+      }
+      clazz += base::StringPrintf("<%s>", base::Join(type_params, ", ").c_str());
+    }
+    return TypeInfo{clazz};
+  } else if (const AidlEnumDeclaration* enum_decl = type->AsEnumDeclaration();
+             enum_decl != nullptr) {
+    const std::string clazz = NdkFullClassName(*enum_decl, cpp::ClassNames::RAW);
+    return TypeInfo{clazz, true};
+  } else {
+    AIDL_FATAL(aidl_name) << "Unrecognized type";
+  }
+}
+
+static TypeInfo WrapNullableType(TypeInfo info, bool is_heap) {
+  if (is_heap) {
+    info.cpp_name = "std::unique_ptr<" + info.cpp_name + ">";
+  } else {
+    info.cpp_name = "std::optional<" + info.cpp_name + ">";
+  }
+  info.value_is_cheap = false;
+  return info;
+}
+
+static TypeInfo WrapArrayType(TypeInfo info, const ArrayType* array) {
+  AIDL_FATAL_IF(!array, AIDL_LOCATION_HERE) << "not an array";
+  // When "byte"(AIDL) is used in an array, use "uint8_t" because it's more C++ idiomatic.
+  if (info.cpp_name == "int8_t") {
+    info.cpp_name = "uint8_t";
+  }
+  if (std::get_if<DynamicArray>(array)) {
+    info.cpp_name = "std::vector<" + info.cpp_name + ">";
+  } else {
+    auto dimensions = std::get<FixedSizeArray>(*array).GetDimensionInts();
+    for (auto it = rbegin(dimensions), end = rend(dimensions); it != end; it++) {
+      info.cpp_name = "std::array<" + info.cpp_name + ", " + std::to_string(*it) + ">";
+    }
+  }
+  info.value_is_cheap = false;
+  return info;
+}
+
+static bool ShouldWrapNullable(const AidlTypenames& types, const std::string& aidl_name) {
+  if (AidlTypenames::IsPrimitiveTypename(aidl_name) || aidl_name == "ParcelableHolder" ||
+      aidl_name == "IBinder" || aidl_name == "ParcelFileDescriptor") {
+    return false;
+  }
+  if (auto defined_type = types.TryGetDefinedType(aidl_name); defined_type) {
+    if (defined_type->AsEnumDeclaration() || defined_type->AsInterface()) {
+      return false;
+    }
+  }
+  return true;
+}
+
+static TypeInfo GetTypeInfo(const AidlTypenames& types, const AidlTypeSpecifier& aidl) {
+  AIDL_FATAL_IF(!aidl.IsResolved(), aidl) << aidl.ToString();
+  // Keep original @nullable to handle the case of List<T>. "@nullable" is attached to "List" not
+  // "T"
+  bool is_nullable = aidl.IsNullable();
+  const ArrayType* array = nullptr;
+  const AidlTypeSpecifier* element_type = &aidl;
+
+  // List<T> is converted to T[].
+  if (aidl.GetName() == "List") {
+    static const ArrayType kDynamicArray{DynamicArray{}};
+
+    AIDL_FATAL_IF(!aidl.IsGeneric(), aidl) << "List must be generic type.";
+    AIDL_FATAL_IF(aidl.GetTypeParameters().size() != 1, aidl)
+        << "List can accept only one type parameter.";
+    const auto& type_param = *aidl.GetTypeParameters()[0];
+    // TODO(b/136048684) AIDL doesn't support nested type parameter yet.
+    AIDL_FATAL_IF(type_param.IsGeneric(), aidl) << "AIDL doesn't support nested type parameter";
+    // Treat "List<T>" as an array of T.
+    array = &kDynamicArray;
+    element_type = &type_param;
+  } else if (aidl.IsArray()) {
+    array = &aidl.GetArray();
+  }
+
+  TypeInfo info = GetBaseTypeInfo(types, *element_type);
+
+  if (is_nullable && ShouldWrapNullable(types, element_type->GetName())) {
+    info = WrapNullableType(info, aidl.IsHeapNullable());
+  }
+  if (array) {
+    info = WrapArrayType(info, array);
+    if (is_nullable) {
+      AIDL_FATAL_IF(aidl.IsHeapNullable(), aidl) << "Array/List can't be @nullable(heap=true)";
+      info = WrapNullableType(info, /*is_heap=*/false);
+    }
+  }
+  return info;
+}
+
+std::string NdkFullClassName(const AidlDefinedType& type, cpp::ClassNames name) {
+  std::vector<std::string> pieces = {"::aidl"};
+  std::vector<std::string> split_name = Split(type.GetCanonicalName(), ".");
+  pieces.insert(pieces.end(), split_name.begin(), split_name.end());
+  // Override name part with cpp::ClassName(type, name)
+  pieces.back() = cpp::ClassName(type, name);
+  return Join(pieces, "::");
+}
+
+std::string NdkNameOf(const AidlTypenames& types, const AidlTypeSpecifier& aidl, StorageMode mode) {
+  TypeInfo aspect = GetTypeInfo(types, aidl);
+
+  switch (mode) {
+    case StorageMode::STACK:
+      return aspect.cpp_name;
+    case StorageMode::ARGUMENT:
+      if (aspect.value_is_cheap) {
+        return aspect.cpp_name;
+      } else {
+        return "const " + aspect.cpp_name + "&";
+      }
+    case StorageMode::OUT_ARGUMENT:
+      return aspect.cpp_name + "*";
+    default:
+      AIDL_FATAL(aidl.GetName()) << "Unrecognized mode type: " << static_cast<int>(mode);
+  }
+}
+
+void WriteToParcelFor(const CodeGeneratorContext& c) {
+  if (c.type.IsNullable()) {
+    c.writer << "::ndk::AParcel_writeNullableData(" << c.parcel << ", " << c.var << ")";
+  } else {
+    c.writer << "::ndk::AParcel_writeData(" << c.parcel << ", " << c.var << ")";
+  }
+}
+
+void ReadFromParcelFor(const CodeGeneratorContext& c) {
+  if (c.type.IsNullable()) {
+    c.writer << "::ndk::AParcel_readNullableData(" << c.parcel << ", " << c.var << ")";
+  } else {
+    c.writer << "::ndk::AParcel_readData(" << c.parcel << ", " << c.var << ")";
+  }
+}
+
+std::string NdkArgList(
+    const AidlTypenames& types, const AidlMethod& method,
+    std::function<std::string(const std::string& type, const std::string& name, bool isOut)>
+        formatter) {
+  std::vector<std::string> method_arguments;
+  for (const auto& a : method.GetArguments()) {
+    StorageMode mode = a->IsOut() ? StorageMode::OUT_ARGUMENT : StorageMode::ARGUMENT;
+    std::string type = NdkNameOf(types, a->GetType(), mode);
+    std::string name = cpp::BuildVarName(*a);
+    method_arguments.emplace_back(formatter(type, name, a->IsOut()));
+  }
+
+  if (method.GetType().GetName() != "void") {
+    std::string type = NdkNameOf(types, method.GetType(), StorageMode::OUT_ARGUMENT);
+    std::string name = "_aidl_return";
+    method_arguments.emplace_back(formatter(type, name, true));
+  }
+
+  return Join(method_arguments, ", ");
+}
+
+std::string NdkMethodDecl(const AidlTypenames& types, const AidlMethod& method,
+                          const std::string& clazz) {
+  std::string class_prefix = clazz.empty() ? "" : (clazz + "::");
+  return "::ndk::ScopedAStatus " + class_prefix + method.GetName() + "(" +
+         NdkArgList(types, method, FormatArgForDecl) + ")";
+}
+
+}  // namespace ndk
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_to_ndk.h b/aidl_to_ndk.h
new file mode 100644
index 0000000..7d815c5
--- /dev/null
+++ b/aidl_to_ndk.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include "aidl_language.h"
+#include "aidl_to_cpp_common.h"
+
+namespace android {
+namespace aidl {
+namespace ndk {
+
+enum class StorageMode {
+  STACK,
+  ARGUMENT,      // Value for primitives, const& for larger types
+  OUT_ARGUMENT,  // Pointer to raw type
+};
+
+std::string NdkHeaderFile(const AidlDefinedType& defined_type, cpp::ClassNames name,
+                          bool use_os_sep = true);
+
+std::string ConstantValueDecorator(
+    const AidlTypeSpecifier& type,
+    const std::variant<std::string, std::vector<std::string>>& raw_value);
+
+// Returns ::aidl::some_package::some_sub_package::foo::IFoo/BpFoo/BnFoo
+std::string NdkFullClassName(const AidlDefinedType& type, cpp::ClassNames name);
+
+// Returns the corresponding Ndk type name for an AIDL type spec including
+// array modifiers.
+std::string NdkNameOf(const AidlTypenames& types, const AidlTypeSpecifier& aidl, StorageMode mode);
+
+struct CodeGeneratorContext {
+  CodeWriter& writer;
+
+  const AidlTypenames& types;
+  const AidlTypeSpecifier& type;
+
+  const string parcel;
+  const string var;
+};
+
+void WriteToParcelFor(const CodeGeneratorContext& c);
+void ReadFromParcelFor(const CodeGeneratorContext& c);
+
+// Returns argument list of a method where each arg is formatted by the fomatter
+std::string NdkArgList(
+    const AidlTypenames& types, const AidlMethod& method,
+    std::function<std::string(const std::string& type, const std::string& name, bool isOut)>
+        formatter);
+
+inline std::string FormatArgForDecl(const std::string& type, const std::string& name,
+                                    bool /*isOut*/) {
+  return type + " " + name;
+}
+
+inline std::string FormatArgNameUnused(const std::string& type, const std::string& name,
+                                       bool /*isOut*/) {
+  return type + " /*" + name + "*/";
+}
+
+inline std::string FormatArgForCall(const std::string& /*type*/, const std::string& name,
+                                    bool isOut) {
+  std::string reference_prefix = isOut ? "&" : "";
+  return reference_prefix + name;
+}
+
+inline std::string FormatArgNameOnly(const std::string& /*type*/, const std::string& name,
+                                     bool /*isOut*/) {
+  return name;
+}
+
+// -> 'status (class::)name(type name, ...)' for a method
+std::string NdkMethodDecl(const AidlTypenames& types, const AidlMethod& method,
+                          const std::string& clazz = "");
+
+}  // namespace ndk
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_to_rust.cpp b/aidl_to_rust.cpp
new file mode 100644
index 0000000..aeb4b69
--- /dev/null
+++ b/aidl_to_rust.cpp
@@ -0,0 +1,406 @@
+/*
+ * Copyright (C) 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl_to_rust.h"
+#include "aidl_language.h"
+#include "aidl_typenames.h"
+#include "logging.h"
+
+#include <android-base/stringprintf.h>
+#include <android-base/strings.h>
+
+#include <functional>
+#include <iostream>
+#include <map>
+#include <string>
+#include <vector>
+
+using android::base::Join;
+using android::base::Split;
+using android::base::StringPrintf;
+
+namespace android {
+namespace aidl {
+namespace rust {
+
+namespace {
+std::string GetRawRustName(const AidlTypeSpecifier& type);
+
+std::string ConstantValueDecoratorInternal(
+    const AidlTypeSpecifier& type,
+    const std::variant<std::string, std::vector<std::string>>& raw_value, bool by_ref) {
+  if (type.IsArray()) {
+    const auto& values = std::get<std::vector<std::string>>(raw_value);
+    std::string value = "[" + Join(values, ", ") + "]";
+    if (type.IsDynamicArray()) {
+      value = "vec!" + value;
+    }
+    if (!type.IsMutated() && type.IsNullable()) {
+      value = "Some(" + value + ")";
+    }
+    return value;
+  }
+
+  std::string value = std::get<std::string>(raw_value);
+
+  const auto& aidl_name = type.GetName();
+  if (aidl_name == "char") {
+    return value + " as u16";
+  }
+
+  if (aidl_name == "float") {
+    // value already ends in `f`, so just add `32`
+    return value + "32";
+  }
+
+  if (aidl_name == "double") {
+    return value + "f64";
+  }
+
+  if (auto defined_type = type.GetDefinedType(); defined_type) {
+    auto enum_type = defined_type->AsEnumDeclaration();
+    AIDL_FATAL_IF(!enum_type, type) << "Invalid type for \"" << value << "\"";
+    return GetRawRustName(type) + "::" + value.substr(value.find_last_of('.') + 1);
+  }
+
+  if (aidl_name == "String" && !by_ref) {
+    // The actual type might be String or &str,
+    // and .into() transparently converts into either one
+    value = value + ".into()";
+  }
+
+  if (type.IsNullable()) {
+    value = "Some(" + value + ")";
+  }
+
+  return value;
+}
+
+std::string GetRawRustName(const AidlTypeSpecifier& type) {
+  const auto defined_type = type.GetDefinedType();
+  if (defined_type != nullptr) {
+    const auto unstructured = AidlCast<AidlParcelable>(*defined_type);
+    if (unstructured != nullptr) {
+      // Unstructured parcelable should set its rust_type. Use it.
+      const std::string rust_type = unstructured->GetRustType();
+      AIDL_FATAL_IF(rust_type.empty(), unstructured)
+          << "Parcelable " << unstructured->GetCanonicalName() << " has no rust_type defined.";
+      return rust_type;
+    }
+  }
+
+  // Each Rust type is defined in a file with the same name,
+  // e.g., IFoo is in IFoo.rs
+  auto split_name = type.GetSplitName();
+  std::string rust_name{"crate::mangled::"};
+  for (const auto& component : split_name) {
+    rust_name += StringPrintf("_%zd_%s", component.size(), component.c_str());
+  }
+  return rust_name;
+}
+
+// Usually, this means that the type implements `Default`, however `ParcelableHolder` is also
+// included in this list because the code generator knows how to call `::new(stability)`.
+bool AutoConstructor(const AidlTypeSpecifier& type, const AidlTypenames& typenames) {
+  return !(type.GetName() == "ParcelFileDescriptor" || type.GetName() == "IBinder" ||
+           TypeIsInterface(type, typenames));
+}
+
+std::string GetRustName(const AidlTypeSpecifier& type, const AidlTypenames& typenames,
+                        StorageMode mode) {
+  // map from AIDL built-in type name to the corresponding Rust type name
+  static map<string, string> m = {
+      {"void", "()"},
+      {"boolean", "bool"},
+      {"byte", "i8"},
+      {"char", "u16"},
+      {"int", "i32"},
+      {"long", "i64"},
+      {"float", "f32"},
+      {"double", "f64"},
+      {"String", "String"},
+      {"IBinder", "binder::SpIBinder"},
+      {"ParcelFileDescriptor", "binder::ParcelFileDescriptor"},
+      {"ParcelableHolder", "binder::ParcelableHolder"},
+  };
+  const string& type_name = type.GetName();
+  if (m.find(type_name) != m.end()) {
+    AIDL_FATAL_IF(!AidlTypenames::IsBuiltinTypename(type_name), type);
+    if (type_name == "String" && mode == StorageMode::UNSIZED_ARGUMENT) {
+      return "str";
+    } else {
+      return m[type_name];
+    }
+  }
+  auto name = GetRawRustName(type);
+  if (TypeIsInterface(type, typenames)) {
+    name = "binder::Strong<dyn " + name + ">";
+  }
+  if (type.IsGeneric()) {
+    name += "<";
+    for (const auto& param : type.GetTypeParameters()) {
+      name += GetRustName(*param, typenames, mode);
+      name += ",";
+    }
+    name += ">";
+  }
+  return name;
+}
+}  // namespace
+
+std::string ConstantValueDecorator(
+    const AidlTypeSpecifier& type,
+    const std::variant<std::string, std::vector<std::string>>& raw_value) {
+  return ConstantValueDecoratorInternal(type, raw_value, false);
+}
+
+std::string ConstantValueDecoratorRef(
+    const AidlTypeSpecifier& type,
+    const std::variant<std::string, std::vector<std::string>>& raw_value) {
+  return ConstantValueDecoratorInternal(type, raw_value, true);
+}
+
+// Returns default value for array.
+std::string ArrayDefaultValue(const AidlTypeSpecifier& type) {
+  AIDL_FATAL_IF(!type.IsFixedSizeArray(), type) << "not a fixed-size array";
+  auto dimensions = type.GetFixedSizeArrayDimensions();
+  std::string value = "Default::default()";
+  for (auto it = rbegin(dimensions), end = rend(dimensions); it != end; it++) {
+    value = "[" + Join(std::vector<std::string>(*it, value), ", ") + "]";
+  }
+  return value;
+}
+
+// Returns true if @nullable T[] should be mapped Option<Vec<Option<T>>
+bool UsesOptionInNullableVector(const AidlTypeSpecifier& type, const AidlTypenames& typenames) {
+  AIDL_FATAL_IF(!type.IsArray() && !typenames.IsList(type), type) << "not a vector";
+  AIDL_FATAL_IF(typenames.IsList(type) && type.GetTypeParameters().size() != 1, type)
+      << "List should have a single type arg.";
+
+  const auto& element_type = type.IsArray() ? type : *type.GetTypeParameters().at(0);
+  if (typenames.IsPrimitiveTypename(element_type.GetName())) {
+    return false;
+  }
+  if (typenames.GetEnumDeclaration(element_type)) {
+    return false;
+  }
+  return true;
+}
+
+std::string RustLifetimeName(Lifetime lifetime) {
+  switch (lifetime) {
+    case Lifetime::NONE:
+      return "";
+    case Lifetime::A:
+      return "'a ";
+  }
+}
+
+std::string RustLifetimeGeneric(Lifetime lifetime) {
+  switch (lifetime) {
+    case Lifetime::NONE:
+      return "";
+    case Lifetime::A:
+      return "<'a>";
+  }
+}
+
+std::string RustNameOf(const AidlTypeSpecifier& type, const AidlTypenames& typenames,
+                       StorageMode mode, Lifetime lifetime) {
+  std::string rust_name;
+  if (type.IsArray() || typenames.IsList(type)) {
+    const auto& element_type = type.IsGeneric() ? (*type.GetTypeParameters().at(0)) : type;
+    StorageMode element_mode;
+    if (type.IsFixedSizeArray() && mode == StorageMode::PARCELABLE_FIELD) {
+      // Elements of fixed-size array field need to have Default.
+      element_mode = StorageMode::DEFAULT_VALUE;
+    } else if (mode == StorageMode::OUT_ARGUMENT || mode == StorageMode::DEFAULT_VALUE) {
+      // Elements need to have Default for resize_out_vec()
+      element_mode = StorageMode::DEFAULT_VALUE;
+    } else {
+      element_mode = StorageMode::VALUE;
+    }
+    if (type.IsArray() && element_type.GetName() == "byte") {
+      rust_name = "u8";
+    } else {
+      rust_name = GetRustName(element_type, typenames, element_mode);
+    }
+
+    // Needs `Option` wrapping because type is not default constructible
+    const bool default_option =
+        element_mode == StorageMode::DEFAULT_VALUE && !AutoConstructor(element_type, typenames);
+    // Needs `Option` wrapping due to being a nullable, non-primitive, non-enum type in a vector.
+    const bool nullable_option = type.IsNullable() && UsesOptionInNullableVector(type, typenames);
+    if (default_option || nullable_option) {
+      rust_name = "Option<" + rust_name + ">";
+    }
+
+    if (mode == StorageMode::UNSIZED_ARGUMENT) {
+      rust_name = "[" + rust_name + "]";
+    } else if (type.IsFixedSizeArray()) {
+      auto dimensions = type.GetFixedSizeArrayDimensions();
+      // T[N][M] => [[T; M]; N]
+      for (auto it = rbegin(dimensions), end = rend(dimensions); it != end; it++) {
+        rust_name = "[" + rust_name + "; " + std::to_string(*it) + "]";
+      }
+    } else {
+      rust_name = "Vec<" + rust_name + ">";
+    }
+  } else {
+    rust_name = GetRustName(type, typenames, mode);
+  }
+
+  if (mode == StorageMode::IN_ARGUMENT || mode == StorageMode::UNSIZED_ARGUMENT) {
+    // If this is a nullable input argument, put the reference inside the option,
+    // e.g., `Option<&str>` instead of `&Option<str>`
+    rust_name = "&" + RustLifetimeName(lifetime) + rust_name;
+  }
+
+  if (type.IsNullable() ||
+      // Some types don't implement Default, so we wrap them
+      // in Option, which defaults to None
+      (TypeNeedsOption(type, typenames) &&
+       (mode == StorageMode::DEFAULT_VALUE || mode == StorageMode::OUT_ARGUMENT ||
+        mode == StorageMode::PARCELABLE_FIELD))) {
+    if (type.IsHeapNullable()) {
+      rust_name = "Option<Box<" + rust_name + ">>";
+    } else {
+      rust_name = "Option<" + rust_name + ">";
+    }
+  }
+
+  if (mode == StorageMode::OUT_ARGUMENT || mode == StorageMode::INOUT_ARGUMENT) {
+    rust_name = "&" + RustLifetimeName(lifetime) + "mut " + rust_name;
+  }
+
+  return rust_name;
+}
+
+StorageMode ArgumentStorageMode(const AidlArgument& arg, const AidlTypenames& typenames) {
+  if (arg.IsOut()) {
+    return arg.IsIn() ? StorageMode::INOUT_ARGUMENT : StorageMode::OUT_ARGUMENT;
+  }
+
+  const auto typeName = arg.GetType().GetName();
+  const auto definedType = typenames.TryGetDefinedType(typeName);
+
+  const bool isEnum = definedType && definedType->AsEnumDeclaration() != nullptr;
+  const bool isPrimitive = AidlTypenames::IsPrimitiveTypename(typeName);
+  if (typeName == "String" || arg.GetType().IsDynamicArray() || typenames.IsList(arg.GetType())) {
+    return StorageMode::UNSIZED_ARGUMENT;
+  } else if (!(isPrimitive || isEnum) || arg.GetType().IsFixedSizeArray()) {
+    return StorageMode::IN_ARGUMENT;
+  } else {
+    return StorageMode::VALUE;
+  }
+}
+
+ReferenceMode ArgumentReferenceMode(const AidlArgument& arg, const AidlTypenames& typenames) {
+  auto arg_mode = ArgumentStorageMode(arg, typenames);
+  switch (arg_mode) {
+    case StorageMode::IN_ARGUMENT:
+      if (arg.GetType().IsNullable()) {
+        // &Option<T> => Option<&T>
+        return ReferenceMode::AS_REF;
+      } else {
+        return ReferenceMode::REF;
+      }
+
+    case StorageMode::OUT_ARGUMENT:
+    case StorageMode::INOUT_ARGUMENT:
+      return ReferenceMode::MUT_REF;
+
+    case StorageMode::UNSIZED_ARGUMENT:
+      if (arg.GetType().IsNullable()) {
+        // &Option<String> => Option<&str>
+        // &Option<Vec<T>> => Option<&[T]>
+        return ReferenceMode::AS_DEREF;
+      } else {
+        return ReferenceMode::REF;
+      }
+
+    default:
+      return ReferenceMode::VALUE;
+  }
+}
+
+std::string TakeReference(ReferenceMode ref_mode, const std::string& name) {
+  switch (ref_mode) {
+    case ReferenceMode::REF:
+      return "&" + name;
+
+    case ReferenceMode::MUT_REF:
+      return "&mut " + name;
+
+    case ReferenceMode::AS_REF:
+      return name + ".as_ref()";
+
+    case ReferenceMode::AS_DEREF:
+      return name + ".as_deref()";
+
+    default:
+      return name;
+  }
+}
+
+bool TypeIsInterface(const AidlTypeSpecifier& type, const AidlTypenames& typenames) {
+  const auto definedType = typenames.TryGetDefinedType(type.GetName());
+  return definedType != nullptr && definedType->AsInterface() != nullptr;
+}
+
+bool TypeNeedsOption(const AidlTypeSpecifier& type, const AidlTypenames& typenames) {
+  if (type.IsArray() || typenames.IsList(type)) {
+    return false;
+  }
+
+  // Already an Option<T>
+  if (type.IsNullable()) {
+    return false;
+  }
+
+  const string& aidl_name = type.GetName();
+  if (aidl_name == "IBinder") {
+    return true;
+  }
+  if (aidl_name == "ParcelFileDescriptor") {
+    return true;
+  }
+  if (aidl_name == "ParcelableHolder") {
+    // ParcelableHolder never needs an Option because we always
+    // call its new() constructor directly instead of default()
+    return false;
+  }
+
+  // Strong<dyn IFoo> values don't implement Default
+  if (TypeIsInterface(type, typenames)) {
+    return true;
+  }
+
+  // Unstructured parcelables may not implement Default.
+  const auto defined_type = type.GetDefinedType();
+  if (defined_type != nullptr) {
+    const auto unstructured = AidlCast<AidlParcelable>(*defined_type);
+    if (unstructured != nullptr) {
+      return true;
+    }
+  }
+
+  return false;
+}
+
+}  // namespace rust
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_to_rust.h b/aidl_to_rust.h
new file mode 100644
index 0000000..8a49a56
--- /dev/null
+++ b/aidl_to_rust.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include "aidl_language.h"
+#include "aidl_typenames.h"
+
+namespace android {
+namespace aidl {
+namespace rust {
+
+// This header provides functions that translate AIDL things to Rust things.
+
+enum class StorageMode {
+  VALUE,
+  DEFAULT_VALUE,       // Value that implements Default::default()
+  IN_ARGUMENT,         // Value for primitives, & for larger types
+  UNSIZED_ARGUMENT,    // Unsized input argument, e.g., str/slice
+  OUT_ARGUMENT,        // Mutable reference to write-only raw type
+  INOUT_ARGUMENT,      // Mutable reference to inout argument
+  PARCELABLE_FIELD,    // Field in a parcelable
+};
+
+enum class ReferenceMode {
+  VALUE,
+  REF,
+  MUT_REF,
+  AS_REF,
+  AS_DEREF,
+};
+
+enum class Lifetime {
+  NONE,
+  A,
+};
+
+inline bool IsReference(ReferenceMode ref_mode) {
+  switch (ref_mode) {
+    case ReferenceMode::REF:
+    case ReferenceMode::MUT_REF:
+      return true;
+
+    default:
+      return false;
+  }
+}
+
+std::string ConstantValueDecorator(
+    const AidlTypeSpecifier& type,
+    const std::variant<std::string, std::vector<std::string>>& raw_value);
+
+std::string ConstantValueDecoratorRef(
+    const AidlTypeSpecifier& type,
+    const std::variant<std::string, std::vector<std::string>>& raw_value);
+
+std::string ArrayDefaultValue(const AidlTypeSpecifier& type);
+
+// Returns "'lifetime_name " including the initial apostrophe and the trailing space.
+// Returns empty string for NONE.
+std::string RustLifetimeName(Lifetime lifetime);
+
+// Returns "<'lifetime_name>" or empty string for NONE.
+std::string RustLifetimeGeneric(Lifetime lifetime);
+
+// Returns the Rust type signature of the AIDL type spec
+// This includes generic type parameters with array modifiers.
+//
+// The lifetime argument is used to annotate all references.
+std::string RustNameOf(const AidlTypeSpecifier& aidl, const AidlTypenames& typenames,
+                       StorageMode mode, Lifetime lifetime);
+
+StorageMode ArgumentStorageMode(const AidlArgument& arg, const AidlTypenames& typenames);
+
+ReferenceMode ArgumentReferenceMode(const AidlArgument& arg, const AidlTypenames& typenames);
+
+std::string TakeReference(ReferenceMode ref_mode, const std::string& name);
+
+bool TypeIsInterface(const AidlTypeSpecifier& type, const AidlTypenames& typenames);
+
+bool TypeNeedsOption(const AidlTypeSpecifier& type, const AidlTypenames& typenames);
+
+}  // namespace rust
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_typenames.cpp b/aidl_typenames.cpp
new file mode 100644
index 0000000..67da4e7
--- /dev/null
+++ b/aidl_typenames.cpp
@@ -0,0 +1,416 @@
+/*
+ * Copyright (C) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl_typenames.h"
+#include "aidl_language.h"
+#include "logging.h"
+
+#include <android-base/file.h>
+#include <android-base/strings.h>
+
+#include <map>
+#include <memory>
+#include <set>
+#include <string>
+#include <utility>
+#include <vector>
+
+using android::base::Split;
+
+using std::make_pair;
+using std::map;
+using std::pair;
+using std::set;
+using std::string;
+using std::unique_ptr;
+using std::vector;
+
+namespace android {
+namespace aidl {
+
+// The built-in AIDL types..
+static const set<string> kBuiltinTypes = {"void",
+                                          "boolean",
+                                          "byte",
+                                          "char",
+                                          "int",
+                                          "long",
+                                          "float",
+                                          "double",
+                                          "String",
+                                          "List",
+                                          "Map",
+                                          "IBinder",
+                                          "FileDescriptor",
+                                          "CharSequence",
+                                          "ParcelFileDescriptor",
+                                          "ParcelableHolder"};
+
+static const set<string> kPrimitiveTypes = {"void", "boolean", "byte",  "char",
+                                            "int",  "long",    "float", "double"};
+
+// Note: these types may look wrong because they look like Java
+// types, but they have long been supported from the time when Java
+// was the only target language of this compiler. They are added here for
+// backwards compatibility, but we internally treat them as List and Map,
+// respectively.
+static const map<string, string> kJavaLikeTypeToAidlType = {
+    {"java.util.List", "List"},
+    {"java.util.Map", "Map"},
+    {"android.os.ParcelFileDescriptor", "ParcelFileDescriptor"},
+};
+
+// Package name and type name can't be one of these as they are keywords
+// in Java and C++. Using these names will eventually cause compilation error,
+// so checking this here is not a must have, but early detection of errors
+// is always better.
+static const set<string> kCppOrJavaReservedWord = {
+    "break",  "case",   "catch", "char",     "class",  "continue", "default",
+    "do",     "double", "else",  "enum",     "false",  "float",    "for",
+    "goto",   "if",     "int",   "long",     "new",    "private",  "protected",
+    "public", "return", "short", "static",   "switch", "this",     "throw",
+    "true",   "try",    "void",  "volatile", "while"};
+
+static bool HasValidNameComponents(const AidlDefinedType& defined) {
+  bool success = true;
+  vector<string> pieces = Split(defined.GetCanonicalName(), ".");
+  for (const string& piece : pieces) {
+    if (kCppOrJavaReservedWord.find(piece) != kCppOrJavaReservedWord.end()) {
+      AIDL_ERROR(defined) << defined.GetCanonicalName() << " is an invalid name because '" << piece
+                          << "' is a Java or C++ identifier.";
+      success = false;
+    }
+    // not checking kJavaLikeTypeToAidl, since that wouldn't make sense here
+    if (kBuiltinTypes.find(piece) != kBuiltinTypes.end()) {
+      AIDL_ERROR(defined) << defined.GetCanonicalName() << " is an invalid name because '" << piece
+                          << "' is a built-in AIDL type.";
+      success = false;
+    }
+  }
+  return success;
+}
+
+bool AidlTypenames::IsIgnorableImport(const string& import) const {
+  if (IsBuiltinTypename(import)) return true;
+
+  static set<string> ignore_import = {
+      "android.os.IInterface",   "android.os.IBinder", "android.os.Parcelable", "android.os.Parcel",
+      "android.content.Context", "java.lang.String",   "java.lang.CharSequence"};
+  // these known built-in types don't need to be imported
+  if (ignore_import.find(import) != ignore_import.end()) return true;
+
+  if (TryGetDefinedType(import)) return true;
+
+  return false;
+}
+
+// Add a parsed document and populate type names in it.
+// Name conflict is an error unless one of them is from preprocessed.
+// For legacy, we populate unqualified names from preprocessed unstructured parcelable types
+// so that they can be referenced via a simple name.
+bool AidlTypenames::AddDocument(std::unique_ptr<AidlDocument> doc) {
+  bool is_preprocessed = doc->IsPreprocessed();
+  std::vector<AidlDefinedType*> types_to_add;
+  // Add types in two steps to avoid adding a type while the doc is rejected.
+  // 1. filter types to add
+  // 2. add types
+
+  std::function<bool(const std::vector<std::unique_ptr<AidlDefinedType>>&)> collect_types_to_add;
+  collect_types_to_add = [&](auto& types) {
+    for (const auto& type : types) {
+      if (IsBuiltinTypename(type->GetName())) {
+        // ParcelFileDescriptor is treated as a built-in type, but it's also in the framework.aidl.
+        // So aidl should ignore built-in types in framework.aidl to prevent duplication.
+        // (b/130899491)
+        if (is_preprocessed) {
+          continue;
+        }
+        // HasValidNameComponents handles name conflicts with built-in types
+      }
+
+      if (auto prev_definition = defined_types_.find(type->GetCanonicalName());
+          prev_definition != defined_types_.end()) {
+        // Skip duplicate type in preprocessed document
+        if (is_preprocessed) {
+          continue;
+        }
+        // Overwrite duplicate type which is already added via preprocessed with a new one
+        if (!prev_definition->second->GetDocument().IsPreprocessed()) {
+          AIDL_ERROR(type) << "redefinition: " << type->GetCanonicalName() << " is defined "
+                           << prev_definition->second->GetLocation();
+          return false;
+        }
+      }
+
+      if (!HasValidNameComponents(*type)) {
+        return false;
+      }
+
+      types_to_add.push_back(type.get());
+
+      // recursively check nested types
+      if (!collect_types_to_add(type->GetNestedTypes())) {
+        return false;
+      }
+    }
+    return true;
+  };
+
+  if (!collect_types_to_add(doc->DefinedTypes())) {
+    return false;
+  }
+
+  for (const auto& type : types_to_add) {
+    // populate global 'type' namespace with fully-qualified names
+    defined_types_.emplace(type->GetCanonicalName(), type);
+    // preprocessed unstructured parcelable types can be referenced without qualification
+    if (is_preprocessed && type->AsUnstructuredParcelable()) {
+      defined_types_.emplace(type->GetName(), type);
+    }
+  }
+
+  // transfer ownership of document
+  documents_.push_back(std::move(doc));
+  return true;
+}
+
+const AidlDocument& AidlTypenames::MainDocument() const {
+  AIDL_FATAL_IF(documents_.size() == 0, AIDL_LOCATION_HERE) << "Main document doesn't exist";
+  return *(documents_[0]);
+}
+
+bool AidlTypenames::IsBuiltinTypename(const string& type_name) {
+  return kBuiltinTypes.find(type_name) != kBuiltinTypes.end() ||
+      kJavaLikeTypeToAidlType.find(type_name) != kJavaLikeTypeToAidlType.end();
+}
+
+bool AidlTypenames::IsPrimitiveTypename(const string& type_name) {
+  return kPrimitiveTypes.find(type_name) != kPrimitiveTypes.end();
+}
+
+bool AidlTypenames::IsParcelable(const string& type_name) const {
+  if (IsBuiltinTypename(type_name)) {
+    return type_name == "ParcelableHolder" || type_name == "ParcelFileDescriptor";
+  }
+  if (auto defined_type = TryGetDefinedType(type_name); defined_type) {
+    return defined_type->AsParcelable() != nullptr;
+  }
+  return false;
+}
+
+const AidlDefinedType* AidlTypenames::TryGetDefinedType(const string& type_name) const {
+  auto found_def = defined_types_.find(type_name);
+  if (found_def != defined_types_.end()) {
+    return found_def->second;
+  }
+  return nullptr;
+}
+
+std::vector<const AidlDefinedType*> AidlTypenames::AllDefinedTypes() const {
+  std::vector<const AidlDefinedType*> res;
+  for (const auto& doc : AllDocuments()) {
+    VisitTopDown(
+        [&](const AidlNode& node) {
+          if (auto defined_type = AidlCast<AidlDefinedType>(node); defined_type) {
+            res.push_back(defined_type);
+          }
+        },
+        *doc);
+  }
+  return res;
+}
+
+AidlTypenames::ResolvedTypename AidlTypenames::ResolveTypename(const string& type_name) const {
+  if (IsBuiltinTypename(type_name)) {
+    auto found = kJavaLikeTypeToAidlType.find(type_name);
+    if (found != kJavaLikeTypeToAidlType.end()) {
+      return {found->second, true, nullptr};
+    }
+    return {type_name, true, nullptr};
+  }
+  const AidlDefinedType* defined_type = TryGetDefinedType(type_name);
+  if (defined_type != nullptr) {
+    return {defined_type->GetCanonicalName(), true, defined_type};
+  } else {
+    return {type_name, false, nullptr};
+  }
+}
+
+std::unique_ptr<AidlTypeSpecifier> AidlTypenames::MakeResolvedType(const AidlLocation& location,
+                                                                   const string& name,
+                                                                   bool is_array) const {
+  std::optional<ArrayType> array;
+  if (is_array) {
+    array = DynamicArray{};
+  }
+  std::unique_ptr<AidlTypeSpecifier> type(
+      new AidlTypeSpecifier(location, name, std::move(array), nullptr, {}));
+  AIDL_FATAL_IF(!type->Resolve(*this, nullptr), type) << "Can't make unknown type: " << name;
+  type->MarkVisited();
+  return type;
+}
+
+// Only immutable Parcelable, primitive type, and String, and List, Map, array of the types can be
+// immutable.
+bool AidlTypenames::CanBeJavaOnlyImmutable(const AidlTypeSpecifier& type) const {
+  const string& name = type.GetName();
+  if (type.IsGeneric()) {
+    if (type.GetName() == "List" || type.GetName() == "Map") {
+      const auto& types = type.GetTypeParameters();
+      return std::all_of(types.begin(), types.end(),
+                         [this](const auto& t) { return CanBeJavaOnlyImmutable(*t); });
+    }
+    AIDL_ERROR(type) << "For a generic type, an immutable parcelable can contain only List or Map.";
+    return false;
+  }
+  if (IsPrimitiveTypename(name) || name == "String") {
+    return true;
+  }
+  const AidlDefinedType* t = TryGetDefinedType(type.GetName());
+  if (t == nullptr) {
+    AIDL_ERROR(type) << "An immutable parcelable can contain only immutable Parcelable, primitive "
+                        "type, and String.";
+    return false;
+  }
+  if (t->AsEnumDeclaration()) {
+    return true;
+  }
+  return t->IsJavaOnlyImmutable();
+}
+
+// Followings can be FixedSize:
+// - @FixedSize parcelables
+// - primitive types and enum types
+// - fixed-size arrays of FixedSize types
+bool AidlTypenames::CanBeFixedSize(const AidlTypeSpecifier& type) const {
+  const string& name = type.GetName();
+  if (type.IsGeneric() || type.IsNullable()) {
+    return false;
+  }
+  if (type.IsArray() && !type.IsFixedSizeArray()) {
+    return false;
+  }
+  if (IsPrimitiveTypename(name)) {
+    return true;
+  }
+  if (IsBuiltinTypename(name)) {
+    return false;
+  }
+  const AidlDefinedType* t = TryGetDefinedType(type.GetName());
+  AIDL_FATAL_IF(t == nullptr, type)
+      << "Failed to look up type. Cannot determine if it can be fixed size: " << type.GetName();
+
+  if (t->AsEnumDeclaration()) {
+    return true;
+  }
+  return t->IsFixedSize();
+}
+
+bool AidlTypenames::IsList(const AidlTypeSpecifier& type) {
+  return type.GetName() == "List";
+}
+
+ArgumentAspect AidlTypenames::GetArgumentAspect(const AidlTypeSpecifier& type) const {
+  if (type.IsArray()) {
+    return {"array",
+            {AidlArgument::Direction::IN_DIR, AidlArgument::Direction::OUT_DIR,
+             AidlArgument::Direction::INOUT_DIR}};
+  }
+  const string& name = type.GetName();
+  if (IsBuiltinTypename(name)) {
+    if (name == "List" || name == "Map") {
+      return {name,
+              {AidlArgument::Direction::IN_DIR, AidlArgument::Direction::OUT_DIR,
+               AidlArgument::Direction::INOUT_DIR}};
+    } else if (name == "ParcelFileDescriptor") {
+      // "out ParcelFileDescriptor" is not allowed because ParcelFileDescriptor is not
+      // default-constructible.
+      return {name, {AidlArgument::Direction::IN_DIR, AidlArgument::Direction::INOUT_DIR}};
+    } else if (name == "ParcelableHolder") {
+      // TODO(b/156872582): Support it when ParcelableHolder supports every backend.
+      return {name, {}};
+    } else {
+      return {name, {AidlArgument::Direction::IN_DIR}};
+    }
+  }
+
+  const AidlDefinedType* t = TryGetDefinedType(name);
+  AIDL_FATAL_IF(t == nullptr, type) << "Unrecognized type: '" << name << "'";
+
+  // An 'out' field is passed as an argument, so it doesn't make sense if it is immutable.
+  if (t->AsParcelable() != nullptr) {
+    if (t->IsJavaOnlyImmutable()) {
+      return {"@JavaOnlyImmutable", {AidlArgument::Direction::IN_DIR}};
+    }
+    return {"parcelable/union",
+            {AidlArgument::Direction::IN_DIR, AidlArgument::Direction::OUT_DIR,
+             AidlArgument::Direction::INOUT_DIR}};
+  }
+
+  return {t->GetPreprocessDeclarationName(), {AidlArgument::Direction::IN_DIR}};
+}
+
+const AidlEnumDeclaration* AidlTypenames::GetEnumDeclaration(const AidlTypeSpecifier& type) const {
+  if (auto defined_type = TryGetDefinedType(type.GetName()); defined_type != nullptr) {
+    if (auto enum_decl = defined_type->AsEnumDeclaration(); enum_decl != nullptr) {
+      return enum_decl;
+    }
+  }
+  return nullptr;
+}
+
+const AidlInterface* AidlTypenames::GetInterface(const AidlTypeSpecifier& type) const {
+  if (auto defined_type = TryGetDefinedType(type.GetName()); defined_type != nullptr) {
+    if (auto intf = defined_type->AsInterface(); intf != nullptr) {
+      return intf;
+    }
+  }
+  return nullptr;
+}
+
+const AidlParcelable* AidlTypenames::GetParcelable(const AidlTypeSpecifier& type) const {
+  if (auto defined_type = TryGetDefinedType(type.GetName()); defined_type != nullptr) {
+    if (auto parcelable = defined_type->AsParcelable(); parcelable != nullptr) {
+      return parcelable;
+    }
+  }
+  return nullptr;
+}
+
+void AidlTypenames::IterateTypes(const std::function<void(const AidlDefinedType&)>& body) const {
+  for (const auto& kv : defined_types_) {
+    body(*kv.second);
+  }
+}
+
+bool AidlTypenames::Autofill() const {
+  bool success = true;
+  IterateTypes([&](const AidlDefinedType& type) {
+    // BackingType is filled in for all known enums, including imported enums,
+    // because other types that may use enums, such as Interface or
+    // StructuredParcelable, need to know the enum BackingType when
+    // generating code.
+    if (auto enum_decl = const_cast<AidlDefinedType&>(type).AsEnumDeclaration(); enum_decl) {
+      if (!enum_decl->Autofill(*this)) {
+        success = false;
+      }
+    }
+  });
+  return success;
+}
+
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_typenames.h b/aidl_typenames.h
new file mode 100644
index 0000000..9ae851d
--- /dev/null
+++ b/aidl_typenames.h
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include <functional>
+#include <map>
+#include <memory>
+#include <optional>
+#include <set>
+#include <string>
+#include <utility>
+#include <vector>
+
+using std::map;
+using std::optional;
+using std::pair;
+using std::set;
+using std::string;
+using std::unique_ptr;
+using std::vector;
+
+class AidlDefinedType;
+class AidlEnumDeclaration;
+class AidlInterface;
+class AidlLocation;
+class AidlParcelable;
+class AidlTypeSpecifier;
+class AidlDocument;
+struct ArgumentAspect;
+
+namespace android {
+namespace aidl {
+
+// AidlTypenames is a collection of AIDL types available to a compilation unit.
+//
+// Basic types (such as int, String, etc.) are added by default, while defined
+// types (such as IFoo, MyParcelable, etc.) and types from preprocessed inputs
+// are added as they are recognized by the parser.
+//
+// When AidlTypeSpecifier is encountered during parsing, parser defers the
+// resolution of it until the end of the parsing, where it uses AidlTypenames
+// to resolve type names in AidlTypeSpecifier.
+//
+// Note that nothing here is specific to either Java or C++.
+class AidlTypenames final {
+ public:
+  AidlTypenames() = default;
+  bool AddDocument(std::unique_ptr<AidlDocument> doc);
+  const std::vector<std::unique_ptr<AidlDocument>>& AllDocuments() const { return documents_; }
+  const AidlDocument& MainDocument() const;
+  static bool IsBuiltinTypename(const string& type_name);
+  static bool IsPrimitiveTypename(const string& type_name);
+  bool IsParcelable(const string& type_name) const;
+  const AidlDefinedType* TryGetDefinedType(const string& type_name) const;
+  std::vector<const AidlDefinedType*> AllDefinedTypes() const;
+
+  struct ResolvedTypename {
+    std::string canonical_name;
+    bool is_resolved;
+    const AidlDefinedType* defined_type;
+  };
+  ResolvedTypename ResolveTypename(const string& type_name) const;
+  std::unique_ptr<AidlTypeSpecifier> MakeResolvedType(const AidlLocation& location,
+                                                      const string& name, bool is_array) const;
+  ArgumentAspect GetArgumentAspect(const AidlTypeSpecifier& type) const;
+  bool CanBeJavaOnlyImmutable(const AidlTypeSpecifier& type) const;
+  bool CanBeFixedSize(const AidlTypeSpecifier& type) const;
+  static bool IsList(const AidlTypeSpecifier& type);
+
+  bool IsIgnorableImport(const string& import) const;
+  // Returns the AidlEnumDeclaration of the given type, or nullptr if the type
+  // is not an AidlEnumDeclaration;
+  const AidlEnumDeclaration* GetEnumDeclaration(const AidlTypeSpecifier& type) const;
+  // Returns the AidlInterface of the given type, or nullptr if the type
+  // is not an AidlInterface;
+  const AidlInterface* GetInterface(const AidlTypeSpecifier& type) const;
+  // Returns the AidlParcelable of the given type, or nullptr if the type
+  // is not an AidlParcelable;
+  const AidlParcelable* GetParcelable(const AidlTypeSpecifier& type) const;
+  // Iterates over all defined types
+  void IterateTypes(const std::function<void(const AidlDefinedType&)>& body) const;
+  // Fixes AST after type/ref resolution before validation
+  bool Autofill() const;
+
+ private:
+  map<string, AidlDefinedType*> defined_types_;
+  std::vector<std::unique_ptr<AidlDocument>> documents_;
+};
+
+}  // namespace aidl
+}  // namespace android
diff --git a/aidl_unittest.cpp b/aidl_unittest.cpp
new file mode 100644
index 0000000..614a612
--- /dev/null
+++ b/aidl_unittest.cpp
@@ -0,0 +1,5701 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl.h"
+
+#include <android-base/format.h>
+#include <android-base/stringprintf.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <map>
+#include <memory>
+#include <set>
+#include <string>
+#include <variant>
+#include <vector>
+
+#include "aidl_checkapi.h"
+#include "aidl_dumpapi.h"
+#include "aidl_language.h"
+#include "aidl_to_cpp.h"
+#include "aidl_to_cpp_common.h"
+#include "aidl_to_java.h"
+#include "aidl_to_ndk.h"
+#include "aidl_to_rust.h"
+#include "comments.h"
+#include "logging.h"
+#include "options.h"
+#include "parser.h"
+#include "preprocess.h"
+#include "tests/fake_io_delegate.h"
+
+using android::aidl::test::FakeIoDelegate;
+using android::base::StringPrintf;
+using std::map;
+using std::set;
+using std::string;
+using std::unique_ptr;
+using std::variant;
+using std::vector;
+using testing::HasSubstr;
+using testing::TestParamInfo;
+using testing::internal::CaptureStderr;
+using testing::internal::GetCapturedStderr;
+
+namespace android {
+namespace aidl {
+namespace {
+
+const char kExpectedDepFileContents[] =
+R"(place/for/output/p/IFoo.java : \
+  p/IFoo.aidl
+
+p/IFoo.aidl :
+)";
+
+const char kExpectedNinjaDepFileContents[] =
+R"(place/for/output/p/IFoo.java : \
+  p/IFoo.aidl
+)";
+
+const char kExpectedParcelableDeclarationDepFileContents[] =
+    R"( : \
+  p/Foo.aidl
+
+p/Foo.aidl :
+)";
+
+const char kExpectedStructuredParcelableDepFileContents[] =
+    R"(place/for/output/p/Foo.java : \
+  p/Foo.aidl
+
+p/Foo.aidl :
+)";
+
+}  // namespace
+
+const string INVALID_INT8_VALUE = "Invalid type specifier for an int8 literal";
+const string INVALID_FLOAT_VALUE = "Invalid type specifier for a literal float";
+const string INVALID_OPERATION = "Cannot perform operation";
+
+class AidlTest : public ::testing::TestWithParam<Options::Language> {
+ protected:
+  AidlDefinedType* Parse(const string& path, const string& contents, AidlTypenames& typenames_,
+                         Options::Language lang, AidlError* error = nullptr,
+                         const vector<string> additional_arguments = {}) {
+    io_delegate_.SetFileContents(path, contents);
+    vector<string> args;
+    args.emplace_back("aidl");
+    args.emplace_back("--min_sdk_version=current");
+    args.emplace_back("--lang=" + to_string(lang));
+    for (const string& s : additional_arguments) {
+      args.emplace_back(s);
+    }
+    for (const string& f : preprocessed_files_) {
+      args.emplace_back("--preprocessed=" + f);
+    }
+    args.emplace_back("--include=.");
+    for (const string& i : import_paths_) {
+      args.emplace_back("--include=" + i);
+    }
+    args.emplace_back(path);
+    Options options = Options::From(args);
+    vector<string> imported_files;
+    ImportResolver import_resolver{io_delegate_, path, import_paths_};
+    AidlError actual_error = ::android::aidl::internals::load_and_validate_aidl(
+        path, options, io_delegate_, &typenames_, &imported_files);
+
+    if (error != nullptr) {
+      *error = actual_error;
+    }
+
+    if (actual_error != AidlError::OK) {
+      return nullptr;
+    }
+
+    const auto& defined_types = typenames_.MainDocument().DefinedTypes();
+    EXPECT_EQ(1ul, defined_types.size());
+
+    return defined_types.front().get();
+  }
+
+  void EvaluateInvalidAssignment(string content, string expected_stderr, AidlTypenames& typenames_,
+                                 Options::Language lang) {
+    AidlError error;
+    CaptureStderr();
+    EXPECT_EQ(nullptr, Parse("a/IFoo.aidl", content, typenames_, lang, &error));
+    EXPECT_THAT(GetCapturedStderr(), HasSubstr(expected_stderr));
+  };
+
+  void EvaluateValidAssignment(string content, string expected_stderr, AidlTypenames& typenames_,
+                               Options::Language lang) {
+    AidlError error;
+    CaptureStderr();
+    EXPECT_NE(nullptr, Parse("a/IFoo.aidl", content, typenames_, lang, &error));
+    EXPECT_THAT(GetCapturedStderr(), HasSubstr(expected_stderr));
+  };
+
+  Options::Language GetLanguage() { return GetParam(); }
+
+  FakeIoDelegate io_delegate_;
+  vector<string> preprocessed_files_;
+  set<string> import_paths_;
+  AidlTypenames typenames_;
+};
+
+// Instantiate the AidlTest parameterized suite, calling all of the TEST_P
+// tests with each of the supported languages as a parameter.
+INSTANTIATE_TEST_SUITE_P(AidlTestSuite, AidlTest,
+                         testing::Values(Options::Language::CPP, Options::Language::JAVA,
+                                         Options::Language::NDK, Options::Language::RUST),
+                         [](const testing::TestParamInfo<Options::Language>& info) {
+                           return to_string(info.param);
+                         });
+
+TEST_P(AidlTest, AcceptMissingPackage) {
+  EXPECT_NE(nullptr, Parse("IFoo.aidl", "interface IFoo { }", typenames_, GetLanguage()));
+}
+
+TEST_P(AidlTest, EndsInSingleLineComment) {
+  EXPECT_NE(nullptr, Parse("IFoo.aidl", "interface IFoo { } // foo", typenames_, GetLanguage()));
+}
+
+TEST_P(AidlTest, InterfaceRequiresCorrectPath) {
+  const string expected_stderr =
+      "ERROR: a/Foo.aidl:1.11-21: IBar should be declared in a file called a/IBar.aidl\n";
+  const std::string file_contents = "package a; interface IBar {}";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/Foo.aidl", file_contents, typenames_, GetLanguage()));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr()) << file_contents;
+}
+
+TEST_P(AidlTest, ParcelableRequiresCorrectPath) {
+  const string expected_stderr =
+      "ERROR: a/Foo.aidl:1.11-21: Bar should be declared in a file called a/Bar.aidl\n";
+  const std::string file_contents = "package a; interface Bar {}";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/Foo.aidl", file_contents, typenames_, GetLanguage()));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr()) << file_contents;
+}
+
+TEST_P(AidlTest, UnstructuredParcelableRequiresCorrectPath) {
+  const string expected_stderr =
+      "ERROR: a/Foo.aidl:1.22-26: Bar should be declared in a file called a/Bar.aidl\n";
+  const std::string file_contents = "package a; parcelable Bar cpp_header \"anything.h\";";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/Foo.aidl", file_contents, typenames_, GetLanguage()));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr()) << file_contents;
+}
+
+TEST_P(AidlTest, EnumRequiresCorrectPath) {
+  const string expected_stderr =
+      "ERROR: a/Foo.aidl:1.16-20: Bar should be declared in a file called a/Bar.aidl\n";
+  const std::string file_contents = "package a; enum Bar { A, }";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/Foo.aidl", file_contents, typenames_, GetLanguage()));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr()) << file_contents;
+}
+
+TEST_P(AidlTest, SupportOnlyOutParameters) {
+  const string interface_list = "package a; interface IBar { void f(out List<String> bar); }";
+  EXPECT_NE(nullptr, Parse("a/IBar.aidl", interface_list, typenames_, GetLanguage()));
+}
+
+TEST_P(AidlTest, RejectOutParametersForIBinder) {
+  const string interface_ibinder = "package a; interface IBaz { void f(out IBinder bar); }";
+  const string expected_ibinder_stderr =
+      "ERROR: a/IBaz.aidl:1.47-51: 'bar' can't be an out parameter because IBinder can only be an "
+      "in parameter.\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/IBaz.aidl", interface_ibinder, typenames_, GetLanguage()));
+  EXPECT_EQ(expected_ibinder_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, RejectsOutParametersInOnewayInterface) {
+  const string oneway_interface = "package a; oneway interface IBar { void f(out int[] bar); }";
+  const string expected_stderr =
+      "ERROR: a/IBar.aidl:1.40-42: oneway method 'f' cannot have out parameters\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/IBar.aidl", oneway_interface, typenames_, GetLanguage()));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, RejectsOutParametersInOnewayMethod) {
+  const string oneway_method = "package a; interface IBar { oneway void f(out int[] bar); }";
+  const string expected_stderr =
+      "ERROR: a/IBar.aidl:1.40-42: oneway method 'f' cannot have out parameters\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/IBar.aidl", oneway_method, typenames_, GetLanguage()));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, RejectsOnewayNonVoidReturn) {
+  const string oneway_method = "package a; interface IFoo { oneway int f(); }";
+  const string expected_stderr =
+      "ERROR: a/IFoo.aidl:1.39-41: oneway method 'f' cannot return a value\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/IFoo.aidl", oneway_method, typenames_, GetLanguage()));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, RejectsNullablePrimitive) {
+  const string oneway_method = "package a; interface IFoo { @nullable int f(); }";
+  const string expected_stderr =
+      "ERROR: a/IFoo.aidl:1.38-42: Primitive type cannot get nullable annotation\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/IFoo.aidl", oneway_method, typenames_, GetLanguage()));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, AcceptNullableList) {
+  const string oneway_method = "package a; interface IFoo { @nullable List<String> f(); }";
+  const string expected_stderr = "";
+  CaptureStderr();
+  EXPECT_NE(nullptr, Parse("a/IFoo.aidl", oneway_method, typenames_, GetLanguage()));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, RejectRecursiveParcelable) {
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("Foo.aidl", "parcelable Foo { Foo foo; }", typenames_, GetLanguage()));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Foo is a recursive parcelable"));
+}
+
+TEST_P(AidlTest, RejectIndirectRecursiveParcelable) {
+  io_delegate_.SetFileContents("Bar.aidl", "parcelable Bar { Foo foo; }");
+  import_paths_.emplace("");
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("Foo.aidl", "parcelable Foo { Bar bar; }", typenames_, GetLanguage()));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Foo is a recursive parcelable"));
+}
+
+TEST_P(AidlTest, RejectRecursiveTypeEvenIfNullable) {
+  // Note: in native backends @nullable is mapped to non-heap wrapper like std::optional/Option<T>
+  io_delegate_.SetFileContents("Bar.aidl", "parcelable Bar { @nullable Foo foo; }");
+  import_paths_.emplace("");
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("Foo.aidl", "parcelable Foo { Bar bar; }", typenames_, GetLanguage()));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Foo is a recursive parcelable"));
+}
+
+TEST_P(AidlTest, OkayIfRecursionInvolvesHeapType) {
+  CaptureStderr();
+  std::string java_only_map_field;
+  if (GetLanguage() == Options::Language::JAVA) {
+    java_only_map_field = "  Map<String, Foo> map;\n";
+  }
+  EXPECT_NE(nullptr, Parse("Foo.aidl",
+                           "parcelable Foo {\n"
+                           "  List<Foo> list;\n" +
+                               java_only_map_field +
+                               "  Foo[] arr;\n"
+                               "  @nullable(heap=true) Foo heap_nullable;\n"
+                               "}\n",
+                           typenames_, GetLanguage()));
+  EXPECT_THAT(GetCapturedStderr(), "");
+}
+
+TEST_P(AidlTest, InterfaceCanReferenceItself) {
+  CaptureStderr();
+  EXPECT_NE(nullptr, Parse("IFoo.aidl", "interface IFoo { void foo(in IFoo self); }", typenames_,
+                           GetLanguage()));
+  EXPECT_THAT(GetCapturedStderr(), "");
+}
+
+TEST_P(AidlTest, HeapNullableCantApplyToOtherThanParcelables) {
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("Foo.aidl",
+                           "parcelable Foo {\n"
+                           "  @nullable(heap=true) String s;\n"
+                           "}",
+                           typenames_, GetLanguage()));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("@nullable(heap=true) is available to parcelables"));
+}
+
+TEST_P(AidlTest, RejectsDuplicatedArgumentNames) {
+  const string method = "package a; interface IFoo { void f(int a, int a); }";
+  const string expected_stderr =
+      "ERROR: a/IFoo.aidl:1.33-35: method 'f' has duplicate argument name 'a'\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/IFoo.aidl", method, typenames_, GetLanguage()));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, RejectsDuplicatedFieldNames) {
+  const string method = "package a; parcelable Foo { int a; String a; }";
+  const string expected_stderr = "ERROR: a/Foo.aidl:1.42-44: 'Foo' has duplicate field name 'a'\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/Foo.aidl", method, typenames_, GetLanguage()));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, AcceptsEmptyParcelable) {
+  CaptureStderr();
+  EXPECT_NE(nullptr, Parse("Foo.aidl", "parcelable Foo {}", typenames_, GetLanguage()));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+TEST_P(AidlTest, RejectsDuplicatedAnnotationParams) {
+  const string method = "package a; interface IFoo { @UnsupportedAppUsage(foo=1, foo=2)void f(); }";
+  const string expected_stderr = "ERROR: a/IFoo.aidl:1.56-62: Trying to redefine parameter foo.\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/IFoo.aidl", method, typenames_, GetLanguage()));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, RejectUnsupportedInterfaceAnnotations) {
+  AidlError error;
+  const string method = "package a; @nullable interface IFoo { int f(); }";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/IFoo.aidl", method, typenames_, GetLanguage(), &error));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("@nullable is not available."));
+  EXPECT_EQ(AidlError::BAD_TYPE, error);
+}
+
+TEST_P(AidlTest, RejectUnsupportedTypeAnnotations) {
+  AidlError error;
+  const string method = "package a; interface IFoo { @JavaOnlyStableParcelable int f(); }";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/IFoo.aidl", method, typenames_, GetLanguage(), &error));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("@JavaOnlyStableParcelable is not available."));
+  EXPECT_EQ(AidlError::BAD_TYPE, error);
+}
+
+TEST_P(AidlTest, RejectUnsupportedParcelableDefineAnnotations) {
+  AidlError error;
+  const string method = "package a; @nullable parcelable Foo { String a; String b; }";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/Foo.aidl", method, typenames_, GetLanguage(), &error));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("@nullable is not available."));
+  EXPECT_EQ(AidlError::BAD_TYPE, error);
+}
+
+TEST_P(AidlTest, ParsesNonNullableAnnotation) {
+  auto parse_result =
+      Parse("a/IFoo.aidl", "package a; interface IFoo { String f(); }", typenames_, GetLanguage());
+  ASSERT_NE(nullptr, parse_result);
+  const AidlInterface* interface = parse_result->AsInterface();
+  ASSERT_NE(nullptr, interface);
+  ASSERT_FALSE(interface->GetMethods().empty());
+  EXPECT_FALSE(interface->GetMethods()[0]->GetType().IsNullable());
+}
+
+TEST_P(AidlTest, ParsesNullableAnnotation) {
+  auto parse_result = Parse("a/IFoo.aidl", "package a; interface IFoo { @nullable String f(); }",
+                            typenames_, GetLanguage());
+  ASSERT_NE(nullptr, parse_result);
+  const AidlInterface* interface = parse_result->AsInterface();
+  ASSERT_NE(nullptr, interface);
+  ASSERT_FALSE(interface->GetMethods().empty());
+  EXPECT_TRUE(interface->GetMethods()[0]->GetType().IsNullable());
+}
+
+TEST_P(AidlTest, ParsesNonUtf8Annotations) {
+  auto parse_result =
+      Parse("a/IFoo.aidl", "package a; interface IFoo { String f(); }", typenames_, GetLanguage());
+  ASSERT_NE(nullptr, parse_result);
+  const AidlInterface* interface = parse_result->AsInterface();
+  ASSERT_NE(nullptr, interface);
+  ASSERT_FALSE(interface->GetMethods().empty());
+  EXPECT_FALSE(interface->GetMethods()[0]->GetType().IsUtf8InCpp());
+}
+
+TEST_P(AidlTest, ParsesUtf8Annotations) {
+  auto parse_result = Parse("a/IFoo.aidl", "package a; interface IFoo { @utf8InCpp String f(); }",
+                            typenames_, GetLanguage());
+  ASSERT_NE(nullptr, parse_result);
+  const AidlInterface* interface = parse_result->AsInterface();
+  ASSERT_NE(nullptr, interface);
+  ASSERT_FALSE(interface->GetMethods().empty());
+  EXPECT_TRUE(interface->GetMethods()[0]->GetType().IsUtf8InCpp());
+}
+
+TEST_P(AidlTest, VintfRequiresStructuredAndStability) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: IFoo.aidl:1.16-26: Must compile @VintfStability type w/ aidl_interface 'stability: "
+      "\"vintf\"'\n"
+      "ERROR: IFoo.aidl:1.16-26: Must compile @VintfStability type w/ aidl_interface "
+      "--structured\n";
+  CaptureStderr();
+  ASSERT_EQ(nullptr, Parse("IFoo.aidl", "@VintfStability interface IFoo {}", typenames_,
+                           GetLanguage(), &error));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+  ASSERT_EQ(AidlError::NOT_STRUCTURED, error);
+}
+
+TEST_P(AidlTest, VintfRequiresStructured) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: IFoo.aidl:1.16-26: Must compile @VintfStability type w/ aidl_interface "
+      "--structured\n";
+  CaptureStderr();
+  ASSERT_EQ(nullptr, Parse("IFoo.aidl", "@VintfStability interface IFoo {}", typenames_,
+                           GetLanguage(), &error, {"--stability", "vintf"}));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+  ASSERT_EQ(AidlError::NOT_STRUCTURED, error);
+}
+
+TEST_P(AidlTest, VintfRequiresSpecifiedStability) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: IFoo.aidl:1.16-26: Must compile @VintfStability type w/ aidl_interface 'stability: "
+      "\"vintf\"'\n";
+  CaptureStderr();
+  ASSERT_EQ(nullptr, Parse("IFoo.aidl", "@VintfStability interface IFoo {}", typenames_,
+                           GetLanguage(), &error, {"--structured"}));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+  ASSERT_EQ(AidlError::NOT_STRUCTURED, error);
+}
+
+TEST_P(AidlTest, ParsesStabilityAnnotations) {
+  AidlError error;
+  auto parse_result = Parse("IFoo.aidl", "@VintfStability interface IFoo {}", typenames_,
+                            GetLanguage(), &error, {"--structured", "--stability", "vintf"});
+  ASSERT_EQ(AidlError::OK, error);
+  ASSERT_NE(nullptr, parse_result);
+  const AidlInterface* interface = parse_result->AsInterface();
+  ASSERT_NE(nullptr, interface);
+  ASSERT_TRUE(interface->IsVintfStability());
+}
+
+TEST_P(AidlTest, TypesShouldHaveVintfStabilityWhenCompilingWithTheVintfFlag) {
+  CaptureStderr();
+  string code =
+      "@VintfStability\n"
+      "parcelable Foo {\n"
+      "  interface INested { interface INastyNester {} }"
+      "}";
+  EXPECT_NE(nullptr, Parse("Foo.aidl", code, typenames_, GetLanguage(), nullptr,
+                           {"--structured", "--stability", "vintf"}));
+  EXPECT_EQ(GetCapturedStderr(), "");
+  auto nested = typenames_.TryGetDefinedType("Foo.INested");
+  ASSERT_NE(nullptr, nested);
+  ASSERT_TRUE(nested->IsVintfStability());
+
+  auto nastyNester = typenames_.TryGetDefinedType("Foo.INested.INastyNester");
+  ASSERT_NE(nullptr, nastyNester);
+  ASSERT_TRUE(nastyNester->IsVintfStability());
+}
+
+TEST_P(AidlTest, VintfStabilityAppliesToNestedTypesAsWell) {
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("Foo.aidl", "parcelable Foo {}", typenames_, GetLanguage(), nullptr,
+                           {"--structured", "--stability", "vintf"}));
+  EXPECT_THAT(GetCapturedStderr(),
+              HasSubstr("Foo does not have VINTF level stability (marked @VintfStability)"));
+}
+
+TEST_F(AidlTest, ParsesJavaOnlyStableParcelable) {
+  Options java_options = Options::From("aidl -I . -o out --structured a/Foo.aidl");
+  Options cpp_options = Options::From("aidl -I . --lang=cpp -o out -h out/include a/Foo.aidl");
+  Options cpp_structured_options =
+      Options::From("aidl --lang=cpp -I . --structured -o out -h out/include a/Foo.aidl");
+  Options rust_options = Options::From("aidl -I . --lang=rust -o out --structured a/Foo.aidl");
+  io_delegate_.SetFileContents(
+      "a/Foo.aidl",
+      StringPrintf("package a; @JavaOnlyStableParcelable parcelable Foo cpp_header \"Foo.h\" ;"));
+
+  EXPECT_TRUE(compile_aidl(java_options, io_delegate_));
+  EXPECT_TRUE(compile_aidl(cpp_options, io_delegate_));
+
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(cpp_structured_options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Cannot declare unstructured"));
+
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(rust_options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Cannot declare unstructured"));
+}
+
+TEST_F(AidlTest, ParsesNdkOnlyStableParcelable) {
+  Options java_options = Options::From("aidl -I . -o out --structured a/Foo.aidl");
+  Options ndk_structured_options =
+      Options::From("aidl --lang=ndk --structured -I . -o out -h out/include a/Foo.aidl");
+  Options rust_options = Options::From("aidl --lang=rust -I . -o out --structured a/Foo.aidl");
+  Options cpp_options = Options::From("aidl --lang=cpp -I . -o out -h out/include a/Foo.aidl");
+  io_delegate_.SetFileContents(
+      "a/Foo.aidl",
+      StringPrintf("package a; @NdkOnlyStableParcelable parcelable Foo cpp_header \"Foo.h\" ;"));
+
+  EXPECT_TRUE(compile_aidl(cpp_options, io_delegate_));
+
+  // not considered unstructured, but it still can't be compiled directly with
+  // --structured AIDL - it can only be used as an import
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(ndk_structured_options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(),
+              HasSubstr("Refusing to generate code with unstructured parcelables"));
+
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(java_options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Cannot declare unstructured"));
+
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(rust_options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Cannot declare unstructured"));
+}
+
+TEST_P(AidlTest, NdkAndJavaAndRustStabilityIsVintfStable) {
+  CaptureStderr();
+
+  io_delegate_.SetFileContents(
+      "NonPortableThing.aidl",
+      "@NdkOnlyStableParcelable @JavaOnlyStableParcelable @RustOnlyStableParcelable parcelable "
+      "NonPortableThing ndk_header \"lol.h\" cpp_header \"lolol.h\" rust_type \"lol::Lol\";");
+  import_paths_.emplace("");
+
+  auto result =
+      Parse("IFoo.aidl",
+            "import NonPortableThing; @VintfStability interface IFoo { NonPortableThing get(); }",
+            typenames_, GetLanguage(), nullptr, {"--structured", "--stability", "vintf"});
+
+  if (GetLanguage() == Options::Language::NDK || GetLanguage() == Options::Language::JAVA ||
+      GetLanguage() == Options::Language::RUST) {
+    EXPECT_NE(result, nullptr);
+    EXPECT_EQ(GetCapturedStderr(), "");
+  } else {
+    EXPECT_EQ(result, nullptr);
+    EXPECT_THAT(
+        GetCapturedStderr(),
+        HasSubstr("NonPortableThing does not have VINTF level stability (marked @VintfStability)"));
+  }
+}
+
+TEST_F(AidlTest, ParcelableSupportJavaDeriveToString) {
+  io_delegate_.SetFileContents("a/Foo.aidl", R"(package a;
+    @JavaDerive(toString=true) parcelable Foo { int a; float b; })");
+  Options java_options = Options::From("aidl --lang=java -I . -o out a/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(java_options, io_delegate_));
+
+  string java_out;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/a/Foo.java", &java_out));
+  EXPECT_THAT(java_out, testing::HasSubstr("public String toString() {"));
+
+  // Other backends shouldn't be bothered
+  Options cpp_options = Options::From("aidl --lang=cpp -I . -o out -h out a/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(cpp_options, io_delegate_));
+
+  Options ndk_options = Options::From("aidl --lang=ndk -I . -o out -h out a/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(ndk_options, io_delegate_));
+}
+
+TEST_F(AidlTest, UnionSupportJavaDeriveToString) {
+  io_delegate_.SetFileContents("a/Foo.aidl", R"(package a;
+    @JavaDerive(toString=true) union Foo { int a; int[] b; })");
+  CaptureStderr();
+  Options java_options = Options::From("aidl --lang=java -I . -o out a/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(java_options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+TEST_F(AidlTest, ParcelableSupportJavaDeriveEquals) {
+  io_delegate_.SetFileContents("a/Foo.aidl", R"(package a;
+    @JavaDerive(equals=true) parcelable Foo { int a; float b; })");
+  CaptureStderr();
+  Options java_options = Options::From("aidl --lang=java -I . -o out a/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(java_options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+
+  const std::string expected = R"--(
+  @Override
+  public boolean equals(Object other) {
+    if (this == other) return true;
+    if (other == null) return false;
+    if (!(other instanceof Foo)) return false;
+    Foo that = (Foo)other;
+    if (!java.util.Objects.deepEquals(a, that.a)) return false;
+    if (!java.util.Objects.deepEquals(b, that.b)) return false;
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return java.util.Arrays.deepHashCode(java.util.Arrays.asList(a, b).toArray());
+  }
+)--";
+
+  string java_out;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/a/Foo.java", &java_out));
+  EXPECT_THAT(java_out, testing::HasSubstr(expected));
+}
+
+TEST_F(AidlTest, UnionSupportJavaDeriveEquals) {
+  io_delegate_.SetFileContents("a/Foo.aidl", R"(package a;
+    @JavaDerive(equals=true) union Foo { int a; int[] b; })");
+  CaptureStderr();
+  Options java_options = Options::From("aidl --lang=java -I . -o out a/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(java_options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+
+  const std::string expected = R"--(
+  @Override
+  public boolean equals(Object other) {
+    if (this == other) return true;
+    if (other == null) return false;
+    if (!(other instanceof Foo)) return false;
+    Foo that = (Foo)other;
+    if (_tag != that._tag) return false;
+    if (!java.util.Objects.deepEquals(_value, that._value)) return false;
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return java.util.Arrays.deepHashCode(java.util.Arrays.asList(_tag, _value).toArray());
+  }
+)--";
+
+  string java_out;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/a/Foo.java", &java_out));
+  EXPECT_THAT(java_out, testing::HasSubstr(expected));
+}
+
+TEST_F(AidlTest, RejectsJavaDeriveAnnotation) {
+  {
+    io_delegate_.SetFileContents("a/Foo.aidl",
+                                 "package a; @JavaDerive(blah=true) parcelable Foo{}");
+    Options java_options = Options::From("aidl --lang=java -I . -o out a/Foo.aidl");
+    CaptureStderr();
+    EXPECT_FALSE(compile_aidl(java_options, io_delegate_));
+    const std::string expected_stderr =
+        "ERROR: a/Foo.aidl:1.11-34: Parameter blah not supported for annotation JavaDerive.";
+    EXPECT_THAT(GetCapturedStderr(),
+                HasSubstr("Parameter blah not supported for annotation JavaDerive."));
+  }
+
+  {
+    io_delegate_.SetFileContents("a/IFoo.aidl", "package a; @JavaDerive interface IFoo{}");
+    Options java_options = Options::From("aidl --lang=java -I . -o out a/IFoo.aidl");
+    CaptureStderr();
+    EXPECT_FALSE(compile_aidl(java_options, io_delegate_));
+    EXPECT_THAT(GetCapturedStderr(), HasSubstr("@JavaDerive is not available."));
+  }
+}
+
+TEST_P(AidlTest, ParseDescriptorAnnotation) {
+  AidlError error;
+  auto parse_result = Parse("IFoo.aidl", R"(@Descriptor(value="IBar") interface IFoo{})",
+                            typenames_, GetLanguage(), &error, {"--structured"});
+  ASSERT_EQ(AidlError::OK, error);
+  ASSERT_NE(nullptr, parse_result);
+  const AidlInterface* interface = parse_result->AsInterface();
+  ASSERT_NE(nullptr, interface);
+  ASSERT_EQ("IBar", interface->GetDescriptor());
+}
+
+TEST_P(AidlTest, UnknownAnnotation) {
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/IFoo.aidl", "package a; @Unknown interface IFoo { }", typenames_,
+                           GetLanguage()));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("not a recognized annotation"));
+
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/IFoo.aidl", "package a; @Unknown(param=true) interface IFoo { }",
+                           typenames_, GetLanguage()));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("not a recognized annotation"));
+}
+
+TEST_P(AidlTest, AcceptsOnewayMethod) {
+  const string oneway_method = "package a; interface IFoo { oneway void f(int a); }";
+  EXPECT_NE(nullptr, Parse("a/IFoo.aidl", oneway_method, typenames_, GetLanguage()));
+}
+
+TEST_P(AidlTest, AcceptsOnewayInterface) {
+  const string oneway_interface = "package a; oneway interface IBar { void f(int a); }";
+  EXPECT_NE(nullptr, Parse("a/IBar.aidl", oneway_interface, typenames_, GetLanguage()));
+}
+
+TEST_P(AidlTest, AcceptsAnnotatedOnewayMethod) {
+  const string oneway_method =
+      "package a; interface IFoo { @UnsupportedAppUsage oneway void f(int a); }";
+  EXPECT_NE(nullptr, Parse("a/IFoo.aidl", oneway_method, typenames_, GetLanguage()));
+}
+
+TEST_P(AidlTest, AnnotationsInMultiplePlaces) {
+  const string oneway_method =
+      "package a; interface IFoo { @UnsupportedAppUsage oneway @PropagateAllowBlocking void f(int "
+      "a); }";
+  const AidlDefinedType* defined = Parse("a/IFoo.aidl", oneway_method, typenames_, GetLanguage());
+  ASSERT_NE(nullptr, defined);
+  const AidlInterface* iface = defined->AsInterface();
+  ASSERT_NE(nullptr, iface);
+
+  const auto& methods = iface->GetMethods();
+  ASSERT_EQ(1u, methods.size());
+  const auto& method = methods[0];
+  const AidlTypeSpecifier& ret_type = method->GetType();
+
+  // TODO(b/151102494): these annotations should be on the method
+  ASSERT_NE(nullptr, ret_type.UnsupportedAppUsage());
+  ASSERT_TRUE(ret_type.IsPropagateAllowBlocking());
+}
+
+TEST_P(AidlTest, AnnotationValueAttribute) {
+  const string content =
+      "package a; @Descriptor(\"descriptor_value\") interface IFoo { void f(int a); }";
+  const AidlDefinedType* defined = Parse("a/IFoo.aidl", content, typenames_, GetLanguage());
+  ASSERT_NE(nullptr, defined);
+  const AidlInterface* iface = defined->AsInterface();
+  ASSERT_NE(nullptr, iface);
+
+  ASSERT_EQ("descriptor_value", iface->GetDescriptor());
+}
+
+TEST_F(AidlTest, CheckApiForAnnotationValueAttribute) {
+  Options options = Options::From("aidl --checkapi=equal old new");
+
+  io_delegate_.SetFileContents("old/p/IFoo.aidl",
+                               "package p; @Descriptor(value=\"v1\") interface IFoo{ void foo();}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl",
+                               "package p; @Descriptor(\"v1\") interface IFoo{ void foo();}");
+
+  EXPECT_TRUE(::android::aidl::check_api(options, io_delegate_));
+}
+
+TEST_P(AidlTest, WritesComments) {
+  string foo_interface =
+      R"(package a;
+        /* foo */
+        interface IFoo {
+          /* i */
+          int i();
+          // j
+          @nullable String j();
+          // k1
+          /* k2 */
+          @UnsupportedAppUsage oneway void k(int a);
+        })";
+
+  CaptureStderr();
+  auto parse_result = Parse("a/IFoo.aidl", foo_interface, typenames_, GetLanguage());
+  EXPECT_NE(nullptr, parse_result);
+  EXPECT_EQ("", GetCapturedStderr());
+
+  EXPECT_EQ((Comments{{"/* foo */"}}), parse_result->GetComments());
+
+  const AidlInterface* interface = parse_result->AsInterface();
+  EXPECT_EQ((Comments{{"/* i */"}}), interface->GetMethods()[0]->GetComments());
+  EXPECT_EQ((Comments{{"// j\n"}}), interface->GetMethods()[1]->GetComments());
+  EXPECT_EQ((Comments{{"// k1\n"}, {"/* k2 */"}}), interface->GetMethods()[2]->GetComments());
+}
+
+TEST_P(AidlTest, CppHeaderCanBeIdentifierAsWell) {
+  io_delegate_.SetFileContents("p/cpp_header.aidl",
+                               R"(package p;
+         parcelable cpp_header cpp_header "bar/header" ndk_header "ndk/bar/header" )"
+                               R"(rust_type "package::SomeType";)");
+  import_paths_.emplace("");
+  const string input_path = "p/IFoo.aidl";
+  const string input = R"(package p;
+                          import p.cpp_header;
+                          interface IFoo {
+                            // get bar
+                            cpp_header get();
+                          })";
+
+  auto parse_result = Parse(input_path, input, typenames_, GetLanguage());
+  EXPECT_NE(nullptr, parse_result);
+  const AidlInterface* interface = parse_result->AsInterface();
+  EXPECT_EQ((Comments{{"// get bar\n"}}), interface->GetMethods()[0]->GetComments());
+}
+
+TEST_F(AidlTest, RejectsIfCppHeaderIsMissing) {
+  io_delegate_.SetFileContents("Foo.aidl", "parcelable Foo;");
+  Options options = Options::From("aidl -I . --lang cpp -h h -o o Foo.aidl");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("must have cpp_header defined"));
+}
+
+TEST_F(AidlTest, RejectsIfTypeRefsCppHeaderIsMissing) {
+  io_delegate_.SetFileContents("Foo.aidl", "parcelable Foo;");
+  io_delegate_.SetFileContents("IBar.aidl", "interface IBar { void bar(in Foo foo); }");
+  Options options = Options::From("aidl -I . --lang cpp -h h -o o IBar.aidl");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("must have cpp_header defined"));
+}
+
+TEST_F(AidlTest, ParsesPreprocessedFile) {
+  string simple_content = "parcelable a.Foo;\ninterface b.IBar;";
+  io_delegate_.SetFileContents("path", simple_content);
+  EXPECT_FALSE(typenames_.ResolveTypename("a.Foo").is_resolved);
+  EXPECT_TRUE(Parser::Parse("path", io_delegate_, typenames_, /*is_preprocessed=*/true));
+  EXPECT_TRUE(typenames_.ResolveTypename("a.Foo").is_resolved);
+  EXPECT_TRUE(typenames_.ResolveTypename("b.IBar").is_resolved);
+}
+
+TEST_F(AidlTest, ParsesPreprocessedFileWithWhitespace) {
+  string simple_content = "parcelable    a.Foo;\n  interface b.IBar  ;\t";
+  io_delegate_.SetFileContents("path", simple_content);
+
+  EXPECT_FALSE(typenames_.ResolveTypename("a.Foo").is_resolved);
+  EXPECT_TRUE(Parser::Parse("path", io_delegate_, typenames_, /*is_preprocessed=*/true));
+  EXPECT_TRUE(typenames_.ResolveTypename("a.Foo").is_resolved);
+  EXPECT_TRUE(typenames_.ResolveTypename("b.IBar").is_resolved);
+}
+
+TEST_P(AidlTest, PreferImportToPreprocessed) {
+  io_delegate_.SetFileContents("preprocessed", "interface another.IBar;");
+  io_delegate_.SetFileContents("one/IBar.aidl", "package one; "
+                                                "interface IBar {}");
+  preprocessed_files_.push_back("preprocessed");
+  import_paths_.emplace("");
+  auto parse_result = Parse("p/IFoo.aidl", "package p; import one.IBar; interface IFoo {}",
+                            typenames_, GetLanguage());
+  EXPECT_NE(nullptr, parse_result);
+
+  // We expect to know about both kinds of IBar
+  EXPECT_TRUE(typenames_.ResolveTypename("one.IBar").is_resolved);
+  EXPECT_TRUE(typenames_.ResolveTypename("another.IBar").is_resolved);
+  // But if we request just "IBar" we should get our imported one.
+  AidlTypeSpecifier ambiguous_type(AIDL_LOCATION_HERE, "IBar", /*array=*/std::nullopt, nullptr, {});
+  ambiguous_type.Resolve(typenames_, parse_result);
+  EXPECT_EQ("one.IBar", ambiguous_type.GetName());
+}
+
+// Special case of PreferImportToPreprocessed. Imported type should be preferred
+// even when the preprocessed file already has the same type.
+TEST_P(AidlTest, B147918827) {
+  io_delegate_.SetFileContents("preprocessed", "interface another.IBar;\ninterface one.IBar;");
+  io_delegate_.SetFileContents("one/IBar.aidl",
+                               "package one; "
+                               "interface IBar {}");
+  preprocessed_files_.push_back("preprocessed");
+  import_paths_.emplace("");
+  auto parse_result = Parse("p/IFoo.aidl", "package p; import one.IBar; interface IFoo {}",
+                            typenames_, GetLanguage());
+  EXPECT_NE(nullptr, parse_result);
+
+  // We expect to know about both kinds of IBar
+  EXPECT_TRUE(typenames_.ResolveTypename("one.IBar").is_resolved);
+  EXPECT_TRUE(typenames_.ResolveTypename("another.IBar").is_resolved);
+  // But if we request just "IBar" we should get our imported one.
+  AidlTypeSpecifier ambiguous_type(AIDL_LOCATION_HERE, "IBar", /*array=*/std::nullopt, nullptr, {});
+  ambiguous_type.Resolve(typenames_, parse_result);
+  EXPECT_EQ("one.IBar", ambiguous_type.GetName());
+}
+
+TEST_F(AidlTest, WritePreprocessedFile) {
+  io_delegate_.SetFileContents("p/Outer.aidl",
+                               "package p; parcelable Outer.Inner;");
+  io_delegate_.SetFileContents("one/IBar.aidl", "package one; import p.Outer;"
+                                                "interface IBar {}");
+
+  vector<string> args{"aidl", "--preprocess", "preprocessed",
+                      "-I.",  "p/Outer.aidl", "one/IBar.aidl"};
+  Options options = Options::From(args);
+  EXPECT_TRUE(::android::aidl::Preprocess(options, io_delegate_));
+
+  std::map<std::string, std::string> expected = {{"preprocessed",
+                                                  "parcelable p.Outer.Inner;\n"
+                                                  "interface one.IBar {\n"
+                                                  "}\n"}};
+  EXPECT_THAT(io_delegate_.OutputFiles(), testing::Eq(expected));
+}
+
+TEST_F(AidlTest, PreprocessVariousThings) {
+  io_delegate_.SetFileContents("foo/bar/IFoo.aidl",
+                               "package foo.bar;\n"
+                               "interface IFoo {\n"
+                               "    int foo();\n"
+                               "    const int FOO = foo.bar.Bar.BAR + 1; // should be 44\n"
+                               "}\n");
+  io_delegate_.SetFileContents("foo/bar/Bar.aidl",
+                               "package foo.bar;\n"
+                               "parcelable Bar {\n"
+                               "    const int BAR = imported.Foo.FOO + 1; // should be 43\n"
+                               "    imported.Foo foo;\n"
+                               "}\n");
+  io_delegate_.SetFileContents("foo/bar/Gen.aidl",
+                               "package foo.bar;\n"
+                               "parcelable Gen<T> {\n"
+                               "}\n");
+  io_delegate_.SetFileContents("foo/bar/Enum.aidl",
+                               "package foo.bar;\n"
+                               "enum Enum {\n"
+                               "    FOO = 3, BAR = FOO + 3, // should be 3, 6\n"
+                               "}\n");
+  io_delegate_.SetFileContents("sub/imported/Foo.aidl",
+                               "package imported;\n"
+                               "parcelable Foo {\n"
+                               "    const int FOO = 42;\n"
+                               "}\n");
+
+  vector<string> args = {
+      "aidl",
+      "--preprocess",
+      "preprocessed",
+      "-Isub",
+      "-I.",
+      "foo/bar/IFoo.aidl",
+      "foo/bar/Bar.aidl",
+      "foo/bar/Gen.aidl",
+      "foo/bar/Enum.aidl",
+  };
+  ASSERT_TRUE(Preprocess(Options::From(args), io_delegate_));
+  std::string preprocessed =
+      "interface foo.bar.IFoo {\n"
+      "  const int FOO = 44;\n"
+      "}\n"
+      "parcelable foo.bar.Bar {\n"
+      "  const int BAR = 43;\n"
+      "}\n"
+      "parcelable foo.bar.Gen<T> {\n"
+      "}\n"
+      "enum foo.bar.Enum {\n"
+      "  FOO = 3,\n"
+      "  BAR = 6,\n"
+      "}\n";
+  std::map<std::string, std::string> expected = {{"preprocessed", preprocessed}};
+  EXPECT_THAT(io_delegate_.OutputFiles(), testing::Eq(expected));
+
+  // use preprocessed
+  io_delegate_.SetFileContents("a/Foo.aidl",
+                               "package a; parcelable Foo { const int y = foo.bar.Bar.BAR; }");
+  io_delegate_.SetFileContents("preprocessed", preprocessed);
+  CaptureStderr();
+  auto options = Options::From("aidl --lang java -I . -o out a/Foo.aidl -ppreprocessed");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+  string code;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/a/Foo.java", &code));
+  EXPECT_THAT(code, testing::HasSubstr("public static final int y = 43;"));
+}
+
+TEST_F(AidlTest, AllowMultipleUnstructuredNestedParcelablesInASingleDocument) {
+  io_delegate_.SetFileContents("p/IFoo.aidl",
+                               "package p;\n"
+                               "import x.Outer;\n"
+                               "interface IFoo {\n"
+                               "  void foo(in Outer.Inner1 in1, in Outer.Inner2 in2);\n"
+                               "}");
+  io_delegate_.SetFileContents("imported/x/Outer.aidl",
+                               "package x;\n"
+                               "parcelable Outer.Inner1;\n"
+                               "parcelable Outer.Inner2;\n");
+  auto opt = Options::From("aidl -I . -Iimported --lang=java p/IFoo.aidl");
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(opt, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+TEST_F(AidlTest,
+       StubsSourceIsGeneratedFromDuplicateDefinitionWithFrameworkAidl_FrameworkAidlLater) {
+  // Main doc(Foo.aidl) is loaded
+  // And then framework.aidl is loaded as preprocessed. (conflict)
+  io_delegate_.SetFileContents("sdk/framework.aidl", "parcelable x.Foo.Inner;\n");
+  io_delegate_.SetFileContents("x/Foo.aidl",
+                               "package x;\n"
+                               "parcelable Foo.Inner;\n");
+  auto opt = Options::From("aidl -psdk/framework.aidl -I. x/Foo.aidl");
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(opt, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+TEST_F(AidlTest,
+       StubsSourceIsGeneratedFromDuplicateDefinitionWithFrameworkAidl_FrameworkAidlFirst) {
+  // Main doc(IBar.aidl) is loaded first.
+  // Framework.aidl is loaded as preprocessed.
+  // And then import(Foo.aidl) is loaded. (conflict)
+  io_delegate_.SetFileContents("sdk/framework.aidl", "parcelable x.Foo.Inner;\n");
+  io_delegate_.SetFileContents("x/IBar.aidl",
+                               "package x;\n"
+                               "import x.Foo;\n"
+                               "interface IBar {\n"
+                               "  void bar(in Foo.Inner inner);\n"
+                               "}");
+  io_delegate_.SetFileContents("x/Foo.aidl",
+                               "package x;\n"
+                               "parcelable Foo.Inner;\n");
+  auto opt = Options::From("aidl -psdk/framework.aidl -I. x/IBar.aidl");
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(opt, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+TEST_F(AidlTest, PreprocessedFileCantDeclarePackage) {
+  string simple_content = "package xxx; parcelable a.Foo;";
+  io_delegate_.SetFileContents("path", simple_content);
+  CaptureStderr();
+  EXPECT_FALSE(Parser::Parse("path", io_delegate_, typenames_, /*is_preprocessed=*/true));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Preprocessed file can't declare package."));
+}
+
+TEST_F(AidlTest, RejectQualifiedTypeNameUnlessPreprocessed) {
+  string simple_content = "parcelable a.Foo {}";
+  io_delegate_.SetFileContents("path", simple_content);
+  CaptureStderr();
+  EXPECT_FALSE(Parser::Parse("path", io_delegate_, typenames_, /*is_preprocessed=*/false));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Type name can't be qualified"));
+}
+
+TEST_P(AidlTest, PreprocessedCanDeclareJavaStyleBuiltinTypes) {
+  string contents = R"(
+    interface android.os.IBinder;
+    interface android.os.IInterface;
+    parcelable android.os.ParcelFileDescriptor;
+  )";
+  io_delegate_.SetFileContents("path", contents);
+  CaptureStderr();
+  EXPECT_TRUE(Parser::Parse("path", io_delegate_, typenames_, /*is_preprocessed=*/true));
+  EXPECT_THAT(GetCapturedStderr(), "");
+}
+
+TEST_P(AidlTest, SupportDeprecated) {
+  struct TestCase {
+    std::string output_file;
+    std::string annotation;
+  };
+
+  auto CheckDeprecated = [&](const std::string& filename, const std::string& contents,
+                             std::vector<std::pair<Options::Language, TestCase>> expectations) {
+    io_delegate_.SetFileContents(filename, contents);
+
+    auto options = Options::From("aidl -I . --lang=" + to_string(GetLanguage()) + " " + filename +
+                                 " --out=out --header_out=out");
+    EXPECT_TRUE(compile_aidl(options, io_delegate_));
+    for (const auto& [lang, test_case] : expectations) {
+      if (lang != GetLanguage()) continue;
+      string output;
+      EXPECT_TRUE(io_delegate_.GetWrittenContents(test_case.output_file, &output));
+      EXPECT_THAT(output, HasSubstr(test_case.annotation));
+    }
+  };
+
+  // Emit escaped string for notes
+  CheckDeprecated(
+      "IFoo.aidl",
+      R"(interface IFoo {
+           /**
+            * @note asdf
+            * @deprecated a really long deprecation message
+            *
+            *    which is really long
+            * @param foo bar
+            */
+           List<String> foo();
+        })",
+      {
+          {Options::Language::JAVA, {"out/IFoo.java", "@Deprecated"}},
+          {Options::Language::CPP,
+           {"out/IFoo.h",
+            R"(__attribute__((deprecated("a really long deprecation message which is really long"))))"}},
+          {Options::Language::NDK,
+           {"out/aidl/IFoo.h",
+            R"(__attribute__((deprecated("a really long deprecation message which is really long"))))"}},
+          {Options::Language::RUST,
+           {"out/IFoo.rs",
+            R"(#[deprecated = "a really long deprecation message which is really long"])"}},
+      });
+
+  // In AIDL @deprecated can be in block comments as well as javadoc style
+  CheckDeprecated(
+      "IFoo.aidl",
+      "interface IFoo {\n"
+      "  /* @deprecated use bar() */\n"
+      "  List<String> foo();\n"
+      "}",
+      {
+          {Options::Language::JAVA, {"out/IFoo.java", "@Deprecated"}},
+          {Options::Language::JAVA, {"out/IFoo.java", "/** @deprecated use bar() */"}},
+          {Options::Language::CPP, {"out/IFoo.h", "__attribute__((deprecated(\"use bar()\")))"}},
+          {Options::Language::NDK,
+           {"out/aidl/IFoo.h", "__attribute__((deprecated(\"use bar()\")))"}},
+          {Options::Language::RUST, {"out/IFoo.rs", "#[deprecated = \"use bar()\"]"}},
+      });
+
+  // but not in line comments
+  auto parsed = Parse("IFoo.aidl", "// @deprecated\ninterface IFoo {}", typenames_, GetLanguage());
+  EXPECT_FALSE(parsed->IsDeprecated());
+
+  // parcelable
+  CheckDeprecated("Foo.aidl",
+                  "parcelable Foo {\n"
+                  "  /** @deprecated use bar*/\n"
+                  "  int foo = 0;\n"
+                  "}",
+                  {
+                      {Options::Language::JAVA, {"out/Foo.java", "@Deprecated"}},
+                      {Options::Language::CPP, {"out/Foo.h", "__attribute__((deprecated"}},
+                      {Options::Language::NDK, {"out/aidl/Foo.h", "__attribute__((deprecated"}},
+                      {Options::Language::RUST, {"out/Foo.rs", "#[deprecated"}},
+                  });
+
+  // interface constants
+  CheckDeprecated("IFoo.aidl",
+                  "interface IFoo {\n"
+                  "  /** @deprecated use bar*/\n"
+                  "  const int FOO = 0;\n"
+                  "}",
+                  {
+                      {Options::Language::JAVA, {"out/IFoo.java", "@Deprecated"}},
+                      {Options::Language::CPP, {"out/IFoo.h", "__attribute__((deprecated"}},
+                      {Options::Language::NDK, {"out/aidl/IFoo.h", "__attribute__((deprecated"}},
+                      {Options::Language::RUST, {"out/IFoo.rs", "#[deprecated"}},
+                  });
+
+  // union fields
+  CheckDeprecated("Foo.aidl",
+                  "union Foo {\n"
+                  "  int bar = 0;\n"
+                  "  /** @deprecated use bar*/\n"
+                  "  int foo;\n"
+                  "}",
+                  {
+                      {Options::Language::JAVA, {"out/Foo.java", "@Deprecated"}},
+                      {Options::Language::CPP, {"out/Foo.h", "__attribute__((deprecated"}},
+                      {Options::Language::NDK, {"out/aidl/Foo.h", "__attribute__((deprecated"}},
+                      {Options::Language::RUST, {"out/Foo.rs", "#[deprecated"}},
+                  });
+
+  CheckDeprecated("Foo.aidl",
+                  "/** @deprecated use Bar */\n"
+                  "parcelable Foo {}",
+                  {
+                      {Options::Language::JAVA, {"out/Foo.java", "@Deprecated"}},
+                      {Options::Language::CPP, {"out/Foo.h", "__attribute__((deprecated"}},
+                      {Options::Language::NDK, {"out/aidl/Foo.h", "__attribute__((deprecated"}},
+                      {Options::Language::RUST, {"out/Foo.rs", "#[deprecated"}},
+                  });
+
+  CheckDeprecated("Foo.aidl",
+                  "/** @deprecated use Bar */\n"
+                  "union Foo { int foo = 0; }",
+                  {
+                      {Options::Language::JAVA, {"out/Foo.java", "@Deprecated"}},
+                      {Options::Language::CPP, {"out/Foo.h", "__attribute__((deprecated"}},
+                      {Options::Language::NDK, {"out/aidl/Foo.h", "__attribute__((deprecated"}},
+                      {Options::Language::RUST, {"out/Foo.rs", "#[deprecated"}},
+                  });
+
+  CheckDeprecated("IFoo.aidl",
+                  "/** @deprecated use IBar */\n"
+                  "interface IFoo {}",
+                  {
+                      {Options::Language::JAVA, {"out/IFoo.java", "@Deprecated"}},
+                      {Options::Language::CPP, {"out/IFoo.h", "__attribute__((deprecated"}},
+                      {Options::Language::NDK, {"out/aidl/IFoo.h", "__attribute__((deprecated"}},
+                      {Options::Language::RUST, {"out/IFoo.rs", "#[deprecated"}},
+                  });
+
+  CheckDeprecated("Foo.aidl",
+                  "/** @deprecated use IBar */\n"
+                  "enum Foo { FOO }",
+                  {
+                      {Options::Language::JAVA, {"out/Foo.java", "@Deprecated"}},
+                      {Options::Language::CPP, {"out/Foo.h", "__attribute__((deprecated"}},
+                      {Options::Language::NDK, {"out/aidl/Foo.h", "__attribute__((deprecated"}},
+                      {Options::Language::RUST, {"out/Foo.rs", "#[deprecated"}},
+                  });
+
+  CheckDeprecated("Foo.aidl",
+                  "enum Foo {\n"
+                  " /** @deprecated */\n"
+                  " FOO,\n"
+                  " BAR,\n"
+                  "}",
+                  {
+                      {Options::Language::JAVA, {"out/Foo.java", "@Deprecated"}},
+                      {Options::Language::CPP, {"out/Foo.h", "__attribute__((deprecated"}},
+                      {Options::Language::NDK, {"out/aidl/Foo.h", "__attribute__((deprecated"}},
+                      {Options::Language::RUST, {"out/Foo.rs", "#[deprecated"}},
+                  });
+}
+
+TEST_P(AidlTest, RequireOuterClass) {
+  const string expected_stderr =
+      "ERROR: p/IFoo.aidl: Couldn't find import for class Inner. Searched here:\n - ./\nERROR: "
+      "p/IFoo.aidl:1.54-60: Failed to resolve 'Inner'\n";
+  io_delegate_.SetFileContents("p/Outer.aidl",
+                               "package p; parcelable Outer.Inner;");
+  import_paths_.emplace("");
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("p/IFoo.aidl",
+                           "package p; import p.Outer; interface IFoo { void f(in Inner c); }",
+                           typenames_, GetLanguage()));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, ParseCompoundParcelableFromPreprocess) {
+  io_delegate_.SetFileContents("preprocessed",
+                               "parcelable p.Outer.Inner cpp_header \"inner.h\" ndk_header "
+                               "\"ndk/inner.h\" rust_type \"package::Inner\";");
+  preprocessed_files_.push_back("preprocessed");
+  auto parse_result = Parse("p/IFoo.aidl", "package p; interface IFoo { void f(in Inner c); }",
+                            typenames_, GetLanguage());
+  // Require legacy behavior - inner class name can be used without outer class name.
+  EXPECT_NE(nullptr, parse_result);
+}
+
+TEST_F(AidlTest, ApiMappingAcceptsUnstructuredParcelables) {
+  io_delegate_.SetFileContents("p/Foo.aidl", "package p; parcelable Foo;");
+
+  Options options1 = Options::From("aidl -I . --apimapping mapping.txt p/Foo.aidl");
+  CaptureStderr();
+  EXPECT_EQ(0, aidl_entry(options1, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+TEST_F(AidlTest, FailOnParcelable) {
+  const string expected_foo_stderr =
+      "ERROR: p/IFoo.aidl:1.22-27: Refusing to generate code with unstructured parcelables. "
+      "Declared parcelables should be in their own file and/or cannot be used with --structured "
+      "interfaces.\n";
+  io_delegate_.SetFileContents("p/IFoo.aidl", "package p; parcelable IFoo;");
+
+  // By default, we shouldn't fail on parcelable.
+  Options options1 = Options::From("aidl -I . p/IFoo.aidl");
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options1, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+
+  // -b considers this an error
+  Options options2 = Options::From("aidl -I . -b p/IFoo.aidl");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options2, io_delegate_));
+  EXPECT_EQ(expected_foo_stderr, GetCapturedStderr());
+
+  const string expected_bar_stderr =
+      "ERROR: p/IBar.aidl:1.22-26: Refusing to generate code with unstructured parcelables. "
+      "Declared parcelables should be in their own file and/or cannot be used with --structured "
+      "interfaces.\n";
+  io_delegate_.SetFileContents("p/IBar.aidl", "package p; parcelable Foo; interface IBar{}");
+
+  // With '-b' option, a parcelable and an interface should fail.
+  Options options3 = Options::From("aidl -I . p/IBar.aidl");
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options3, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+  Options options4 = Options::From("aidl -I . -b p/IBar.aidl");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options4, io_delegate_));
+  EXPECT_EQ(expected_bar_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, ImportingJavaStyleBuiltinTypesIsAllowed) {
+  string contents = R"(
+    import android.os.IBinder;
+    import android.os.IInterface;
+    interface IFoo {
+      void foo(in IBinder b);
+    }
+  )";
+  EXPECT_NE(nullptr, Parse("IFoo.aidl", contents, typenames_, GetLanguage()));
+}
+
+TEST_P(AidlTest, StructuredFailOnUnstructuredParcelable) {
+  const string expected_stderr =
+      "o.WhoKnowsWhat is not structured, but this is a structured interface";
+  io_delegate_.SetFileContents("o/WhoKnowsWhat.aidl",
+                               "package o; parcelable WhoKnowsWhat cpp_header \"who_knows.h\" "
+                               "ndk_header \"ndk/who_knows.h\" rust_type \"WhoKnows\";");
+  import_paths_.emplace("");
+  AidlError error;
+  CaptureStderr();
+  EXPECT_EQ(
+      nullptr,
+      Parse("p/IFoo.aidl",
+            "package p; import o.WhoKnowsWhat; interface IFoo { void f(in WhoKnowsWhat thisIs); }",
+            typenames_, GetLanguage(), &error, {"--structured"}));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr(expected_stderr));
+  EXPECT_EQ(AidlError::NOT_STRUCTURED, error);
+}
+
+TEST_P(AidlTest, FailOnDuplicateConstantNames) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: p/IFoo.aidl:4.34-45: Found duplicate constant name 'DUPLICATED'\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("p/IFoo.aidl",
+                           R"(package p;
+                      interface IFoo {
+                        const String DUPLICATED = "d";
+                        const int DUPLICATED = 1;
+                      }
+                   )",
+                           typenames_, GetLanguage(), &error));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+  EXPECT_EQ(AidlError::BAD_TYPE, error);
+}
+
+TEST_P(AidlTest, InvalidConstString) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: p/IFoo.aidl:3.47-60: Found invalid character '\\' at index 4 in string constant "
+      "'\"test\\\"test\"'\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("p/IFoo.aidl",
+                           R"(package p;
+                      interface IFoo {
+                        const String someVar = "test\"test";
+                      }
+                   )",
+                           typenames_, GetLanguage(), &error));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+  EXPECT_EQ(AidlError::BAD_TYPE, error);
+}
+
+TEST_F(AidlTest, InvalidCharLiteral) {
+  auto filename = "Foo.aidl";
+  char code[] = "parcelable Foo { char a = '\0'; char b = '\t'; }";
+  io_delegate_.SetFileContents(filename,
+                               string{code, sizeof(code) - 1});  // -1 to drop nil at the end
+  CaptureStderr();
+  EXPECT_TRUE(Parser::Parse(filename, io_delegate_, typenames_, /*is_preprocessed=*/false));
+  auto err = GetCapturedStderr();
+  EXPECT_THAT(err, HasSubstr("Invalid character literal \\0"));
+  EXPECT_THAT(err, HasSubstr("Invalid character literal \\t"));
+}
+
+TEST_P(AidlTest, RejectUnstructuredParcelablesInNDKandRust) {
+  io_delegate_.SetFileContents("o/Foo.aidl", "package o; parcelable Foo cpp_header \"cpp/Foo.h\";");
+  const auto options =
+      Options::From("aidl --lang=" + to_string(GetLanguage()) + " -o out -h out -I. o/Foo.aidl");
+  const bool reject_unstructured_parcelables =
+      GetLanguage() == Options::Language::NDK || GetLanguage() == Options::Language::RUST;
+  const string expected_err = reject_unstructured_parcelables
+                                  ? "Refusing to generate code with unstructured parcelables"
+                                  : "";
+  CaptureStderr();
+  EXPECT_EQ(compile_aidl(options, io_delegate_), !reject_unstructured_parcelables);
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr(expected_err));
+}
+
+TEST_F(AidlTest, CosntantValueType) {
+  unique_ptr<AidlConstantValue> num{AidlConstantValue::Integral(AIDL_LOCATION_HERE, "1")};
+  EXPECT_EQ(num->GetType(), AidlConstantValue::Type::INT8);
+}
+
+TEST_P(AidlTest, FailOnTooBigConstant) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: p/IFoo.aidl:3.48-52: Invalid type specifier for an int32 literal: byte (256)\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("p/IFoo.aidl",
+                           R"(package p;
+                      interface IFoo {
+                        const byte type2small = 256;
+                      }
+                   )",
+                           typenames_, GetLanguage(), &error));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+  EXPECT_EQ(AidlError::BAD_TYPE, error);
+}
+
+TEST_F(AidlTest, BoolConstantsEvaluatesToIntegers) {
+  io_delegate_.SetFileContents("a/Foo.aidl", "package a; parcelable Foo { const int y = true; }");
+  CaptureStderr();
+  auto options = Options::From("aidl -I . --lang java -o out a/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+  string code;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/a/Foo.java", &code));
+  EXPECT_THAT(code, testing::HasSubstr("public static final int y = 1;"));
+}
+
+TEST_F(AidlTest, AidlConstantValue_EvaluatedValue) {
+  using Ptr = unique_ptr<AidlConstantValue>;
+  const AidlLocation& loc = AIDL_LOCATION_HERE;
+
+  EXPECT_EQ('c', Ptr(AidlConstantValue::Character(loc, "'c'"))->EvaluatedValue<char16_t>());
+  EXPECT_EQ("abc", Ptr(AidlConstantValue::String(loc, "\"abc\""))->EvaluatedValue<string>());
+  EXPECT_FLOAT_EQ(1.0f, Ptr(AidlConstantValue::Floating(loc, "1.0f"))->EvaluatedValue<float>());
+  EXPECT_EQ(true, Ptr(AidlConstantValue::Boolean(loc, true))->EvaluatedValue<bool>());
+
+  AidlBinaryConstExpression one_plus_one(loc, Ptr(AidlConstantValue::Integral(loc, "1")), "+",
+                                         Ptr(AidlConstantValue::Integral(loc, "1")));
+  EXPECT_EQ(2, one_plus_one.EvaluatedValue<int32_t>());
+
+  auto values = unique_ptr<vector<Ptr>>{new vector<Ptr>};
+  values->emplace_back(AidlConstantValue::String(loc, "\"hello\""));
+  values->emplace_back(AidlConstantValue::String(loc, "\"world\""));
+  vector<string> expected{"hello", "world"};
+  EXPECT_EQ(
+      expected,
+      Ptr(AidlConstantValue::Array(loc, std::move(values)))->EvaluatedValue<vector<string>>());
+}
+
+TEST_F(AidlTest, AidlConstantCharacterDefault) {
+  auto char_type = typenames_.MakeResolvedType(AIDL_LOCATION_HERE, "char", false);
+  auto default_value = unique_ptr<AidlConstantValue>(AidlConstantValue::Default(*char_type));
+  EXPECT_EQ("'\\0'", default_value->ValueString(*char_type, cpp::ConstantValueDecorator));
+  EXPECT_EQ("'\\0'", default_value->ValueString(*char_type, ndk::ConstantValueDecorator));
+  EXPECT_EQ("'\\0'", default_value->ValueString(*char_type, java::ConstantValueDecorator));
+}
+
+TEST_P(AidlTest, FailOnManyDefinedTypes) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: p/IFoo.aidl:3.33-38: You must declare only one type per file.\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("p/IFoo.aidl",
+                           R"(package p;
+                      interface IFoo {}
+                      parcelable IBar {}
+                      parcelable StructuredParcelable {}
+                      interface IBaz {}
+                  )",
+                           typenames_, GetLanguage(), &error));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+  // Parse success is important for clear error handling even if the cases aren't
+  // actually supported in code generation.
+  EXPECT_EQ(AidlError::BAD_TYPE, error);
+}
+
+TEST_P(AidlTest, FailOnNoDefinedTypes) {
+  AidlError error;
+  const string expected_stderr = "ERROR: p/IFoo.aidl:1.11-11: syntax error, unexpected $end\n";
+  const string expected_stderr_newbison =
+      "ERROR: p/IFoo.aidl:1.11-11: syntax error, unexpected end of file\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("p/IFoo.aidl", R"(package p;)", typenames_, GetLanguage(), &error));
+  EXPECT_THAT(GetCapturedStderr(),
+              testing::AnyOf(testing::Eq(expected_stderr), testing::Eq(expected_stderr_newbison)));
+  EXPECT_EQ(AidlError::PARSE_ERROR, error);
+}
+
+TEST_P(AidlTest, FailOnEmptyListWithComma) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: p/Foo.aidl:1.45-47: syntax error, unexpected ',', expecting '}'\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("p/Foo.aidl", R"(package p; parcelable Foo { uint64_t[] a = { , }; })",
+                           typenames_, GetLanguage(), &error));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+  EXPECT_EQ(AidlError::PARSE_ERROR, error);
+}
+
+TEST_P(AidlTest, FailOnMalformedConstHexValue) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: p/IFoo.aidl:3.50-71: Could not parse hexvalue: 0xffffffffffffffffff\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("p/IFoo.aidl",
+                           R"(package p;
+                      interface IFoo {
+                        const int BAD_HEX_VALUE = 0xffffffffffffffffff;
+                      }
+                   )",
+                           typenames_, GetLanguage(), &error));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+  EXPECT_EQ(AidlError::PARSE_ERROR, error);
+}
+
+TEST_P(AidlTest, FailOnMalformedQualifiedNameAsIdentifier) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: p/IFoo.aidl:1.25-26: syntax error, unexpected ';', expecting identifier";
+  CaptureStderr();
+  // Notice the trailing dot(.) in the name, which isn't a correct name
+  EXPECT_EQ(nullptr, Parse("p/IFoo.aidl", R"(package p; parcelable A.; )", typenames_,
+                           GetLanguage(), &error));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr(expected_stderr));
+  EXPECT_EQ(AidlError::PARSE_ERROR, error);
+}
+
+TEST_P(AidlTest, FailOnAssigningDoubleInFloatConst) {
+  EvaluateInvalidAssignment(R"(package a; interface IFoo { const float DOUBLE_VALUE = 1.1; })",
+                            INVALID_FLOAT_VALUE, typenames_, GetLanguage());
+}
+
+TEST_P(AidlTest, FailOnAssigningFloatInDoubleConst) {
+  EvaluateValidAssignment(R"(package a; interface IFoo { const double FLOAT_VALUE = 1.1f; })", "",
+                          typenames_, GetLanguage());
+}
+
+TEST_P(AidlTest, FailOnAssigningIntInFloatConst) {
+  EvaluateInvalidAssignment(R"(package a; interface IFoo { const float INT_VALUE = 1; })",
+                            INVALID_INT8_VALUE, typenames_, GetLanguage());
+}
+
+TEST_P(AidlTest, FailOnAssigningFloatInIntConst) {
+  EvaluateInvalidAssignment(R"(package a; interface IFoo { const int FLOAT_VALUE = 1.1f; })",
+                            INVALID_FLOAT_VALUE, typenames_, GetLanguage());
+}
+
+TEST_P(AidlTest, FailOnAssigningIntInDoubleConst) {
+  EvaluateInvalidAssignment(R"(package a; interface IFoo { const double INT_VALUE = 1; })",
+                            INVALID_INT8_VALUE, typenames_, GetLanguage());
+}
+
+TEST_P(AidlTest, FailOnAssigningDoubleInIntConst) {
+  EvaluateInvalidAssignment(R"(package a; interface IFoo { const int DOUBLE_VALUE = 1.1; })",
+                            INVALID_FLOAT_VALUE, typenames_, GetLanguage());
+}
+
+TEST_P(AidlTest, FailOnAssigningFloatPlusIntConst) {
+  EvaluateInvalidAssignment(R"(package a; interface IFoo { const float FLOAT_VALUE = 1.1f + 1; })",
+                            INVALID_OPERATION, typenames_, GetLanguage());
+}
+
+TEST_P(AidlTest, FailOnAssigningIntPlusFloatConst) {
+  EvaluateInvalidAssignment(R"(package a; interface IFoo { const float FLOAT_VALUE = 1 + 1.1f; })",
+                            INVALID_OPERATION, typenames_, GetLanguage());
+}
+
+TEST_P(AidlTest, FailOnAssigningDoublePlusIntConst) {
+  EvaluateInvalidAssignment(R"(package a; interface IFoo { const double DOUBLE_VALUE = 1.1 + 1; })",
+                            INVALID_OPERATION, typenames_, GetLanguage());
+}
+
+TEST_P(AidlTest, FailOnAssigningIntPlusDoubleConst) {
+  EvaluateInvalidAssignment(R"(package a; interface IFoo { const double DOUBLE_VALUE = 1 + 1.1; })",
+                            INVALID_OPERATION, typenames_, GetLanguage());
+}
+
+TEST_P(AidlTest, FailOnAssigningTooLargeFloatConst) {
+  EvaluateInvalidAssignment(R"(package a; interface IFoo { const float DOUBLE_VALUE = 1e50f; })",
+                            INVALID_FLOAT_VALUE, typenames_, GetLanguage());
+}
+
+TEST_P(AidlTest, FailOnAssigningTooLargeDoubleConst) {
+  EvaluateInvalidAssignment(R"(package a; interface IFoo { const double DOUBLE_VALUE = 1e310; })",
+                            INVALID_FLOAT_VALUE, typenames_, GetLanguage());
+}
+
+TEST_P(AidlTest, PassOnAssigningLargeFloatConst) {
+  EvaluateValidAssignment(R"(package a; interface IFoo { const float DOUBLE_VALUE = 1e20f; })", "",
+                          typenames_, GetLanguage());
+}
+
+TEST_P(AidlTest, PassOnAssigningLargeDoubleConst) {
+  EvaluateValidAssignment(R"(package a; interface IFoo { const double DOUBLE_VALUE = 1e150; })", "",
+                          typenames_, GetLanguage());
+}
+
+TEST_P(AidlTest, FailOnMalformedQualifiedNameAsPackage) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: p/IFoo.aidl:1.11-12: syntax error, unexpected ';', expecting identifier";
+  CaptureStderr();
+  // Notice the trailing dot(.) in the package name
+  EXPECT_EQ(nullptr, Parse("p/IFoo.aidl", R"(package p.; parcelable A; )", typenames_,
+                           GetLanguage(), &error));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr(expected_stderr));
+  EXPECT_EQ(AidlError::PARSE_ERROR, error);
+}
+
+TEST_P(AidlTest, ParsePositiveConstHexValue) {
+  AidlError error;
+  auto parse_result = Parse("p/IFoo.aidl",
+                            R"(package p;
+              interface IFoo {
+                const int POSITIVE_HEX_VALUE = 0xf5;
+              }
+           )",
+                            typenames_, GetLanguage(), &error);
+  EXPECT_NE(nullptr, parse_result);
+  const AidlInterface* interface = parse_result->AsInterface();
+  ASSERT_NE(nullptr, interface);
+  const auto& cpp_constants = interface->GetConstantDeclarations();
+  EXPECT_EQ((size_t)1, cpp_constants.size());
+  EXPECT_EQ("POSITIVE_HEX_VALUE", cpp_constants[0]->GetName());
+  EXPECT_TRUE(cpp_constants[0]->CheckValid(typenames_));
+  EXPECT_EQ("245", cpp_constants[0]->ValueString(cpp::ConstantValueDecorator));
+}
+
+TEST_P(AidlTest, ParseNegativeConstHexValue) {
+  AidlError error;
+  auto parse_result = Parse("p/IFoo.aidl",
+                            R"(package p;
+              interface IFoo {
+                const int NEGATIVE_HEX_VALUE = 0xffffffff;
+              }
+           )",
+                            typenames_, GetLanguage(), &error);
+  ASSERT_NE(nullptr, parse_result);
+  const AidlInterface* interface = parse_result->AsInterface();
+  ASSERT_NE(nullptr, interface);
+  const auto& cpp_constants = interface->GetConstantDeclarations();
+  EXPECT_EQ((size_t)1, cpp_constants.size());
+  EXPECT_EQ("NEGATIVE_HEX_VALUE", cpp_constants[0]->GetName());
+  EXPECT_EQ(true, cpp_constants[0]->CheckValid(typenames_));
+  EXPECT_EQ("-1", cpp_constants[0]->ValueString(cpp::ConstantValueDecorator));
+}
+
+TEST_F(AidlTest, ByteAndByteArrayDifferInCpp) {
+  auto type = Parse("p/Foo.aidl",
+                    R"(
+                      package p;
+                      parcelable Foo {
+                        byte a = -1;
+                        byte[] b = {-1, 1};
+                        @nullable byte[] c = {-1, 1};
+                      }
+                    )",
+                    typenames_, Options::Language::CPP);
+  ASSERT_NE(nullptr, type);
+  auto& fields = type->GetFields();
+  ASSERT_EQ(3ul, fields.size());
+  EXPECT_EQ("-1", fields[0]->ValueString(cpp::ConstantValueDecorator));
+  EXPECT_EQ("{uint8_t(-1), 1}", fields[1]->ValueString(cpp::ConstantValueDecorator));
+  EXPECT_EQ("{{uint8_t(-1), 1}}", fields[2]->ValueString(cpp::ConstantValueDecorator));
+}
+
+TEST_F(AidlTest, ByteAndByteArrayDifferInNdk) {
+  auto type = Parse("p/Foo.aidl",
+                    R"(
+                      package p;
+                      parcelable Foo {
+                        byte a = -1;
+                        byte[] b = {-1, 1};
+                        @nullable byte[] c = {-1, 1};
+                      }
+                    )",
+                    typenames_, Options::Language::NDK);
+  ASSERT_NE(nullptr, type);
+  auto& fields = type->GetFields();
+  ASSERT_EQ(3ul, fields.size());
+  EXPECT_EQ("-1", fields[0]->ValueString(ndk::ConstantValueDecorator));
+  EXPECT_EQ("{uint8_t(-1), 1}", fields[1]->ValueString(ndk::ConstantValueDecorator));
+  EXPECT_EQ("{{uint8_t(-1), 1}}", fields[2]->ValueString(ndk::ConstantValueDecorator));
+}
+
+TEST_P(AidlTest, UnderstandsNestedUnstructuredParcelables) {
+  io_delegate_.SetFileContents("p/Outer.aidl",
+                               "package p; parcelable Outer.Inner cpp_header \"baz/header\" "
+                               "ndk_header \"ndk/baz/header\" rust_type \"baz::Inner\";");
+  import_paths_.emplace("");
+  const string input_path = "p/IFoo.aidl";
+  const string input = "package p; import p.Outer; interface IFoo"
+                       " { Outer.Inner get(); }";
+
+  auto parse_result = Parse(input_path, input, typenames_, GetLanguage());
+  EXPECT_NE(nullptr, parse_result);
+
+  EXPECT_TRUE(typenames_.ResolveTypename("p.Outer.Inner").is_resolved);
+  // C++ uses "::" instead of "." to refer to a inner class.
+  AidlTypeSpecifier nested_type(AIDL_LOCATION_HERE, "p.Outer.Inner", /*array=*/std::nullopt,
+                                nullptr, {});
+  EXPECT_EQ("::p::Outer::Inner", cpp::CppNameOf(nested_type, typenames_));
+}
+
+TEST_P(AidlTest, UnderstandsNestedUnstructuredParcelablesWithoutImports) {
+  io_delegate_.SetFileContents("p/Outer.aidl",
+                               "package p; parcelable Outer.Inner cpp_header \"baz/header\" "
+                               "ndk_header \"ndk/baz/header\" rust_type \"baz::Inner\";");
+  import_paths_.emplace("");
+  const string input_path = "p/IFoo.aidl";
+  const string input = "package p; interface IFoo { p.Outer.Inner get(); }";
+
+  auto parse_result = Parse(input_path, input, typenames_, GetLanguage());
+  EXPECT_NE(nullptr, parse_result);
+
+  EXPECT_TRUE(typenames_.ResolveTypename("p.Outer.Inner").is_resolved);
+  // C++ uses "::" instead of "." to refer to a inner class.
+  AidlTypeSpecifier nested_type(AIDL_LOCATION_HERE, "p.Outer.Inner", /*array=*/std::nullopt,
+                                nullptr, {});
+  EXPECT_EQ("::p::Outer::Inner", cpp::CppNameOf(nested_type, typenames_));
+}
+
+TEST_F(AidlTest, UnderstandsNestedTypes) {
+  io_delegate_.SetFileContents("p/IOuter.aidl",
+                               "package p;\n"
+                               "interface IOuter {\n"
+                               "  parcelable Inner {}\n"
+                               "}");
+  import_paths_.emplace("");
+  const string input_path = "p/IFoo.aidl";
+  const string input =
+      "package p;\n"
+      "import p.IOuter;\n"
+      "interface IFoo {\n"
+      "  IOuter.Inner get();\n"
+      "}";
+  CaptureStderr();
+  EXPECT_NE(nullptr, Parse(input_path, input, typenames_, Options::Language::CPP));
+  EXPECT_EQ(GetCapturedStderr(), "");
+
+  EXPECT_TRUE(typenames_.ResolveTypename("p.IOuter.Inner").is_resolved);
+  // C++ uses "::" instead of "." to refer to a inner class.
+  AidlTypeSpecifier nested_type(AIDL_LOCATION_HERE, "p.IOuter.Inner", /*array=*/std::nullopt,
+                                nullptr, {});
+  EXPECT_EQ("::p::IOuter::Inner", cpp::CppNameOf(nested_type, typenames_));
+}
+
+TEST_F(AidlTest, DefinedTypeKnowsItsParentScope) {
+  const string input_path = "p/IFoo.aidl";
+  const string input =
+      "package p;\n"
+      "interface IFoo {\n"
+      "  parcelable Inner {\n"
+      "    enum Enum { A }\n"
+      "  }\n"
+      "}";
+  CaptureStderr();
+  EXPECT_NE(nullptr, Parse(input_path, input, typenames_, Options::Language::CPP));
+  EXPECT_EQ(GetCapturedStderr(), "");
+
+  auto enum_type = typenames_.ResolveTypename("p.IFoo.Inner.Enum");
+  auto inner_type = typenames_.ResolveTypename("p.IFoo.Inner");
+  auto ifoo_type = typenames_.ResolveTypename("p.IFoo");
+  EXPECT_TRUE(enum_type.is_resolved);
+  EXPECT_TRUE(inner_type.is_resolved);
+  EXPECT_TRUE(ifoo_type.is_resolved);
+  // GetParentType()
+  EXPECT_EQ(inner_type.defined_type, enum_type.defined_type->GetParentType());
+  EXPECT_EQ(ifoo_type.defined_type, inner_type.defined_type->GetParentType());
+  EXPECT_EQ(nullptr, ifoo_type.defined_type->GetParentType());
+  // GetRootType()
+  EXPECT_EQ(ifoo_type.defined_type, enum_type.defined_type->GetRootType());
+  EXPECT_EQ(ifoo_type.defined_type, inner_type.defined_type->GetRootType());
+  EXPECT_EQ(ifoo_type.defined_type, ifoo_type.defined_type->GetRootType());
+  // GetDocument()
+  auto main_document = &typenames_.MainDocument();
+  EXPECT_EQ(main_document, &enum_type.defined_type->GetDocument());
+  EXPECT_EQ(main_document, &inner_type.defined_type->GetDocument());
+  EXPECT_EQ(main_document, &ifoo_type.defined_type->GetDocument());
+}
+
+TEST_F(AidlTest, UnderstandsNestedTypesViaFullyQualifiedName) {
+  io_delegate_.SetFileContents("p/IOuter.aidl",
+                               "package p;\n"
+                               "interface IOuter {\n"
+                               "  parcelable Inner {}\n"
+                               "}");
+  import_paths_.emplace("");
+  const string input_path = "p/IFoo.aidl";
+  const string input =
+      "package p;\n"
+      "interface IFoo {\n"
+      "  p.IOuter.Inner get();\n"
+      "}";
+  CaptureStderr();
+  EXPECT_NE(nullptr, Parse(input_path, input, typenames_, Options::Language::CPP));
+  EXPECT_EQ(GetCapturedStderr(), "");
+
+  EXPECT_TRUE(typenames_.ResolveTypename("p.IOuter.Inner").is_resolved);
+}
+
+TEST_F(AidlTest, IncludeParentsRawHeaderForNestedInterface) {
+  CaptureStderr();
+  EXPECT_NE(nullptr, Parse("p/Outer.aidl",
+                           "package p;\n"
+                           "parcelable Outer {\n"
+                           "  interface IInner {}\n"
+                           "}",
+                           typenames_, Options::Language::CPP));
+
+  EXPECT_EQ(GetCapturedStderr(), "");
+  auto resolved = typenames_.ResolveTypename("p.Outer.IInner");
+  ASSERT_TRUE(resolved.defined_type);
+  EXPECT_EQ(cpp::HeaderFile(*resolved.defined_type, cpp::ClassNames::CLIENT), "p/Outer.h");
+}
+
+TEST_F(AidlTest, UnderstandsNestedTypesViaFullyQualifiedImport) {
+  io_delegate_.SetFileContents("p/IOuter.aidl",
+                               "package p;\n"
+                               "interface IOuter {\n"
+                               "  parcelable Inner {}\n"
+                               "}");
+  import_paths_.emplace("");
+  const string input_path = "p/IFoo.aidl";
+  const string input =
+      "package p;\n"
+      "import p.IOuter.Inner;"
+      "interface IFoo {\n"
+      "  Inner get();\n"
+      "}";
+  CaptureStderr();
+  EXPECT_NE(nullptr, Parse(input_path, input, typenames_, Options::Language::CPP));
+  EXPECT_EQ(GetCapturedStderr(), "");
+
+  EXPECT_TRUE(typenames_.ResolveTypename("p.IOuter.Inner").is_resolved);
+}
+
+TEST_F(AidlTest, UnderstandsNestedTypesInTheSameScope) {
+  const string input_path = "p/IFoo.aidl";
+  const string input =
+      "package p;\n"
+      "interface IFoo {\n"
+      "  parcelable Result {}\n"
+      "  Result get();\n"
+      "}";
+  CaptureStderr();
+  EXPECT_NE(nullptr, Parse(input_path, input, typenames_, Options::Language::CPP));
+  EXPECT_EQ(GetCapturedStderr(), "");
+
+  EXPECT_TRUE(typenames_.ResolveTypename("p.IFoo.Result").is_resolved);
+}
+
+// Finding the type of nested named member.
+struct TypeFinder : AidlVisitor {
+  string name;
+  const AidlTypeSpecifier* type = nullptr;
+  TypeFinder(std::string name) : name(name) {}
+  void Visit(const AidlVariableDeclaration& v) override {
+    if (v.GetName() == name) {
+      type = &v.GetType();
+    }
+  }
+  void Visit(const AidlMethod& m) override {
+    if (m.GetName() == name) {
+      type = &m.GetType();
+    }
+  }
+  static string Get(const AidlDefinedType& type, const string& name) {
+    TypeFinder v(name);
+    VisitTopDown(v, type);
+    return v.type ? v.type->Signature() : "(null)";
+  };
+};
+
+TEST_F(AidlTest, UnderstandsNestedTypesViaQualifiedInTheSameScope) {
+  io_delegate_.SetFileContents("q/IBar.aidl",
+                               "package q;\n"
+                               "interface IBar {\n"
+                               "  parcelable Baz {}\n"
+                               "}");
+  import_paths_.emplace("");
+  const string input_path = "p/IFoo.aidl";
+  const string input =
+      "package p;\n"
+      "import q.IBar;\n"
+      "interface IFoo {\n"
+      "  parcelable Nested {\n"
+      "    Baz t1;\n"
+      "  }\n"
+      "  parcelable Baz { }\n"
+      "  IBar.Baz t2();\n"
+      "  Baz t3();\n"
+      "}";
+  CaptureStderr();
+  auto foo = Parse(input_path, input, typenames_, Options::Language::CPP);
+  EXPECT_EQ(GetCapturedStderr(), "");
+  ASSERT_NE(nullptr, foo);
+
+  EXPECT_EQ(TypeFinder::Get(*foo, "t1"), "p.IFoo.Baz");
+  EXPECT_EQ(TypeFinder::Get(*foo, "t2"), "q.IBar.Baz");
+  EXPECT_EQ(TypeFinder::Get(*foo, "t3"), "p.IFoo.Baz");
+}
+
+TEST_F(AidlTest, NestedTypeResolutionWithNoPackage) {
+  const string input_path = "Foo.aidl";
+  const string input =
+      "parcelable Foo {\n"
+      "  parcelable Bar {\n"
+      "    enum Baz { BAZ }\n"
+      "    Baz baz = Baz.BAZ;\n"
+      "  }\n"
+      "  Bar bar;\n"
+      "}";
+  CaptureStderr();
+  auto foo = Parse(input_path, input, typenames_, Options::Language::CPP);
+  EXPECT_EQ(GetCapturedStderr(), "");
+  ASSERT_NE(nullptr, foo);
+
+  EXPECT_EQ(TypeFinder::Get(*foo, "bar"), "Foo.Bar");
+  EXPECT_EQ(TypeFinder::Get(*foo, "baz"), "Foo.Bar.Baz");
+}
+
+TEST_F(AidlTest, RejectsNestedTypesWithParentsName) {
+  const string input_path = "p/Foo.aidl";
+  const string input =
+      "package p;\n"
+      "parcelable Foo {\n"
+      "  parcelable Foo {}\n"
+      "}";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse(input_path, input, typenames_, Options::Language::CPP));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Nested type 'Foo' has the same name as its parent."));
+}
+
+TEST_F(AidlTest, RejectUnstructuredParcelableAsNestedTypes) {
+  const string input_path = "p/IFoo.aidl";
+  const string input =
+      "package p;\n"
+      "interface IFoo {\n"
+      "  parcelable Bar cpp_header \"Bar.h\";\n"
+      "}";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse(input_path, input, typenames_, Options::Language::CPP));
+  EXPECT_THAT(GetCapturedStderr(),
+              HasSubstr("Unstructured parcelables should be at the root scope"));
+}
+
+TEST_F(AidlTest, RejectGenericTypeWithNestedTypes) {
+  const string input_path = "p/Foo.aidl";
+  const string input =
+      "package p;\n"
+      "parcelable Foo<T> {\n"
+      "  parcelable Bar {}\n"
+      "}";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse(input_path, input, typenames_, Options::Language::CPP));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Generic types can't have nested types."));
+}
+
+TEST_F(AidlTest, HandleSyntaxErrorsInNestedDecl) {
+  const string input_path = "p/IFoo.aidl";
+  const string input =
+      "package p;\n"
+      "interface IFoo {\n"
+      "  parcelable;\n"  // missing identifier
+      "}";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse(input_path, input, typenames_, Options::Language::CPP));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("expecting identifier"));
+}
+
+TEST_F(AidlTest, RejectsNestedTypesWithDuplicateNames) {
+  const string input_path = "p/Foo.aidl";
+  const string input =
+      "package p;\n"
+      "interface Foo {\n"
+      "  parcelable Bar {}\n"
+      "  parcelable Bar {}\n"
+      "}";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse(input_path, input, typenames_, Options::Language::CPP));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Redefinition of 'Bar'"));
+}
+
+TEST_F(AidlTest, TypeResolutionWithMultipleLevelsOfNesting) {
+  struct Failure {
+    string err;
+  };
+  struct TestCase {
+    string type;
+    variant<string, Failure> expected;  // success<0> or failure<1>
+  };
+  vector<TestCase> cases = {
+      {"foo.A", "foo.A"},
+      {"foo.A.B", "foo.A.B"},
+      {"@nullable(heap=true) A", "foo.A.B.A"},
+      // In the scope of foo.A.B.A, B is resolved to A.B.A.B first.
+      {"B.A", Failure{"Failed to resolve 'B.A'"}},
+      {"B", "foo.A.B.A.B"},
+      {"A.B", "foo.A.B.A.B"},
+  };
+  const string input_path = "foo/A.aidl";
+  for (auto& [type, expected] : cases) {
+    AidlTypenames typenames;
+    // clang-format off
+    const string input =
+        "package foo;\n"
+        "parcelable A {\n"
+        "  parcelable B {\n"
+        "    parcelable A {\n"
+        "      parcelable B {\n"
+        "      }\n"
+        "      " + type + " m;\n"
+        "    }\n"
+        "  }\n"
+        "}";
+    // clang-format on
+    CaptureStderr();
+    auto foo = Parse(input_path, input, typenames, Options::Language::CPP);
+    if (auto failure = std::get_if<Failure>(&expected); failure) {
+      ASSERT_EQ(nullptr, foo);
+      EXPECT_THAT(GetCapturedStderr(), HasSubstr(failure->err));
+    } else {
+      EXPECT_EQ(GetCapturedStderr(), "");
+      ASSERT_NE(nullptr, foo);
+      EXPECT_EQ(TypeFinder::Get(*foo, "m"), std::get<string>(expected));
+    }
+  }
+}
+
+TEST_F(AidlTest, HeaderForNestedTypeShouldPointToTopMostParent) {
+  const string input_path = "p/IFoo.aidl";
+  const string input =
+      "package p;\n"
+      "interface IFoo {\n"
+      "  parcelable Result {}\n"
+      "}";
+  CaptureStderr();
+  auto foo = Parse(input_path, input, typenames_, Options::Language::CPP);
+  ASSERT_NE(nullptr, foo);
+  EXPECT_EQ(GetCapturedStderr(), "");
+
+  auto result = typenames_.ResolveTypename("p.IFoo.Result").defined_type;
+  ASSERT_NE(nullptr, result);
+  EXPECT_EQ("p/IFoo.h", cpp::CppHeaderForType(*result));
+}
+
+TEST_F(AidlTest, ReorderNestedTypesForCppOutput) {
+  const string input_path = "p/IFoo.aidl";
+  const string input = R"(
+    package p;
+    interface IFoo {
+      // partial orderings for [A, D, G]:
+      //   D - A
+      //   A - G
+      parcelable A {
+        // partial orderings for [B, C]:
+        //   C - B
+        parcelable B {
+          C c;
+          D.E d;
+        }
+        parcelable C {}
+      }
+      parcelable D {
+        // partial orderings for [E, F]:
+        //   F - E
+        parcelable E {
+          F f;
+        }
+        parcelable F {}
+      }
+      parcelable G {
+        A.B b;
+      }
+    }
+  )";
+  Options options = Options::From("aidl --lang cpp -I. -oout -hout p/IFoo.aidl");
+  io_delegate_.SetFileContents(input_path, input);
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(GetCapturedStderr(), "");
+
+  string code;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/p/IFoo.h", &code));
+  // check partial orderings: a should comes before b
+  EXPECT_LE(code.find("class D"), code.find("class A"));
+  EXPECT_LE(code.find("class A"), code.find("class G"));
+  EXPECT_LE(code.find("class C"), code.find("class B"));
+  EXPECT_LE(code.find("class F"), code.find("class E"));
+}
+
+TEST_F(AidlTest, RejectsNestedTypesWithCyclicDeps) {
+  const string input_path = "p/IFoo.aidl";
+  const string input = R"(
+    package p;
+    interface IFoo {
+      // Cycles:
+      //   D - A
+      //   A - G
+      //   G - D
+      parcelable A {
+        parcelable B {
+          C c;
+        }
+      }
+      parcelable C {
+        parcelable D {
+          E e;
+        }
+      }
+      parcelable E {
+        parcelable F {
+          A a;
+        }
+      }
+    }
+  )";
+  Options options = Options::From("aidl --lang cpp -I. -oout -hout p/IFoo.aidl");
+  io_delegate_.SetFileContents(input_path, input);
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("IFoo has nested types with cyclic references."));
+}
+
+TEST_F(AidlTest, RejectsCyclicNestedInterfaces) {
+  Options options = Options::From(
+      "aidl --lang cpp -I. -oout -hout "
+      "p/IFoo.aidl p/IBar.aidl p/IQux.aidl");
+  io_delegate_.SetFileContents("p/IFoo.aidl",
+                               "package p; import p.IBar; "
+                               "interface IFoo { IBar getBar(); }");
+  io_delegate_.SetFileContents("p/IBar.aidl",
+                               "package p; import p.IQux; "
+                               "interface IBar { IQux.Inner getQux(); }");
+  io_delegate_.SetFileContents("p/IQux.aidl",
+                               "package p; import p.IFoo; "
+                               "interface IQux { interface Inner { IFoo getFoo(); } }");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(),
+              HasSubstr("ERROR: p/IQux.aidl:1.43-53: has cyclic references to nested types."));
+}
+
+TEST_F(AidlTest, RejectsCyclicNestedInterfacesAndParcelables) {
+  Options options = Options::From(
+      "aidl --lang cpp -I. -oout -hout "
+      "p/IFoo.aidl p/Bar.aidl");
+  io_delegate_.SetFileContents("p/IFoo.aidl",
+                               "package p; import p.Bar; "
+                               "interface IFoo { interface Inner { Bar getBar(); } }");
+  io_delegate_.SetFileContents("p/Bar.aidl",
+                               "package p; import p.IFoo; "
+                               "parcelable Bar { IFoo.Inner foo; }");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(),
+              HasSubstr("ERROR: p/IFoo.aidl:1.42-52: has cyclic references to nested types."));
+}
+
+TEST_F(AidlTest, CppNameOf_GenericType) {
+  const string input_path = "p/Wrapper.aidl";
+  const string input = "package p; parcelable Wrapper<T> {}";
+
+  auto parse_result = Parse(input_path, input, typenames_, Options::Language::CPP);
+  EXPECT_NE(nullptr, parse_result);
+
+  auto type = [](std::string name, auto&&... type_params) -> std::unique_ptr<AidlTypeSpecifier> {
+    auto params = new std::vector<std::unique_ptr<AidlTypeSpecifier>>;
+    (..., params->emplace_back(std::move(type_params)));
+    return std::make_unique<AidlTypeSpecifier>(AIDL_LOCATION_HERE, name, std::nullopt, params,
+                                               Comments{});
+  };
+
+  auto set_nullable = [](std::unique_ptr<AidlTypeSpecifier>&& type) {
+    std::vector<std::unique_ptr<AidlAnnotation>> annotations;
+    annotations.emplace_back(std::unique_ptr<AidlAnnotation>(
+        AidlAnnotation::Parse(AIDL_LOCATION_HERE, "nullable", {}, {})));
+    type->Annotate(std::move(annotations));
+    return std::move(type);
+  };
+
+  auto set_array = [](std::unique_ptr<AidlTypeSpecifier>&& type) {
+    (void)type->MakeArray(DynamicArray{});
+    return std::move(type);
+  };
+
+  auto w = type("p.Wrapper", type("String"));
+  EXPECT_EQ("::p::Wrapper<::android::String16>", cpp::CppNameOf(*w, typenames_));
+
+  auto nullable_w = set_nullable(type("p.Wrapper", type("String")));
+  EXPECT_EQ("::std::optional<::p::Wrapper<::android::String16>>",
+            cpp::CppNameOf(*nullable_w, typenames_));
+
+  auto array_w = set_array(type("p.Wrapper", type("String")));
+  EXPECT_EQ("::std::vector<::p::Wrapper<::android::String16>>",
+            cpp::CppNameOf(*array_w, typenames_));
+
+  auto nullable_array_w = set_nullable(set_array(type("p.Wrapper", type("String"))));
+  EXPECT_EQ("::std::optional<::std::vector<::std::optional<::p::Wrapper<::android::String16>>>>",
+            cpp::CppNameOf(*nullable_array_w, typenames_));
+
+  auto list_w = type("List", type("p.Wrapper", type("String")));
+  EXPECT_EQ("::std::vector<::p::Wrapper<::android::String16>>",
+            cpp::CppNameOf(*list_w, typenames_));
+
+  auto nullable_list_w = set_nullable(type("List", type("p.Wrapper", type("String"))));
+  EXPECT_EQ("::std::optional<::std::vector<::std::optional<::p::Wrapper<::android::String16>>>>",
+            cpp::CppNameOf(*nullable_list_w, typenames_));
+}
+
+TEST_P(AidlTest, UnderstandsNativeParcelables) {
+  io_delegate_.SetFileContents(
+      "p/Bar.aidl",
+      "package p; parcelable Bar cpp_header \"baz/header\";");
+  import_paths_.emplace("");
+  const string input_path = "p/IFoo.aidl";
+  const string input = "package p; import p.Bar; interface IFoo { }";
+  auto parse_result = Parse(input_path, input, typenames_, GetLanguage());
+  EXPECT_NE(nullptr, parse_result);
+  EXPECT_TRUE(typenames_.ResolveTypename("p.Bar").is_resolved);
+  AidlTypeSpecifier native_type(AIDL_LOCATION_HERE, "p.Bar", /*array=*/std::nullopt, nullptr, {});
+  native_type.Resolve(typenames_, parse_result);
+
+  EXPECT_EQ("p.Bar", java::InstantiableJavaSignatureOf(native_type));
+  // C++ understands C++ specific stuff
+  EXPECT_EQ("::p::Bar", cpp::CppNameOf(native_type, typenames_));
+  set<string> headers;
+  cpp::AddHeaders(native_type, typenames_, &headers);
+  EXPECT_EQ(1u, headers.size());
+  EXPECT_EQ(1u, headers.count("baz/header"));
+}
+
+TEST_F(AidlTest, WritesCorrectDependencyFile) {
+  // While the in tree build system always gives us an output file name,
+  // other android tools take advantage of our ability to infer the intended
+  // file name.  This test makes sure we handle this correctly.
+  vector<string> args = {"aidl", "-I .", "-d dep/file/path", "-o place/for/output", "p/IFoo.aidl"};
+  Options options = Options::From(args);
+  io_delegate_.SetFileContents(options.InputFiles().front(), "package p; interface IFoo {}");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  string actual_dep_file_contents;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents(options.DependencyFile(), &actual_dep_file_contents));
+  EXPECT_EQ(actual_dep_file_contents, kExpectedDepFileContents);
+}
+
+TEST_F(AidlTest, WritesCorrectDependencyFileNinja) {
+  // While the in tree build system always gives us an output file name,
+  // other android tools take advantage of our ability to infer the intended
+  // file name.  This test makes sure we handle this correctly.
+  vector<string> args = {"aidl",       "-I .", "-d dep/file/path", "--ninja", "-o place/for/output",
+                         "p/IFoo.aidl"};
+  Options options = Options::From(args);
+  io_delegate_.SetFileContents(options.InputFiles().front(), "package p; interface IFoo {}");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  string actual_dep_file_contents;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents(options.DependencyFile(), &actual_dep_file_contents));
+  EXPECT_EQ(actual_dep_file_contents, kExpectedNinjaDepFileContents);
+}
+
+TEST_F(AidlTest, WritesTrivialDependencyFileForParcelableDeclaration) {
+  // The SDK uses aidl to decide whether a .aidl file is a parcelable.  It does
+  // this by calling aidl with every .aidl file it finds, then parsing the
+  // generated dependency files.  Those that reference .java output files are
+  // for interfaces and those that do not are parcelables.  However, for both
+  // parcelables and interfaces, we *must* generate a non-empty dependency file.
+  vector<string> args = {"aidl", "-I .", "-o place/for/output", "-d dep/file/path", "p/Foo.aidl"};
+  Options options = Options::From(args);
+  io_delegate_.SetFileContents(options.InputFiles().front(), "package p; parcelable Foo;");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  string actual_dep_file_contents;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents(options.DependencyFile(), &actual_dep_file_contents));
+  EXPECT_EQ(actual_dep_file_contents, kExpectedParcelableDeclarationDepFileContents);
+}
+
+TEST_F(AidlTest, WritesDependencyFileForStructuredParcelable) {
+  vector<string> args = {
+      "aidl", "-I .", "--structured", "-o place/for/output", "-d dep/file/path", "p/Foo.aidl"};
+  Options options = Options::From(args);
+  io_delegate_.SetFileContents(options.InputFiles().front(), "package p; parcelable Foo {int a;}");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  string actual_dep_file_contents;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents(options.DependencyFile(), &actual_dep_file_contents));
+  EXPECT_EQ(actual_dep_file_contents, kExpectedStructuredParcelableDepFileContents);
+}
+
+TEST_F(AidlTest, NoJavaOutputForParcelableDeclaration) {
+  vector<string> args = {"aidl", "-I .", "--lang=java", "-o place/for/output", "p/Foo.aidl"};
+  Options options = Options::From(args);
+  io_delegate_.SetFileContents(options.InputFiles().front(), "package p; parcelable Foo;");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  string output_file_contents;
+  EXPECT_FALSE(io_delegate_.GetWrittenContents(options.OutputFile(), &output_file_contents));
+}
+
+TEST_P(AidlTest, RejectsListArray) {
+  const string input = "package a; parcelable Foo { List<String>[] lists; }";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/Foo.aidl", input, typenames_, GetLanguage()));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Arrays of List are not supported"));
+}
+
+TEST_P(AidlTest, RejectsPrimitiveListInStableAidl) {
+  AidlError error;
+  string expected_stderr =
+      "ERROR: a/IFoo.aidl:2.7-11: "
+      "Encountered an untyped List or Map. The use of untyped List/Map is "
+      "prohibited because it is not guaranteed that the objects in the list are recognizable in "
+      "the receiving side. Consider switching to an array or a generic List/Map.\n";
+  if (GetLanguage() != Options::Language::JAVA) {
+    expected_stderr =
+        "ERROR: a/IFoo.aidl:2.1-7: "
+        "Currently, only the Java backend supports non-generic List.\n";
+  }
+
+  const string primitive_interface =
+      "package a; interface IFoo {\n"
+      "  List foo(); }";
+  CaptureStderr();
+  AidlTypenames tn1;
+  EXPECT_EQ(nullptr, Parse("a/IFoo.aidl", primitive_interface, tn1, GetLanguage(), &error,
+                           {"--structured"}));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+
+  string primitive_parcelable =
+      "package a; parcelable IFoo {\n"
+      "  List foo;}";
+  CaptureStderr();
+  AidlTypenames tn2;
+  EXPECT_EQ(nullptr, Parse("a/IFoo.aidl", primitive_parcelable, tn2, GetLanguage(), &error,
+                           {"--structured"}));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, ExtensionTest) {
+  CaptureStderr();
+  string extendable_parcelable =
+      "package a; parcelable Data {\n"
+      "  ParcelableHolder extension;\n"
+      "  ParcelableHolder extension2;\n"
+      "}";
+  EXPECT_NE(nullptr, Parse("a/Data.aidl", extendable_parcelable, typenames_, GetLanguage()));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+TEST_P(AidlTest, ParcelableHolderAsReturnType) {
+  CaptureStderr();
+  string parcelableholder_return_interface =
+      "package a; interface IFoo {\n"
+      "  ParcelableHolder foo();\n"
+      "}";
+  EXPECT_EQ(nullptr,
+            Parse("a/IFoo.aidl", parcelableholder_return_interface, typenames_, GetLanguage()));
+
+  EXPECT_EQ("ERROR: a/IFoo.aidl:2.19-23: ParcelableHolder cannot be a return type\n",
+            GetCapturedStderr());
+}
+
+TEST_P(AidlTest, ParcelableHolderAsArgumentType) {
+  CaptureStderr();
+  string extendable_parcelable_arg_interface =
+      "package a; interface IFoo {\n"
+      "  void foo(in ParcelableHolder ph);\n"
+      "}";
+  EXPECT_EQ(nullptr,
+            Parse("a/IFoo.aidl", extendable_parcelable_arg_interface, typenames_, GetLanguage()));
+
+  EXPECT_EQ("ERROR: a/IFoo.aidl:2.31-34: ParcelableHolder cannot be an argument type\n",
+            GetCapturedStderr());
+}
+
+TEST_P(AidlTest, RejectNullableParcelableHolderField) {
+  io_delegate_.SetFileContents("Foo.aidl", "parcelable Foo { @nullable ParcelableHolder ext; }");
+  Options options = Options::From("aidl Foo.aidl -I . --lang=" + to_string(GetLanguage()));
+  const string expected_stderr = "ERROR: Foo.aidl:1.27-44: ParcelableHolder cannot be nullable.\n";
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, ParcelablesWithConstants) {
+  io_delegate_.SetFileContents("Foo.aidl", "parcelable Foo { const int BIT = 0x1 << 3; }");
+  Options options = Options::From("aidl Foo.aidl -I . --lang=" + to_string(GetLanguage()));
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+TEST_P(AidlTest, UnionWithConstants) {
+  io_delegate_.SetFileContents("Foo.aidl", "union Foo { const int BIT = 0x1 << 3; int n; }");
+  Options options = Options::From("aidl Foo.aidl -I . --lang=" + to_string(GetLanguage()));
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+TEST_F(AidlTest, ConstantsWithAnnotations) {
+  io_delegate_.SetFileContents("IFoo.aidl",
+                               "interface IFoo {\n"
+                               " @JavaPassthrough(annotation=\"@Foo\")\n"
+                               " const @JavaPassthrough(annotation=\"@Bar\") int FOO = 0;\n"
+                               "}");
+  Options options = Options::From("aidl IFoo.aidl -I . --lang=java -o out");
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+  string code;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/IFoo.java", &code));
+  EXPECT_THAT(code, HasSubstr("@Foo\n"));
+  EXPECT_THAT(code, HasSubstr("@Bar\n"));
+}
+
+TEST_F(AidlTest, ApiDump) {
+  io_delegate_.SetFileContents(
+      "foo/bar/IFoo.aidl",
+      "// comment\n"
+      "package foo.bar;\n"
+      "import foo.bar.Data;\n"
+      "// commented /* @hide */\n"
+      "interface IFoo {\n"
+      "    /* @hide applied \n"
+      "       @deprecated use foo2 */\n"
+      "    int foo(out int[] a, String b, boolean c, inout List<String> d);\n"
+      "    int foo2(@utf8InCpp String x, inout List<String> y);\n"
+      "    IFoo foo3(IFoo foo);\n"
+      "    void foo4(in int[2][3] fixedArray);\n"
+      "    Data getData();\n"
+      "    // @hide not applied\n"
+      "    /** blahblah\n"
+      "        @deprecated\n"
+      "          reason why... */\n"
+      "    const int A = 1;\n"
+      "    // @deprecated tags in line comments are ignored\n"
+      "    const String STR = \"Hello\";\n"
+      "}\n");
+  io_delegate_.SetFileContents("foo/bar/Data.aidl",
+                               "// comment\n"
+                               "package foo.bar;\n"
+                               "import foo.bar.IFoo;\n"
+                               "/* @hide*/\n"
+                               "parcelable Data {\n"
+                               "   // @hide\n"
+                               "   int x = 10;\n"
+                               "   // @hide\n"
+                               "   int y;\n"
+                               "   /*@hide2*/\n"
+                               "   IFoo foo;\n"
+                               "   // Ignore @hide property in line comment\n"
+                               "   @nullable String[] c;\n"
+                               "}\n");
+  io_delegate_.SetFileContents("api.aidl", "");
+  vector<string> args = {"aidl", "--dumpapi", "--out=dump", "--include=.",
+                         "foo/bar/IFoo.aidl", "foo/bar/Data.aidl"};
+  Options options = Options::From(args);
+  bool result = dump_api(options, io_delegate_);
+  ASSERT_TRUE(result);
+  string actual;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("dump/foo/bar/IFoo.aidl", &actual));
+  EXPECT_EQ(string("// comment\n").append(string(kPreamble)).append(R"(package foo.bar;
+interface IFoo {
+  /**
+   * @hide
+   * @deprecated use foo2
+   */
+  int foo(out int[] a, String b, boolean c, inout List<String> d);
+  int foo2(@utf8InCpp String x, inout List<String> y);
+  foo.bar.IFoo foo3(foo.bar.IFoo foo);
+  void foo4(in int[2][3] fixedArray);
+  foo.bar.Data getData();
+  /**
+   * @deprecated reason why...
+   */
+  const int A = 1;
+  const String STR = "Hello";
+}
+)"),
+            actual);
+
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("dump/foo/bar/Data.aidl", &actual));
+  EXPECT_EQ(string("// comment\n").append(string(kPreamble)).append(R"(package foo.bar;
+/* @hide */
+parcelable Data {
+  int x = 10;
+  int y;
+  foo.bar.IFoo foo;
+  @nullable String[] c;
+}
+)"),
+            actual);
+}
+
+TEST_F(AidlTest, ApiDumpWithManualIds) {
+  io_delegate_.SetFileContents(
+      "foo/bar/IFoo.aidl",
+      "package foo.bar;\n"
+      "interface IFoo {\n"
+      "    int foo() = 1;\n"
+      "    int bar() = 2;\n"
+      "    int baz() = 10;\n"
+      "}\n");
+
+  vector<string> args = {"aidl", "-I . ", "--dumpapi", "-o dump", "foo/bar/IFoo.aidl"};
+  Options options = Options::From(args);
+  bool result = dump_api(options, io_delegate_);
+  ASSERT_TRUE(result);
+  string actual;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("dump/foo/bar/IFoo.aidl", &actual));
+  EXPECT_EQ(actual, string(kPreamble).append(R"(package foo.bar;
+interface IFoo {
+  int foo() = 1;
+  int bar() = 2;
+  int baz() = 10;
+}
+)"));
+}
+
+TEST_F(AidlTest, ApiDumpWithManualIdsOnlyOnSomeMethods) {
+  const string expected_stderr =
+      "ERROR: foo/bar/IFoo.aidl:4.8-12: You must either assign id's to all methods or to none of "
+      "them.\n";
+  io_delegate_.SetFileContents(
+      "foo/bar/IFoo.aidl",
+      "package foo.bar;\n"
+      "interface IFoo {\n"
+      "    int foo() = 1;\n"
+      "    int bar();\n"
+      "    int baz() = 10;\n"
+      "}\n");
+
+  vector<string> args = {"aidl", "-I . ", "--dumpapi", "-o dump", "foo/bar/IFoo.aidl"};
+  Options options = Options::From(args);
+  CaptureStderr();
+  EXPECT_FALSE(dump_api(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, ApiDumpConstWithAnnotation) {
+  io_delegate_.SetFileContents("foo/bar/IFoo.aidl",
+                               "package foo.bar;\n"
+                               "interface IFoo {\n"
+                               "    @utf8InCpp String foo();\n"
+                               "    const @utf8InCpp String bar = \"bar\";\n"
+                               "}\n");
+
+  vector<string> args = {"aidl", "-I . ", "--dumpapi", "-o dump", "foo/bar/IFoo.aidl"};
+  Options options = Options::From(args);
+  CaptureStderr();
+  EXPECT_TRUE(dump_api(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+  string actual;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("dump/foo/bar/IFoo.aidl", &actual));
+  EXPECT_EQ(string(kPreamble).append(R"(package foo.bar;
+interface IFoo {
+  @utf8InCpp String foo();
+  const @utf8InCpp String bar = "bar";
+}
+)"),
+            actual);
+}
+
+TEST_F(AidlTest, ApiDumpWithEnums) {
+  io_delegate_.SetFileContents("foo/bar/Enum.aidl",
+                               "package foo.bar;\n"
+                               "enum Enum {\n"
+                               "    FOO,\n"
+                               "    BAR = FOO + 1,\n"
+                               "}\n");
+
+  vector<string> args = {"aidl", "--dumpapi", "-I . ", "-o dump", "foo/bar/Enum.aidl"};
+  Options options = Options::From(args);
+  CaptureStderr();
+  EXPECT_TRUE(dump_api(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+  string actual;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("dump/foo/bar/Enum.aidl", &actual));
+  EXPECT_EQ(string(kPreamble).append("package foo.bar;\n"
+                                     "enum Enum {\n"
+                                     "  FOO,\n"
+                                     "  BAR = (FOO + 1) /* 1 */,\n"
+                                     "}\n"),
+            actual);
+}
+
+TEST_F(AidlTest, ApiDumpWithEnumDefaultValues) {
+  io_delegate_.SetFileContents("foo/bar/Enum.aidl",
+                               "package foo.bar;\n"
+                               "enum Enum {\n"
+                               "    FOO,\n"
+                               "}\n");
+  io_delegate_.SetFileContents("foo/bar/Foo.aidl",
+                               "package foo.bar;\n"
+                               "import foo.bar.Enum;\n"
+                               "parcelable Foo {\n"
+                               "    Enum e = Enum.FOO;\n"
+                               "    int n = Enum.FOO;\n"
+                               "}\n");
+
+  vector<string> args = {"aidl", "--dumpapi", "-I . ", "-o dump", "foo/bar/Foo.aidl"};
+  Options options = Options::From(args);
+  CaptureStderr();
+  EXPECT_TRUE(dump_api(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+  string actual;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("dump/foo/bar/Foo.aidl", &actual));
+  EXPECT_EQ(string(kPreamble).append("package foo.bar;\n"
+                                     "parcelable Foo {\n"
+                                     "  foo.bar.Enum e = foo.bar.Enum.FOO;\n"
+                                     "  int n = foo.bar.Enum.FOO /* 0 */;\n"
+                                     "}\n"),
+            actual);
+}
+
+TEST_F(AidlTest, ApiDumpWithGenerics) {
+  io_delegate_.SetFileContents("foo/bar/Foo.aidl",
+                               "package foo.bar;\n"
+                               "parcelable Foo<T, U> {\n"
+                               "}\n");
+
+  vector<string> args = {"aidl", "--dumpapi", "-I . ", "-o dump", "foo/bar/Foo.aidl"};
+  Options options = Options::From(args);
+  CaptureStderr();
+  EXPECT_TRUE(dump_api(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+  string actual;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("dump/foo/bar/Foo.aidl", &actual));
+  EXPECT_EQ(string(kPreamble).append("package foo.bar;\n"
+                                     "parcelable Foo<T, U> {\n"
+                                     "}\n"),
+            actual);
+}
+
+TEST_F(AidlTest, ImportedDocumentHasDuplicateDefinitions) {
+  io_delegate_.SetFileContents("IFoo.aidl", "interface IFoo; interface IFoo;\n");
+  io_delegate_.SetFileContents("Bar.aidl", "enum Bar { CONST = IFoo.NONE }\n");
+
+  vector<string> args = {"aidl", "--dumpapi", "-I.", "-o out", "Bar.aidl"};
+  Options options = Options::From(args);
+  CaptureStderr();
+  EXPECT_FALSE(dump_api(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Can't find NONE in IFoo"));
+}
+
+TEST_F(AidlTest, CheckNumGenericTypeSecifier) {
+  const string expected_list_stderr =
+      "ERROR: p/IFoo.aidl:1.37-41: List can only have one type parameter, but got: "
+      "'List<String,String>'\n";
+  const string expected_map_stderr =
+      "ERROR: p/IFoo.aidl:1.37-40: Map must have 0 or 2 type parameters, but got 'Map<String>'\n";
+  Options options = Options::From("aidl -I . p/IFoo.aidl IFoo.java");
+  io_delegate_.SetFileContents(options.InputFiles().front(),
+                               "package p; interface IFoo {"
+                               "void foo(List<String, String> a);}");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_list_stderr, GetCapturedStderr());
+
+  io_delegate_.SetFileContents(options.InputFiles().front(),
+                               "package p; interface IFoo {"
+                               "void foo(Map<String> a);}");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_map_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, CheckTypeParameterInMapType) {
+  const string expected_stderr =
+      "ERROR: p/IFoo.aidl:1.28-31: The type of key in map must be String, but it is 'p.Bar'\n";
+  Options options = Options::From("aidl -I . p/IFoo.aidl");
+  io_delegate_.SetFileContents("p/Bar.aidl", "package p; parcelable Bar { String s; }");
+
+  io_delegate_.SetFileContents("p/IFoo.aidl",
+                               "package p; interface IFoo {"
+                               "Map<String, p.Bar> foo();}");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+
+  io_delegate_.SetFileContents("p/IFoo.aidl",
+                               "package p; interface IFoo {"
+                               "Map<p.Bar, p.Bar> foo();}");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+
+  io_delegate_.SetFileContents("p/IFoo.aidl",
+                               "package p; interface IFoo {"
+                               "Map<String, String> foo();}");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+
+  io_delegate_.SetFileContents("p/IFoo.aidl",
+                               "package p; interface IFoo {"
+                               "Map<String, ParcelFileDescriptor> foo();}");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+}
+
+TEST_F(AidlTest, WrongGenericType) {
+  const string expected_stderr = "ERROR: p/IFoo.aidl:1.28-34: String is not a generic type.\n";
+  Options options = Options::From("aidl -I . p/IFoo.aidl IFoo.java");
+  io_delegate_.SetFileContents(options.InputFiles().front(),
+                               "package p; interface IFoo {"
+                               "String<String> foo(); }");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, UserDefinedUnstructuredGenericParcelableType) {
+  Options optionsForParcelable = Options::From("aidl -I . p/Bar.aidl");
+  io_delegate_.SetFileContents("p/Bar.aidl", "package p; parcelable Bar<T, T>;");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(optionsForParcelable, io_delegate_));
+  EXPECT_EQ("ERROR: p/Bar.aidl:1.22-26: Every type parameter should be unique.\n",
+            GetCapturedStderr());
+
+  Options options = Options::From("aidl -I . p/IFoo.aidl");
+  io_delegate_.SetFileContents("p/Bar.aidl", "package p; parcelable Bar;");
+  io_delegate_.SetFileContents("p/IFoo.aidl",
+                               "package p; interface IFoo {"
+                               "p.Bar<String, String> foo();}");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("p.Bar is not a generic type"));
+  io_delegate_.SetFileContents("p/Bar.aidl", "package p; parcelable Bar<T>;");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("p.Bar must have 1 type parameters, but got 2"));
+  io_delegate_.SetFileContents("p/Bar.aidl", "package p; parcelable Bar<T, V>;");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  io_delegate_.SetFileContents("p/IFoo.aidl",
+                               "package p; interface IFoo {"
+                               "p.Bar<String, ParcelFileDescriptor> foo();}");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+
+  io_delegate_.SetFileContents("p/IFoo.aidl",
+                               "package p; interface IFoo {"
+                               "p.Bar<int, long> foo();}");
+
+  io_delegate_.SetFileContents("p/IFoo.aidl",
+                               "package p; interface IFoo {"
+                               "p.Bar<int[], long[]> foo();}");
+
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+}
+
+TEST_F(AidlTest, FailOnMultipleTypesInSingleFile) {
+  std::vector<std::string> rawOptions{"aidl --lang=java -I . -o out foo/bar/Foo.aidl",
+                                      "aidl --lang=cpp -I . -o out -h out/include foo/bar/Foo.aidl",
+                                      "aidl --lang=rust -I . -o out foo/bar/Foo.aidl"};
+  for (const auto& rawOption : rawOptions) {
+    string expected_stderr =
+        "ERROR: foo/bar/Foo.aidl:3.1-10: You must declare only one type per file.\n";
+    Options options = Options::From(rawOption);
+    io_delegate_.SetFileContents(options.InputFiles().front(),
+                                 "package foo.bar;\n"
+                                 "interface IFoo1 { int foo(); }\n"
+                                 "interface IFoo2 { int foo(); }\n"
+                                 "parcelable Data1 { int a; int b;}\n"
+                                 "parcelable Data2 { int a; int b;}\n");
+    CaptureStderr();
+    EXPECT_FALSE(compile_aidl(options, io_delegate_));
+    EXPECT_EQ(expected_stderr, GetCapturedStderr());
+
+    io_delegate_.SetFileContents(options.InputFiles().front(),
+                                 "package foo.bar;\n"
+                                 "interface IFoo1 { int foo(); }\n"
+                                 "interface IFoo2 { int foo(); }\n");
+    CaptureStderr();
+    EXPECT_FALSE(compile_aidl(options, io_delegate_));
+    EXPECT_EQ(expected_stderr, GetCapturedStderr());
+
+    expected_stderr = "ERROR: foo/bar/Foo.aidl:3.11-17: You must declare only one type per file.\n";
+    io_delegate_.SetFileContents(options.InputFiles().front(),
+                                 "package foo.bar;\n"
+                                 "parcelable Data1 { int a; int b;}\n"
+                                 "parcelable Data2 { int a; int b;}\n");
+    CaptureStderr();
+    EXPECT_FALSE(compile_aidl(options, io_delegate_));
+    EXPECT_EQ(expected_stderr, GetCapturedStderr());
+  }
+}
+
+TEST_P(AidlTest, FailParseOnEmptyFile) {
+  const string contents = "";
+  const string expected_stderr = "ERROR: a/IFoo.aidl:1.1-1: syntax error, unexpected $end\n";
+  const string expected_stderr_newbison =
+      "ERROR: a/IFoo.aidl:1.1-1: syntax error, unexpected end of file\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/IFoo.aidl", contents, typenames_, GetLanguage()));
+  EXPECT_THAT(GetCapturedStderr(),
+              testing::AnyOf(testing::Eq(expected_stderr), testing::Eq(expected_stderr_newbison)));
+}
+
+TEST_F(AidlTest, MultipleInputFiles) {
+  Options options = Options::From(
+      "aidl --lang=java -o out -I . foo/bar/IFoo.aidl foo/bar/Data.aidl");
+
+  io_delegate_.SetFileContents(options.InputFiles().at(0),
+      "package foo.bar;\n"
+      "import foo.bar.Data;\n"
+      "interface IFoo { Data getData(); }\n");
+
+  io_delegate_.SetFileContents(options.InputFiles().at(1),
+        "package foo.bar;\n"
+        "import foo.bar.IFoo;\n"
+        "parcelable Data { IFoo foo; }\n");
+
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+
+  string content;
+  for (const auto file : {
+    "out/foo/bar/IFoo.java", "out/foo/bar/Data.java"}) {
+    content.clear();
+    EXPECT_TRUE(io_delegate_.GetWrittenContents(file, &content));
+    EXPECT_FALSE(content.empty());
+  }
+}
+
+TEST_F(AidlTest, MultipleInputFilesCpp) {
+  Options options = Options::From(
+      "aidl --lang=cpp -I . -o out -h out/include "
+      "-I . foo/bar/IFoo.aidl foo/bar/Data.aidl");
+
+  io_delegate_.SetFileContents(options.InputFiles().at(0),
+      "package foo.bar;\n"
+      "import foo.bar.Data;\n"
+      "interface IFoo { Data getData(); }\n");
+
+  io_delegate_.SetFileContents(options.InputFiles().at(1),
+        "package foo.bar;\n"
+        "import foo.bar.IFoo;\n"
+        "parcelable Data { IFoo foo; }\n");
+
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+
+  string content;
+  for (const auto file : {
+    "out/foo/bar/IFoo.cpp", "out/foo/bar/Data.cpp",
+    "out/include/foo/bar/IFoo.h", "out/include/foo/bar/Data.h",
+    "out/include/foo/bar/BpFoo.h", "out/include/foo/bar/BpData.h",
+    "out/include/foo/bar/BnFoo.h", "out/include/foo/bar/BnData.h"}) {
+    content.clear();
+    EXPECT_TRUE(io_delegate_.GetWrittenContents(file, &content));
+    EXPECT_FALSE(content.empty());
+  }
+}
+
+TEST_F(AidlTest, MultipleInputFilesRust) {
+  Options options =
+      Options::From("aidl --lang=rust -o out -I . foo/bar/IFoo.aidl foo/bar/Data.aidl");
+
+  io_delegate_.SetFileContents(options.InputFiles().at(0),
+                               "package foo.bar;\n"
+                               "import foo.bar.Data;\n"
+                               "interface IFoo { Data getData(); }\n");
+
+  io_delegate_.SetFileContents(options.InputFiles().at(1),
+                               "package foo.bar;\n"
+                               "import foo.bar.IFoo;\n"
+                               "parcelable Data { IFoo foo; }\n");
+
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+
+  string content;
+  for (const auto file : {"out/foo/bar/IFoo.rs", "out/foo/bar/Data.rs"}) {
+    content.clear();
+    EXPECT_TRUE(io_delegate_.GetWrittenContents(file, &content));
+    EXPECT_FALSE(content.empty());
+  }
+}
+
+TEST_F(AidlTest, ConflictWithMetaTransactionGetVersion) {
+  const string expected_stderr =
+      "ERROR: p/IFoo.aidl:1.31-51:  method getInterfaceVersion() is reserved for internal use.\n";
+  Options options = Options::From("aidl --lang=java -I . -o place/for/output p/IFoo.aidl");
+  // int getInterfaceVersion() is one of the meta transactions
+  io_delegate_.SetFileContents(options.InputFiles().front(),
+                               "package p; interface IFoo {"
+                               "int getInterfaceVersion(); }");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, ConflictWithSimilarMetaTransaction) {
+  // boolean getInterfaceVersion() is not a meta transaction, but should be
+  // prevented because return type is not part of a method signature
+  const string expected_stderr =
+      "ERROR: p/IFoo.aidl:1.35-55:  method getInterfaceVersion() is reserved for internal use.\n";
+  Options options = Options::From("aidl --lang=java -I . -o place/for/output p/IFoo.aidl");
+  io_delegate_.SetFileContents(options.InputFiles().front(),
+                               "package p; interface IFoo {"
+                               "boolean getInterfaceVersion(); }");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, ConflictWithMetaTransactionGetName) {
+  // this is another reserved name
+  const string expected_stderr =
+      "ERROR: p/IFoo.aidl:1.34-53:  method getTransactionName(int) is reserved for internal use.\n";
+  Options options = Options::From("aidl --lang=java -I . -o place/for/output p/IFoo.aidl");
+  io_delegate_.SetFileContents(options.InputFiles().front(),
+                               "package p; interface IFoo {"
+                               "String getTransactionName(int code); }");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+
+  // this is not a meta interface method as it differs type arguments
+  io_delegate_.SetFileContents(options.InputFiles().front(),
+                               "package p; interface IFoo {"
+                               "String getTransactionName(); }");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+}
+
+TEST_F(AidlTest, CheckApiForEquality) {
+  CaptureStderr();
+  Options options = Options::From("aidl --checkapi=equal old new");
+
+  io_delegate_.SetFileContents("old/p/IFoo.aidl",
+                               "package p; interface IFoo{ @utf8InCpp @nullable String foo();}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl",
+                               "package p; interface IFoo{ @utf8InCpp String foo();}");
+
+  EXPECT_FALSE(::android::aidl::check_api(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("+  @utf8InCpp String foo();"));
+}
+
+TEST_F(AidlTest, DifferentOrderAnnotationsInCheckAPI) {
+  Options options = Options::From("aidl --checkapi old new");
+  io_delegate_.SetFileContents("old/p/IFoo.aidl",
+                               "package p; interface IFoo{ @utf8InCpp @nullable String foo();}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl",
+                               "package p; interface IFoo{ @nullable @utf8InCpp String foo();}");
+
+  EXPECT_TRUE(::android::aidl::check_api(options, io_delegate_));
+}
+
+TEST_F(AidlTest, JavaPassthroughAnnotationAddedInCheckApi) {
+  Options options = Options::From("aidl --checkapi old new");
+  io_delegate_.SetFileContents("old/p/IFoo.aidl", "package p; interface IFoo{}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl",
+                               "package p; @JavaPassthrough(annotation=\"@foo\") interface IFoo{}");
+
+  EXPECT_TRUE(::android::aidl::check_api(options, io_delegate_));
+}
+
+TEST_F(AidlTest, SuccessOnIdenticalApiDumps) {
+  Options options = Options::From("aidl --checkapi old new");
+  io_delegate_.SetFileContents("old/p/IFoo.aidl", "package p; interface IFoo{ void foo();}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl", "package p; interface IFoo{ void foo();}");
+
+  EXPECT_TRUE(::android::aidl::check_api(options, io_delegate_));
+}
+
+TEST_F(AidlTest, CheckApi_EnumFieldsWithDefaultValues) {
+  Options options = Options::From("aidl --checkapi old new");
+  const string foo_definition = "package p; parcelable Foo{ p.Enum e = p.Enum.FOO; }";
+  const string enum_definition = "package p; enum Enum { FOO }";
+  io_delegate_.SetFileContents("old/p/Foo.aidl", foo_definition);
+  io_delegate_.SetFileContents("old/p/Enum.aidl", enum_definition);
+  io_delegate_.SetFileContents("new/p/Foo.aidl", foo_definition);
+  io_delegate_.SetFileContents("new/p/Enum.aidl", enum_definition);
+
+  EXPECT_TRUE(::android::aidl::check_api(options, io_delegate_));
+}
+
+TEST_F(AidlTest, CheckApi_EnumFieldsFromImported) {
+  Options options = Options::From("aidl --checkapi old new -I import");
+
+  io_delegate_.SetFileContents("old/p/Foo.aidl", "package p; parcelable Foo{ other.Enum e; }");
+  io_delegate_.SetFileContents("new/p/Foo.aidl",
+                               "package p; parcelable Foo{ other.Enum e = other.Enum.FOO; }");
+  io_delegate_.SetFileContents("import/other/Enum.aidl", "package other; enum Enum { FOO }");
+
+  EXPECT_TRUE(::android::aidl::check_api(options, io_delegate_));
+}
+
+TEST_F(AidlTest, CheckApiEqual_EnumFieldsWithDefaultValues) {
+  Options options = Options::From("aidl --checkapi=equal old new");
+  const string foo_definition = "package p; parcelable Foo{ p.Enum e = p.Enum.FOO; }";
+  const string enum_definition = "package p; enum Enum { FOO }";
+  io_delegate_.SetFileContents("old/p/Foo.aidl", foo_definition);
+  io_delegate_.SetFileContents("old/p/Enum.aidl", enum_definition);
+  io_delegate_.SetFileContents("new/p/Foo.aidl", foo_definition);
+  io_delegate_.SetFileContents("new/p/Enum.aidl", enum_definition);
+  CaptureStderr();
+  EXPECT_TRUE(::android::aidl::check_api(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+class AidlTestCompatibleChanges : public AidlTest {
+ protected:
+  Options options_ = Options::From("aidl --checkapi old new");
+};
+
+TEST_F(AidlTestCompatibleChanges, NewType) {
+  io_delegate_.SetFileContents("old/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(int a);"
+                               "}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(int a);"
+                               "}");
+  io_delegate_.SetFileContents("new/p/IBar.aidl",
+                               "package p;"
+                               "interface IBar {"
+                               "  void bar();"
+                               "}");
+  EXPECT_TRUE(::android::aidl::check_api(options_, io_delegate_));
+}
+
+TEST_F(AidlTestCompatibleChanges, NewMethod) {
+  io_delegate_.SetFileContents("old/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(int a);"
+                               "}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(int a);"
+                               "  void bar();"
+                               "  void baz(in List<String> arg);"
+                               "}");
+  EXPECT_TRUE(::android::aidl::check_api(options_, io_delegate_));
+}
+
+TEST_F(AidlTestCompatibleChanges, NewField) {
+  io_delegate_.SetFileContents("old/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int foo;"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int foo;"
+                               "  int bar = 0;"
+                               "  @nullable List<Data> list;"
+                               "}");
+  EXPECT_TRUE(::android::aidl::check_api(options_, io_delegate_));
+}
+
+TEST_F(AidlTestCompatibleChanges, NewField2) {
+  io_delegate_.SetFileContents("old/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int foo = 0;"
+                               "}");
+  EXPECT_TRUE(::android::aidl::check_api(options_, io_delegate_));
+}
+
+TEST_F(AidlTestCompatibleChanges, NewEnumerator) {
+  io_delegate_.SetFileContents("old/p/Enum.aidl",
+                               "package p;"
+                               "enum Enum {"
+                               "  FOO = 1,"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Enum.aidl",
+                               "package p;"
+                               "enum Enum {"
+                               "  FOO = 1,"
+                               "  BAR = 2,"
+                               "}");
+  EXPECT_TRUE(::android::aidl::check_api(options_, io_delegate_));
+}
+
+TEST_F(AidlTestCompatibleChanges, ReorderedEnumerator) {
+  io_delegate_.SetFileContents("old/p/Enum.aidl",
+                               "package p;"
+                               "enum Enum {"
+                               "  FOO = 1,"
+                               "  BAR = 2,"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Enum.aidl",
+                               "package p;"
+                               "enum Enum {"
+                               "  BAR = 2,"
+                               "  FOO = 1,"
+                               "}");
+  EXPECT_TRUE(::android::aidl::check_api(options_, io_delegate_));
+}
+
+TEST_F(AidlTestCompatibleChanges, NewUnionField) {
+  io_delegate_.SetFileContents("old/p/Union.aidl",
+                               "package p;"
+                               "union Union {"
+                               "  String foo;"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Union.aidl",
+                               "package p;"
+                               "union Union {"
+                               "  String foo;"
+                               "  int num;"
+                               "}");
+  EXPECT_TRUE(::android::aidl::check_api(options_, io_delegate_));
+}
+
+TEST_F(AidlTestCompatibleChanges, NewPackage) {
+  io_delegate_.SetFileContents("old/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(int a);"
+                               "}");
+  io_delegate_.SetFileContents("old/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int foo;"
+                               "}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(int a);"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int foo;"
+                               "}");
+  io_delegate_.SetFileContents("new/q/IFoo.aidl",
+                               "package q;"
+                               "interface IFoo {"
+                               "  void foo(int a);"
+                               "}");
+  io_delegate_.SetFileContents("new/q/Data.aidl",
+                               "package q;"
+                               "parcelable Data {"
+                               "  int foo;"
+                               "}");
+  EXPECT_TRUE(::android::aidl::check_api(options_, io_delegate_));
+}
+
+TEST_F(AidlTestCompatibleChanges, ArgNameChange) {
+  io_delegate_.SetFileContents("old/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(int a);"
+                               "}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(int b);"
+                               "}");
+  EXPECT_TRUE(::android::aidl::check_api(options_, io_delegate_));
+}
+
+TEST_F(AidlTestCompatibleChanges, AddedConstValue) {
+  io_delegate_.SetFileContents("old/p/I.aidl",
+                               "package p; interface I {"
+                               "const int A = 1; }");
+  io_delegate_.SetFileContents("new/p/I.aidl",
+                               "package p ; interface I {"
+                               "const int A = 1; const int B = 2;}");
+  EXPECT_TRUE(::android::aidl::check_api(options_, io_delegate_));
+}
+
+TEST_F(AidlTestCompatibleChanges, ChangedConstValueOrder) {
+  io_delegate_.SetFileContents("old/p/I.aidl",
+                               "package p; interface I {"
+                               "const int A = 1; const int B = 2;}");
+  io_delegate_.SetFileContents("new/p/I.aidl",
+                               "package p ; interface I {"
+                               "const int B = 2; const int A = 1;}");
+  EXPECT_TRUE(::android::aidl::check_api(options_, io_delegate_));
+}
+
+TEST_F(AidlTestCompatibleChanges, ReorderedAnnatations) {
+  io_delegate_.SetFileContents("old/p/Foo.aidl",
+                               "package p;"
+                               "@JavaPassthrough(annotation=\"Alice\")"
+                               "@JavaPassthrough(annotation=\"Bob\")"
+                               "parcelable Foo {}");
+  io_delegate_.SetFileContents("new/p/Foo.aidl",
+                               "package p;"
+                               "@JavaPassthrough(annotation=\"Bob\")"
+                               "@JavaPassthrough(annotation=\"Alice\")"
+                               "parcelable Foo {}");
+  EXPECT_TRUE(::android::aidl::check_api(options_, io_delegate_));
+}
+
+TEST_F(AidlTestCompatibleChanges, OkayToDeprecate) {
+  io_delegate_.SetFileContents("old/p/Foo.aidl",
+                               "package p;"
+                               "parcelable Foo {}");
+  io_delegate_.SetFileContents("new/p/Foo.aidl",
+                               "package p;"
+                               "@JavaPassthrough(annotation=\"@Deprecated\")"
+                               "parcelable Foo {}");
+  EXPECT_TRUE(::android::aidl::check_api(options_, io_delegate_));
+}
+
+TEST_F(AidlTestCompatibleChanges, NewFieldOfNewType) {
+  io_delegate_.SetFileContents("old/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int num;"
+                               "}");
+  io_delegate_.SetFileContents(
+      "new/p/Data.aidl",
+      "package p;"
+      "parcelable Data {"
+      "  int num;"
+      "  p.Enum e;"  // this is considered as valid since 0(enum default) is valid for "Enum" type
+      "}");
+  io_delegate_.SetFileContents("new/p/Enum.aidl",
+                               "package p;"
+                               "enum Enum {"
+                               "  FOO = 0,"
+                               "  BAR = 1,"
+                               "}");
+  EXPECT_TRUE(::android::aidl::check_api(options_, io_delegate_));
+}
+
+TEST_F(AidlTestCompatibleChanges, CompatibleExplicitDefaults) {
+  io_delegate_.SetFileContents("old/p/Data.aidl",
+                               "package p;\n"
+                               "parcelable Data {\n"
+                               "  p.Enum e;\n"
+                               "}");
+  io_delegate_.SetFileContents("old/p/Enum.aidl",
+                               "package p;\n"
+                               "enum Enum {\n"
+                               "  FOO = 0,\n"
+                               "  BAR = 1,\n"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Data.aidl",
+                               "package p;\n"
+                               "parcelable Data {\n"
+                               "  p.Enum e = p.Enum.FOO;\n"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Enum.aidl",
+                               "package p;\n"
+                               "enum Enum {\n"
+                               "  FOO = 0,\n"
+                               "  BAR = 1,\n"
+                               "}");
+  EXPECT_TRUE(::android::aidl::check_api(options_, io_delegate_));
+}
+
+TEST_F(AidlTestCompatibleChanges, NewNestedTypes) {
+  io_delegate_.SetFileContents("old/p/Data.aidl",
+                               "package p;\n"
+                               "parcelable Data {\n"
+                               "  int n;\n"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Data.aidl",
+                               "package p;\n"
+                               "parcelable Data {\n"
+                               "  enum NewEnum { N = 3 }\n"
+                               "  int n;\n"
+                               "  NewEnum e = NewEnum.N;\n"
+                               "}");
+  EXPECT_TRUE(::android::aidl::check_api(options_, io_delegate_));
+}
+
+TEST_F(AidlTestCompatibleChanges, NewJavaSuppressLint) {
+  io_delegate_.SetFileContents("old/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(int a);"
+                               "}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl",
+                               "package p;"
+                               "@JavaSuppressLint({\"NewApi\"})"
+                               "interface IFoo {"
+                               "  void foo(int a);"
+                               "}");
+  EXPECT_TRUE(::android::aidl::check_api(options_, io_delegate_));
+}
+
+class AidlTestIncompatibleChanges : public AidlTest {
+ protected:
+  Options options_ = Options::From("aidl --checkapi old new");
+};
+
+TEST_F(AidlTestIncompatibleChanges, RemovedType) {
+  const string expected_stderr = "ERROR: old/p/IFoo.aidl:1.11-20: Removed type: p.IFoo\n";
+  io_delegate_.SetFileContents("old/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(in String[] str);"
+                               "  void bar(@utf8InCpp String str);"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, RemovedMethod) {
+  const string expected_stderr =
+      "ERROR: old/p/IFoo.aidl:1.61-65: Removed or changed method: p.IFoo.bar(String)\n";
+  io_delegate_.SetFileContents("old/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(in String[] str);"
+                               "  void bar(@utf8InCpp String str);"
+                               "}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(in String[] str);"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, UntypedListInInterface) {
+  const string expected_stderr =
+      "ERROR: new/p/IFoo.aidl:1.61-65: "
+      "Encountered an untyped List or Map. The use of untyped List/Map is "
+      "prohibited because it is not guaranteed that the objects in the list are recognizable in "
+      "the receiving side. Consider switching to an array or a generic List/Map.\n"
+      "ERROR: new/p/IFoo.aidl: Failed to read.\n";
+  io_delegate_.SetFileContents("old/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(in String[] str);"
+                               "}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(in String[] str);"
+                               "  void bar(in List arg);"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestCompatibleChanges, UntypedListInParcelable) {
+  const string expected_stderr =
+      "ERROR: new/p/Data.aidl:1.54-59: "
+      "Encountered an untyped List or Map. The use of untyped List/Map is "
+      "prohibited because it is not guaranteed that the objects in the list are recognizable in "
+      "the receiving side. Consider switching to an array or a generic List/Map.\n"
+      "ERROR: new/p/Data.aidl: Failed to read.\n";
+  io_delegate_.SetFileContents("old/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int foo;"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int foo;"
+                               "  @nullable List list;"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, RemovedField) {
+  const string expected_stderr =
+      "ERROR: new/p/Data.aidl:1.21-26: Number of fields in p.Data is reduced from 2 to 1.\n";
+  io_delegate_.SetFileContents("old/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int foo;"
+                               "  int bar;"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int foo;"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, NewFieldWithNoDefault) {
+  const string expected_stderr =
+      "ERROR: new/p/Data.aidl:1.46-50: Field 'str' does not have a useful default in some "
+      "backends. Please either provide a default value for this field or mark the field as "
+      "@nullable. This value or a null value will be used automatically when an old version of "
+      "this parcelable is sent to a process which understands a new version of this parcelable. In "
+      "order to make sure your code continues to be backwards compatible, make sure the default or "
+      "null value does not cause a semantic change to this parcelable.\n";
+  io_delegate_.SetFileContents("old/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int num;"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int num;"
+                               "  String str;"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, NewFieldWithNonZeroEnum) {
+  const string expected_stderr =
+      "ERROR: new/p/Data.aidl:1.46-48: Field 'e' of enum 'Enum' can't be initialized as '0'. "
+      "Please make sure 'Enum' has '0' as a valid value.\n";
+  io_delegate_.SetFileContents("old/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int num;"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int num;"
+                               "  p.Enum e;"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Enum.aidl",
+                               "package p;"
+                               "enum Enum {"
+                               "  FOO = 1,"
+                               "  BAR = 2,"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, RemovedEnumerator) {
+  const string expected_stderr =
+      "ERROR: new/p/Enum.aidl:1.15-20: Removed enumerator from p.Enum: FOO\n";
+  io_delegate_.SetFileContents("old/p/Enum.aidl",
+                               "package p;"
+                               "enum Enum {"
+                               "  FOO = 1,"
+                               "  BAR = 2,"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Enum.aidl",
+                               "package p;"
+                               "enum Enum {"
+                               "  BAR = 2,"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, RemovedUnionField) {
+  const string expected_stderr =
+      "ERROR: new/p/Union.aidl:1.16-22: Number of fields in p.Union is reduced from 2 to 1.\n";
+  io_delegate_.SetFileContents("old/p/Union.aidl",
+                               "package p;"
+                               "union Union {"
+                               "  String str;"
+                               "  int num;"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Union.aidl",
+                               "package p;"
+                               "union Union {"
+                               "  String str;"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, RenamedMethod) {
+  const string expected_stderr =
+      "ERROR: old/p/IFoo.aidl:1.61-65: Removed or changed method: p.IFoo.bar(String)\n";
+  io_delegate_.SetFileContents("old/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(in String[] str);"
+                               "  void bar(@utf8InCpp String str);"
+                               "}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(in String[] str);"
+                               "  void bar2(@utf8InCpp String str);"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, RenamedType) {
+  const string expected_stderr = "ERROR: old/p/IFoo.aidl:1.11-20: Removed type: p.IFoo\n";
+  io_delegate_.SetFileContents("old/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(in String[] str);"
+                               "  void bar(@utf8InCpp String str);"
+                               "}");
+  io_delegate_.SetFileContents("new/p/IFoo2.aidl",
+                               "package p;"
+                               "interface IFoo2 {"
+                               "  void foo(in String[] str);"
+                               "  void bar(@utf8InCpp String str);"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, ChangedEnumerator) {
+  const string expected_stderr =
+      "ERROR: new/p/Enum.aidl:1.15-20: Changed enumerator value: p.Enum::FOO from 1 to 3.\n";
+  io_delegate_.SetFileContents("old/p/Enum.aidl",
+                               "package p;"
+                               "enum Enum {"
+                               "  FOO = 1,"
+                               "  BAR = 2,"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Enum.aidl",
+                               "package p;"
+                               "enum Enum {"
+                               "  FOO = 3,"
+                               "  BAR = 2,"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, ReorderedMethod) {
+  const string expected_stderr =
+      "ERROR: new/p/IFoo.aidl:1.67-71: Transaction ID changed: p.IFoo.foo(String[]) is changed "
+      "from 0 to 1.\n"
+      "ERROR: new/p/IFoo.aidl:1.33-37: Transaction ID changed: p.IFoo.bar(String) is changed from "
+      "1 to 0.\n";
+  io_delegate_.SetFileContents("old/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(in String[] str);"
+                               "  void bar(@utf8InCpp String str);"
+                               "}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void bar(@utf8InCpp String str);"
+                               "  void foo(in String[] str);"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, ReorderedField) {
+  const string expected_stderr =
+      "ERROR: new/p/Data.aidl:1.33-37: Reordered bar from 1 to 0.\n"
+      "ERROR: new/p/Data.aidl:1.43-47: Reordered foo from 0 to 1.\n";
+  io_delegate_.SetFileContents("old/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int foo;"
+                               "  int bar;"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int bar;"
+                               "  int foo;"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, ChangedDirectionSpecifier) {
+  const string expected_stderr = "ERROR: new/p/IFoo.aidl:1.33-37: Direction changed: in to out.\n";
+  io_delegate_.SetFileContents("old/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(in String[] str);"
+                               "  void bar(@utf8InCpp String str);"
+                               "}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(out String[] str);"
+                               "  void bar(@utf8InCpp String str);"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, AddedAnnotation) {
+  const string expected_stderr =
+      "ERROR: new/p/IFoo.aidl:1.51-58: Changed annotations: (empty) to @utf8InCpp\n";
+  io_delegate_.SetFileContents("old/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(in String[] str);"
+                               "  void bar(@utf8InCpp String str);"
+                               "}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(in @utf8InCpp String[] str);"
+                               "  void bar(@utf8InCpp String str);"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, RemovedAnnotation) {
+  const string expected_stderr =
+      "ERROR: new/p/IFoo.aidl:1.66-72: Changed annotations: @utf8InCpp to (empty)\n";
+  io_delegate_.SetFileContents("old/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(in String[] str);"
+                               "  void bar(@utf8InCpp String str);"
+                               "}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo {"
+                               "  void foo(in String[] str);"
+                               "  void bar(String str);"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, ChangedFixedSizeArraySize) {
+  const string expected_stderr =
+      "ERROR: new/p/Data.aidl:1.28-33: Type changed: int[8] to int[9].\n";
+  io_delegate_.SetFileContents("old/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int[8] bar;"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Data.aidl",
+                               "package p;"
+                               "parcelable Data {"
+                               "  int[9] bar;"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, ChangedAnnatationParams) {
+  // this is also the test for backing type remaining the same
+  const string expected_stderr =
+      "ERROR: new/p/Foo.aidl:1.36-40: Changed annotations: @Backing(type=\"int\") "
+      "to @Backing(type=\"long\")\n";
+  io_delegate_.SetFileContents("old/p/Foo.aidl",
+                               "package p;"
+                               "@Backing(type=\"int\")"
+                               "enum Foo {A}");
+  io_delegate_.SetFileContents("new/p/Foo.aidl",
+                               "package p;"
+                               "@Backing(type=\"long\")"
+                               "enum Foo {A}");
+
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, AddedParcelableAnnotation) {
+  const string expected_stderr =
+      "ERROR: new/p/Foo.aidl:1.32-36: Changed annotations: (empty) to @FixedSize\n";
+  io_delegate_.SetFileContents("old/p/Foo.aidl",
+                               "package p;"
+                               "parcelable Foo {"
+                               "  int A;"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Foo.aidl",
+                               "package p;"
+                               "@FixedSize parcelable Foo {"
+                               "  int A;"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, RemovedParcelableAnnotation) {
+  const string expected_stderr =
+      "ERROR: new/p/Foo.aidl:1.21-25: Changed annotations: @FixedSize to (empty)\n";
+  io_delegate_.SetFileContents("old/p/Foo.aidl",
+                               "package p;"
+                               "@FixedSize parcelable Foo {"
+                               "  int A;"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Foo.aidl",
+                               "package p;"
+                               "parcelable Foo {"
+                               "  int A;"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, RemovedPackage) {
+  const string expected_stderr = "ERROR: old/q/IFoo.aidl:1.11-21: Removed type: q.IFoo\n";
+  io_delegate_.SetFileContents("old/p/IFoo.aidl", "package p; interface IFoo{}");
+  io_delegate_.SetFileContents("old/q/IFoo.aidl", "package q; interface IFoo{}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl", "package p; interface IFoo{}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, ChangedDefaultValue) {
+  const string expected_stderr = "ERROR: new/p/D.aidl:1.30-32: Changed default value: 1 to 2.\n";
+  io_delegate_.SetFileContents("old/p/D.aidl", "package p; parcelable D { int a = 1; }");
+  io_delegate_.SetFileContents("new/p/D.aidl", "package p; parcelable D { int a = 2; }");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, RemovedConstValue) {
+  const string expected_stderr =
+      "ERROR: old/p/I.aidl:1.51-53: Removed constant declaration: p.I.B\n";
+  io_delegate_.SetFileContents("old/p/I.aidl",
+                               "package p; interface I {"
+                               "const int A = 1; const int B = 2;}");
+  io_delegate_.SetFileContents("new/p/I.aidl", "package p; interface I { const int A = 1; }");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, ChangedConstValue) {
+  const string expected_stderr =
+      "ERROR: new/p/I.aidl:1.11-21: Changed constant value: p.I.A from 1 to 2.\n";
+  io_delegate_.SetFileContents("old/p/I.aidl", "package p; interface I { const int A = 1; }");
+  io_delegate_.SetFileContents("new/p/I.aidl", "package p; interface I { const int A = 2; }");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, FixedSizeAddedField) {
+  const string expected_stderr =
+      "ERROR: new/p/Foo.aidl:1.33-37: Number of fields in p.Foo is changed from 1 to 2. "
+      "This is an incompatible change for FixedSize types.\n";
+  io_delegate_.SetFileContents("old/p/Foo.aidl",
+                               "package p; @FixedSize parcelable Foo { int A = 1; }");
+  io_delegate_.SetFileContents("new/p/Foo.aidl",
+                               "package p; @FixedSize parcelable Foo { int A = 1; int B = 2; }");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, UidRangeParcelAddedField) {
+  const string expected_stderr =
+      "ERROR: new/android/net/UidRangeParcel.aidl:1.32-47: Number of fields in "
+      "android.net.UidRangeParcel is changed from 1 to 2. "
+      "But it is forbidden because of legacy support.\n";
+  io_delegate_.SetFileContents("old/android/net/UidRangeParcel.aidl",
+                               "package android.net; parcelable UidRangeParcel { int A = 1; }");
+  io_delegate_.SetFileContents(
+      "new/android/net/UidRangeParcel.aidl",
+      "package android.net; parcelable UidRangeParcel { int A = 1; int B = 2; }");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, FixedSizeRemovedField) {
+  const string expected_stderr =
+      "ERROR: new/p/Foo.aidl:1.33-37: Number of fields in p.Foo is reduced from 2 to 1.\n";
+  io_delegate_.SetFileContents("old/p/Foo.aidl",
+                               "package p; @FixedSize parcelable Foo { int A = 1; int B = 1; }");
+  io_delegate_.SetFileContents("new/p/Foo.aidl",
+                               "package p; @FixedSize parcelable Foo { int A = 1; }");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTestIncompatibleChanges, IncompatibleChangesInNestedType) {
+  const string expected_stderr =
+      "ERROR: new/p/Foo.aidl:1.33-37: Number of fields in p.Foo is reduced from 2 to 1.\n";
+  io_delegate_.SetFileContents("old/p/Foo.aidl",
+                               "package p;\n"
+                               "parcelable Foo {\n"
+                               "  interface IBar {\n"
+                               "    void foo();"
+                               "  }\n"
+                               "}");
+  io_delegate_.SetFileContents("new/p/Foo.aidl",
+                               "package p;\n"
+                               "parcelable Foo {\n"
+                               "  interface IBar {\n"
+                               "    void foo(int n);"  // incompatible: signature changed
+                               "  }\n"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options_, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Removed or changed method: p.Foo.IBar.foo()"));
+}
+
+TEST_P(AidlTest, RejectNonFixedSizeFromFixedSize) {
+  const string expected_stderr =
+      "ERROR: Foo.aidl:2.8-10: The @FixedSize parcelable 'Foo' has a non-fixed size field named "
+      "a.\n"
+      "ERROR: Foo.aidl:3.6-8: The @FixedSize parcelable 'Foo' has a non-fixed size field named b.\n"
+      "ERROR: Foo.aidl:4.9-11: The @FixedSize parcelable 'Foo' has a non-fixed size field named "
+      "c.\n"
+      "ERROR: Foo.aidl:5.23-25: The @FixedSize parcelable 'Foo' has a non-fixed size field named "
+      "d.\n"
+      "ERROR: Foo.aidl:6.10-12: The @FixedSize parcelable 'Foo' has a non-fixed size field named "
+      "e.\n"
+      "ERROR: Foo.aidl:7.15-17: The @FixedSize parcelable 'Foo' has a non-fixed size field named "
+      "f.\n"
+      "ERROR: Foo.aidl:9.23-33: The @FixedSize parcelable 'Foo' has a non-fixed size field named "
+      "nullable1.\n"
+      "ERROR: Foo.aidl:10.34-44: The @FixedSize parcelable 'Foo' has a non-fixed size field named "
+      "nullable2.\n";
+
+  io_delegate_.SetFileContents("Foo.aidl",
+                               "@FixedSize parcelable Foo {\n"
+                               "  int[] a;\n"
+                               "  Bar b;\n"
+                               "  String c;\n"
+                               "  ParcelFileDescriptor d;\n"
+                               "  IBinder e;\n"
+                               "  List<String> f;\n"
+                               "  int isFixedSize;\n"
+                               "  @nullable OtherFixed nullable1;\n"
+                               "  @nullable(heap=true) OtherFixed nullable2;\n"
+                               "  float[16] floats;\n"
+                               "}");
+  io_delegate_.SetFileContents("Bar.aidl", "parcelable Bar { int a; }");
+  io_delegate_.SetFileContents("OtherFixed.aidl", "@FixedSize parcelable OtherFixed { int a; }");
+  Options options = Options::From("aidl Foo.aidl -I . --lang=" + to_string(GetLanguage()));
+
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, RejectNonFixedSizeFromFixedSize_Union) {
+  const string expected_stderr =
+      "ERROR: Foo.aidl:2.8-10: The @FixedSize parcelable 'Foo' has a non-fixed size field named "
+      "a.\n"
+      "ERROR: Foo.aidl:3.6-8: The @FixedSize parcelable 'Foo' has a non-fixed size field named b.\n"
+      "ERROR: Foo.aidl:4.9-11: The @FixedSize parcelable 'Foo' has a non-fixed size field named "
+      "c.\n"
+      "ERROR: Foo.aidl:5.23-25: The @FixedSize parcelable 'Foo' has a non-fixed size field named "
+      "d.\n"
+      "ERROR: Foo.aidl:6.10-12: The @FixedSize parcelable 'Foo' has a non-fixed size field named "
+      "e.\n"
+      "ERROR: Foo.aidl:7.15-17: The @FixedSize parcelable 'Foo' has a non-fixed size field named "
+      "f.\n"
+      "ERROR: Foo.aidl:9.23-33: The @FixedSize parcelable 'Foo' has a non-fixed size field named "
+      "nullable1.\n"
+      "ERROR: Foo.aidl:10.34-44: The @FixedSize parcelable 'Foo' has a non-fixed size field named "
+      "nullable2.\n";
+
+  io_delegate_.SetFileContents("Foo.aidl",
+                               "@FixedSize union Foo {\n"
+                               "  int[] a = {};\n"
+                               "  Bar b;\n"
+                               "  String c;\n"
+                               "  ParcelFileDescriptor d;\n"
+                               "  IBinder e;\n"
+                               "  List<String> f;\n"
+                               "  int isFixedSize;\n"
+                               "  @nullable OtherFixed nullable1;\n"
+                               "  @nullable(heap=true) OtherFixed nullable2;\n"
+                               "  float[16] floats;\n"
+                               "}");
+  io_delegate_.SetFileContents("Bar.aidl", "parcelable Bar { int a; }");
+  io_delegate_.SetFileContents("OtherFixed.aidl", "@FixedSize parcelable OtherFixed { int a; }");
+  Options options = Options::From("aidl Foo.aidl -I . --lang=" + to_string(GetLanguage()));
+
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, AcceptFixedSizeFromFixedSize) {
+  const string expected_stderr = "";
+
+  io_delegate_.SetFileContents("Foo.aidl", "@FixedSize parcelable Foo { int a; Bar b; }");
+  io_delegate_.SetFileContents("Bar.aidl", "@FixedSize parcelable Bar { Val c; }");
+  io_delegate_.SetFileContents("Val.aidl", "enum Val { A, B, }");
+  Options options = Options::From("aidl Foo.aidl -I . --lang=" + to_string(GetLanguage()));
+
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, RejectAmbiguousImports) {
+  const string expected_stderr =
+      "ERROR: p/IFoo.aidl: Duplicate files found for q.IBar from:\n"
+      "dir1/q/IBar.aidl\n"
+      "dir2/q/IBar.aidl\n";
+  Options options = Options::From("aidl --lang=java -o out -I . -I dir1 -I dir2 p/IFoo.aidl");
+  io_delegate_.SetFileContents("p/IFoo.aidl", "package p; import q.IBar; interface IFoo{}");
+  io_delegate_.SetFileContents("dir1/q/IBar.aidl", "package q; interface IBar{}");
+  io_delegate_.SetFileContents("dir2/q/IBar.aidl", "package q; interface IBar{}");
+
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, HandleManualIdAssignments) {
+  const string expected_stderr =
+      "ERROR: new/p/IFoo.aidl:1.32-36: Transaction ID changed: p.IFoo.foo() is changed from 10 to "
+      "11.\n";
+  Options options = Options::From("aidl --checkapi old new");
+  io_delegate_.SetFileContents("old/p/IFoo.aidl", "package p; interface IFoo{ void foo() = 10;}");
+  io_delegate_.SetFileContents("new/p/IFoo.aidl", "package p; interface IFoo{ void foo() = 10;}");
+
+  EXPECT_TRUE(::android::aidl::check_api(options, io_delegate_));
+
+  io_delegate_.SetFileContents("new/p/IFoo.aidl", "package p; interface IFoo{ void foo() = 11;}");
+  CaptureStderr();
+  EXPECT_FALSE(::android::aidl::check_api(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, ParcelFileDescriptorIsBuiltinType) {
+  Options options =
+      Options::From("aidl -I . --lang=" + to_string(GetLanguage()) + " -h out -o out p/IFoo.aidl");
+
+  // use without import
+  io_delegate_.SetFileContents("p/IFoo.aidl",
+                               "package p; interface IFoo{ void foo(in ParcelFileDescriptor fd);}");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+
+  // capture output files
+  map<string, string> outputs = io_delegate_.OutputFiles();
+
+  // use without import but with full name
+  io_delegate_.SetFileContents(
+      "p/IFoo.aidl",
+      "package p; interface IFoo{ void foo(in android.os.ParcelFileDescriptor fd);}");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  // output files should be the same
+  EXPECT_EQ(outputs, io_delegate_.OutputFiles());
+
+  // use with import (as before)
+  io_delegate_.SetFileContents("p/IFoo.aidl",
+                               "package p;"
+                               "import android.os.ParcelFileDescriptor;"
+                               "interface IFoo{"
+                               "  void foo(in ParcelFileDescriptor fd);"
+                               "}");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  // output files should be the same
+  EXPECT_EQ(outputs, io_delegate_.OutputFiles());
+}
+
+TEST_P(AidlTest, RejectsOutputParcelFileDescriptor) {
+  Options options = Options::From("aidl p/IFoo.aidl -I . --lang=" + to_string(GetLanguage()));
+  CaptureStderr();
+  io_delegate_.SetFileContents("p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo{"
+                               "  void foo(out ParcelFileDescriptor fd);"
+                               "}");
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("can't be an out parameter"));
+}
+
+TEST_P(AidlTest, RejectsArgumentDirectionNotSpecified) {
+  Options options = Options::From("aidl p/IFoo.aidl -I . --lang=" + to_string(GetLanguage()));
+  CaptureStderr();
+  io_delegate_.SetFileContents("p/IFoo.aidl",
+                               "package p;"
+                               "interface IFoo{"
+                               "  void foo(ParcelFileDescriptor fd);"
+                               "}");
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(),
+              HasSubstr("ParcelFileDescriptor can be an in or inout parameter."));
+}
+
+TEST_F(AidlTest, ManualIds) {
+  Options options = Options::From("aidl --lang=java -I . -o out IFoo.aidl");
+  io_delegate_.SetFileContents("IFoo.aidl",
+                               "interface IFoo {\n"
+                               "  void foo() = 0;\n"
+                               "  void bar() = 1;\n"
+                               "}");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+}
+
+TEST_F(AidlTest, ManualIdsWithMetaTransactions) {
+  Options options = Options::From("aidl --lang=java -I . --version 10 -o out IFoo.aidl");
+  io_delegate_.SetFileContents("IFoo.aidl",
+                               "interface IFoo {\n"
+                               "  void foo() = 0;\n"
+                               "  void bar() = 1;\n"
+                               "}");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+}
+
+TEST_F(AidlTest, FailOnDuplicatedIds) {
+  const string expected_stderr =
+      "ERROR: IFoo.aidl:3.7-11: Found duplicate method id (3) for method bar\n";
+  Options options = Options::From("aidl --lang=java -I . --version 10 -o out IFoo.aidl");
+  io_delegate_.SetFileContents("IFoo.aidl",
+                               "interface IFoo {\n"
+                               "  void foo() = 3;\n"
+                               "  void bar() = 3;\n"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, FailOnOutOfRangeIds) {
+  // 16777115 is kLastMetaMethodId + 1
+  const string expected_stderr =
+      "ERROR: IFoo.aidl:3.7-11: Found out of bounds id (16777115) for method bar. "
+      "Value for id must be between 0 and 16777114 inclusive.\n";
+  Options options = Options::From("aidl --lang=java -I . --version 10 -o out IFoo.aidl");
+  io_delegate_.SetFileContents("IFoo.aidl",
+                               "interface IFoo {\n"
+                               "  void foo() = 3;\n"
+                               "  void bar() = 16777115;\n"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, FailOnPartiallyAssignedIds) {
+  const string expected_stderr =
+      "ERROR: IFoo.aidl:3.7-11: You must either assign id's to all methods or to none of them.\n";
+  Options options = Options::From("aidl --lang=java -I . --version 10 -o out IFoo.aidl");
+  io_delegate_.SetFileContents("IFoo.aidl",
+                               "interface IFoo {\n"
+                               "  void foo() = 3;\n"
+                               "  void bar();\n"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, AssignedIds) {
+  CaptureStderr();
+  EXPECT_NE(nullptr, Parse("IFoo.aidl",
+                           "interface IFoo {\n"
+                           "  void foo();\n"
+                           "  void bar();\n"
+                           "  interface INested {\n"
+                           "    void foo();\n"
+                           "    void bar();\n"
+                           "  }\n"
+                           "}",
+                           typenames_, Options::Language::JAVA));
+  EXPECT_EQ("", GetCapturedStderr());
+  auto foo = typenames_.ResolveTypename("IFoo").defined_type;
+  ASSERT_EQ(2u, foo->GetMethods().size());
+  EXPECT_EQ(0, foo->GetMethods()[0]->GetId());
+  EXPECT_EQ(1, foo->GetMethods()[1]->GetId());
+  auto nested = typenames_.ResolveTypename("IFoo.INested").defined_type;
+  ASSERT_EQ(2u, nested->GetMethods().size());
+  EXPECT_EQ(0, nested->GetMethods()[0]->GetId());
+  EXPECT_EQ(1, nested->GetMethods()[1]->GetId());
+}
+
+TEST_F(AidlTest, AllowDuplicatedImportPaths) {
+  Options options = Options::From("aidl --lang=java -I . -I dir -I dir IFoo.aidl");
+  io_delegate_.SetFileContents("dir/IBar.aidl", "interface IBar{}");
+  io_delegate_.SetFileContents("IFoo.aidl", "import IBar; interface IFoo{}");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+}
+
+TEST_F(AidlTest, UnusedImportDoesNotContributeInclude) {
+  io_delegate_.SetFileContents("a/b/IFoo.aidl",
+                               "package a.b;\n"
+                               "import a.b.IBar;\n"
+                               "import a.b.IQux;\n"
+                               "interface IFoo { IQux foo(); }\n");
+  io_delegate_.SetFileContents("a/b/IBar.aidl", "package a.b; interface IBar { void foo(); }");
+  io_delegate_.SetFileContents("a/b/IQux.aidl", "package a.b; interface IQux { void foo(); }");
+
+  Options options = Options::From("aidl --lang=ndk a/b/IFoo.aidl -I . -o out -h out/include");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+
+  string output;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/include/aidl/a/b/IFoo.h", &output));
+  // IBar was imported but wasn't used. include is not expected.
+  EXPECT_THAT(output, Not(testing::HasSubstr("#include <aidl/a/b/IBar.h>")));
+  // IBar was imported and used. include is expected.
+  EXPECT_THAT(output, (testing::HasSubstr("#include <aidl/a/b/IQux.h>")));
+}
+
+TEST_F(AidlTest, BasePathAsImportPath) {
+  Options options = Options::From("aidl --lang=java -I some -I other some/dir/pkg/name/IFoo.aidl");
+  io_delegate_.SetFileContents("some/dir/pkg/name/IFoo.aidl",
+      "package pkg.name; interface IFoo { void foo(); }");
+  const string expected_stderr =
+      "ERROR: some/dir/pkg/name/IFoo.aidl:1.18-28: directory some/dir/ is not found in any of "
+      "the import paths:\n - other/\n - some/\n";
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, ParseJavaPassthroughAnnotation) {
+  io_delegate_.SetFileContents("a/IFoo.aidl", R"--(package a;
+    import a.MyEnum;
+    @JavaPassthrough(annotation="@com.android.Alice(arg=com.android.Alice.Value.A)")
+    @JavaPassthrough(annotation="@com.android.AliceTwo")
+    interface IFoo {
+        @JavaPassthrough(annotation="@com.android.Bob")
+        void foo(@JavaPassthrough(annotation="@com.android.Cat") int x, MyEnum y);
+        const @JavaPassthrough(annotation="@com.android.David") int A = 3;
+    })--");
+  // JavaPassthrough should work with other types as well (e.g. enum)
+  io_delegate_.SetFileContents("a/MyEnum.aidl", R"--(package a;
+    @JavaPassthrough(annotation="@com.android.Alice(arg=com.android.Alice.Value.A)")
+    @JavaPassthrough(annotation="@com.android.AliceTwo")
+    @Backing(type="byte")
+    enum MyEnum {
+      a, b, c
+    })--");
+
+  Options java_options = Options::From("aidl -I . --lang=java -o out a/IFoo.aidl a/MyEnum.aidl");
+  EXPECT_TRUE(compile_aidl(java_options, io_delegate_));
+
+  string java_out;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/a/IFoo.java", &java_out));
+  // type-decl-level annotations with newline at the end
+  EXPECT_THAT(java_out, testing::HasSubstr("@com.android.Alice(arg=com.android.Alice.Value.A)\n"));
+  EXPECT_THAT(java_out, testing::HasSubstr("@com.android.AliceTwo\n"));
+  // member-decl-level annotations with newline at the end
+  EXPECT_THAT(java_out, testing::HasSubstr("@com.android.Bob\n"));
+  EXPECT_THAT(java_out, testing::HasSubstr("@com.android.David\n"));
+  // inline annotations with space at the end
+  EXPECT_THAT(java_out, testing::HasSubstr("@com.android.Cat "));
+
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/a/MyEnum.java", &java_out));
+  // type-decl-level annotations with newline at the end
+  EXPECT_THAT(java_out, testing::HasSubstr("@com.android.Alice(arg=com.android.Alice.Value.A)\n"));
+  EXPECT_THAT(java_out, testing::HasSubstr("@com.android.AliceTwo\n"));
+
+  // Other backends shouldn't be bothered
+  Options cpp_options =
+      Options::From("aidl -I . --lang=cpp -o out -h out a/IFoo.aidl a/MyEnum.aidl");
+  EXPECT_TRUE(compile_aidl(cpp_options, io_delegate_));
+
+  Options ndk_options =
+      Options::From("aidl -I . --lang=ndk -o out -h out a/IFoo.aidl a/MyEnum.aidl");
+  EXPECT_TRUE(compile_aidl(ndk_options, io_delegate_));
+
+  Options rust_options = Options::From("aidl -I . --lang=rust -o out a/IFoo.aidl a/MyEnum.aidl");
+  EXPECT_TRUE(compile_aidl(rust_options, io_delegate_));
+}
+
+TEST_F(AidlTest, ParseRustDerive) {
+  io_delegate_.SetFileContents("a/Foo.aidl", R"(package a;
+    @RustDerive(Clone=true, Copy=false)
+    parcelable Foo {
+        int a;
+    })");
+
+  Options rust_options = Options::From("aidl -I . --lang=rust -o out a/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(rust_options, io_delegate_));
+
+  string rust_out;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/a/Foo.rs", &rust_out));
+  EXPECT_THAT(rust_out, testing::HasSubstr("#[derive(Debug, Clone)]"));
+
+  // Other backends shouldn't be bothered
+  Options cpp_options = Options::From("aidl --lang=cpp -I . -o out -h out a/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(cpp_options, io_delegate_));
+
+  Options ndk_options = Options::From("aidl --lang=ndk -I . -o out -h out a/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(ndk_options, io_delegate_));
+
+  Options java_options = Options::From("aidl --lang=java -I . -o out a/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(java_options, io_delegate_));
+}
+
+TEST_P(AidlTest, TypesShouldHaveRustDerive) {
+  CaptureStderr();
+  string code =
+      "@RustDerive(PartialEq=true)\n"
+      "parcelable Foo {\n"
+      "  parcelable Bar {}\n"
+      "  Bar bar;\n"
+      "}";
+  EXPECT_EQ(nullptr, Parse("Foo.aidl", code, typenames_, GetLanguage(), nullptr, {}));
+  EXPECT_THAT(
+      GetCapturedStderr(),
+      testing::HasSubstr("Field bar of type with @RustDerive PartialEq also needs to derive this"));
+}
+
+TEST_F(AidlTest, EmptyEnforceAnnotation) {
+  io_delegate_.SetFileContents("a/IFoo.aidl", R"(package a;
+    interface IFoo {
+        @EnforcePermission()
+        void Protected();
+    })");
+
+  Options options = Options::From("aidl --lang=java -I . -o out a/IFoo.aidl");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Unable to parse @EnforcePermission annotation"));
+}
+
+TEST_F(AidlTest, InterfaceEnforceCondition) {
+  io_delegate_.SetFileContents("a/IFoo.aidl", R"(package a;
+    @EnforcePermission("INTERNET")
+    interface IFoo {
+        void Protected();
+    })");
+
+  Options options = Options::From("aidl --lang=java -I . -o out a/IFoo.aidl");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+}
+
+TEST_F(AidlTest, EnforceConditionAny) {
+  io_delegate_.SetFileContents("a/IFoo.aidl", R"(package a;
+    interface IFoo {
+        @EnforcePermission(anyOf={"INTERNET", "READ_PHONE_STATE"})
+        void Protected();
+    })");
+
+  Options options = Options::From("aidl --lang=java -I . -o out a/IFoo.aidl");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+}
+
+TEST_F(AidlTest, EnforceConditionAll) {
+  io_delegate_.SetFileContents("a/IFoo.aidl", R"(package a;
+    interface IFoo {
+        @EnforcePermission(allOf={"INTERNET", "READ_PHONE_STATE"})
+        void Protected();
+    })");
+
+  Options options = Options::From("aidl --lang=java -I . -o out a/IFoo.aidl");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+}
+
+TEST_F(AidlTest, InterfaceAndMethodEnforceCondition) {
+  io_delegate_.SetFileContents("a/IFoo.aidl", R"(package a;
+    @EnforcePermission("INTERNET")
+    interface IFoo {
+        @EnforcePermission("SYSTEM_UID")
+        void Protected();
+    })");
+
+  Options options = Options::From("aidl --lang=java -I . -o out a/IFoo.aidl");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("The interface IFoo uses a permission annotation but "
+                                             "the method Protected is also annotated"));
+}
+
+TEST_F(AidlTest, NoPermissionInterfaceEnforceMethod) {
+  io_delegate_.SetFileContents("a/IFoo.aidl", R"(package a;
+    @RequiresNoPermission
+    interface IFoo {
+        @EnforcePermission("INTERNET")
+        void Protected();
+    })");
+
+  Options options = Options::From("aidl --lang=java -I . -o out a/IFoo.aidl");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("The interface IFoo uses a permission annotation but "
+                                             "the method Protected is also annotated"));
+}
+
+TEST_F(AidlTest, ManualPermissionInterfaceEnforceMethod) {
+  io_delegate_.SetFileContents("a/IFoo.aidl", R"(package a;
+    @PermissionManuallyEnforced
+    interface IFoo {
+        @EnforcePermission("INTERNET")
+        void Protected();
+    })");
+
+  Options options = Options::From("aidl --lang=java -I . -o out a/IFoo.aidl");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("The interface IFoo uses a permission annotation but "
+                                             "the method Protected is also annotated"));
+}
+
+TEST_F(AidlTest, EnforceInterfaceNoPermissionsMethod) {
+  io_delegate_.SetFileContents("a/IFoo.aidl", R"(package a;
+    @EnforcePermission("INTERNET")
+    interface IFoo {
+        @RequiresNoPermission
+        void Protected();
+    })");
+
+  Options options = Options::From("aidl --lang=java -I . -o out a/IFoo.aidl");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("The interface IFoo uses a permission annotation but "
+                                             "the method Protected is also annotated"));
+}
+
+TEST_F(AidlTest, EnforceInterfaceManualPermissionMethod) {
+  io_delegate_.SetFileContents("a/IFoo.aidl", R"(package a;
+    @EnforcePermission("INTERNET")
+    interface IFoo {
+        @PermissionManuallyEnforced
+        void Protected();
+    })");
+
+  Options options = Options::From("aidl --lang=java -I . -o out a/IFoo.aidl");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("The interface IFoo uses a permission annotation but "
+                                             "the method Protected is also annotated"));
+}
+
+TEST_F(AidlTest, JavaSuppressLint) {
+  io_delegate_.SetFileContents("a/IFoo.aidl", R"(package a;
+    @JavaSuppressLint({"NewApi"})
+    interface IFoo {
+    })");
+
+  Options options = Options::From("aidl --lang=java -I . -o out a/IFoo.aidl");
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(GetCapturedStderr(), "");
+  string code;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/a/IFoo.java", &code));
+  EXPECT_THAT(code, HasSubstr("@android.annotation.SuppressLint(value = {\"NewApi\"})"));
+}
+
+class AidlOutputPathTest : public AidlTest {
+ protected:
+  void SetUp() override {
+    AidlTest::SetUp();
+    io_delegate_.SetFileContents("sub/dir/foo/bar/IFoo.aidl", "package foo.bar; interface IFoo {}");
+  }
+
+  void Test(const Options& options, const std::string expected_output_path) {
+    EXPECT_TRUE(compile_aidl(options, io_delegate_));
+    // check the existence
+    EXPECT_TRUE(io_delegate_.GetWrittenContents(expected_output_path, nullptr));
+  }
+};
+
+TEST_F(AidlOutputPathTest, OutDirWithNoOutputFile) {
+  // <out_dir> / <package_name> / <type_name>.java
+  Test(Options::From("aidl -I sub/dir -o out sub/dir/foo/bar/IFoo.aidl"), "out/foo/bar/IFoo.java");
+}
+
+TEST_F(AidlOutputPathTest, OutDirWithOutputFile) {
+  // when output file is explicitly set, it is always respected. -o option is
+  // ignored.
+  Test(Options::From("aidl -I sub/dir -o out sub/dir/foo/bar/IFoo.aidl output/IFoo.java"),
+       "output/IFoo.java");
+}
+
+TEST_F(AidlOutputPathTest, NoOutDirWithOutputFile) {
+  Test(Options::From("aidl -I sub/dir -o out sub/dir/foo/bar/IFoo.aidl output/IFoo.java"),
+       "output/IFoo.java");
+}
+
+TEST_F(AidlOutputPathTest, NoOutDirWithNoOutputFile) {
+  // output is the same as the input file except for the suffix
+  Test(Options::From("aidl -I sub/dir sub/dir/foo/bar/IFoo.aidl"), "sub/dir/foo/bar/IFoo.java");
+}
+
+TEST_P(AidlTest, FailOnOutOfBoundsInt32MaxConstInt) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: p/IFoo.aidl:3.58-69: Invalid type specifier for an int64 literal: int (2147483650)\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("p/IFoo.aidl",
+                           R"(package p;
+                              interface IFoo {
+                                const int int32_max_oob = 2147483650;
+                              }
+                             )",
+                           typenames_, GetLanguage(), &error));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+  EXPECT_EQ(AidlError::BAD_TYPE, error);
+}
+
+TEST_P(AidlTest, FailOnOutOfBoundsInt32MinConstInt) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: p/IFoo.aidl:3.58-60: Invalid type specifier for an int64 literal: int "
+      "(-2147483650)\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("p/IFoo.aidl",
+                           R"(package p;
+                              interface IFoo {
+                                const int int32_min_oob = -2147483650;
+                              }
+                             )",
+                           typenames_, GetLanguage(), &error));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+  EXPECT_EQ(AidlError::BAD_TYPE, error);
+}
+
+TEST_P(AidlTest, FailOnOutOfBoundsInt64MaxConstInt) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: p/IFoo.aidl:3.59-86: Could not parse integer: 21474836509999999999999999\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("p/IFoo.aidl",
+                           R"(package p;
+                              interface IFoo {
+                                const long int64_max_oob = 21474836509999999999999999;
+                              }
+                             )",
+                           typenames_, GetLanguage(), &error));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+  EXPECT_EQ(AidlError::PARSE_ERROR, error);
+}
+
+TEST_P(AidlTest, FailOnOutOfBoundsInt64MinConstInt) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: p/IFoo.aidl:3.61-87: Could not parse integer: 21474836509999999999999999\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("p/IFoo.aidl",
+                           R"(package p;
+                              interface IFoo {
+                                const long int64_min_oob = -21474836509999999999999999;
+                              }
+                             )",
+                           typenames_, GetLanguage(), &error));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+  EXPECT_EQ(AidlError::PARSE_ERROR, error);
+}
+
+TEST_P(AidlTest, FailOnOutOfBoundsAutofilledEnum) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: p/TestEnum.aidl:5.1-36: Invalid type specifier for an int32 literal: byte (FOO+1)\n"
+      "ERROR: p/TestEnum.aidl:5.1-36: Enumerator type differs from enum backing type.\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("p/TestEnum.aidl",
+                           R"(package p;
+                              @Backing(type="byte")
+                              enum TestEnum {
+                                FOO = 127,
+                                BAR,
+                              }
+                             )",
+                           typenames_, GetLanguage(), &error));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+  EXPECT_EQ(AidlError::BAD_TYPE, error);
+}
+
+TEST_P(AidlTest, FailOnUnsupportedBackingType) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: p/TestEnum.aidl:3.35-44: Invalid backing type: boolean. Backing type must be one of: "
+      "byte, int, long\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("p/TestEnum.aidl",
+                           R"(package p;
+                              @Backing(type="boolean")
+                              enum TestEnum {
+                                FOO = 0,
+                                BAR = 1,
+                              }
+                             )",
+                           typenames_, GetLanguage(), &error));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+  EXPECT_EQ(AidlError::BAD_TYPE, error);
+}
+
+TEST_P(AidlTest, UnsupportedBackingAnnotationParam) {
+  AidlError error;
+  const string expected_stderr =
+      "ERROR: p/TestEnum.aidl:2.1-51: Parameter foo not supported for annotation Backing. It must "
+      "be one of: type\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("p/TestEnum.aidl",
+                           R"(package p;
+                              @Backing(foo="byte")
+                              enum TestEnum {
+                                FOO = 1,
+                                BAR,
+                              }
+                             )",
+                           typenames_, GetLanguage(), &error));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+  EXPECT_EQ(AidlError::BAD_TYPE, error);
+}
+
+TEST_P(AidlTest, BackingAnnotationRequireTypeParameter) {
+  const string expected_stderr = "ERROR: Enum.aidl:1.1-9: Missing 'type' on @Backing.\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("Enum.aidl", "@Backing enum Enum { FOO }", typenames_, GetLanguage()));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, SupportJavaOnlyImmutableAnnotation) {
+  io_delegate_.SetFileContents("Foo.aidl",
+                               "@JavaOnlyImmutable parcelable Foo { int a; Bar b; List<Bar> c; "
+                               "Map<String, Baz> d; Bar[] e; }");
+  io_delegate_.SetFileContents("Bar.aidl", "@JavaOnlyImmutable parcelable Bar { String a; }");
+  io_delegate_.SetFileContents("Baz.aidl",
+                               "@JavaOnlyImmutable @JavaOnlyStableParcelable parcelable Baz;");
+  Options options = Options::From("aidl --lang=java -I . Foo.aidl");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+}
+
+TEST_F(AidlTest, RejectMutableParcelableFromJavaOnlyImmutableParcelable) {
+  io_delegate_.SetFileContents("Foo.aidl", "@JavaOnlyImmutable parcelable Foo { Bar bar; }");
+  io_delegate_.SetFileContents("Bar.aidl", "parcelable Bar { String a; }");
+  string expected_error =
+      "ERROR: Foo.aidl:1.40-44: The @JavaOnlyImmutable 'Foo' has a non-immutable field "
+      "named 'bar'.\n";
+  CaptureStderr();
+  Options options = Options::From("aidl --lang=java Foo.aidl -I .");
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_error, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, JavaOnlyImmutableParcelableWithEnumFields) {
+  io_delegate_.SetFileContents("Foo.aidl", "@JavaOnlyImmutable parcelable Foo { Bar bar; }");
+  io_delegate_.SetFileContents("Bar.aidl", "enum Bar { FOO }");
+  CaptureStderr();
+  Options options = Options::From("aidl --lang=java Foo.aidl -I .");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+TEST_F(AidlTest, RejectMutableParcelableFromJavaOnlyImmutableUnion) {
+  io_delegate_.SetFileContents("Foo.aidl", "@JavaOnlyImmutable union Foo { Bar bar; }");
+  io_delegate_.SetFileContents("Bar.aidl", "parcelable Bar { String a; }");
+  string expected_error =
+      "ERROR: Foo.aidl:1.35-39: The @JavaOnlyImmutable 'Foo' has a non-immutable field "
+      "named 'bar'.\n";
+  CaptureStderr();
+  Options options = Options::From("aidl --lang=java Foo.aidl -I .");
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_error, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, ImmutableParcelableCannotBeInOut) {
+  io_delegate_.SetFileContents("Foo.aidl", "@JavaOnlyImmutable parcelable Foo { int a; }");
+  io_delegate_.SetFileContents("IBar.aidl", "interface IBar { void my(inout Foo foo); }");
+  string expected_error =
+      "ERROR: IBar.aidl:1.35-39: 'foo' can't be an inout parameter because @JavaOnlyImmutable can "
+      "only be an in parameter.\n";
+  CaptureStderr();
+  Options options = Options::From("aidl --lang=java IBar.aidl -I .");
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_error, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, ImmutableParcelableCannotBeOut) {
+  io_delegate_.SetFileContents("Foo.aidl", "@JavaOnlyImmutable parcelable Foo { int a; }");
+  io_delegate_.SetFileContents("IBar.aidl", "interface IBar { void my(out Foo foo); }");
+  string expected_error =
+      "ERROR: IBar.aidl:1.33-37: 'foo' can't be an out parameter because @JavaOnlyImmutable can "
+      "only be an in parameter.\n";
+  CaptureStderr();
+  Options options = Options::From("aidl --lang=java IBar.aidl -I .");
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_error, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, ImmutableParcelableFieldNameRestriction) {
+  io_delegate_.SetFileContents("Foo.aidl", "@JavaOnlyImmutable parcelable Foo { int a; int A; }");
+  Options options = Options::From("aidl -I . --lang=java Foo.aidl");
+  const string expected_stderr =
+      "ERROR: Foo.aidl:1.47-49: 'Foo' has duplicate field name 'A' after capitalizing the first "
+      "letter\n";
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, UnionInUnion) {
+  import_paths_.insert(".");
+  io_delegate_.SetFileContents("Bar.aidl", "union Bar { int n = 42; long l; }");
+  CaptureStderr();
+  EXPECT_NE(nullptr, Parse("Foo.aidl", "union Foo { Bar b; int n; }", typenames_, GetLanguage()));
+  EXPECT_THAT("", GetCapturedStderr());
+}
+
+TEST_P(AidlTest, UnionRejectsEmptyDecl) {
+  const string method = "package a; union Foo {}";
+  const string expected_stderr = "ERROR: a/Foo.aidl:1.17-21: The union 'Foo' has no fields.\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/Foo.aidl", method, typenames_, GetLanguage()));
+  EXPECT_THAT(GetCapturedStderr(), testing::HasSubstr(expected_stderr));
+}
+
+TEST_P(AidlTest, UnionRejectsParcelableHolder) {
+  const string method = "package a; union Foo { ParcelableHolder x; }";
+  const string expected_stderr =
+      "ERROR: a/Foo.aidl:1.40-42: A union can't have a member of ParcelableHolder 'x'\n";
+  CaptureStderr();
+  EXPECT_EQ(nullptr, Parse("a/Foo.aidl", method, typenames_, GetLanguage()));
+  EXPECT_THAT(GetCapturedStderr(), testing::HasSubstr(expected_stderr));
+}
+
+TEST_P(AidlTest, UnionRejectsFirstEnumWithNoDefaults) {
+  import_paths_.insert(".");
+  io_delegate_.SetFileContents("a/Enum.aidl", "package a; enum Enum { FOO, BAR }");
+  const string expected_err = "The union's first member should have a useful default value.";
+  CaptureStderr();
+  EXPECT_EQ(nullptr,
+            Parse("a/Foo.aidl", "package a; union Foo { a.Enum e; }", typenames_, GetLanguage()));
+  EXPECT_THAT(GetCapturedStderr(), testing::HasSubstr(expected_err));
+}
+
+TEST_P(AidlTest, GenericStructuredParcelable) {
+  io_delegate_.SetFileContents("Foo.aidl", "parcelable Foo<T, U> { int a; int A; }");
+  Options options = Options::From("aidl -I . Foo.aidl --lang=" + to_string(GetLanguage()));
+  const string expected_stderr = "";
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, GenericStructuredParcelableWithStringConstants_Cpp) {
+  io_delegate_.SetFileContents("Foo.aidl",
+                               "parcelable Foo<T, U> { int a; const String s = \"\"; }");
+  Options options = Options::From("aidl Foo.aidl -I . --lang=" + to_string(Options::Language::CPP) +
+                                  " -o out -h out");
+  const string expected_stderr = "";
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+
+  string code;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/Foo.h", &code));
+  EXPECT_THAT(code, testing::HasSubstr(R"--(template <typename T, typename U>
+const ::android::String16& Foo<T,U>::s() {
+  static const ::android::String16 value(::android::String16(""));
+  return value;
+})--"));
+}
+
+TEST_F(AidlTest, GenericStructuredParcelableWithStringConstants_Ndk) {
+  io_delegate_.SetFileContents("Foo.aidl",
+                               "parcelable Foo<T, U> { int a; const String s = \"\"; }");
+  Options options = Options::From("aidl Foo.aidl -I . --lang=" + to_string(Options::Language::NDK) +
+                                  " -o out -h out");
+  const string expected_stderr = "";
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+
+  string code;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/aidl/Foo.h", &code));
+  EXPECT_THAT(code, testing::HasSubstr(R"--(template <typename T, typename U>
+const char* Foo<T, U>::s = "";
+)--"));
+}
+
+TEST_F(AidlTest, NestedTypeArgs) {
+  io_delegate_.SetFileContents("a/Bar.aidl", "package a; parcelable Bar<A> { }");
+  io_delegate_.SetFileContents("a/Baz.aidl", "package a; parcelable Baz<A, B> { }");
+
+  io_delegate_.SetFileContents("a/Foo.aidl",
+                               "package a; import a.Bar; import a.Baz; parcelable Foo { "
+                               "Baz<Bar<Bar<String[]>>[], Bar<String>> barss; }");
+  Options options = Options::From("aidl a/Foo.aidl -I . -o out --lang=java");
+  const string expected_stderr = "";
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+
+  string code;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/a/Foo.java", &code));
+  EXPECT_THAT(code,
+              testing::HasSubstr(
+                  "a.Baz<a.Bar<a.Bar<java.lang.String[]>>[],a.Bar<java.lang.String>> barss;"));
+}
+
+TEST_F(AidlTest, AcceptMultiDimensionalFixedSizeArray) {
+  io_delegate_.SetFileContents("a/Bar.aidl", "package a; parcelable Bar { String[2][3] a; }");
+
+  Options options = Options::From("aidl a/Bar.aidl -I . -o out --lang=ndk");
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+TEST_F(AidlTest, AcceptBinarySizeArray) {
+  io_delegate_.SetFileContents(
+      "a/Bar.aidl", "package a; parcelable Bar { const int CONST = 3; String[CONST + 1] a; }");
+
+  Options options = Options::From("aidl a/Bar.aidl -I . -o out --lang=ndk");
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+TEST_F(AidlTest, AcceptRefSizeArray) {
+  io_delegate_.SetFileContents(
+      "a/Bar.aidl", "package a; parcelable Bar { const int CONST = 3; String[CONST] a; }");
+
+  Options options = Options::From("aidl a/Bar.aidl -I . -o out --lang=ndk");
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+TEST_F(AidlTest, RejectArrayOfFixedSizeArray) {
+  io_delegate_.SetFileContents("a/Bar.aidl", "package a; parcelable Bar { String[2][] a; }");
+
+  Options options = Options::From("aidl a/Bar.aidl -I . -o out --lang=java");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Multi-dimensional arrays must be fixed size."));
+}
+
+TEST_F(AidlTest, RejectFixedSizeArrayOfDynamicArray) {
+  io_delegate_.SetFileContents("a/Bar.aidl", "package a; parcelable Bar { String[][3] a; }");
+
+  Options options = Options::From("aidl a/Bar.aidl -I . -o out --lang=java");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Multi-dimensional arrays must be fixed size."));
+}
+
+TEST_F(AidlTest, RejectArrayOfArray) {
+  io_delegate_.SetFileContents("a/Bar.aidl", "package a; parcelable Bar { String[][] a; }");
+
+  Options options = Options::From("aidl a/Bar.aidl -I . -o out --lang=java");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Multi-dimensional arrays must be fixed size."));
+}
+
+TEST_F(AidlTest, RejectInvalidArraySize_Negative) {
+  io_delegate_.SetFileContents("a/Bar.aidl", "package a; parcelable Bar { String[-1] a; }");
+
+  Options options = Options::From("aidl a/Bar.aidl -I . -o out --lang=java");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Array size must be a positive number"));
+}
+
+TEST_F(AidlTest, RejectInvalidArraySize_WrongType) {
+  io_delegate_.SetFileContents("a/Bar.aidl", "package a; parcelable Bar { String[\"3\"] a; }");
+
+  Options options = Options::From("aidl a/Bar.aidl -I . -o out --lang=java");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Array size must be a positive number"));
+}
+
+TEST_F(AidlTest, DoubleGenericError) {
+  io_delegate_.SetFileContents("a/Bar.aidl",
+                               "package a; parcelable Bar { List<String><String> a; }");
+
+  Options options = Options::From("aidl a/Bar.aidl -I . -o out --lang=java");
+  const string expected_stderr =
+      "ERROR: a/Bar.aidl:1.28-33: Can only specify one set of type parameters.\n";
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, ArrayBeforeGenericError) {
+  io_delegate_.SetFileContents("a/Bar.aidl", "package a; parcelable Bar { List[]<String> a; }");
+
+  Options options = Options::From("aidl a/Bar.aidl -I . -o out --lang=java");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), testing::HasSubstr("syntax error, unexpected '<'"));
+}
+
+TEST_F(AidlTest, NullableArraysAreNotSupported) {
+  io_delegate_.SetFileContents("a/Bar.aidl",
+                               "package a; parcelable Bar { String @nullable [] a; }");
+
+  Options options = Options::From("aidl a/Bar.aidl -I . -o out --lang=java");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), testing::HasSubstr("Annotations for arrays are not supported."));
+}
+
+TEST_F(AidlTest, ListOfNullablesAreNotSupported) {
+  io_delegate_.SetFileContents("a/Bar.aidl",
+                               "package a; parcelable Bar { List<@nullable String> a; }");
+
+  Options options = Options::From("aidl a/Bar.aidl -I . -o out --lang=java");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(),
+              testing::HasSubstr("Annotations for type arguments are not supported."));
+}
+
+TEST_F(AidlTest, DefaultShouldMatchWithFixedSizeArray) {
+  io_delegate_.SetFileContents("a/Bar.aidl",
+                               "package a;\n"
+                               "parcelable Bar {\n"
+                               "  int[2][3] a = {{1,2,3}, {4,5,6}};\n"
+                               "}");
+
+  Options options = Options::From("aidl a/Bar.aidl -I . -o out --lang=ndk");
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+TEST_F(AidlTest, FixedSizeArrayWithWrongTypeDefaultValue) {
+  io_delegate_.SetFileContents("a/Bar.aidl",
+                               "package a;\n"
+                               "parcelable Bar {\n"
+                               "  int[2][3] a = {{\"1\",\"2\",\"3\"}, {4,5,6}};\n"
+                               "}");
+
+  Options options = Options::From("aidl a/Bar.aidl -I . -o out --lang=java");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Invalid type specifier for a literal string: int"));
+}
+
+TEST_F(AidlTest, FixedSizeArrayWithMoreElements) {
+  io_delegate_.SetFileContents("a/Bar.aidl",
+                               "package a;\n"
+                               "parcelable Bar {\n"
+                               "  int[2][3] a = {{1,2,3,4}, {4,5,6}};\n"
+                               "}");
+
+  Options options = Options::From("aidl a/Bar.aidl -I . -o out --lang=java");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(),
+              HasSubstr("Expected an array of 3 elements, but found one with 4 elements"));
+}
+
+TEST_F(AidlTest, FixedSizeArrayWithFewerElements) {
+  io_delegate_.SetFileContents("a/Bar.aidl",
+                               "package a;\n"
+                               "parcelable Bar {\n"
+                               "  int[2][3] a = {};\n"
+                               "}");
+
+  Options options = Options::From("aidl a/Bar.aidl -I . -o out --lang=java");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(),
+              HasSubstr("Expected an array of 2 elements, but found one with 0 elements"));
+}
+
+struct GenericAidlTest : ::testing::Test {
+  FakeIoDelegate io_delegate_;
+  void Compile(string cmd) {
+    io_delegate_.SetFileContents("Foo.aidl", "parcelable Foo { Bar<Baz<Qux>> x; }");
+    io_delegate_.SetFileContents("Bar.aidl", "parcelable Bar<T> {  }");
+    io_delegate_.SetFileContents("Baz.aidl", "parcelable Baz<T> {  }");
+    io_delegate_.SetFileContents("Qux.aidl", "parcelable Qux {  }");
+
+    Options options = Options::From(cmd);
+    CaptureStderr();
+    EXPECT_TRUE(compile_aidl(options, io_delegate_));
+    EXPECT_EQ("", GetCapturedStderr());
+  }
+};
+
+TEST_F(GenericAidlTest, ImportGenericParameterTypesCPP) {
+  Compile("aidl Foo.aidl --lang=cpp -I . -o out -h out");
+  string code;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/Foo.h", &code));
+  EXPECT_THAT(code, testing::HasSubstr("#include <Bar.h>"));
+  EXPECT_THAT(code, testing::HasSubstr("#include <Baz.h>"));
+  EXPECT_THAT(code, testing::HasSubstr("#include <Qux.h>"));
+}
+
+TEST_F(GenericAidlTest, ImportGenericParameterTypesNDK) {
+  Compile("aidl Foo.aidl --lang=ndk -I . -o out -h out");
+  string code;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/aidl/Foo.h", &code));
+  EXPECT_THAT(code, testing::HasSubstr("#include <aidl/Bar.h>"));
+  EXPECT_THAT(code, testing::HasSubstr("#include <aidl/Baz.h>"));
+  EXPECT_THAT(code, testing::HasSubstr("#include <aidl/Qux.h>"));
+}
+
+TEST_P(AidlTest, RejectGenericStructuredParcelabelRepeatedParam) {
+  io_delegate_.SetFileContents("Foo.aidl", "parcelable Foo<T,T> { int a; int A; }");
+  Options options = Options::From("aidl Foo.aidl -I . --lang=" + to_string(GetLanguage()));
+  const string expected_stderr =
+      "ERROR: Foo.aidl:1.11-15: Every type parameter should be unique.\n";
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, RejectGenericStructuredParcelableField) {
+  io_delegate_.SetFileContents("Foo.aidl", "parcelable Foo<T,T> { T a; int A; }");
+  Options options = Options::From("aidl Foo.aidl -I . --lang=" + to_string(GetLanguage()));
+  const string expected_stderr =
+      "ERROR: Foo.aidl: Couldn't find import for class T. Searched here:\n - ./\nERROR: "
+      "Foo.aidl:1.22-24: Failed to resolve 'T'\n";
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expected_stderr, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, LongCommentWithinConstExpression) {
+  io_delegate_.SetFileContents("Foo.aidl", "enum Foo { FOO = (1 << 1) /* comment */ | 0x0 }");
+  Options options = Options::From("aidl Foo.aidl -I . --lang=" + to_string(GetLanguage()));
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+TEST_F(AidlTest, RejectUntypdeListAndMapInUnion) {
+  io_delegate_.SetFileContents("a/Foo.aidl", "package a; union Foo { List l; Map m; }");
+  Options options = Options::From("aidl a/Foo.aidl -I . --lang=java -o out");
+  std::string expectedErr =
+      "ERROR: a/Foo.aidl:1.28-30: "
+      "Encountered an untyped List or Map. The use of untyped List/Map is "
+      "prohibited because it is not guaranteed that the objects in the list are recognizable in "
+      "the receiving side. Consider switching to an array or a generic List/Map.\n"
+      "ERROR: a/Foo.aidl:1.35-37: "
+      "Encountered an untyped List or Map. The use of untyped List/Map is "
+      "prohibited because it is not guaranteed that the objects in the list are recognizable in "
+      "the receiving side. Consider switching to an array or a generic List/Map.\n";
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expectedErr, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, RejectUntypdeListAndMapInUnstructuredParcelable) {
+  io_delegate_.SetFileContents("a/Foo.aidl", "package a; parcelable Foo { List l; Map m; }");
+  Options options = Options::From("aidl a/Foo.aidl -I . --lang=java -o out");
+  std::string expectedErr =
+      "ERROR: a/Foo.aidl:1.33-35: "
+      "Encountered an untyped List or Map. The use of untyped List/Map is "
+      "prohibited because it is not guaranteed that the objects in the list are recognizable in "
+      "the receiving side. Consider switching to an array or a generic List/Map.\n"
+      "ERROR: a/Foo.aidl:1.40-42: "
+      "Encountered an untyped List or Map. The use of untyped List/Map is "
+      "prohibited because it is not guaranteed that the objects in the list are recognizable in "
+      "the receiving side. Consider switching to an array or a generic List/Map.\n";
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expectedErr, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, RejectNestedUntypedListAndMap) {
+  io_delegate_.SetFileContents("a/Bar.aidl", "package a; parcelable Bar<T>;");
+  io_delegate_.SetFileContents(
+      "a/Foo.aidl", "package a; import a.Bar; parcelable Foo { Bar<List> a; Bar<Map> b; }");
+  Options options = Options::From("aidl a/Foo.aidl -I . --lang=java -o out");
+  std::string expectedErr =
+      "ERROR: a/Foo.aidl:1.52-54: "
+      "Encountered an untyped List or Map. The use of untyped List/Map is "
+      "prohibited because it is not guaranteed that the objects in the list are recognizable in "
+      "the receiving side. Consider switching to an array or a generic List/Map.\n"
+      "ERROR: a/Foo.aidl:1.64-66: "
+      "Encountered an untyped List or Map. The use of untyped List/Map is "
+      "prohibited because it is not guaranteed that the objects in the list are recognizable in "
+      "the receiving side. Consider switching to an array or a generic List/Map.\n";
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(expectedErr, GetCapturedStderr());
+}
+
+TEST_F(AidlTest, EnumWithDefaults_Java) {
+  io_delegate_.SetFileContents("a/p/Enum.aidl", "package p; enum Enum { FOO, BAR }");
+  io_delegate_.SetFileContents("a/p/Foo.aidl", R"(
+package p;
+import p.Enum;
+parcelable Foo {
+  Enum e = Enum.BAR;
+})");
+  CaptureStderr();
+  auto options = Options::From("aidl -I a --lang java -o out a/p/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  auto err = GetCapturedStderr();
+  EXPECT_EQ("", err);
+
+  string code;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/p/Foo.java", &code));
+  EXPECT_THAT(code, testing::HasSubstr("byte e = p.Enum.BAR"));
+}
+
+TEST_F(AidlTest, EnumWithDefaults_Cpp) {
+  io_delegate_.SetFileContents("a/p/Enum.aidl", "package p; enum Enum { FOO, BAR }");
+  io_delegate_.SetFileContents("a/p/Foo.aidl", R"(
+package p;
+import p.Enum;
+parcelable Foo {
+  Enum e = Enum.BAR;
+})");
+  CaptureStderr();
+  auto options = Options::From("aidl -I a --lang cpp -o out -h out a/p/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  auto err = GetCapturedStderr();
+  EXPECT_EQ("", err);
+
+  string code;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/p/Foo.h", &code));
+  EXPECT_THAT(code, testing::HasSubstr("::p::Enum e = ::p::Enum::BAR;"));
+}
+
+TEST_F(AidlTest, EnumWithDefaults_Ndk) {
+  io_delegate_.SetFileContents("a/p/Enum.aidl", "package p; enum Enum { FOO, BAR }");
+  io_delegate_.SetFileContents("a/p/Foo.aidl", R"(
+package p;
+import p.Enum;
+parcelable Foo {
+  Enum e = Enum.BAR;
+})");
+  CaptureStderr();
+  auto options = Options::From("aidl -I a --lang ndk -o out -h out a/p/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  auto err = GetCapturedStderr();
+  EXPECT_EQ("", err);
+
+  string code;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/aidl/p/Foo.h", &code));
+  EXPECT_THAT(code, testing::HasSubstr("::aidl::p::Enum e = ::aidl::p::Enum::BAR;"));
+}
+
+TEST_F(AidlTest, EnumWithDefaults_Rust) {
+  io_delegate_.SetFileContents("a/p/Enum.aidl", "package p; enum Enum { FOO, BAR }");
+  io_delegate_.SetFileContents("a/p/Foo.aidl", R"(
+package p;
+import p.Enum;
+parcelable Foo {
+  int  n = 42;
+  Enum e = Enum.BAR;
+})");
+  CaptureStderr();
+  auto options = Options::From("aidl -I a --lang rust -o out -h out a/p/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  auto err = GetCapturedStderr();
+  EXPECT_EQ("", err);
+
+  string code;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/p/Foo.rs", &code));
+  EXPECT_THAT(code, testing::HasSubstr(R"(
+  fn default() -> Self {
+    Self {
+      r#n: 42,
+      r#e: crate::mangled::_1_p_4_Enum::BAR,
+    }
+  })"));
+}
+
+TEST_P(AidlTest, EnumeratorIsConstantValue_DefaultValue) {
+  import_paths_.insert("a");
+  io_delegate_.SetFileContents("a/p/Enum.aidl", "package p; enum Enum { FOO = 1, BAR = 2}");
+  CaptureStderr();
+  const AidlDefinedType* type = Parse("a/p/Foo.aidl", R"(
+package p;
+import p.Enum;
+parcelable Foo {
+  int e = Enum.FOO | Enum.BAR;
+})",
+                                      typenames_, GetLanguage());
+  auto err = GetCapturedStderr();
+  EXPECT_EQ("", err);
+  EXPECT_TRUE(type);
+  const auto& fields = type->AsStructuredParcelable()->GetFields();
+  EXPECT_EQ("int e = 3", fields[0]->ToString());
+}
+
+TEST_F(AidlTest, EnumeratorIsConstantValue_CanDefineOtherEnumerator) {
+  CaptureStderr();
+  const AidlDefinedType* type = Parse("a/p/Foo.aidl", R"(
+package a.p;
+@Backing(type="int")
+enum Foo {
+      STANDARD_SHIFT = 16,
+      STANDARD_BT709 = 1 << STANDARD_SHIFT,
+      STANDARD_BT601_625 = 2 << STANDARD_SHIFT,
+}
+)",
+                                      typenames_, Options::Language::JAVA);
+  auto err = GetCapturedStderr();
+  EXPECT_EQ("", err);
+  ASSERT_NE(type, nullptr);
+  const auto& enum_type = type->AsEnumDeclaration();
+  string code;
+  auto writer = CodeWriter::ForString(&code);
+  DumpVisitor visitor(*writer, /*inline_constants=*/true);
+  visitor.Visit(*enum_type);
+  writer->Close();
+  EXPECT_EQ(R"--(@Backing(type="int")
+enum Foo {
+  STANDARD_SHIFT = 16,
+  STANDARD_BT709 = 65536,
+  STANDARD_BT601_625 = 131072,
+}
+)--",
+            code);
+}
+
+TEST_F(AidlTest, DumpApiWithConstantReferences) {
+  io_delegate_.SetFileContents("foo/bar/Foo.aidl", R"(
+package foo.bar;
+import foo.bar.Bar;
+import foo.bar.Enum;
+parcelable Foo {
+  int n = Bar.A + 1;
+  int[] ns = {1, Bar.A, Bar.B + 1};
+  Enum e = Enum.A;
+  Enum[] es = {Enum.A, Enum.B};
+}
+)");
+  io_delegate_.SetFileContents("foo/bar/Bar.aidl", R"(
+package foo.bar;
+parcelable Bar {
+  const int A = 1;
+  const int B = A + 1;
+}
+)");
+  io_delegate_.SetFileContents("foo/bar/Enum.aidl", R"(
+package foo.bar;
+enum Enum {
+  A,
+  B = A + 2,
+}
+)");
+  vector<string> args = {"aidl",
+                         "--dumpapi",
+                         "--out=dump",
+                         "--include=.",
+                         "foo/bar/Foo.aidl",
+                         "foo/bar/Bar.aidl",
+                         "foo/bar/Enum.aidl"};
+  ASSERT_TRUE(dump_api(Options::From(args), io_delegate_));
+
+  string actual;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("dump/foo/bar/Foo.aidl", &actual));
+  EXPECT_EQ(string(kPreamble).append(R"(package foo.bar;
+parcelable Foo {
+  int n = (foo.bar.Bar.A + 1) /* 2 */;
+  int[] ns = {1, foo.bar.Bar.A /* 1 */, (foo.bar.Bar.B + 1) /* 3 */};
+  foo.bar.Enum e = foo.bar.Enum.A;
+  foo.bar.Enum[] es = {foo.bar.Enum.A, foo.bar.Enum.B};
+}
+)"),
+            actual);
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("dump/foo/bar/Bar.aidl", &actual));
+  EXPECT_EQ(string(kPreamble).append(R"(package foo.bar;
+parcelable Bar {
+  const int A = 1;
+  const int B = (A + 1) /* 2 */;
+}
+)"),
+            actual);
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("dump/foo/bar/Enum.aidl", &actual));
+  EXPECT_EQ(string(kPreamble).append(R"(package foo.bar;
+enum Enum {
+  A,
+  B = (A + 2) /* 2 */,
+}
+)"),
+            actual);
+}
+
+TEST_F(AidlTest, EnumDefaultShouldBeEnumerators) {
+  io_delegate_.SetFileContents("a/p/Enum.aidl", "package p; enum Enum { FOO = 1, BAR = 2}");
+  io_delegate_.SetFileContents("a/p/Foo.aidl", R"(
+package p;
+import p.Enum;
+parcelable Foo {
+  Enum e = Enum.FOO | Enum.BAR;
+})");
+  CaptureStderr();
+  auto options = Options::From("aidl -I a --lang java -o out -h out a/p/Foo.aidl");
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  auto err = GetCapturedStderr();
+  EXPECT_EQ("ERROR: a/p/Foo.aidl:5.11-20: Invalid value (Enum.FOO|Enum.BAR) for enum p.Enum\n",
+            err);
+}
+
+TEST_F(AidlTest, EnumDefaultShouldBeEnumerators_RejectsNumericValue) {
+  io_delegate_.SetFileContents("a/p/Enum.aidl", "package p; enum Enum { FOO = 1, BAR = 2}");
+  io_delegate_.SetFileContents("a/p/Foo.aidl", R"(
+package p;
+import p.Enum;
+parcelable Foo {
+  Enum e = 1;
+})");
+  CaptureStderr();
+  auto options = Options::From("aidl -I a --lang java -o out -h out a/p/Foo.aidl");
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("Invalid value (1) for enum p.Enum"));
+}
+
+TEST_P(AidlTest, DefaultWithEmptyArray) {
+  io_delegate_.SetFileContents("a/p/Foo.aidl", "package p; parcelable Foo { p.Bar[] bars = {}; }");
+  io_delegate_.SetFileContents("a/p/Bar.aidl", "package p; parcelable Bar { }");
+  CaptureStderr();
+  auto options =
+      Options::From("aidl -I a --lang " + to_string(GetLanguage()) + " -o out -h out a/p/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  auto err = GetCapturedStderr();
+  EXPECT_EQ("", err);
+}
+
+TEST_P(AidlTest, RejectRefsInAnnotation) {
+  io_delegate_.SetFileContents("a/p/IFoo.aidl",
+                               "package p; interface IFoo {\n"
+                               "  const String ANNOTATION = \"@Annotation\";\n"
+                               "  @JavaPassthrough(annotation=ANNOTATION) void foo();\n"
+                               "}");
+  CaptureStderr();
+  auto options = Options::From("aidl -I a --lang " + to_string(GetLanguage()) +
+                               " -o out -h out a/p/IFoo.aidl");
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  auto err = GetCapturedStderr();
+  EXPECT_EQ(
+      "ERROR: a/p/IFoo.aidl:3.31-41: Value must be a constant expression but contains reference to "
+      "ANNOTATION.\n",
+      err);
+}
+
+TEST_F(AidlTest, DefaultWithEnumValues) {
+  io_delegate_.SetFileContents(
+      "a/p/Foo.aidl",
+      "package p; import p.Bar; parcelable Foo { Bar[] bars = { Bar.FOO, Bar.FOO }; }");
+  io_delegate_.SetFileContents("a/p/Bar.aidl", "package p; enum Bar { FOO, BAR }");
+  CaptureStderr();
+  auto options = Options::From("aidl -I a --lang ndk -o out -h out a/p/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  auto err = GetCapturedStderr();
+  EXPECT_EQ("", err);
+  string code;
+  EXPECT_TRUE(io_delegate_.GetWrittenContents("out/aidl/p/Foo.h", &code));
+  EXPECT_THAT(
+      code, testing::HasSubstr(
+                "std::vector<::aidl::p::Bar> bars = {::aidl::p::Bar::FOO, ::aidl::p::Bar::FOO};"));
+}
+
+TEST_F(AidlTest, RejectsCircularReferencingEnumerators) {
+  io_delegate_.SetFileContents("a/p/Foo.aidl", "package p; enum Foo { A = B, B }");
+  CaptureStderr();
+  auto options = Options::From("aidl -I a --lang ndk -o out -h out a/p/Foo.aidl");
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  auto err = GetCapturedStderr();
+  EXPECT_EQ("ERROR: a/p/Foo.aidl:1.26-28: Found a circular reference: B -> A -> B\n", err);
+}
+
+TEST_F(AidlTest, RejectsCircularReferencingConsts) {
+  io_delegate_.SetFileContents("a/p/Foo.aidl",
+                               "package p; parcelable Foo { const int A = A + 1; }");
+  CaptureStderr();
+  auto options = Options::From("aidl -I a --lang ndk -o out -h out a/p/Foo.aidl");
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  auto err = GetCapturedStderr();
+  EXPECT_EQ("ERROR: a/p/Foo.aidl:1.42-44: Found a circular reference: A -> A\n", err);
+}
+
+TEST_F(AidlTest, RecursiveReferences) {
+  io_delegate_.SetFileContents("a/p/Foo.aidl",
+                               "package p; parcelable Foo { const int A = p.Bar.A + 1; }");
+  io_delegate_.SetFileContents("a/p/Bar.aidl",
+                               "package p; parcelable Bar { const int A = p.Baz.A + 1; }");
+  io_delegate_.SetFileContents("a/p/Baz.aidl", "package p; parcelable Baz { const int A = 1; }");
+  CaptureStderr();
+  auto options = Options::From("aidl -I a --lang ndk -o out -h out a/p/Foo.aidl");
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+TEST_P(AidlTest, CircularReferenceWithFullyQualified) {
+  io_delegate_.SetFileContents("Foo.aidl", "enum Foo { A = Foo.A }");
+  auto options =
+      Options::From("aidl --lang " + to_string(GetLanguage()) + " -I . -o out -h out Foo.aidl");
+  const string err = "ERROR: Foo.aidl:1.15-21: Found a circular reference: Foo.A -> Foo.A\n";
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(err, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, ConstRefsCanPointToTheSameValue) {
+  io_delegate_.SetFileContents("Foo.aidl", "enum Foo { A = 0 }");
+  // this demonstrates the case that "Foo.A" const-ref node is visited twice by B and C.
+  io_delegate_.SetFileContents("Bar.aidl", "enum Bar { A = Foo.A, B = A, C = A }");
+  auto options =
+      Options::From("aidl --lang " + to_string(GetLanguage()) + " -I . -o out -h out Bar.aidl");
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ("", GetCapturedStderr());
+}
+
+TEST_P(AidlTest, UnknownConstReference) {
+  io_delegate_.SetFileContents("Foo.aidl", " parcelable Foo { int field = UNKNOWN_REF; }");
+  auto options =
+      Options::From("aidl -I . --lang " + to_string(GetLanguage()) + " -o out -h out Foo.aidl");
+  const string err =
+      "ERROR: Foo.aidl:1.30-42: Can't find UNKNOWN_REF in Foo\n"
+      "ERROR: Foo.aidl:1.30-42: Unknown reference 'UNKNOWN_REF'\n";
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(err, GetCapturedStderr());
+}
+
+TEST_P(AidlTest, JavaCompatibleBuiltinTypes) {
+  string contents = R"(
+import android.os.IBinder;
+import android.os.IInterface;
+interface IFoo {}
+  )";
+  EXPECT_NE(nullptr, Parse("IFoo.aidl", contents, typenames_, GetLanguage()));
+}
+
+TEST_P(AidlTest, WarningInterfaceName) {
+  io_delegate_.SetFileContents("p/Foo.aidl", "package p; interface Foo {}");
+  auto options = Options::From("aidl -I . --lang " + to_string(GetLanguage()) +
+                               " -Winterface-name -o out -h out p/Foo.aidl");
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ(
+      "WARNING: p/Foo.aidl:1.11-21: Interface names should start with I. [-Winterface-name]\n",
+      GetCapturedStderr());
+}
+
+TEST_P(AidlTest, ErrorInterfaceName) {
+  io_delegate_.SetFileContents("p/Foo.aidl", "package p; interface Foo {}");
+  auto options = Options::From("aidl -I . --lang " + to_string(GetLanguage()) +
+                               " -Winterface-name -Werror -o out -h out p/Foo.aidl");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_EQ("ERROR: p/Foo.aidl:1.11-21: Interface names should start with I. [-Winterface-name]\n",
+            GetCapturedStderr());
+}
+
+TEST_F(AidlTest, RejectsIncorrectOutputFilePathOnLegacyCppInput) {
+  const std::string input_file = "base/p/q/IFoo.aidl";
+  const std::string header_dir = "out/";
+  const std::string output_file = "out/base/p/q/IFoo.cpp";
+  io_delegate_.SetFileContents(input_file, "package p.q; interface IFoo {}");
+
+  auto options = Options::From({"aidl-cpp", "-I base", input_file, header_dir, output_file});
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(
+      GetCapturedStderr(),
+      testing::StartsWith(
+          "ERROR: base/p/q/IFoo.aidl:1.13-23: Output file is expected to be at out/p/q/IFoo.cpp, "
+          "but is out/base/p/q/IFoo.cpp."));
+}
+
+TEST_F(AidlTest, FormatCommentsForJava) {
+  using android::aidl::FormatCommentsForJava;
+
+  struct TestCase {
+    vector<Comment> comments;
+    string formatted;
+  };
+  vector<TestCase> testcases = {
+      {{}, ""},
+      {{{"// line comments\n"}}, "// line comments\n"},
+      {{{"// @hide \n"}}, "// @hide \n"},
+      // Transform the last block comment as Javadoc.
+      {{{"/*\n"
+         " * Hello, world!\n"
+         " */"}},
+       "/** Hello, world! */\n"},
+      {{{"/* @hide */"}}, "/** @hide */\n"},
+      {{{"/**\n"
+         "   @param foo ...\n"
+         "*/"}},
+       "/** @param foo ... */\n"},
+      {{{"/* @hide */"}, {"/* @hide */"}}, "/* @hide */\n/** @hide */\n"},
+      {{{"/* @deprecated first */"}, {"/* @deprecated second */"}},
+       "/* @deprecated first */\n/** @deprecated second */\n"},
+      {{{"/* @deprecated */"}, {"/** @param foo */"}}, "/* @deprecated */\n/** @param foo */\n"},
+      // Line comments are printed as they are
+      {{{"/* @deprecated */"}, {"// line comments\n"}}, "/* @deprecated */\n// line comments\n"},
+  };
+  for (const auto& [input, formatted] : testcases) {
+    EXPECT_EQ(formatted, FormatCommentsForJava(input));
+  }
+}
+
+TEST_F(AidlTest, SuppressWarningsIsNotForArgs) {
+  io_delegate_.SetFileContents(
+      "IFoo.aidl",
+      "interface IFoo {\n"
+      "  void foo(in @SuppressWarnings(value={\"inout-parameter\"}) int x);\n"
+      "}");
+  auto options = Options::From("aidl -I . --lang=java IFoo.aidl");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("@SuppressWarnings is not available"));
+}
+
+TEST_F(AidlTest, VoidCantBeUsedInMethodParameterType) {
+  io_delegate_.SetFileContents("p/IFoo.aidl", "package p; interface IFoo{ void j(void n);}");
+  auto options = Options::From("aidl -I . --lang=java -o out p/IFoo.aidl");
+  CaptureStderr();
+  EXPECT_FALSE(compile_aidl(options, io_delegate_));
+  EXPECT_THAT(GetCapturedStderr(), HasSubstr("'void' is an invalid type for the parameter 'n'"));
+}
+
+TEST_F(AidlTest, InterfaceVectorIsAvailableAfterTiramisu) {
+  io_delegate_.SetFileContents("p/IFoo.aidl",
+                               "package p;\n"
+                               "interface IFoo{\n"
+                               "  void foo(in IFoo[] n);\n"
+                               "  void bar(in List<IFoo> n);\n"
+                               "}");
+  CaptureStderr();
+  EXPECT_FALSE(
+      compile_aidl(Options::From("aidl -I . --lang=java --min_sdk_version 30 -o out p/IFoo.aidl"),
+                   io_delegate_));
+  auto captured_stderr = GetCapturedStderr();
+  EXPECT_THAT(captured_stderr, HasSubstr("Array of interfaces is available since"));
+  EXPECT_THAT(captured_stderr, HasSubstr("List of interfaces is available since"));
+
+  CaptureStderr();
+  EXPECT_TRUE(compile_aidl(
+      Options::From("aidl -I . --lang=java --min_sdk_version Tiramisu -o out p/IFoo.aidl"),
+      io_delegate_));
+  EXPECT_EQ(GetCapturedStderr(), "");
+}
+
+TEST_F(AidlTest, RustNameOf_PfdFixedArray) {
+  auto pfd = typenames_.MakeResolvedType(AIDL_LOCATION_HERE, "ParcelFileDescriptor", false);
+  ASSERT_TRUE(pfd->MakeArray(FixedSizeArray{
+      std::unique_ptr<AidlConstantValue>(AidlConstantValue::Integral(AIDL_LOCATION_HERE, "2"))}));
+  ASSERT_TRUE(pfd->MakeArray(FixedSizeArray{
+      std::unique_ptr<AidlConstantValue>(AidlConstantValue::Integral(AIDL_LOCATION_HERE, "3"))}));
+  EXPECT_EQ(
+      rust::RustNameOf(*pfd, typenames_, rust::StorageMode::PARCELABLE_FIELD, rust::Lifetime::NONE),
+      "[[Option<binder::ParcelFileDescriptor>; 3]; 2]");
+  EXPECT_EQ(
+      rust::RustNameOf(*pfd, typenames_, rust::StorageMode::DEFAULT_VALUE, rust::Lifetime::NONE),
+      "[[Option<binder::ParcelFileDescriptor>; 3]; 2]");
+  EXPECT_EQ(
+      rust::RustNameOf(*pfd, typenames_, rust::StorageMode::IN_ARGUMENT, rust::Lifetime::NONE),
+      "&[[binder::ParcelFileDescriptor; 3]; 2]");
+  EXPECT_EQ(rust::RustNameOf(*pfd, typenames_, rust::StorageMode::VALUE, rust::Lifetime::NONE),
+            "[[binder::ParcelFileDescriptor; 3]; 2]");
+}
+
+TEST_F(AidlTest, RustNameOf_PfdDynamicArray) {
+  auto pfd = typenames_.MakeResolvedType(AIDL_LOCATION_HERE, "ParcelFileDescriptor", true);
+  EXPECT_EQ(
+      rust::RustNameOf(*pfd, typenames_, rust::StorageMode::PARCELABLE_FIELD, rust::Lifetime::NONE),
+      "Vec<binder::ParcelFileDescriptor>");
+  EXPECT_EQ(
+      rust::RustNameOf(*pfd, typenames_, rust::StorageMode::DEFAULT_VALUE, rust::Lifetime::NONE),
+      "Vec<Option<binder::ParcelFileDescriptor>>");
+  // we use UNSIZED_ARGUMENT mode for input argument of dynamic array
+  EXPECT_EQ(
+      rust::RustNameOf(*pfd, typenames_, rust::StorageMode::UNSIZED_ARGUMENT, rust::Lifetime::NONE),
+      "&[binder::ParcelFileDescriptor]");
+  EXPECT_EQ(rust::RustNameOf(*pfd, typenames_, rust::StorageMode::VALUE, rust::Lifetime::NONE),
+            "Vec<binder::ParcelFileDescriptor>");
+}
+
+struct TypeParam {
+  string kind;
+  string literal;
+};
+
+const TypeParam kTypeParams[] = {
+    {"primitive", "int"},
+    {"primitiveArray", "int[]"},
+    {"primitiveFixedArray", "int[3]"},
+    {"String", "String"},
+    {"StringArray", "String[]"},
+    {"IBinder", "IBinder"},
+    {"ParcelFileDescriptor", "ParcelFileDescriptor"},
+    {"parcelable", "a.Foo"},
+    {"enum", "a.Enum"},
+    {"union", "a.Union"},
+    {"interface", "a.IBar"},
+};
+
+struct ExpectedResult {
+  string expected_error;
+  string expected_error_for_nullable;
+};
+
+const std::map<std::string, ExpectedResult> kListSupportExpectations = {
+    {"cpp_primitive", {"A generic type cannot", "A generic type cannot"}},
+    {"java_primitive", {"A generic type cannot", "A generic type cannot"}},
+    {"ndk_primitive", {"A generic type cannot", "A generic type cannot"}},
+    {"rust_primitive", {"A generic type cannot", "A generic type cannot"}},
+    {"cpp_primitiveArray", {"List of arrays is not supported", "List of arrays is not supported"}},
+    {"java_primitiveArray", {"List of arrays is not supported", "List of arrays is not supported"}},
+    {"ndk_primitiveArray", {"List of arrays is not supported", "List of arrays is not supported"}},
+    {"rust_primitiveArray", {"List of arrays is not supported", "List of arrays is not supported"}},
+    {"cpp_primitiveFixedArray",
+     {"List of arrays is not supported", "List of arrays is not supported"}},
+    {"java_primitiveFixedArray",
+     {"List of arrays is not supported", "List of arrays is not supported"}},
+    {"ndk_primitiveFixedArray",
+     {"List of arrays is not supported", "List of arrays is not supported"}},
+    {"rust_primitiveFixedArray",
+     {"List of arrays is not supported", "List of arrays is not supported"}},
+    {"cpp_String", {"", ""}},
+    {"java_String", {"", ""}},
+    {"ndk_String", {"", ""}},
+    {"rust_String", {"", ""}},
+    {"cpp_StringArray", {"List of arrays is not supported", "List of arrays is not supported"}},
+    {"java_StringArray", {"List of arrays is not supported", "List of arrays is not supported"}},
+    {"ndk_StringArray", {"List of arrays is not supported", "List of arrays is not supported"}},
+    {"rust_StringArray", {"List of arrays is not supported", "List of arrays is not supported"}},
+    {"cpp_IBinder", {"", ""}},
+    {"java_IBinder", {"", ""}},
+    {"ndk_IBinder", {"", ""}},
+    {"rust_IBinder", {"", ""}},
+    {"cpp_ParcelFileDescriptor", {"", ""}},
+    {"java_ParcelFileDescriptor", {"", ""}},
+    {"ndk_ParcelFileDescriptor", {"", ""}},
+    {"rust_ParcelFileDescriptor", {"", ""}},
+    {"cpp_interface", {"", ""}},
+    {"java_interface", {"", ""}},
+    {"ndk_interface", {"", ""}},
+    {"rust_interface", {"", ""}},
+    {"cpp_parcelable", {"", ""}},
+    {"java_parcelable", {"", ""}},
+    {"ndk_parcelable", {"", ""}},
+    {"rust_parcelable", {"", ""}},
+    {"cpp_enum", {"A generic type cannot", "A generic type cannot"}},
+    {"java_enum", {"A generic type cannot", "A generic type cannot"}},
+    {"ndk_enum", {"A generic type cannot", "A generic type cannot"}},
+    {"rust_enum", {"A generic type cannot", "A generic type cannot"}},
+    {"cpp_union", {"", ""}},
+    {"java_union", {"", ""}},
+    {"ndk_union", {"", ""}},
+    {"rust_union", {"", ""}},
+};
+
+const std::map<std::string, ExpectedResult> kArraySupportExpectations = {
+    {"cpp_primitive", {"", ""}},
+    {"java_primitive", {"", ""}},
+    {"ndk_primitive", {"", ""}},
+    {"rust_primitive", {"", ""}},
+    {"cpp_primitiveArray",
+     {"Multi-dimensional arrays must be fixed size.",
+      "Multi-dimensional arrays must be fixed size."}},
+    {"java_primitiveArray",
+     {"Multi-dimensional arrays must be fixed size.",
+      "Multi-dimensional arrays must be fixed size."}},
+    {"ndk_primitiveArray",
+     {"Multi-dimensional arrays must be fixed size.",
+      "Multi-dimensional arrays must be fixed size."}},
+    {"rust_primitiveArray",
+     {"Multi-dimensional arrays must be fixed size.",
+      "Multi-dimensional arrays must be fixed size."}},
+    {"cpp_primitiveFixedArray",
+     {"Multi-dimensional arrays must be fixed size.",
+      "Multi-dimensional arrays must be fixed size."}},
+    {"java_primitiveFixedArray",
+     {"Multi-dimensional arrays must be fixed size.",
+      "Multi-dimensional arrays must be fixed size."}},
+    {"ndk_primitiveFixedArray",
+     {"Multi-dimensional arrays must be fixed size.",
+      "Multi-dimensional arrays must be fixed size."}},
+    {"rust_primitiveFixedArray",
+     {"Multi-dimensional arrays must be fixed size.",
+      "Multi-dimensional arrays must be fixed size."}},
+    {"cpp_String", {"", ""}},
+    {"java_String", {"", ""}},
+    {"ndk_String", {"", ""}},
+    {"rust_String", {"", ""}},
+    {"cpp_StringArray",
+     {"Multi-dimensional arrays must be fixed size.",
+      "Multi-dimensional arrays must be fixed size."}},
+    {"java_StringArray",
+     {"Multi-dimensional arrays must be fixed size.",
+      "Multi-dimensional arrays must be fixed size."}},
+    {"ndk_StringArray",
+     {"Multi-dimensional arrays must be fixed size.",
+      "Multi-dimensional arrays must be fixed size."}},
+    {"rust_StringArray",
+     {"Multi-dimensional arrays must be fixed size.",
+      "Multi-dimensional arrays must be fixed size."}},
+    {"cpp_IBinder", {"", ""}},
+    {"java_IBinder", {"", ""}},
+    {"ndk_IBinder", {"", ""}},
+    {"rust_IBinder", {"", ""}},
+    {"cpp_ParcelFileDescriptor", {"", ""}},
+    {"java_ParcelFileDescriptor", {"", ""}},
+    {"ndk_ParcelFileDescriptor", {"", ""}},
+    {"rust_ParcelFileDescriptor", {"", ""}},
+    {"cpp_interface", {"", ""}},
+    {"java_interface", {"", ""}},
+    {"ndk_interface", {"", ""}},
+    {"rust_interface", {"", ""}},
+    {"cpp_parcelable", {"", ""}},
+    {"java_parcelable", {"", ""}},
+    {"ndk_parcelable", {"", ""}},
+    {"rust_parcelable", {"", ""}},
+    {"cpp_enum", {"", ""}},
+    {"java_enum", {"", ""}},
+    {"ndk_enum", {"", ""}},
+    {"rust_enum", {"", ""}},
+    {"cpp_union", {"", ""}},
+    {"java_union", {"", ""}},
+    {"ndk_union", {"", ""}},
+    {"rust_union", {"", ""}},
+};
+
+const std::map<std::string, ExpectedResult> kFieldSupportExpectations = {
+    {"cpp_primitive", {"", "cannot get nullable annotation"}},
+    {"java_primitive", {"", "cannot get nullable annotation"}},
+    {"ndk_primitive", {"", "cannot get nullable annotation"}},
+    {"rust_primitive", {"", "cannot get nullable annotation"}},
+    {"cpp_primitiveArray", {"", ""}},
+    {"java_primitiveArray", {"", ""}},
+    {"ndk_primitiveArray", {"", ""}},
+    {"rust_primitiveArray", {"", ""}},
+    {"cpp_primitiveFixedArray", {"", ""}},
+    {"java_primitiveFixedArray", {"", ""}},
+    {"ndk_primitiveFixedArray", {"", ""}},
+    {"rust_primitiveFixedArray", {"", ""}},
+    {"cpp_String", {"", ""}},
+    {"java_String", {"", ""}},
+    {"ndk_String", {"", ""}},
+    {"rust_String", {"", ""}},
+    {"cpp_StringArray", {"", ""}},
+    {"java_StringArray", {"", ""}},
+    {"ndk_StringArray", {"", ""}},
+    {"rust_StringArray", {"", ""}},
+    {"cpp_IBinder", {"", ""}},
+    {"java_IBinder", {"", ""}},
+    {"ndk_IBinder", {"", ""}},
+    {"rust_IBinder", {"", ""}},
+    {"cpp_ParcelFileDescriptor", {"", ""}},
+    {"java_ParcelFileDescriptor", {"", ""}},
+    {"ndk_ParcelFileDescriptor", {"", ""}},
+    {"rust_ParcelFileDescriptor", {"", ""}},
+    {"cpp_interface", {"", ""}},
+    {"java_interface", {"", ""}},
+    {"ndk_interface", {"", ""}},
+    {"rust_interface", {"", ""}},
+    {"cpp_parcelable", {"", ""}},
+    {"java_parcelable", {"", ""}},
+    {"ndk_parcelable", {"", ""}},
+    {"rust_parcelable", {"", ""}},
+    {"cpp_enum", {"", "cannot get nullable annotation"}},
+    {"java_enum", {"", "cannot get nullable annotation"}},
+    {"ndk_enum", {"", "cannot get nullable annotation"}},
+    {"rust_enum", {"", "cannot get nullable annotation"}},
+    {"cpp_union", {"", ""}},
+    {"java_union", {"", ""}},
+    {"ndk_union", {"", ""}},
+    {"rust_union", {"", ""}},
+};
+
+class AidlTypeParamTest
+    : public testing::TestWithParam<std::tuple<Options::Language, TypeParam, bool>> {
+ public:
+  void Run(const std::string& generic_type_decl,
+           const std::map<std::string, ExpectedResult>& expectations) {
+    const auto& param = GetParam();
+    const auto& lang = to_string(std::get<0>(param));
+    const auto& kind = std::get<1>(param).kind;
+    const bool nullable = std::get<2>(param);
+
+    FakeIoDelegate io;
+    io.SetFileContents("a/IBar.aidl", "package a; interface IBar { }");
+    io.SetFileContents("a/Enum.aidl", "package a; enum Enum { A }");
+    io.SetFileContents("a/Union.aidl", "package a; union Union { int a; }");
+    io.SetFileContents("a/Foo.aidl", "package a; parcelable Foo { int a; }");
+    std::string decl = fmt::format(generic_type_decl, std::get<1>(param).literal);
+    if (nullable) {
+      decl = "@nullable " + decl;
+    }
+    io.SetFileContents("a/Target.aidl", "package a; parcelable Target { " + decl + " f; }");
+
+    const auto options = Options::From(fmt::format(
+        "aidl -I . --min_sdk_version current --lang={} a/Target.aidl -o out -h out", lang));
+    CaptureStderr();
+    compile_aidl(options, io);
+    auto it = expectations.find(lang + "_" + kind);
+    ASSERT_TRUE(it != expectations.end()) << "missing expectation for " << lang << "_" << kind;
+    const string err = GetCapturedStderr();
+    const string expected_error =
+        nullable ? it->second.expected_error_for_nullable : it->second.expected_error;
+    if (expected_error.empty()) {
+      EXPECT_EQ("", err);
+    } else {
+      EXPECT_THAT(err, testing::HasSubstr(expected_error));
+    }
+  }
+};
+
+INSTANTIATE_TEST_SUITE_P(
+    AidlTestSuite, AidlTypeParamTest,
+    testing::Combine(testing::Values(Options::Language::CPP, Options::Language::JAVA,
+                                     Options::Language::NDK, Options::Language::RUST),
+                     testing::ValuesIn(kTypeParams), testing::Values(true, false)),
+    [](const testing::TestParamInfo<std::tuple<Options::Language, TypeParam, bool>>& info) {
+      string name = to_string(std::get<0>(info.param)) + "_" + std::get<1>(info.param).kind;
+      if (std::get<2>(info.param)) {
+        name += "_nullable";
+      }
+      return name;
+    });
+
+TEST_P(AidlTypeParamTest, ListSupportedTypes) {
+  Run("List<{}>", kListSupportExpectations);
+}
+
+TEST_P(AidlTypeParamTest, ArraySupportedTypes) {
+  Run("{}[]", kArraySupportExpectations);
+}
+
+TEST_P(AidlTypeParamTest, ParcelableFieldTypes) {
+  Run("{}", kFieldSupportExpectations);
+}
+
+}  // namespace aidl
+}  // namespace android
diff --git a/analyzer/Analyzer.cpp b/analyzer/Analyzer.cpp
new file mode 100644
index 0000000..1b48d2c
--- /dev/null
+++ b/analyzer/Analyzer.cpp
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "include/Analyzer.h"
+
+using std::unique_ptr;
+using std::unordered_map;
+
+namespace android {
+namespace aidl {
+
+using analyzeFn = android::status_t (*)(uint32_t _aidl_code, const android::Parcel& _aidl_data,
+                                        const android::Parcel& _aidl_reply);
+
+Analyzer::Analyzer(const std::string& package, const std::string& interface, analyzeFn function)
+    : mPackageName(package), mInterfaceName(interface), mAnalyzeFunction(function) {}
+
+const std::string& Analyzer::getPackageName() const {
+  return mPackageName;
+}
+
+const std::string& Analyzer::getInterfaceName() const {
+  return mInterfaceName;
+}
+
+const analyzeFn& Analyzer::getAnalyzeFunction() const {
+  return mAnalyzeFunction;
+}
+
+unordered_map<std::string, unique_ptr<Analyzer>>& Analyzer::getAnalyzers() {
+  static unordered_map<std::string, unique_ptr<Analyzer>> gAnalyzers;
+  return gAnalyzers;
+}
+
+void Analyzer::installAnalyzer(std::unique_ptr<Analyzer> install) {
+  getAnalyzers().insert_or_assign(install->getPackageName(), std::move(install));
+}
+
+}  // namespace aidl
+}  // namespace android
diff --git a/analyzer/analyzerMain.cpp b/analyzer/analyzerMain.cpp
new file mode 100644
index 0000000..95e424a
--- /dev/null
+++ b/analyzer/analyzerMain.cpp
@@ -0,0 +1,417 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android-base/file.h>
+#include <android-base/logging.h>
+#include <binder/BpBinder.h>
+#include <binder/IServiceManager.h>
+#include <binder/Parcel.h>
+#include <binder/RecordedTransaction.h>
+#include <signal.h>
+#include <fstream>
+#include <sstream>
+#include "include/Analyzer.h"
+
+using android::IBinder;
+using android::NO_ERROR;
+using android::sp;
+using android::status_t;
+using android::String16;
+using android::aidl::Analyzer;
+using android::binder::debug::RecordedTransaction;
+using std::string;
+
+namespace {
+
+static volatile size_t gCtrlCCount = 0;
+static constexpr size_t kCtrlCLimit = 3;
+static const char kStandardRecordingPath[] = "/data/local/recordings/";
+
+status_t startRecording(const sp<IBinder>& binder, const string& filePath) {
+  if (auto mkdir_return = mkdir(kStandardRecordingPath, 0666);
+      mkdir_return != 0 && errno != EEXIST) {
+    std::cout << "Failed to create recordings directory.\n";
+    return android::NO_ERROR;
+  }
+
+  int openFlags = O_WRONLY | O_CREAT | O_APPEND | O_CLOEXEC | O_BINARY;
+  android::base::unique_fd fd(open(filePath.c_str(), openFlags, 0666));
+  if (fd == -1) {
+    std::cout << "Failed to open file for recording with error: " << strerror(errno) << '\n';
+    return android::BAD_VALUE;
+  }
+
+  // TODO (b/245804633): this still requires setenforce 0, but nothing above does
+  if (status_t err = binder->remoteBinder()->startRecordingBinder(fd); err != android::NO_ERROR) {
+    auto checkSE = std::ifstream("/sys/fs/selinux/enforce");
+    bool recommendSetenforce = false;
+    if ((checkSE.rdstate() & std::ifstream::failbit) != 0) {
+      std::cout << "Failed to determine selinux state.";
+      recommendSetenforce = true;
+    } else {
+      char seState = checkSE.get();
+      if (checkSE.good()) {
+        if (seState == '1') {
+          std::cout << "SELinux must be permissive.";
+          recommendSetenforce = true;
+        } else if (seState == '0') {
+          std::cout << "SELinux is permissive. Failing for some other reason.\n";
+        }
+      } else {
+        std::cout << "Failed to determine SELinux state.";
+        recommendSetenforce = true;
+      }
+    }
+    if (recommendSetenforce) {
+      std::cout << " Try running:\n\n  setenforce 0\n\n";
+    }
+    std::cout << "Failed to start recording with error: " << android::statusToString(err) << '\n';
+    return err;
+  } else {
+    std::cout << "Recording started successfully.\n";
+    return android::NO_ERROR;
+  }
+}
+
+status_t stopRecording(const sp<IBinder>& binder) {
+  if (status_t err = binder->remoteBinder()->stopRecordingBinder(); err != NO_ERROR) {
+    std::cout << "Failed to stop recording with error: " << err << '\n';
+    return err;
+  } else {
+    std::cout << "Recording stopped successfully.\n";
+    return NO_ERROR;
+  }
+}
+
+void printTransaction(const RecordedTransaction& transaction) {
+  auto& analyzers = Analyzer::getAnalyzers();
+
+  auto analyzer = analyzers.find(transaction.getInterfaceName());
+  if (analyzer != analyzers.end()) {
+    (analyzer->second)
+        ->getAnalyzeFunction()(transaction.getCode(), transaction.getDataParcel(),
+                               transaction.getReplyParcel());
+  } else {
+    std::cout << "No analyzer:";
+    std::cout << "  interface: " << transaction.getInterfaceName() << "\n";
+    std::cout << "  code: " << transaction.getCode() << "\n";
+    std::cout << "  data: " << transaction.getDataParcel().dataSize() << " bytes\n";
+    std::cout << "  reply: " << transaction.getReplyParcel().dataSize() << " bytes\n";
+  }
+  std::cout << "  status: " << transaction.getReturnedStatus() << "\n\n";
+}
+
+status_t inspectRecording(const string& path) {
+  auto& analyzers = Analyzer::getAnalyzers();
+
+  android::base::unique_fd fd(open(path.c_str(), O_RDONLY));
+  if (fd.get() == -1) {
+    std::cout << "Failed to open recording file with error: " << strerror(errno) << '\n';
+    return android::BAD_VALUE;
+  }
+
+  int i = 1;
+  while (auto transaction = RecordedTransaction::fromFile(fd)) {
+    std::cout << "Transaction " << i << ":\n";
+    printTransaction(transaction.value());
+    i++;
+  }
+  return NO_ERROR;
+}
+
+void incrementCtrlCCount(int signum) {
+  gCtrlCCount++;
+  if (gCtrlCCount > kCtrlCLimit) {
+    std::cout
+        << "Ctrl+C multiple times, but could not quit application. If recording still running, you "
+           "might stop it manually.\n";
+    exit(signum);
+  }
+}
+
+status_t listenToFile(const string& filePath) {
+  android::base::unique_fd listenFd(open(filePath.c_str(), O_RDONLY));
+  if (listenFd == -1) {
+    std::cout << "Failed to open listening file with error: " << strerror(errno) << '\n';
+    return android::BAD_VALUE;
+  }
+
+  auto& analyzers = Analyzer::getAnalyzers();
+
+  signal(SIGINT, incrementCtrlCCount);
+  std::cout << "Starting to listen:\n";
+  int i = 1;
+  while (gCtrlCCount == 0) {
+    auto transaction = RecordedTransaction::fromFile(listenFd);
+    if (!transaction) {
+      sleep(1);
+      continue;
+    }
+    std::cout << "Transaction " << i << ":\n";
+    printTransaction(transaction.value());
+    i++;
+  }
+  return NO_ERROR;
+}
+
+status_t replayFile(const sp<IBinder>& binder, const string& path) {
+  auto& analyzers = Analyzer::getAnalyzers();
+
+  android::base::unique_fd fd(open(path.c_str(), O_RDONLY));
+  if (fd.get() == -1) {
+    std::cout << "Failed to open recording file with error: " << strerror(errno) << '\n';
+    return android::BAD_VALUE;
+  }
+
+  int failureCount = 0;
+  int i = 1;
+  while (auto transaction = RecordedTransaction::fromFile(fd)) {
+    std::cout << "Replaying Transaction " << i << ":\n";
+    printTransaction(transaction.value());
+
+    android::Parcel send, reply;
+    send.setData(transaction->getDataParcel().data(), transaction->getDataParcel().dataSize());
+    android::status_t status = binder->remoteBinder()->transact(transaction->getCode(), send,
+                                                                &reply, transaction->getFlags());
+    if (status != transaction->getReturnedStatus()) {
+      std::cout << "Failure: Expected status " << transaction->getReturnedStatus()
+                << " but received status " << status << "\n\n";
+      failureCount++;
+    } else {
+      std::cout << "Transaction replayed correctly."
+                << "\n\n";
+    }
+    i++;
+  }
+  std::cout << i << " transactions replayed.\n";
+  if (failureCount > 0) {
+    std::cout << failureCount << " transactions had unexpected status. See logs for details.\n";
+    return android::UNKNOWN_ERROR;
+  } else {
+    return NO_ERROR;
+  }
+}
+
+status_t listAvailableInterfaces(int, char**) {
+  auto& analyzers = Analyzer::getAnalyzers();
+  std::cout << "Available Interfaces (" << analyzers.size() << "):\n";
+  for (auto a = analyzers.begin(); a != analyzers.end(); a++) {
+    std::cout << "  " << a->second->getInterfaceName() << '\n';
+  }
+  return NO_ERROR;
+}
+
+struct AnalyzerCommand {
+  std::function<status_t(int, char*[])> command;
+  std::string overview;
+  std::string compactArguments;
+  std::string helpDetail;
+};
+
+status_t helpCommandEntryPoint(int argc, char* argv[]);
+
+const AnalyzerCommand helpCommand = {helpCommandEntryPoint, "Show help information.", "<command>",
+                                     ""};
+
+const AnalyzerCommand listCommand = {listAvailableInterfaces,
+                                     "Prints a list of available interfaces.", "", ""};
+
+status_t startCommandEntryPoint(int argc, char* argv[]) {
+  if (argc != 3) {
+    helpCommandEntryPoint(argc, argv);
+    return android::BAD_VALUE;
+  }
+
+  sp<IBinder> binder = android::defaultServiceManager()->checkService(String16(argv[2]));
+  if (binder == nullptr) {
+    helpCommandEntryPoint(argc, argv);
+    return android::BAD_VALUE;
+  }
+  string filename = argv[2];
+  std::replace(filename.begin(), filename.end(), '/', '.');
+  auto filePath = kStandardRecordingPath + filename;
+
+  return startRecording(binder, filePath);
+}
+
+const AnalyzerCommand startCommand = {
+    startCommandEntryPoint, "Start recording Binder transactions from a given service.",
+    "<service>", "  <service>\tService to record. See 'dumpsys -l'"};
+
+status_t stopCommandEntryPoint(int argc, char* argv[]) {
+  if (argc != 3) {
+    helpCommandEntryPoint(argc, argv);
+    return android::BAD_VALUE;
+  }
+
+  sp<IBinder> binder = android::defaultServiceManager()->checkService(String16(argv[2]));
+  if (binder == nullptr) {
+    helpCommandEntryPoint(argc, argv);
+    return android::BAD_VALUE;
+  }
+  return stopRecording(binder);
+}
+
+const AnalyzerCommand stopCommand = {
+    stopCommandEntryPoint,
+    "Stops recording Binder transactions from a given process. (See 'start')", "<service>",
+    "  <service>\tService to stop recording; <service> argument to previous 'start' command."};
+
+status_t inspectCommandEntryPoint(int argc, char* argv[]) {
+  if (argc != 3) {
+    helpCommandEntryPoint(argc, argv);
+    return android::BAD_VALUE;
+  }
+  std::string path = kStandardRecordingPath + string(argv[2]);
+
+  return inspectRecording(path);
+}
+
+const AnalyzerCommand inspectCommand = {
+    inspectCommandEntryPoint,
+    "Writes the binder transactions in <file-name> to stdout in a human-friendly format.",
+    "<file-name>",
+    "  <file-name>\tA recording in /data/local/recordings/, and the name of the service"};
+
+status_t listenCommandEntryPoint(int argc, char* argv[]) {
+  if (argc != 3) {
+    helpCommandEntryPoint(argc, argv);
+    return android::BAD_VALUE;
+  }
+
+  sp<IBinder> binder = android::defaultServiceManager()->checkService(String16(argv[2]));
+
+  string filename = argv[2];
+  std::replace(filename.begin(), filename.end(), '/', '.');
+  auto filePath = kStandardRecordingPath + filename;
+
+  if (status_t startErr = startRecording(binder, filePath); startErr != NO_ERROR) {
+    return startErr;
+  }
+
+  status_t listenStatus = listenToFile(filePath);
+
+  if (status_t stopErr = stopRecording(binder); stopErr != NO_ERROR) {
+    return stopErr;
+  }
+
+  return listenStatus;
+}
+
+const AnalyzerCommand listenCommand = {
+    listenCommandEntryPoint,
+    "Starts recording binder transactions in <service> and writes transactions to "
+    "stdout.",
+    "<service>", "  <service>\t?\n"};
+
+int replayFunction(int argc, char* argv[]) {
+  if (argc != 4) {
+    return helpCommandEntryPoint(argc, argv);
+  }
+
+  sp<IBinder> binder = android::defaultServiceManager()->checkService(String16(argv[2]));
+  std::string path = kStandardRecordingPath + string(argv[3]);
+
+  return replayFile(binder, path);
+}
+
+const AnalyzerCommand replayCommand = {
+    replayFunction, "No overview", "<service> <file-name>",
+    "  <service>\t?\n"
+    "  <file-name>\tThe name of a file in /data/local/recordings/"};
+
+auto& commands = *new std::map<std::string, AnalyzerCommand>{
+    {"start", startCommand},   {"stop", stopCommand},     {"inspect", inspectCommand},
+    {"listen", listenCommand}, {"replay", replayCommand}, {"help", helpCommand}};
+
+void printGeneralHelp(std::string& toolName) {
+  std::cout << "USAGE: " << toolName << " <command> [<args>]\n\n";
+  std::cout << "COMMANDS:\n";
+  // Display overview this many characters from the start of a line.
+  // Subtract the length of the command name to calculate padding.
+  const size_t commandOverviewDisplayAlignment = 12;
+  for (const auto& command : commands) {
+    if (command.first == "help") {
+      continue;
+    }
+    std::cout << "  " << command.first
+              << std::string(commandOverviewDisplayAlignment - command.first.length(), ' ')
+              << command.second.overview << "\n";
+  }
+  std::cout << "\n  See '" << toolName << " help <command>' for detailed help.\n";
+}
+
+status_t helpCommandEntryPoint(int argc, char* argv[]) {
+  std::string toolName = argv[0];
+
+  if (argc < 2) {
+    printGeneralHelp(toolName);
+    return 0;
+  }
+
+  std::string commandName = argv[1];
+
+  if (commandName == "help") {
+    if (argc < 3) {
+      printGeneralHelp(toolName);
+      return 0;
+    }
+    commandName = argv[2];
+  } else {
+    commandName = argv[1];
+  }
+
+  auto command = commands.find(commandName);
+  if (command == commands.end()) {
+    std::cout << "Unrecognized command: " << commandName << "\n";
+    printGeneralHelp(toolName);
+    return -1;
+  }
+
+  std::cout << "OVERVIEW: " << command->second.overview << "\n\n";
+  std::cout << "USAGE: " << toolName << " " << commandName << " "
+            << command->second.compactArguments << "\n\n";
+  std::cout << "ARGUMENTS:\n" << command->second.helpDetail << "\n";
+
+  return 0;
+}
+
+}  // namespace
+
+int main(int argc, char* argv[]) {
+  std::string toolName = argv[0];
+
+  auto& analyzers = Analyzer::getAnalyzers();
+  if (analyzers.size() >= 1) {
+    commands["list"] = listCommand;
+  }
+
+  if (argc < 2 ||
+      (argc >= 2 && ((strcmp(argv[1], "--help") == 0) || (strcmp(argv[1], "-h") == 0)))) {
+    // General help
+    printGeneralHelp(toolName);
+    return 0;
+  }
+
+  auto command = commands.find(argv[1]);
+  if (command == commands.end()) {
+    std::cout << "Unrecognized command: " << argv[1] << "\n";
+    printGeneralHelp(toolName);
+    return -1;
+  }
+
+  return command->second.command(argc, argv);
+}
diff --git a/analyzer/include/Analyzer.h b/analyzer/include/Analyzer.h
new file mode 100644
index 0000000..ba712b9
--- /dev/null
+++ b/analyzer/include/Analyzer.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <binder/Parcel.h>
+#include <unordered_map>
+
+using std::unique_ptr;
+using std::unordered_map;
+
+using analyzeFn = android::status_t (*)(uint32_t _aidl_code, const android::Parcel& _aidl_data,
+                                        const android::Parcel& _aidl_reply);
+
+namespace android {
+namespace aidl {
+
+class Analyzer {
+ public:
+  Analyzer(const std::string& package, const std::string& interface, analyzeFn function);
+
+  const std::string& getPackageName() const;
+  const std::string& getInterfaceName() const;
+  const analyzeFn& getAnalyzeFunction() const;
+
+  static unordered_map<std::string, unique_ptr<Analyzer>>& getAnalyzers();
+  static void installAnalyzer(std::unique_ptr<Analyzer> install);
+
+ private:
+  std::string mPackageName;
+  std::string mInterfaceName;
+  analyzeFn mAnalyzeFunction;
+};
+
+}  // namespace aidl
+}  // namespace android
diff --git a/ast_java.cpp b/ast_java.cpp
new file mode 100644
index 0000000..7d95bd4
--- /dev/null
+++ b/ast_java.cpp
@@ -0,0 +1,437 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ast_java.h"
+#include "code_writer.h"
+
+using std::vector;
+using std::string;
+
+template <class... Ts>
+struct overloaded : Ts... {
+  using Ts::operator()...;
+};
+template <class... Ts>
+overloaded(Ts...)->overloaded<Ts...>;
+
+namespace android {
+namespace aidl {
+namespace java {
+
+std::string AstNode::ToString() {
+  std::string str;
+  Write(CodeWriter::ForString(&str).get());
+  return str;
+}
+
+void WriteComment(CodeWriter* to, const std::string& comment) {
+  to->Write("%s", comment.c_str());
+  if (!comment.empty() && comment.back() != '\n') to->Write("\n");
+}
+
+void WriteModifiers(CodeWriter* to, int mod, int mask) {
+  int m = mod & mask;
+
+  if (m & OVERRIDE) {
+    to->Write("@Override ");
+  }
+
+  if ((m & SCOPE_MASK) == PUBLIC) {
+    to->Write("public ");
+  } else if ((m & SCOPE_MASK) == PRIVATE) {
+    to->Write("private ");
+  } else if ((m & SCOPE_MASK) == PROTECTED) {
+    to->Write("protected ");
+  }
+
+  if (m & STATIC) {
+    to->Write("static ");
+  }
+
+  if (m & FINAL) {
+    to->Write("final ");
+  }
+
+  if (m & ABSTRACT) {
+    to->Write("abstract ");
+  }
+}
+
+void WriteArgumentList(CodeWriter* to, const vector<std::shared_ptr<Expression>>& arguments) {
+  size_t N = arguments.size();
+  for (size_t i = 0; i < N; i++) {
+    arguments[i]->Write(to);
+    if (i != N - 1) {
+      to->Write(", ");
+    }
+  }
+}
+
+Field::Field(int m, std::shared_ptr<Variable> v) : ClassElement(), modifiers(m), variable(v) {}
+
+void Field::Write(CodeWriter* to) const {
+  WriteComment(to, comment);
+  for (const auto& a : this->annotations) {
+    to->Write("%s\n", a.c_str());
+  }
+  WriteModifiers(to, this->modifiers, SCOPE_MASK | STATIC | FINAL | OVERRIDE);
+  this->variable->WriteDeclaration(to);
+
+  if (this->value.length() != 0) {
+    to->Write(" = %s", this->value.c_str());
+  }
+  to->Write(";\n");
+}
+
+LiteralExpression::LiteralExpression(const string& v) : value(v) {}
+
+void LiteralExpression::Write(CodeWriter* to) const {
+  to->Write("%s", this->value.c_str());
+}
+
+StringLiteralExpression::StringLiteralExpression(const string& v) : value(v) {}
+
+void StringLiteralExpression::Write(CodeWriter* to) const {
+  to->Write("\"%s\"", this->value.c_str());
+}
+
+Variable::Variable(const string& t, const string& n) : type(t), name(n) {}
+
+void Variable::WriteDeclaration(CodeWriter* to) const {
+  for (const auto& a : this->annotations) {
+    to->Write("%s ", a.c_str());
+  }
+  to->Write("%s %s", this->type.c_str(), this->name.c_str());
+}
+
+void Variable::Write(CodeWriter* to) const { to->Write("%s", name.c_str()); }
+
+FieldVariable::FieldVariable(std::shared_ptr<Expression> o, const string& n)
+    : receiver(o), name(n) {}
+
+FieldVariable::FieldVariable(const string& c, const string& n) : receiver(c), name(n) {}
+
+void FieldVariable::Write(CodeWriter* to) const {
+  visit(
+      overloaded{[&](std::shared_ptr<Expression> e) { e->Write(to); },
+                 [&](const std::string& s) { to->Write("%s", s.c_str()); }, [](std::monostate) {}},
+      this->receiver);
+  to->Write(".%s", name.c_str());
+}
+
+LiteralStatement::LiteralStatement(const std::string& value) : value_(value) {}
+
+void LiteralStatement::Write(CodeWriter* to) const {
+  to->Write("%s", value_.c_str());
+}
+
+void StatementBlock::Write(CodeWriter* to) const {
+  to->Write("{\n");
+  to->Indent();
+  int N = this->statements.size();
+  for (int i = 0; i < N; i++) {
+    this->statements[i]->Write(to);
+  }
+  to->Dedent();
+  to->Write("}\n");
+}
+
+void StatementBlock::Add(std::shared_ptr<Statement> statement) {
+  this->statements.push_back(statement);
+}
+
+void StatementBlock::Add(std::shared_ptr<Expression> expression) {
+  this->statements.push_back(std::make_shared<ExpressionStatement>(expression));
+}
+
+ExpressionStatement::ExpressionStatement(std::shared_ptr<Expression> e) : expression(e) {}
+
+void ExpressionStatement::Write(CodeWriter* to) const {
+  this->expression->Write(to);
+  to->Write(";\n");
+}
+
+Assignment::Assignment(std::shared_ptr<Variable> l, std::shared_ptr<Expression> r)
+    : lvalue(l), rvalue(r) {}
+
+Assignment::Assignment(std::shared_ptr<Variable> l, std::shared_ptr<Expression> r, string c)
+    : lvalue(l), rvalue(r), cast(c) {}
+
+void Assignment::Write(CodeWriter* to) const {
+  this->lvalue->Write(to);
+  to->Write(" = ");
+  if (this->cast) {
+    to->Write("(%s)", this->cast->c_str());
+  }
+  this->rvalue->Write(to);
+}
+
+MethodCall::MethodCall(const string& n) : name(n) {}
+
+MethodCall::MethodCall(const string& n, const std::vector<std::shared_ptr<Expression>>& args)
+    : name(n), arguments(args) {}
+
+MethodCall::MethodCall(std::shared_ptr<Expression> o, const string& n) : receiver(o), name(n) {}
+
+MethodCall::MethodCall(const std::string& t, const string& n) : receiver(t), name(n) {}
+
+MethodCall::MethodCall(std::shared_ptr<Expression> o, const string& n,
+                       const std::vector<std::shared_ptr<Expression>>& args)
+    : receiver(o), name(n), arguments(args) {}
+
+MethodCall::MethodCall(const std::string& t, const string& n,
+                       const std::vector<std::shared_ptr<Expression>>& args)
+    : receiver(t), name(n), arguments(args) {}
+
+void MethodCall::Write(CodeWriter* to) const {
+  visit(
+      overloaded{[&](std::shared_ptr<Expression> e) {
+                   e->Write(to);
+                   to->Write(".");
+                 },
+                 [&](const std::string& s) { to->Write("%s.", s.c_str()); }, [](std::monostate) {}},
+      this->receiver);
+  to->Write("%s(", this->name.c_str());
+  WriteArgumentList(to, this->arguments);
+  to->Write(")");
+}
+
+Comparison::Comparison(std::shared_ptr<Expression> l, const string& o,
+                       std::shared_ptr<Expression> r)
+    : lvalue(l), op(o), rvalue(r) {}
+
+void Comparison::Write(CodeWriter* to) const {
+  to->Write("(");
+  this->lvalue->Write(to);
+  to->Write("%s", this->op.c_str());
+  this->rvalue->Write(to);
+  to->Write(")");
+}
+
+NewExpression::NewExpression(const std::string& n) : instantiableName(n) {}
+
+NewExpression::NewExpression(const std::string& n,
+                             const std::vector<std::shared_ptr<Expression>>& args)
+    : instantiableName(n), arguments(args) {}
+
+void NewExpression::Write(CodeWriter* to) const {
+  to->Write("new %s(", this->instantiableName.c_str());
+  WriteArgumentList(to, this->arguments);
+  to->Write(")");
+}
+
+Cast::Cast(const std::string& t, std::shared_ptr<Expression> e) : type(t), expression(e) {}
+
+void Cast::Write(CodeWriter* to) const {
+  to->Write("((%s)", this->type.c_str());
+  expression->Write(to);
+  to->Write(")");
+}
+
+VariableDeclaration::VariableDeclaration(std::shared_ptr<Variable> l, std::shared_ptr<Expression> r)
+    : lvalue(l), rvalue(r) {}
+
+VariableDeclaration::VariableDeclaration(std::shared_ptr<Variable> l) : lvalue(l) {}
+
+void VariableDeclaration::Write(CodeWriter* to) const {
+  this->lvalue->WriteDeclaration(to);
+  if (this->rvalue != nullptr) {
+    to->Write(" = ");
+    this->rvalue->Write(to);
+  }
+  to->Write(";\n");
+}
+
+void IfStatement::Write(CodeWriter* to) const {
+  if (this->expression != nullptr) {
+    to->Write("if (");
+    this->expression->Write(to);
+    to->Write(") ");
+  }
+  this->statements->Write(to);
+  if (this->elseif != nullptr) {
+    to->Write("else ");
+    this->elseif->Write(to);
+  }
+}
+
+ReturnStatement::ReturnStatement(std::shared_ptr<Expression> e) : expression(e) {}
+
+void ReturnStatement::Write(CodeWriter* to) const {
+  to->Write("return ");
+  this->expression->Write(to);
+  to->Write(";\n");
+}
+
+void BreakStatement::Write(CodeWriter* to) const {
+  to->Write("break;\n");
+}
+
+void TryStatement::Write(CodeWriter* to) const {
+  to->Write("try ");
+  this->statements->Write(to);
+}
+
+void FinallyStatement::Write(CodeWriter* to) const {
+  to->Write("finally ");
+  this->statements->Write(to);
+}
+
+Case::Case(const string& c) { cases.push_back(c); }
+
+void Case::Write(CodeWriter* to) const {
+  int N = this->cases.size();
+  if (N > 0) {
+    for (int i = 0; i < N; i++) {
+      string s = this->cases[i];
+      if (s.length() != 0) {
+        to->Write("case %s:\n", s.c_str());
+      } else {
+        to->Write("default:\n");
+      }
+    }
+  } else {
+    to->Write("default:\n");
+  }
+  statements->Write(to);
+}
+
+SwitchStatement::SwitchStatement(std::shared_ptr<Expression> e) : expression(e) {}
+
+void SwitchStatement::Write(CodeWriter* to) const {
+  to->Write("switch (");
+  this->expression->Write(to);
+  to->Write(")\n{\n");
+  to->Indent();
+  int N = this->cases.size();
+  for (int i = 0; i < N; i++) {
+    this->cases[i]->Write(to);
+  }
+  to->Dedent();
+  to->Write("}\n");
+}
+
+void Method::Write(CodeWriter* to) const {
+  size_t N, i;
+
+  WriteComment(to, comment);
+
+  for (const auto& a : this->annotations) {
+    to->Write("%s\n", a.c_str());
+  }
+
+  WriteModifiers(to, this->modifiers,
+                 SCOPE_MASK | STATIC | ABSTRACT | FINAL | OVERRIDE);
+
+  if (this->returnType) {
+    to->Write("%s ", this->returnType->c_str());
+  }
+
+  to->Write("%s(", this->name.c_str());
+
+  N = this->parameters.size();
+  for (i = 0; i < N; i++) {
+    this->parameters[i]->WriteDeclaration(to);
+    if (i != N - 1) {
+      to->Write(", ");
+    }
+  }
+
+  to->Write(")");
+
+  N = this->exceptions.size();
+  for (i = 0; i < N; i++) {
+    if (i == 0) {
+      to->Write(" throws ");
+    } else {
+      to->Write(", ");
+    }
+    to->Write("%s", this->exceptions[i].c_str());
+  }
+
+  if (this->statements == nullptr) {
+    to->Write(";\n");
+  } else {
+    to->Write("\n");
+    this->statements->Write(to);
+  }
+}
+
+void LiteralClassElement::Write(CodeWriter* to) const {
+  to->Write("%s", element.c_str());
+}
+
+void Class::Write(CodeWriter* to) const {
+  size_t N, i;
+
+  WriteComment(to, comment);
+  for (const auto& a : this->annotations) {
+    to->Write("%s\n", a.c_str());
+  }
+
+  WriteModifiers(to, this->modifiers, ALL_MODIFIERS);
+
+  if (this->what == Class::CLASS) {
+    to->Write("class ");
+  } else {
+    to->Write("interface ");
+  }
+
+  string name = this->type;
+  size_t pos = name.rfind('.');
+  if (pos != string::npos) {
+    name = name.c_str() + pos + 1;
+  }
+
+  to->Write("%s", name.c_str());
+
+  if (this->extends) {
+    to->Write(" extends %s", this->extends->c_str());
+  }
+
+  N = this->interfaces.size();
+  if (N != 0) {
+    if (this->what == Class::CLASS) {
+      to->Write(" implements");
+    } else {
+      to->Write(" extends");
+    }
+    for (i = 0; i < N; i++) {
+      to->Write(" %s", this->interfaces[i].c_str());
+    }
+  }
+
+  to->Write("\n");
+  to->Write("{\n");
+  to->Indent();
+
+  N = this->elements.size();
+  for (i = 0; i < N; i++) {
+    this->elements[i]->Write(to);
+  }
+
+  to->Dedent();
+  to->Write("}\n");
+}
+
+std::shared_ptr<Expression> NULL_VALUE = std::make_shared<LiteralExpression>("null");
+std::shared_ptr<Expression> THIS_VALUE = std::make_shared<LiteralExpression>("this");
+std::shared_ptr<Expression> SUPER_VALUE = std::make_shared<LiteralExpression>("super");
+std::shared_ptr<Expression> TRUE_VALUE = std::make_shared<LiteralExpression>("true");
+std::shared_ptr<Expression> FALSE_VALUE = std::make_shared<LiteralExpression>("false");
+}  // namespace java
+}  // namespace aidl
+}  // namespace android
diff --git a/ast_java.h b/ast_java.h
new file mode 100644
index 0000000..d7e5cb5
--- /dev/null
+++ b/ast_java.h
@@ -0,0 +1,339 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <memory>
+#include <optional>
+#include <string>
+#include <variant>
+#include <vector>
+
+enum {
+  PACKAGE_PRIVATE = 0x00000000,
+  PUBLIC = 0x00000001,
+  PRIVATE = 0x00000002,
+  PROTECTED = 0x00000003,
+  SCOPE_MASK = 0x00000003,
+
+  STATIC = 0x00000010,
+  FINAL = 0x00000020,
+  ABSTRACT = 0x00000040,
+
+  OVERRIDE = 0x00000100,
+
+  ALL_MODIFIERS = 0xffffffff
+};
+
+namespace android {
+namespace aidl {
+class CodeWriter;
+}  // namespace aidl
+}  // namespace android
+
+namespace android {
+namespace aidl {
+namespace java {
+
+// Write the modifiers that are set in both mod and mask
+void WriteModifiers(CodeWriter* to, int mod, int mask);
+
+struct AstNode {
+  AstNode() = default;
+  virtual ~AstNode() = default;
+  virtual void Write(CodeWriter* to) const = 0;
+  std::string ToString();
+};
+
+struct ClassElement : public AstNode {
+  ClassElement() = default;
+  virtual ~ClassElement() = default;
+};
+
+struct Expression : public AstNode {
+  virtual ~Expression() = default;
+};
+
+struct LiteralExpression : public Expression {
+  std::string value;
+
+  explicit LiteralExpression(const std::string& value);
+  virtual ~LiteralExpression() = default;
+  void Write(CodeWriter* to) const override;
+};
+
+struct StringLiteralExpression : public Expression {
+  std::string value;
+
+  explicit StringLiteralExpression(const std::string& value);
+  virtual ~StringLiteralExpression() = default;
+  void Write(CodeWriter* to) const override;
+};
+
+struct Variable : public Expression {
+  std::vector<std::string> annotations;
+  const std::string type;
+  std::string name;
+
+  Variable() = default;
+  Variable(const std::string& type, const std::string& name);
+  virtual ~Variable() = default;
+
+  void WriteDeclaration(CodeWriter* to) const;
+  void Write(CodeWriter* to) const;
+};
+
+struct FieldVariable : public Expression {
+  std::variant<std::shared_ptr<Expression>, std::string> receiver;
+  std::string name;
+
+  FieldVariable(std::shared_ptr<Expression> object, const std::string& name);
+  FieldVariable(const std::string& clazz, const std::string& name);
+  virtual ~FieldVariable() = default;
+
+  void Write(CodeWriter* to) const;
+};
+
+struct Field : public ClassElement {
+  std::string comment;
+  std::vector<std::string> annotations;
+  int modifiers = 0;
+  std::shared_ptr<Variable> variable = nullptr;
+  std::string value;
+
+  Field() = default;
+  Field(int modifiers, std::shared_ptr<Variable> variable);
+  virtual ~Field() = default;
+
+  void Write(CodeWriter* to) const override;
+};
+
+struct Statement : public AstNode {
+  virtual ~Statement() = default;
+};
+
+struct LiteralStatement : public Statement {
+ public:
+  LiteralStatement(const std::string& value);
+  virtual ~LiteralStatement() = default;
+  void Write(CodeWriter* to) const override;
+
+ private:
+  const std::string value_;
+};
+
+struct StatementBlock : public Statement {
+  std::vector<std::shared_ptr<Statement>> statements;
+
+  StatementBlock() = default;
+  virtual ~StatementBlock() = default;
+  void Write(CodeWriter* to) const override;
+
+  void Add(std::shared_ptr<Statement> statement);
+  void Add(std::shared_ptr<Expression> expression);
+};
+
+struct ExpressionStatement : public Statement {
+  std::shared_ptr<Expression> expression;
+
+  explicit ExpressionStatement(std::shared_ptr<Expression> expression);
+  virtual ~ExpressionStatement() = default;
+  void Write(CodeWriter* to) const override;
+};
+
+struct Assignment : public Expression {
+  std::shared_ptr<Variable> lvalue;
+  std::shared_ptr<Expression> rvalue;
+  std::optional<std::string> cast = std::nullopt;
+
+  Assignment(std::shared_ptr<Variable> lvalue, std::shared_ptr<Expression> rvalue);
+  Assignment(std::shared_ptr<Variable> lvalue, std::shared_ptr<Expression> rvalue,
+             std::string cast);
+  virtual ~Assignment() = default;
+  void Write(CodeWriter* to) const override;
+};
+
+struct MethodCall : public Expression {
+  std::variant<std::monostate, std::shared_ptr<Expression>, std::string> receiver;
+  std::string name;
+  std::vector<std::shared_ptr<Expression>> arguments;
+  std::vector<std::string> exceptions;
+
+  explicit MethodCall(const std::string& name);
+  MethodCall(const std::string& name, const std::vector<std::shared_ptr<Expression>>& args);
+  MethodCall(std::shared_ptr<Expression> obj, const std::string& name);
+  MethodCall(const std::string& clazz, const std::string& name);
+  MethodCall(std::shared_ptr<Expression> obj, const std::string& name,
+             const std::vector<std::shared_ptr<Expression>>& args);
+  MethodCall(const std::string&, const std::string& name,
+             const std::vector<std::shared_ptr<Expression>>& args);
+  virtual ~MethodCall() = default;
+  void Write(CodeWriter* to) const override;
+};
+
+struct Comparison : public Expression {
+  std::shared_ptr<Expression> lvalue;
+  std::string op;
+  std::shared_ptr<Expression> rvalue;
+
+  Comparison(std::shared_ptr<Expression> lvalue, const std::string& op,
+             std::shared_ptr<Expression> rvalue);
+  virtual ~Comparison() = default;
+  void Write(CodeWriter* to) const override;
+};
+
+struct NewExpression : public Expression {
+  const std::string instantiableName;
+  std::vector<std::shared_ptr<Expression>> arguments;
+
+  explicit NewExpression(const std::string& name);
+  NewExpression(const std::string& name, const std::vector<std::shared_ptr<Expression>>& args);
+  virtual ~NewExpression() = default;
+  void Write(CodeWriter* to) const override;
+};
+
+struct Cast : public Expression {
+  const std::string type;
+  std::shared_ptr<Expression> expression = nullptr;
+
+  Cast() = default;
+  Cast(const std::string& type, std::shared_ptr<Expression> expression);
+  virtual ~Cast() = default;
+  void Write(CodeWriter* to) const override;
+};
+
+struct VariableDeclaration : public Statement {
+  std::shared_ptr<Variable> lvalue = nullptr;
+  std::shared_ptr<Expression> rvalue = nullptr;
+
+  explicit VariableDeclaration(std::shared_ptr<Variable> lvalue);
+  VariableDeclaration(std::shared_ptr<Variable> lvalue, std::shared_ptr<Expression> rvalue);
+  virtual ~VariableDeclaration() = default;
+  void Write(CodeWriter* to) const override;
+};
+
+struct IfStatement : public Statement {
+  std::shared_ptr<Expression> expression = nullptr;
+  std::shared_ptr<StatementBlock> statements = std::make_shared<StatementBlock>();
+  std::shared_ptr<IfStatement> elseif = nullptr;
+
+  IfStatement() = default;
+  virtual ~IfStatement() = default;
+  void Write(CodeWriter* to) const override;
+};
+
+struct ReturnStatement : public Statement {
+  std::shared_ptr<Expression> expression;
+
+  explicit ReturnStatement(std::shared_ptr<Expression> expression);
+  virtual ~ReturnStatement() = default;
+  void Write(CodeWriter* to) const override;
+};
+
+struct BreakStatement : public Statement {
+  BreakStatement() = default;
+  virtual ~BreakStatement() = default;
+  void Write(CodeWriter* to) const override;
+};
+
+struct TryStatement : public Statement {
+  std::shared_ptr<StatementBlock> statements = std::make_shared<StatementBlock>();
+
+  TryStatement() = default;
+  virtual ~TryStatement() = default;
+  void Write(CodeWriter* to) const override;
+};
+
+struct FinallyStatement : public Statement {
+  std::shared_ptr<StatementBlock> statements = std::make_shared<StatementBlock>();
+
+  FinallyStatement() = default;
+  virtual ~FinallyStatement() = default;
+  void Write(CodeWriter* to) const override;
+};
+
+struct Case : public AstNode {
+  std::vector<std::string> cases;
+  std::shared_ptr<StatementBlock> statements = std::make_shared<StatementBlock>();
+
+  Case() = default;
+  explicit Case(const std::string& c);
+  virtual ~Case() = default;
+  void Write(CodeWriter* to) const override;
+};
+
+struct SwitchStatement : public Statement {
+  std::shared_ptr<Expression> expression;
+  std::vector<std::shared_ptr<Case>> cases;
+
+  explicit SwitchStatement(std::shared_ptr<Expression> expression);
+  virtual ~SwitchStatement() = default;
+  void Write(CodeWriter* to) const override;
+};
+
+struct Method : public ClassElement {
+  std::string comment;
+  std::vector<std::string> annotations;
+  int modifiers = 0;
+  std::optional<std::string> returnType = std::nullopt;  // nullopt means constructor
+  std::string name;
+  std::vector<std::shared_ptr<Variable>> parameters;
+  std::vector<std::string> exceptions;
+  std::shared_ptr<StatementBlock> statements = nullptr;
+
+  Method() = default;
+  virtual ~Method() = default;
+
+  void Write(CodeWriter* to) const override;
+};
+
+struct LiteralClassElement : public ClassElement {
+  std::string element;
+
+  LiteralClassElement(std::string e) : element(e) {}
+  virtual ~LiteralClassElement() = default;
+
+  void Write(CodeWriter* to) const override;
+};
+
+struct Class : public ClassElement {
+  enum { CLASS, INTERFACE };
+
+  std::string comment;
+  std::vector<std::string> annotations;
+  int modifiers = 0;
+  int what = CLASS;  // CLASS or INTERFACE
+  std::string type;
+  std::optional<std::string> extends = std::nullopt;
+  std::vector<std::string> interfaces;
+  std::vector<std::shared_ptr<ClassElement>> elements;
+
+  Class() = default;
+  virtual ~Class() = default;
+
+  void Write(CodeWriter* to) const override;
+};
+
+extern std::shared_ptr<Expression> NULL_VALUE;
+extern std::shared_ptr<Expression> THIS_VALUE;
+extern std::shared_ptr<Expression> SUPER_VALUE;
+extern std::shared_ptr<Expression> TRUE_VALUE;
+extern std::shared_ptr<Expression> FALSE_VALUE;
+}  // namespace java
+}  // namespace aidl
+}  // namespace android
diff --git a/ast_java_unittest.cpp b/ast_java_unittest.cpp
new file mode 100644
index 0000000..0101d42
--- /dev/null
+++ b/ast_java_unittest.cpp
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <string>
+
+#include <gtest/gtest.h>
+
+#include "ast_java.h"
+#include "code_writer.h"
+
+using std::string;
+
+namespace android {
+namespace aidl {
+namespace java {
+namespace {
+
+const char kExpectedClassOutput[] =
+R"(// class comment
+final class TestClass extends SuperClass
+{
+}
+)";
+
+}  // namespace
+
+TEST(AstJavaTests, GeneratesClass) {
+  Class a_class;
+  a_class.comment = "// class comment";
+  a_class.modifiers = FINAL;
+  a_class.what = Class::CLASS;
+  a_class.type = "TestClass";
+  a_class.extends = "SuperClass";
+
+  string actual_output;
+  a_class.Write(CodeWriter::ForString(&actual_output).get());
+  EXPECT_EQ(string(kExpectedClassOutput), actual_output);
+}
+
+TEST(AstJavaTests, ToString) {
+  std::string literal = "public void foo() {}";
+  LiteralClassElement ce(literal);
+  std::string actual = ce.ToString();
+  EXPECT_EQ(literal, actual);
+
+  std::string written;
+  ce.Write(CodeWriter::ForString(&written).get());
+  EXPECT_EQ(literal, written);
+}
+
+}  // namespace java
+}  // namespace aidl
+}  // namespace android
diff --git a/build/Android.bp b/build/Android.bp
new file mode 100644
index 0000000..bf85be8
--- /dev/null
+++ b/build/Android.bp
@@ -0,0 +1,442 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "system_tools_aidl_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["system_tools_aidl_license"],
+}
+
+bootstrap_go_package {
+    name: "aidl-soong-rules",
+    pkgPath: "android/soong/aidl",
+    deps: [
+        "blueprint",
+        "soong",
+        "soong-android",
+        "soong-aidl-library",
+        "soong-bp2build",
+        "soong-cc",
+        "soong-genrule",
+        "soong-phony",
+        "soong-java",
+        "soong-rust",
+    ],
+    srcs: [
+        "aidl_interface.go",
+        "properties.go",
+        "aidl_api.go",
+        "aidl_gen_rule.go",
+        "aidl_interface_backends.go",
+
+        "aidl_interface_defaults.go",
+        "aidl_interface_metadata_singleton.go",
+        "aidl_rust_source_provider.go",
+        "aidl_utils.go",
+    ],
+    testSrcs: [
+        "aidl_test.go",
+        "aidl_interface_bp2build_test.go",
+    ],
+    pluginFor: ["soong_build"],
+}
+
+aidl_interfaces_metadata {
+    name: "aidl_metadata_json",
+    visibility: ["//system/tools/aidl:__subpackages__"],
+}
+
+// These configurations are inherited by all aidl-gen modules
+// TODO(b/146436251): default isn't applied because the module is created
+// in PreArchMutators, when import behavior becomes explicit, the logic can
+// be moved back to LoadHook, and then default can be applied as well.
+cc_defaults {
+    name: "aidl-cpp-module-defaults",
+    target: {
+        darwin: {
+            enabled: false,
+        },
+    },
+}
+
+java_defaults {
+    name: "aidl-java-module-defaults",
+}
+
+rust_defaults {
+    name: "aidl-rust-module-defaults",
+}
+
+// Tests
+
+filegroup {
+    name: "aidl-test-filegroup",
+    srcs: [
+        "tests_1/some_package/IFoo.aidl",
+        "tests_1/some_package/Thing.aidl",
+        "tests_1/some_package/sub_package/*.aidl",
+    ],
+}
+
+aidl_interface {
+    name: "test-piece-1",
+    local_include_dir: "tests_1",
+    vendor_available: true,
+    product_available: true,
+    double_loadable: true,
+    host_supported: true,
+    flags: ["-Werror"],
+    srcs: [
+        "tests_1/some_package/IFoo.aidl",
+        "tests_1/some_package/Thing.aidl",
+        "tests_1/some_package/sub_package/*.aidl", // testing glob w/o filegroup
+    ],
+    versions: [
+        "1",
+        "2",
+        "3",
+        "4",
+    ],
+    backend: {
+        rust: {
+            enabled: true,
+        },
+    },
+}
+
+aidl_interface {
+    name: "test-piece-ndk-sdk-29",
+    local_include_dir: "tests_1",
+    flags: ["-Werror"],
+    srcs: [
+        "tests_1/some_package/IFoo.aidl",
+        "tests_1/some_package/Thing.aidl",
+        "tests_1/some_package/sub_package/*.aidl", // testing glob w/o filegroup
+    ],
+    unstable: true,
+    backend: {
+        rust: {
+            enabled: true,
+        },
+        ndk: {
+            sdk_version: "29",
+            cflags: ["-U__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"],
+        },
+    },
+}
+
+aidl_interface {
+    name: "test-piece-ndk-sdk-30",
+    local_include_dir: "tests_1",
+    flags: ["-Werror"],
+    srcs: [
+        "tests_1/some_package/IFoo.aidl",
+        "tests_1/some_package/Thing.aidl",
+        "tests_1/some_package/sub_package/*.aidl", // testing glob w/o filegroup
+    ],
+    unstable: true,
+    backend: {
+        rust: {
+            enabled: true,
+        },
+        ndk: {
+            sdk_version: "30",
+            cflags: ["-U__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"],
+        },
+    },
+}
+
+aidl_interface {
+    name: "test-piece-ndk-sdk-31",
+    local_include_dir: "tests_1",
+    flags: ["-Werror"],
+    srcs: [
+        "tests_1/some_package/IFoo.aidl",
+        "tests_1/some_package/Thing.aidl",
+        "tests_1/some_package/sub_package/*.aidl", // testing glob w/o filegroup
+    ],
+    unstable: true,
+    backend: {
+        rust: {
+            enabled: true,
+        },
+        ndk: {
+            sdk_version: "31",
+            cflags: ["-U__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"],
+        },
+    },
+}
+
+aidl_interface {
+    name: "test-piece-ndk-sdk-32",
+    local_include_dir: "tests_1",
+    flags: ["-Werror"],
+    srcs: [
+        "tests_1/some_package/IFoo.aidl",
+        "tests_1/some_package/Thing.aidl",
+        "tests_1/some_package/sub_package/*.aidl", // testing glob w/o filegroup
+    ],
+    unstable: true,
+    backend: {
+        rust: {
+            enabled: true,
+        },
+        ndk: {
+            sdk_version: "32",
+            cflags: ["-U__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"],
+        },
+    },
+}
+
+aidl_interface {
+    name: "test-piece-ndk-sdk-33",
+    local_include_dir: "tests_1",
+    flags: ["-Werror"],
+    srcs: [
+        "tests_1/some_package/IFoo.aidl",
+        "tests_1/some_package/Thing.aidl",
+        "tests_1/some_package/sub_package/*.aidl", // testing glob w/o filegroup
+    ],
+    unstable: true,
+    backend: {
+        rust: {
+            enabled: true,
+        },
+        ndk: {
+            sdk_version: "33",
+            cflags: ["-U__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__"],
+        },
+    },
+}
+
+aidl_interface {
+    name: "tests-vintf",
+    local_include_dir: "tests_vintf",
+    srcs: ["tests_vintf/vintf/IFoo.aidl"],
+    stability: "vintf",
+    vendor_available: true,
+    backend: {
+        rust: {
+            enabled: true,
+        },
+        ndk: {
+            sdk_version: "31",
+        },
+        java: {
+            sdk_version: "system_current",
+        },
+    },
+    versions_with_info: [
+        {
+            version: "1",
+            imports: [],
+        },
+    ],
+
+}
+
+aidl_interface {
+    name: "test-piece-2",
+    local_include_dir: "tests_1",
+    flags: ["-Werror"],
+    srcs: [
+        "tests_1/INoPackage.aidl",
+        "tests_1/some_package/IBar.aidl",
+    ],
+    imports: [
+        "test-piece-1-V3",
+    ],
+    backend: {
+        rust: {
+            enabled: true,
+        },
+        java: {
+            platform_apis: true,
+        },
+    },
+    gen_trace: true,
+    versions_with_info: [
+        {
+            version: "1",
+            imports: ["test-piece-1-V3"],
+        },
+    ],
+
+}
+
+aidl_interface {
+    name: "test-piece-3",
+    local_include_dir: "tests_1",
+    flags: ["-Werror"],
+    srcs: [
+        "tests_1/other_package/Enum.aidl",
+        "tests_1/other_package/IBaz.aidl",
+    ],
+    imports: [
+        "test-piece-2-V1",
+    ],
+    backend: {
+        rust: {
+            enabled: true,
+        },
+        java: {
+            platform_apis: true,
+            gen_trace: true,
+        },
+    },
+    gen_trace: true,
+    versions_with_info: [
+        {
+            version: "1",
+            imports: ["test-piece-2-V1"],
+        },
+        {
+            version: "2",
+            imports: ["test-piece-2-V1"],
+        },
+
+    ],
+    frozen: true,
+}
+
+cc_test_library {
+    name: "client-using-test-piece-3",
+    srcs: ["client-using-test-piece-3.cpp"],
+    shared_libs: ["test-piece-3-V2-cpp"],
+}
+
+aidl_interface {
+    name: "test-piece-4",
+    local_include_dir: "tests_2",
+    flags: ["-Werror"],
+    srcs: [
+        "tests_2/another_package/IFaz.aidl",
+    ],
+    imports: [
+        "test-piece-1-V3",
+    ],
+    backend: {
+        rust: {
+            enabled: true,
+        },
+        java: {
+            platform_apis: true,
+        },
+    },
+    gen_trace: true,
+    versions: ["1"],
+    dumpapi: {
+        no_license: true,
+    },
+}
+
+aidl_interface {
+    name: "test-root-package",
+    flags: ["-Werror"],
+    srcs: [
+        "test_package/IBaz.aidl",
+    ],
+    imports: [
+        "test-piece-2-V1",
+    ],
+    backend: {
+        rust: {
+            enabled: true,
+        },
+        java: {
+            platform_apis: true,
+        },
+    },
+    gen_trace: true,
+    versions: [
+        "1",
+        "2",
+        "3",
+    ],
+}
+
+aidl_interface {
+    name: "test-piece-5",
+    unstable: true,
+    local_include_dir: "tests_3",
+    flags: ["-Werror"],
+    srcs: [
+        "tests_3/EmptyParcelable.aidl",
+        "tests_3/IEmptyInterface.aidl",
+    ],
+}
+
+aidl_interface {
+    name: "test-piece-6",
+    unstable: true,
+    local_include_dir: "tests_6",
+    flags: ["-Werror"],
+    srcs: [
+        "tests_6/test6/Bar.aidl",
+        "tests_6/test6/Foo.aidl",
+    ],
+}
+
+// These test that a parcel imported from A->B->C will have the required dependencies to link in
+// all backends (C++ backends need to link direclty against the constructor of the parcelable
+// in order to work)
+aidl_interface {
+    name: "tests_transitive_parcel.a",
+    flags: ["-Werror"],
+    srcs: ["tests_transitive_parcel/a/*.aidl"],
+    imports: [
+        "tests_transitive_parcel.b",
+        "tests_transitive_parcel.c",
+    ],
+    unstable: true,
+    backend: {
+        rust: {
+            enabled: true,
+        },
+    },
+}
+
+aidl_interface {
+    name: "tests_transitive_parcel.b",
+    flags: ["-Werror"],
+    srcs: ["tests_transitive_parcel/b/*.aidl"],
+    imports: ["tests_transitive_parcel.c"],
+    unstable: true,
+    backend: {
+        rust: {
+            enabled: true,
+        },
+    },
+}
+
+aidl_interface {
+    name: "tests_transitive_parcel.c",
+    flags: ["-Werror"],
+    srcs: ["tests_transitive_parcel/c/*.aidl"],
+    unstable: true,
+    backend: {
+        rust: {
+            enabled: true,
+        },
+    },
+}
+
+sh_binary {
+    name: "aidl_hash_gen",
+    src: "hash_gen.sh",
+    host_supported: true,
+}
diff --git a/build/OWNERS b/build/OWNERS
new file mode 100644
index 0000000..4cac0f5
--- /dev/null
+++ b/build/OWNERS
@@ -0,0 +1 @@
+include platform/build/soong:/OWNERS
diff --git a/build/aidl_api.go b/build/aidl_api.go
new file mode 100644
index 0000000..c9a2054
--- /dev/null
+++ b/build/aidl_api.go
@@ -0,0 +1,758 @@
+// Copyright (C) 2021 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package aidl
+
+import (
+	"android/soong/aidl_library"
+	"android/soong/android"
+	"reflect"
+
+	"fmt"
+	"io"
+	"path/filepath"
+	"strconv"
+	"strings"
+
+	"github.com/google/blueprint"
+	"github.com/google/blueprint/proptools"
+)
+
+var (
+	aidlDumpApiRule = pctx.StaticRule("aidlDumpApiRule", blueprint.RuleParams{
+		Command: `rm -rf "${outDir}" && mkdir -p "${outDir}" && ` +
+			`${aidlCmd} --dumpapi ${imports} ${optionalFlags} --out ${outDir} ${in} && ` +
+			`${aidlHashGen} ${outDir} ${latestVersion} ${hashFile}`,
+		CommandDeps: []string{"${aidlCmd}", "${aidlHashGen}"},
+	}, "optionalFlags", "imports", "outDir", "hashFile", "latestVersion")
+
+	aidlCheckApiRule = pctx.StaticRule("aidlCheckApiRule", blueprint.RuleParams{
+		Command: `(${aidlCmd} ${optionalFlags} --checkapi=${checkApiLevel} ${imports} ${old} ${new} && touch ${out}) || ` +
+			`(cat ${messageFile} && exit 1)`,
+		CommandDeps: []string{"${aidlCmd}"},
+		Description: "AIDL CHECK API: ${new} against ${old}",
+	}, "optionalFlags", "imports", "old", "new", "messageFile", "checkApiLevel")
+
+	aidlVerifyHashRule = pctx.StaticRule("aidlVerifyHashRule", blueprint.RuleParams{
+		Command: `if [ $$(cd '${apiDir}' && { find ./ -name "*.aidl" -print0 | LC_ALL=C sort -z | xargs -0 sha1sum && echo ${version}; } | sha1sum | cut -d " " -f 1) = $$(tail -1 '${hashFile}') ]; then ` +
+			`touch ${out}; else cat '${messageFile}' && exit 1; fi`,
+		Description: "Verify ${apiDir} files have not been modified",
+	}, "apiDir", "version", "messageFile", "hashFile")
+)
+
+type aidlApiProperties struct {
+	BaseName  string
+	Srcs      []string `android:"path"`
+	AidlRoot  string   // base directory for the input aidl file
+	Stability *string
+	Unstable  *bool
+	Imports   []string
+	Headers   []string
+	Versions  []string
+	Dumpapi   DumpApiProperties
+	Frozen    *bool
+}
+
+type aidlApi struct {
+	android.ModuleBase
+
+	properties aidlApiProperties
+
+	// for triggering api check for version X against version X-1
+	checkApiTimestamps android.WritablePaths
+
+	// for triggering updating current API
+	updateApiTimestamp android.WritablePath
+
+	// for triggering check that files have not been modified
+	checkHashTimestamps android.WritablePaths
+
+	// for triggering freezing API as the new version
+	freezeApiTimestamp android.WritablePath
+
+	// for checking for active development on unfrozen version
+	hasDevelopment android.WritablePath
+}
+
+func (m *aidlApi) apiDir() string {
+	return filepath.Join(aidlApiDir, m.properties.BaseName)
+}
+
+// `m <iface>-freeze-api` will freeze ToT as this version
+func (m *aidlApi) nextVersion() string {
+	return nextVersion(m.properties.Versions)
+}
+
+func (m *aidlApi) hasVersion() bool {
+	return len(m.properties.Versions) > 0
+}
+
+func (m *aidlApi) latestVersion() string {
+	if !m.hasVersion() {
+		return "0"
+	}
+	return m.properties.Versions[len(m.properties.Versions)-1]
+}
+
+func (m *aidlApi) isFrozen() bool {
+	return proptools.Bool(m.properties.Frozen)
+}
+
+// in order to keep original behavior for certain operations, we may want to
+// check if frozen is set.
+func (m *aidlApi) isExplicitlyUnFrozen() bool {
+	return m.properties.Frozen != nil && !proptools.Bool(m.properties.Frozen)
+}
+
+type apiDump struct {
+	version  string
+	dir      android.Path
+	files    android.Paths
+	hashFile android.OptionalPath
+}
+
+func (m *aidlApi) getImports(ctx android.ModuleContext, version string) map[string]string {
+	iface := ctx.GetDirectDepWithTag(m.properties.BaseName, interfaceDep).(*aidlInterface)
+	return iface.getImports(version)
+}
+
+func (m *aidlApi) createApiDumpFromSource(ctx android.ModuleContext) apiDump {
+	srcs, imports := getPaths(ctx, m.properties.Srcs, m.properties.AidlRoot)
+
+	if ctx.Failed() {
+		return apiDump{}
+	}
+
+	// dumpapi uses imports for ToT("") version
+	deps := getDeps(ctx, m.getImports(ctx, m.nextVersion()))
+	imports = append(imports, deps.imports...)
+
+	var apiDir android.WritablePath
+	var apiFiles android.WritablePaths
+	var hashFile android.WritablePath
+
+	apiDir = android.PathForModuleOut(ctx, "dump")
+	for _, src := range srcs {
+		outFile := android.PathForModuleOut(ctx, "dump", src.Rel())
+		apiFiles = append(apiFiles, outFile)
+	}
+	hashFile = android.PathForModuleOut(ctx, "dump", ".hash")
+
+	var optionalFlags []string
+	if !proptools.Bool(m.properties.Unstable) {
+		optionalFlags = append(optionalFlags, "--structured")
+	}
+	if m.properties.Stability != nil {
+		optionalFlags = append(optionalFlags, "--stability", *m.properties.Stability)
+	}
+	if proptools.Bool(m.properties.Dumpapi.No_license) {
+		optionalFlags = append(optionalFlags, "--no_license")
+	}
+	optionalFlags = append(optionalFlags, wrap("-p", deps.preprocessed.Strings(), "")...)
+
+	version := nextVersion(m.properties.Versions)
+	ctx.Build(pctx, android.BuildParams{
+		Rule:      aidlDumpApiRule,
+		Outputs:   append(apiFiles, hashFile),
+		Inputs:    srcs,
+		Implicits: deps.preprocessed,
+		Args: map[string]string{
+			"optionalFlags": strings.Join(optionalFlags, " "),
+			"imports":       strings.Join(wrap("-I", imports, ""), " "),
+			"outDir":        apiDir.String(),
+			"hashFile":      hashFile.String(),
+			"latestVersion": versionForHashGen(version),
+		},
+	})
+	return apiDump{version, apiDir, apiFiles.Paths(), android.OptionalPathForPath(hashFile)}
+}
+
+func wrapWithDiffCheckIfElse(m *aidlApi, rb *android.RuleBuilder, writer func(*android.RuleBuilderCommand), elseBlock func(*android.RuleBuilderCommand)) {
+	rbc := rb.Command()
+	rbc.Text("if [ \"$(cat ").Input(m.hasDevelopment).Text(")\" = \"1\" ]; then")
+	writer(rbc)
+	rbc.Text("; else")
+	elseBlock(rbc)
+	rbc.Text("; fi")
+}
+
+func wrapWithDiffCheckIf(m *aidlApi, rb *android.RuleBuilder, writer func(*android.RuleBuilderCommand), needToWrap bool) {
+	rbc := rb.Command()
+	if needToWrap {
+		rbc.Text("if [ \"$(cat ").Input(m.hasDevelopment).Text(")\" = \"1\" ]; then")
+	}
+	writer(rbc)
+	if needToWrap {
+		rbc.Text("; fi")
+	}
+}
+
+// Migrate `versions` into `version_with_info`, and then append a version if it isn't nil
+func (m *aidlApi) migrateAndAppendVersion(ctx android.ModuleContext, rb *android.RuleBuilder, version *string, transitive bool) {
+	isFreezingApi := version != nil
+
+	// Remove `versions` property which is deprecated.
+	wrapWithDiffCheckIf(m, rb, func(rbc *android.RuleBuilderCommand) {
+		rbc.BuiltTool("bpmodify").
+			Text("-w -m " + m.properties.BaseName).
+			Text("-parameter versions -remove-property").
+			Text(android.PathForModuleSrc(ctx, "Android.bp").String())
+	}, isFreezingApi)
+
+	var iface *aidlInterface
+	ctx.VisitDirectDeps(func(dep android.Module) {
+		switch ctx.OtherModuleDependencyTag(dep).(type) {
+		case interfaceDepTag:
+			iface = dep.(*aidlInterface)
+		}
+	})
+	if iface == nil {
+		ctx.ModuleErrorf("aidl_interface %s doesn't exist", m.properties.BaseName)
+		return
+	}
+	var versions []string
+	if len(iface.properties.Versions_with_info) == 0 {
+		versions = append(versions, iface.getVersions()...)
+	}
+	if isFreezingApi {
+		versions = append(versions, *version)
+	}
+	for _, v := range versions {
+		importIfaces := make(map[string]*aidlInterface)
+		ctx.VisitDirectDeps(func(dep android.Module) {
+			if _, ok := ctx.OtherModuleDependencyTag(dep).(importInterfaceDepTag); ok {
+				other := dep.(*aidlInterface)
+				importIfaces[other.BaseModuleName()] = other
+			}
+		})
+		imports := make([]string, 0, len(iface.getImportsForVersion(v)))
+		needTransitiveFreeze := isFreezingApi && v == *version && transitive
+
+		if needTransitiveFreeze {
+			importApis := make(map[string]*aidlApi)
+			ctx.WalkDeps(func(child android.Module, parent android.Module) bool {
+				if api, ok := child.(*aidlApi); ok {
+					moduleName := strings.TrimSuffix(api.Name(), aidlApiSuffix)
+					if _, ok := importIfaces[moduleName]; ok {
+						importApis[moduleName] = api
+						return false
+					}
+				}
+				return true
+			})
+			wrapWithDiffCheckIf(m, rb, func(rbc *android.RuleBuilderCommand) {
+				rbc.BuiltTool("bpmodify").
+					Text("-w -m " + m.properties.BaseName).
+					Text("-parameter versions_with_info -add-literal '").
+					Text(fmt.Sprintf(`{version: "%s", imports: [`, v))
+
+				for _, im := range iface.getImportsForVersion(v) {
+					moduleName, version := parseModuleWithVersion(im)
+
+					// Invoke an imported interface's freeze-api only if it depends on ToT version explicitly or implicitly.
+					if version == importIfaces[moduleName].nextVersion() || !hasVersionSuffix(im) {
+						rb.Command().Text(fmt.Sprintf(`echo "Call %s-freeze-api because %s depends on %s."`, moduleName, m.properties.BaseName, moduleName))
+						rbc.Implicit(importApis[moduleName].freezeApiTimestamp)
+					}
+					if hasVersionSuffix(im) {
+						rbc.Text(fmt.Sprintf(`"%s",`, im))
+					} else {
+						rbc.Text("\"" + im + "-V'" + `$(if [ "$(cat `).
+							Input(importApis[im].hasDevelopment).
+							Text(`)" = "1" ]; then echo "` + importIfaces[im].nextVersion() +
+								`"; else echo "` + importIfaces[im].latestVersion() + `"; fi)'", `)
+					}
+				}
+				rbc.Text("]}' ").
+					Text(android.PathForModuleSrc(ctx, "Android.bp").String()).
+					Text("&&").
+					BuiltTool("bpmodify").
+					Text("-w -m " + m.properties.BaseName).
+					Text("-parameter frozen -set-bool true").
+					Text(android.PathForModuleSrc(ctx, "Android.bp").String())
+			}, isFreezingApi)
+		} else {
+			for _, im := range iface.getImportsForVersion(v) {
+				if hasVersionSuffix(im) {
+					imports = append(imports, im)
+				} else {
+					versionSuffix := importIfaces[im].latestVersion()
+					if !importIfaces[im].hasVersion() ||
+						importIfaces[im].isExplicitlyUnFrozen() {
+						versionSuffix = importIfaces[im].nextVersion()
+					}
+					imports = append(imports, im+"-V"+versionSuffix)
+				}
+			}
+			importsStr := strings.Join(wrap(`"`, imports, `"`), ", ")
+			data := fmt.Sprintf(`{version: "%s", imports: [%s]}`, v, importsStr)
+
+			// Also modify Android.bp file to add the new version to the 'versions_with_info' property.
+			wrapWithDiffCheckIf(m, rb, func(rbc *android.RuleBuilderCommand) {
+				rbc.BuiltTool("bpmodify").
+					Text("-w -m " + m.properties.BaseName).
+					Text("-parameter versions_with_info -add-literal '" + data + "' ").
+					Text(android.PathForModuleSrc(ctx, "Android.bp").String()).
+					Text("&&").
+					BuiltTool("bpmodify").
+					Text("-w -m " + m.properties.BaseName).
+					Text("-parameter frozen -set-bool true").
+					Text(android.PathForModuleSrc(ctx, "Android.bp").String())
+			}, isFreezingApi)
+		}
+	}
+}
+
+func (m *aidlApi) makeApiDumpAsVersion(ctx android.ModuleContext, dump apiDump, version string, latestVersionDump *apiDump) android.WritablePath {
+	creatingNewVersion := version != currentVersion
+	moduleDir := android.PathForModuleSrc(ctx).String()
+	targetDir := filepath.Join(moduleDir, m.apiDir(), version)
+	rb := android.NewRuleBuilder(pctx, ctx)
+	transitive := ctx.Config().IsEnvTrue("AIDL_TRANSITIVE_FREEZE")
+	var actionWord string
+	if creatingNewVersion {
+		actionWord = "Making"
+		// We are asked to create a new version. But before doing that, check if the given
+		// dump is the same as the latest version. If so, don't create a new version,
+		// otherwise we will be unnecessarily creating many versions.
+		// Copy the given dump to the target directory only when the equality check failed
+		// (i.e. `has_development` file contains "1").
+		wrapWithDiffCheckIf(m, rb, func(rbc *android.RuleBuilderCommand) {
+			rbc.Text("mkdir -p " + targetDir + " && ").
+				Text("cp -rf " + dump.dir.String() + "/. " + targetDir).Implicits(dump.files)
+		}, true /* needToWrap */)
+		wrapWithDiffCheckIfElse(m, rb, func(rbc *android.RuleBuilderCommand) {
+			rbc.Text(fmt.Sprintf(`echo "There is change between ToT version and the latest stable version. Freezing %s-V%s."`, m.properties.BaseName, version))
+		}, func(rbc *android.RuleBuilderCommand) {
+			rbc.Text(fmt.Sprintf(`echo "There is no change from the latest stable version of %s. Nothing happened."`, m.properties.BaseName))
+		})
+		m.migrateAndAppendVersion(ctx, rb, &version, transitive)
+	} else {
+		actionWord = "Updating"
+		if m.isFrozen() {
+			rb.Command().BuiltTool("bpmodify").
+				Text("-w -m " + m.properties.BaseName).
+				Text("-parameter frozen -set-bool false").
+				Text(android.PathForModuleSrc(ctx, "Android.bp").String())
+
+		}
+		// We are updating the current version. Don't copy .hash to the current dump
+		rb.Command().Text("mkdir -p " + targetDir)
+		rb.Command().Text("rsync --recursive --update --delete-before " + dump.dir.String() + "/* " + targetDir).Implicits(dump.files)
+		m.migrateAndAppendVersion(ctx, rb, nil, false)
+	}
+
+	timestampFile := android.PathForModuleOut(ctx, "update_or_freeze_api_"+version+".timestamp")
+	// explicitly don't touch timestamp, so that the command can be run repeatedly
+	rb.Command().Text("true").ImplicitOutput(timestampFile)
+
+	rb.Build("dump_aidl_api_"+m.properties.BaseName+"_"+version, actionWord+" AIDL API dump version "+version+" for "+m.properties.BaseName+" (see "+targetDir+")")
+	return timestampFile
+}
+
+type deps struct {
+	preprocessed android.Paths
+	implicits    android.Paths
+	imports      []string
+}
+
+// calculates import flags(-I) from deps.
+// When the target is ToT, use ToT of imported interfaces. If not, we use "current" snapshot of
+// imported interfaces.
+func getDeps(ctx android.ModuleContext, versionedImports map[string]string) deps {
+	var deps deps
+	ctx.VisitDirectDeps(func(dep android.Module) {
+		switch ctx.OtherModuleDependencyTag(dep).(type) {
+		case importInterfaceDepTag:
+			iface := dep.(*aidlInterface)
+			if version, ok := versionedImports[iface.BaseModuleName()]; ok {
+				if iface.preprocessed[version] == nil {
+					ctx.ModuleErrorf("can't import %v's preprocessed(version=%v)", iface.BaseModuleName(), version)
+				}
+				deps.preprocessed = append(deps.preprocessed, iface.preprocessed[version])
+			}
+		case interfaceDepTag:
+			iface := dep.(*aidlInterface)
+			deps.imports = append(deps.imports, iface.properties.Include_dirs...)
+		case apiDepTag:
+			api := dep.(*aidlApi)
+			// add imported module's checkapiTimestamps as implicits to make sure that imported apiDump is up-to-date
+			deps.implicits = append(deps.implicits, api.checkApiTimestamps.Paths()...)
+			deps.implicits = append(deps.implicits, api.checkHashTimestamps.Paths()...)
+			deps.implicits = append(deps.implicits, api.hasDevelopment)
+		case interfaceHeadersDepTag:
+			aidlLibraryInfo, ok := ctx.OtherModuleProvider(dep, aidl_library.AidlLibraryProvider).(aidl_library.AidlLibraryInfo)
+			if !ok {
+				ctx.PropertyErrorf("headers", "module %v does not provide AidlLibraryInfo", dep.Name())
+				return
+			}
+			deps.implicits = append(deps.implicits, aidlLibraryInfo.Hdrs.ToList()...)
+			deps.imports = append(deps.imports, android.Paths(aidlLibraryInfo.IncludeDirs.ToList()).Strings()...)
+		}
+	})
+	return deps
+}
+
+func (m *aidlApi) checkApi(ctx android.ModuleContext, oldDump, newDump apiDump, checkApiLevel string, messageFile android.Path) android.WritablePath {
+	newVersion := newDump.dir.Base()
+	timestampFile := android.PathForModuleOut(ctx, "checkapi_"+newVersion+".timestamp")
+
+	// --checkapi(old,new) should use imports for "new"
+	deps := getDeps(ctx, m.getImports(ctx, newDump.version))
+	var implicits android.Paths
+	implicits = append(implicits, deps.implicits...)
+	implicits = append(implicits, deps.preprocessed...)
+	implicits = append(implicits, oldDump.files...)
+	implicits = append(implicits, newDump.files...)
+	implicits = append(implicits, messageFile)
+
+	var optionalFlags []string
+	if m.properties.Stability != nil {
+		optionalFlags = append(optionalFlags, "--stability", *m.properties.Stability)
+	}
+	optionalFlags = append(optionalFlags, wrap("-p", deps.preprocessed.Strings(), "")...)
+
+	ctx.Build(pctx, android.BuildParams{
+		Rule:      aidlCheckApiRule,
+		Implicits: implicits,
+		Output:    timestampFile,
+		Args: map[string]string{
+			"optionalFlags": strings.Join(optionalFlags, " "),
+			"imports":       strings.Join(wrap("-I", deps.imports, ""), " "),
+			"old":           oldDump.dir.String(),
+			"new":           newDump.dir.String(),
+			"messageFile":   messageFile.String(),
+			"checkApiLevel": checkApiLevel,
+		},
+	})
+	return timestampFile
+}
+
+func (m *aidlApi) checkCompatibility(ctx android.ModuleContext, oldDump, newDump apiDump) android.WritablePath {
+	messageFile := android.PathForSource(ctx, "system/tools/aidl/build/message_check_compatibility.txt")
+	return m.checkApi(ctx, oldDump, newDump, "compatible", messageFile)
+}
+
+func (m *aidlApi) checkEquality(ctx android.ModuleContext, oldDump apiDump, newDump apiDump) android.WritablePath {
+	// Use different messages depending on whether platform SDK is finalized or not.
+	// In case when it is finalized, we should never allow updating the already frozen API.
+	// If it's not finalized, we let users to update the current version by invoking
+	// `m <name>-update-api`.
+	var messageFile android.SourcePath
+	if m.isFrozen() {
+		messageFile = android.PathForSource(ctx, "system/tools/aidl/build/message_check_equality_frozen.txt")
+	} else {
+		messageFile = android.PathForSource(ctx, "system/tools/aidl/build/message_check_equality.txt")
+	}
+	formattedMessageFile := android.PathForModuleOut(ctx, "message_check_equality.txt")
+	rb := android.NewRuleBuilder(pctx, ctx)
+	rb.Command().Text("sed").Flag(" s/%s/" + m.properties.BaseName + "/g ").Input(messageFile).Text(" > ").Output(formattedMessageFile)
+	rb.Build("format_message_"+m.properties.BaseName, "")
+
+	return m.checkApi(ctx, oldDump, newDump, "equal", formattedMessageFile)
+}
+
+func (m *aidlApi) checkIntegrity(ctx android.ModuleContext, dump apiDump) android.WritablePath {
+	version := dump.dir.Base()
+	timestampFile := android.PathForModuleOut(ctx, "checkhash_"+version+".timestamp")
+	messageFile := android.PathForSource(ctx, "system/tools/aidl/build/message_check_integrity.txt")
+
+	var implicits android.Paths
+	implicits = append(implicits, dump.files...)
+	implicits = append(implicits, dump.hashFile.Path())
+	implicits = append(implicits, messageFile)
+	ctx.Build(pctx, android.BuildParams{
+		Rule:      aidlVerifyHashRule,
+		Implicits: implicits,
+		Output:    timestampFile,
+		Args: map[string]string{
+			"apiDir":      dump.dir.String(),
+			"version":     versionForHashGen(version),
+			"hashFile":    dump.hashFile.Path().String(),
+			"messageFile": messageFile.String(),
+		},
+	})
+	return timestampFile
+}
+
+// Get the `latest` versions of the imported AIDL interfaces. If an interface is frozen, this is the
+// last frozen version, if it is `frozen: false` this is the last frozen version + 1, if `frozen` is
+// not set this is the last frozen version because we don't know if there are changes or not to the
+// interface.
+// map["foo":"3", "bar":1]
+func (m *aidlApi) getLatestImportVersions(ctx android.ModuleContext) map[string]string {
+	var latest_versions = make(map[string]string)
+	ctx.VisitDirectDeps(func(dep android.Module) {
+		switch ctx.OtherModuleDependencyTag(dep).(type) {
+		case apiDepTag:
+			api := dep.(*aidlApi)
+			if len(api.properties.Versions) > 0 {
+				if api.properties.Frozen == nil || api.isFrozen() {
+					latest_versions[api.properties.BaseName] = api.latestVersion()
+				} else {
+					latest_versions[api.properties.BaseName] = api.nextVersion()
+				}
+			} else {
+				latest_versions[api.properties.BaseName] = "1"
+			}
+		}
+	})
+	return latest_versions
+}
+
+func (m *aidlApi) checkForDevelopment(ctx android.ModuleContext, latestVersionDump *apiDump, totDump apiDump) android.WritablePath {
+	hasDevPath := android.PathForModuleOut(ctx, "has_development")
+	rb := android.NewRuleBuilder(pctx, ctx)
+	rb.Command().Text("rm -f " + hasDevPath.String())
+	if latestVersionDump != nil {
+		current_imports := m.getImports(ctx, currentVersion)
+		last_frozen_imports := m.getImports(ctx, m.properties.Versions[len(m.properties.Versions)-1])
+		var latest_versions = m.getLatestImportVersions(ctx)
+		// replace any "latest" version with the version number from latest_versions
+		for import_name, latest_version := range current_imports {
+			if latest_version == "latest" {
+				current_imports[import_name] = latest_versions[import_name]
+			}
+		}
+		for import_name, latest_version := range last_frozen_imports {
+			if latest_version == "latest" {
+				last_frozen_imports[import_name] = latest_versions[import_name]
+			}
+		}
+		different_imports := false
+		if !reflect.DeepEqual(current_imports, last_frozen_imports) {
+			if m.isFrozen() {
+				ctx.ModuleErrorf("This interface is 'frozen: true' but the imports have changed. Set 'frozen: false' to allow changes: \n Version %s imports: %s\n Version %s imports: %s\n",
+					currentVersion,
+					fmt.Sprint(current_imports),
+					m.properties.Versions[len(m.properties.Versions)-1],
+					fmt.Sprint(last_frozen_imports))
+				return hasDevPath
+			}
+			different_imports = true
+		}
+		// checkapi(latest, tot) should use imports for nextVersion(=tot)
+		hasDevCommand := rb.Command()
+		if !different_imports {
+			hasDevCommand.BuiltTool("aidl").FlagWithArg("--checkapi=", "equal")
+			if m.properties.Stability != nil {
+				hasDevCommand.FlagWithArg("--stability ", *m.properties.Stability)
+			}
+			deps := getDeps(ctx, m.getImports(ctx, m.nextVersion()))
+			hasDevCommand.
+				FlagForEachArg("-I", deps.imports).Implicits(deps.implicits).
+				FlagForEachInput("-p", deps.preprocessed).
+				Text(latestVersionDump.dir.String()).Implicits(latestVersionDump.files).
+				Text(totDump.dir.String()).Implicits(totDump.files)
+			if m.isExplicitlyUnFrozen() {
+				// Throw an error if checkapi returns with no differences
+				msg := fmt.Sprintf("echo \"Interface %s can not be marked \\`frozen: false\\` if there are no changes "+
+					"between the current version and the last frozen version.\"", m.properties.BaseName)
+				hasDevCommand.
+					Text(fmt.Sprintf("2> /dev/null && %s && exit -1 || echo $? >", msg)).Output(hasDevPath)
+			} else {
+				hasDevCommand.
+					Text("2> /dev/null; echo $? >").Output(hasDevPath)
+			}
+		} else {
+			// We know there are different imports which means has_development must be true
+			hasDevCommand.Text("echo 1 >").Output(hasDevPath)
+		}
+	} else {
+		rb.Command().Text("echo 1 >").Output(hasDevPath)
+	}
+	rb.Build("check_for_development", "")
+	return hasDevPath
+}
+
+func (m *aidlApi) GenerateAndroidBuildActions(ctx android.ModuleContext) {
+	// An API dump is created from source and it is compared against the API dump of the
+	// 'current' (yet-to-be-finalized) version. By checking this we enforce that any change in
+	// the AIDL interface is gated by the AIDL API review even before the interface is frozen as
+	// a new version.
+	totApiDump := m.createApiDumpFromSource(ctx)
+	currentApiDir := android.ExistentPathForSource(ctx, ctx.ModuleDir(), m.apiDir(), currentVersion)
+	var currentApiDump apiDump
+	if currentApiDir.Valid() {
+		currentApiDump = apiDump{
+			version:  nextVersion(m.properties.Versions),
+			dir:      currentApiDir.Path(),
+			files:    ctx.Glob(filepath.Join(currentApiDir.Path().String(), "**/*.aidl"), nil),
+			hashFile: android.ExistentPathForSource(ctx, ctx.ModuleDir(), m.apiDir(), currentVersion, ".hash"),
+		}
+		checked := m.checkEquality(ctx, currentApiDump, totApiDump)
+		m.checkApiTimestamps = append(m.checkApiTimestamps, checked)
+	} else {
+		// The "current" directory might not exist, in case when the interface is first created.
+		// Instruct user to create one by executing `m <name>-update-api`.
+		rb := android.NewRuleBuilder(pctx, ctx)
+		ifaceName := m.properties.BaseName
+		rb.Command().Text(fmt.Sprintf(`echo "API dump for the current version of AIDL interface %s does not exist."`, ifaceName))
+		rb.Command().Text(fmt.Sprintf(`echo "Run the command \"m %s-update-api\" or add \"unstable: true\" to the build rule for the interface if it does not need to be versioned"`, ifaceName))
+		// This file will never be created. Otherwise, the build will pass simply by running 'm; m'.
+		alwaysChecked := android.PathForModuleOut(ctx, "checkapi_current.timestamp")
+		rb.Command().Text("false").ImplicitOutput(alwaysChecked)
+		rb.Build("check_current_aidl_api", "")
+		m.checkApiTimestamps = append(m.checkApiTimestamps, alwaysChecked)
+	}
+
+	// Also check that version X is backwards compatible with version X-1.
+	// "current" is checked against the latest version.
+	var dumps []apiDump
+	for _, ver := range m.properties.Versions {
+		apiDir := filepath.Join(ctx.ModuleDir(), m.apiDir(), ver)
+		apiDirPath := android.ExistentPathForSource(ctx, apiDir)
+		if apiDirPath.Valid() {
+			hashFilePath := filepath.Join(apiDir, ".hash")
+			dump := apiDump{
+				version:  ver,
+				dir:      apiDirPath.Path(),
+				files:    ctx.Glob(filepath.Join(apiDirPath.String(), "**/*.aidl"), nil),
+				hashFile: android.ExistentPathForSource(ctx, hashFilePath),
+			}
+			if !dump.hashFile.Valid() {
+				// We should show the source path of hash_gen because aidl_hash_gen cannot be built due to build error.
+				cmd := fmt.Sprintf(`(croot && system/tools/aidl/build/hash_gen.sh %s %s %s)`, apiDir, versionForHashGen(ver), hashFilePath)
+				ctx.ModuleErrorf("A frozen aidl_interface must have '.hash' file, but %s-V%s doesn't have it. Use the command below to generate a hash (DANGER: this should not normally happen. If an interface is changed downstream, it may cause undefined behavior, test failures, unexplained weather conditions, or otherwise broad malfunction of society. DO NOT RUN THIS COMMAND TO BREAK APIS. DO NOT!).\n%s\n",
+					m.properties.BaseName, ver, cmd)
+			}
+			dumps = append(dumps, dump)
+		} else if ctx.Config().AllowMissingDependencies() {
+			ctx.AddMissingDependencies([]string{apiDir})
+		} else {
+			ctx.ModuleErrorf("API version %s path %s does not exist", ver, apiDir)
+		}
+	}
+	var latestVersionDump *apiDump
+	if len(dumps) >= 1 {
+		latestVersionDump = &dumps[len(dumps)-1]
+	}
+	if currentApiDir.Valid() {
+		dumps = append(dumps, currentApiDump)
+	}
+	for i, _ := range dumps {
+		if dumps[i].hashFile.Valid() {
+			checkHashTimestamp := m.checkIntegrity(ctx, dumps[i])
+			m.checkHashTimestamps = append(m.checkHashTimestamps, checkHashTimestamp)
+		}
+
+		if i == 0 {
+			continue
+		}
+		checked := m.checkCompatibility(ctx, dumps[i-1], dumps[i])
+		m.checkApiTimestamps = append(m.checkApiTimestamps, checked)
+	}
+
+	// Check for active development on the unfrozen version
+	m.hasDevelopment = m.checkForDevelopment(ctx, latestVersionDump, totApiDump)
+
+	// API dump from source is updated to the 'current' version. Triggered by `m <name>-update-api`
+	m.updateApiTimestamp = m.makeApiDumpAsVersion(ctx, totApiDump, currentVersion, nil)
+
+	// API dump from source is frozen as the next stable version. Triggered by `m <name>-freeze-api`
+	nextVersion := m.nextVersion()
+	m.freezeApiTimestamp = m.makeApiDumpAsVersion(ctx, totApiDump, nextVersion, latestVersionDump)
+
+	nextApiDir := filepath.Join(ctx.ModuleDir(), m.apiDir(), nextVersion)
+	if android.ExistentPathForSource(ctx, nextApiDir).Valid() {
+		ctx.ModuleErrorf("API Directory exists for version %s path %s exists, but it is not specified in versions field.", nextVersion, nextApiDir)
+	}
+}
+
+func (m *aidlApi) AndroidMk() android.AndroidMkData {
+	return android.AndroidMkData{
+		Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {
+			android.WriteAndroidMkData(w, data)
+			targetName := m.properties.BaseName + "-freeze-api"
+			fmt.Fprintln(w, ".PHONY:", targetName)
+			fmt.Fprintln(w, targetName+":", m.freezeApiTimestamp.String())
+
+			targetName = m.properties.BaseName + "-update-api"
+			fmt.Fprintln(w, ".PHONY:", targetName)
+			fmt.Fprintln(w, targetName+":", m.updateApiTimestamp.String())
+		},
+	}
+}
+
+func (m *aidlApi) DepsMutator(ctx android.BottomUpMutatorContext) {
+	ctx.AddReverseDependency(ctx.Module(), nil, aidlMetadataSingletonName)
+}
+
+func aidlApiFactory() android.Module {
+	m := &aidlApi{}
+	m.AddProperties(&m.properties)
+	android.InitAndroidModule(m)
+	return m
+}
+
+func addApiModule(mctx android.DefaultableHookContext, i *aidlInterface) string {
+	apiModule := i.ModuleBase.Name() + aidlApiSuffix
+	srcs, aidlRoot := i.srcsForVersion(mctx, i.nextVersion())
+	mctx.CreateModule(aidlApiFactory, &nameProperties{
+		Name: proptools.StringPtr(apiModule),
+	}, &aidlApiProperties{
+		BaseName:  i.ModuleBase.Name(),
+		Srcs:      srcs,
+		AidlRoot:  aidlRoot,
+		Stability: i.properties.Stability,
+		Unstable:  i.properties.Unstable,
+		Imports:   i.properties.Imports,
+		Headers:   i.properties.Headers,
+		Versions:  i.getVersions(),
+		Dumpapi:   i.properties.Dumpapi,
+		Frozen:    i.properties.Frozen,
+	})
+	return apiModule
+}
+
+func versionForHashGen(ver string) string {
+	// aidlHashGen uses the version before current version. If it has never been frozen, return 'latest-version'.
+	verInt, _ := strconv.Atoi(ver)
+	if verInt > 1 {
+		return strconv.Itoa(verInt - 1)
+	}
+	return "latest-version"
+}
+
+func init() {
+	android.RegisterParallelSingletonType("aidl-freeze-api", freezeApiSingletonFactory)
+}
+
+func freezeApiSingletonFactory() android.Singleton {
+	return &freezeApiSingleton{}
+}
+
+type freezeApiSingleton struct{}
+
+func (f *freezeApiSingleton) GenerateBuildActions(ctx android.SingletonContext) {
+	var files android.Paths
+	ctx.VisitAllModules(func(module android.Module) {
+		if !module.Enabled() {
+			return
+		}
+		if m, ok := module.(*aidlApi); ok {
+			ownersToFreeze := strings.Fields(ctx.Config().Getenv("AIDL_FREEZE_OWNERS"))
+			var shouldBeFrozen bool
+			if len(ownersToFreeze) > 0 {
+				shouldBeFrozen = android.InList(m.Owner(), ownersToFreeze)
+			} else {
+				shouldBeFrozen = m.Owner() == ""
+			}
+			if shouldBeFrozen {
+				files = append(files, m.freezeApiTimestamp)
+			}
+		}
+	})
+	ctx.Phony("aidl-freeze-api", files...)
+}
diff --git a/build/aidl_api/test-piece-1/1/.hash b/build/aidl_api/test-piece-1/1/.hash
new file mode 100644
index 0000000..79228df
--- /dev/null
+++ b/build/aidl_api/test-piece-1/1/.hash
@@ -0,0 +1 @@
+13e24b2fac6a979971819fba2ab0d6d7c4182122
diff --git a/build/aidl_api/test-piece-1/1/some_package/IFoo.aidl b/build/aidl_api/test-piece-1/1/some_package/IFoo.aidl
new file mode 100644
index 0000000..234b6aa
--- /dev/null
+++ b/build/aidl_api/test-piece-1/1/some_package/IFoo.aidl
@@ -0,0 +1,5 @@
+package some_package;
+interface IFoo {
+  void CanYouDealWithThisThing(inout some_package.Thing parcel);
+  void CanYouDealWithThisSubThing(inout some_package.sub_package.SubThing parcel);
+}
diff --git a/build/aidl_api/test-piece-1/1/some_package/Thing.aidl b/build/aidl_api/test-piece-1/1/some_package/Thing.aidl
new file mode 100644
index 0000000..52e0a28
--- /dev/null
+++ b/build/aidl_api/test-piece-1/1/some_package/Thing.aidl
@@ -0,0 +1,5 @@
+package some_package;
+parcelable Thing {
+  int a;
+  int b;
+}
diff --git a/build/aidl_api/test-piece-1/1/some_package/sub_package/IFoo.aidl b/build/aidl_api/test-piece-1/1/some_package/sub_package/IFoo.aidl
new file mode 100644
index 0000000..5c05762
--- /dev/null
+++ b/build/aidl_api/test-piece-1/1/some_package/sub_package/IFoo.aidl
@@ -0,0 +1,5 @@
+package some_package.sub_package;
+interface IFoo {
+  void CanYouDealWithThisThing(inout some_package.Thing parcel);
+  void CanYouDealWithThisSubThing(inout some_package.sub_package.SubThing parcel);
+}
diff --git a/build/aidl_api/test-piece-1/1/some_package/sub_package/SubThing.aidl b/build/aidl_api/test-piece-1/1/some_package/sub_package/SubThing.aidl
new file mode 100644
index 0000000..3dc6ec8
--- /dev/null
+++ b/build/aidl_api/test-piece-1/1/some_package/sub_package/SubThing.aidl
@@ -0,0 +1,5 @@
+package some_package.sub_package;
+parcelable SubThing {
+  int a;
+  int b;
+}
diff --git a/build/aidl_api/test-piece-1/2/.hash b/build/aidl_api/test-piece-1/2/.hash
new file mode 100644
index 0000000..2ad0e01
--- /dev/null
+++ b/build/aidl_api/test-piece-1/2/.hash
@@ -0,0 +1 @@
+dc2a9292847e43b4360bb183f7491f0e9895eaa9
diff --git a/build/aidl_api/test-piece-1/2/some_package/IFoo.aidl b/build/aidl_api/test-piece-1/2/some_package/IFoo.aidl
new file mode 100644
index 0000000..e50ee27
--- /dev/null
+++ b/build/aidl_api/test-piece-1/2/some_package/IFoo.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a frozen snapshot of an AIDL interface (or parcelable). Do not
+// try to edit this file. It looks like you are doing that because you have
+// modified an AIDL interface in a backward-incompatible way, e.g., deleting a
+// function from an interface or a field from a parcelable and it broke the
+// build. That breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package some_package;
+interface IFoo {
+  /* @hide */
+  void CanYouDealWithThisThing(inout some_package.Thing parcel);
+  /* @hide */
+  void CanYouDealWithThisSubThing(inout some_package.sub_package.SubThing parcel);
+}
diff --git a/build/aidl_api/test-piece-1/2/some_package/Thing.aidl b/build/aidl_api/test-piece-1/2/some_package/Thing.aidl
new file mode 100644
index 0000000..3a30cc5
--- /dev/null
+++ b/build/aidl_api/test-piece-1/2/some_package/Thing.aidl
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a frozen snapshot of an AIDL interface (or parcelable). Do not
+// try to edit this file. It looks like you are doing that because you have
+// modified an AIDL interface in a backward-incompatible way, e.g., deleting a
+// function from an interface or a field from a parcelable and it broke the
+// build. That breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package some_package;
+parcelable Thing {
+  int a;
+  int b;
+}
diff --git a/build/aidl_api/test-piece-1/2/some_package/sub_package/IFoo.aidl b/build/aidl_api/test-piece-1/2/some_package/sub_package/IFoo.aidl
new file mode 100644
index 0000000..f45996d
--- /dev/null
+++ b/build/aidl_api/test-piece-1/2/some_package/sub_package/IFoo.aidl
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a frozen snapshot of an AIDL interface (or parcelable). Do not
+// try to edit this file. It looks like you are doing that because you have
+// modified an AIDL interface in a backward-incompatible way, e.g., deleting a
+// function from an interface or a field from a parcelable and it broke the
+// build. That breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package some_package.sub_package;
+interface IFoo {
+  void CanYouDealWithThisThing(inout some_package.Thing parcel);
+  void CanYouDealWithThisSubThing(inout some_package.sub_package.SubThing parcel);
+}
diff --git a/build/aidl_api/test-piece-1/2/some_package/sub_package/SubThing.aidl b/build/aidl_api/test-piece-1/2/some_package/sub_package/SubThing.aidl
new file mode 100644
index 0000000..adad68f
--- /dev/null
+++ b/build/aidl_api/test-piece-1/2/some_package/sub_package/SubThing.aidl
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a frozen snapshot of an AIDL interface (or parcelable). Do not
+// try to edit this file. It looks like you are doing that because you have
+// modified an AIDL interface in a backward-incompatible way, e.g., deleting a
+// function from an interface or a field from a parcelable and it broke the
+// build. That breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package some_package.sub_package;
+parcelable SubThing {
+  int a;
+  int b;
+}
diff --git a/build/aidl_api/test-piece-1/3/.hash b/build/aidl_api/test-piece-1/3/.hash
new file mode 100644
index 0000000..58a9b34
--- /dev/null
+++ b/build/aidl_api/test-piece-1/3/.hash
@@ -0,0 +1 @@
+54f935920ab0934c242145cf00f9852ae3f5a63e
diff --git a/build/aidl_api/test-piece-1/3/some_package/IFoo.aidl b/build/aidl_api/test-piece-1/3/some_package/IFoo.aidl
new file mode 100644
index 0000000..686805c
--- /dev/null
+++ b/build/aidl_api/test-piece-1/3/some_package/IFoo.aidl
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a frozen snapshot of an AIDL interface (or parcelable). Do not
+// try to edit this file. It looks like you are doing that because you have
+// modified an AIDL interface in a backward-incompatible way, e.g., deleting a
+// function from an interface or a field from a parcelable and it broke the
+// build. That breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package some_package;
+interface IFoo {
+  void CanYouDealWithThisThing(inout some_package.Thing parcel);
+  void CanYouDealWithThisSubThing(inout some_package.sub_package.SubThing parcel);
+}
diff --git a/build/aidl_api/test-piece-1/3/some_package/Thing.aidl b/build/aidl_api/test-piece-1/3/some_package/Thing.aidl
new file mode 100644
index 0000000..3a30cc5
--- /dev/null
+++ b/build/aidl_api/test-piece-1/3/some_package/Thing.aidl
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a frozen snapshot of an AIDL interface (or parcelable). Do not
+// try to edit this file. It looks like you are doing that because you have
+// modified an AIDL interface in a backward-incompatible way, e.g., deleting a
+// function from an interface or a field from a parcelable and it broke the
+// build. That breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package some_package;
+parcelable Thing {
+  int a;
+  int b;
+}
diff --git a/build/aidl_api/test-piece-1/3/some_package/sub_package/IFoo.aidl b/build/aidl_api/test-piece-1/3/some_package/sub_package/IFoo.aidl
new file mode 100644
index 0000000..f45996d
--- /dev/null
+++ b/build/aidl_api/test-piece-1/3/some_package/sub_package/IFoo.aidl
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a frozen snapshot of an AIDL interface (or parcelable). Do not
+// try to edit this file. It looks like you are doing that because you have
+// modified an AIDL interface in a backward-incompatible way, e.g., deleting a
+// function from an interface or a field from a parcelable and it broke the
+// build. That breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package some_package.sub_package;
+interface IFoo {
+  void CanYouDealWithThisThing(inout some_package.Thing parcel);
+  void CanYouDealWithThisSubThing(inout some_package.sub_package.SubThing parcel);
+}
diff --git a/build/aidl_api/test-piece-1/3/some_package/sub_package/SubThing.aidl b/build/aidl_api/test-piece-1/3/some_package/sub_package/SubThing.aidl
new file mode 100644
index 0000000..adad68f
--- /dev/null
+++ b/build/aidl_api/test-piece-1/3/some_package/sub_package/SubThing.aidl
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a frozen snapshot of an AIDL interface (or parcelable). Do not
+// try to edit this file. It looks like you are doing that because you have
+// modified an AIDL interface in a backward-incompatible way, e.g., deleting a
+// function from an interface or a field from a parcelable and it broke the
+// build. That breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package some_package.sub_package;
+parcelable SubThing {
+  int a;
+  int b;
+}
diff --git a/build/aidl_api/test-piece-1/4/.hash b/build/aidl_api/test-piece-1/4/.hash
new file mode 100644
index 0000000..8238ab4
--- /dev/null
+++ b/build/aidl_api/test-piece-1/4/.hash
@@ -0,0 +1 @@
+be5dd6bf9c9000ee053621f118b7d6a7cfd1e79e
diff --git a/build/aidl_api/test-piece-1/4/some_package/IFoo.aidl b/build/aidl_api/test-piece-1/4/some_package/IFoo.aidl
new file mode 100644
index 0000000..d8a5be9
--- /dev/null
+++ b/build/aidl_api/test-piece-1/4/some_package/IFoo.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package some_package;
+@SuppressWarnings(value={"inout-parameter"})
+interface IFoo {
+  void CanYouDealWithThisThing(inout some_package.Thing parcel);
+  void CanYouDealWithThisSubThing(inout some_package.sub_package.SubThing parcel);
+}
diff --git a/build/aidl_api/test-piece-1/4/some_package/Thing.aidl b/build/aidl_api/test-piece-1/4/some_package/Thing.aidl
new file mode 100644
index 0000000..90c5720
--- /dev/null
+++ b/build/aidl_api/test-piece-1/4/some_package/Thing.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package some_package;
+parcelable Thing {
+  int a;
+  int b;
+}
diff --git a/build/aidl_api/test-piece-1/4/some_package/sub_package/IFoo.aidl b/build/aidl_api/test-piece-1/4/some_package/sub_package/IFoo.aidl
new file mode 100644
index 0000000..179f166
--- /dev/null
+++ b/build/aidl_api/test-piece-1/4/some_package/sub_package/IFoo.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package some_package.sub_package;
+@SuppressWarnings(value={"inout-parameter"})
+interface IFoo {
+  void CanYouDealWithThisThing(inout some_package.Thing parcel);
+  void CanYouDealWithThisSubThing(inout some_package.sub_package.SubThing parcel);
+}
diff --git a/build/aidl_api/test-piece-1/4/some_package/sub_package/SubThing.aidl b/build/aidl_api/test-piece-1/4/some_package/sub_package/SubThing.aidl
new file mode 100644
index 0000000..bff0008
--- /dev/null
+++ b/build/aidl_api/test-piece-1/4/some_package/sub_package/SubThing.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package some_package.sub_package;
+parcelable SubThing {
+  int a;
+  int b;
+}
diff --git a/build/aidl_api/test-piece-1/current/some_package/IFoo.aidl b/build/aidl_api/test-piece-1/current/some_package/IFoo.aidl
new file mode 100644
index 0000000..d8a5be9
--- /dev/null
+++ b/build/aidl_api/test-piece-1/current/some_package/IFoo.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package some_package;
+@SuppressWarnings(value={"inout-parameter"})
+interface IFoo {
+  void CanYouDealWithThisThing(inout some_package.Thing parcel);
+  void CanYouDealWithThisSubThing(inout some_package.sub_package.SubThing parcel);
+}
diff --git a/build/aidl_api/test-piece-1/current/some_package/Thing.aidl b/build/aidl_api/test-piece-1/current/some_package/Thing.aidl
new file mode 100644
index 0000000..90c5720
--- /dev/null
+++ b/build/aidl_api/test-piece-1/current/some_package/Thing.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package some_package;
+parcelable Thing {
+  int a;
+  int b;
+}
diff --git a/build/aidl_api/test-piece-1/current/some_package/sub_package/IFoo.aidl b/build/aidl_api/test-piece-1/current/some_package/sub_package/IFoo.aidl
new file mode 100644
index 0000000..179f166
--- /dev/null
+++ b/build/aidl_api/test-piece-1/current/some_package/sub_package/IFoo.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package some_package.sub_package;
+@SuppressWarnings(value={"inout-parameter"})
+interface IFoo {
+  void CanYouDealWithThisThing(inout some_package.Thing parcel);
+  void CanYouDealWithThisSubThing(inout some_package.sub_package.SubThing parcel);
+}
diff --git a/build/aidl_api/test-piece-1/current/some_package/sub_package/SubThing.aidl b/build/aidl_api/test-piece-1/current/some_package/sub_package/SubThing.aidl
new file mode 100644
index 0000000..bff0008
--- /dev/null
+++ b/build/aidl_api/test-piece-1/current/some_package/sub_package/SubThing.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package some_package.sub_package;
+parcelable SubThing {
+  int a;
+  int b;
+}
diff --git a/build/aidl_api/test-piece-2/1/.hash b/build/aidl_api/test-piece-2/1/.hash
new file mode 100644
index 0000000..3c32edf
--- /dev/null
+++ b/build/aidl_api/test-piece-2/1/.hash
@@ -0,0 +1,2 @@
+c544902ab8a1d2e72ae9396032ba113e9b9698c4
+fcd36db451cdbeeb049833fd7f499a987acf3930
diff --git a/build/aidl_api/test-piece-2/1/INoPackage.aidl b/build/aidl_api/test-piece-2/1/INoPackage.aidl
new file mode 100644
index 0000000..28cc69a
--- /dev/null
+++ b/build/aidl_api/test-piece-2/1/INoPackage.aidl
@@ -0,0 +1,3 @@
+interface INoPackage {
+  void CanYouDealWithThisBar(in some_package.IBar bar);
+}
diff --git a/build/aidl_api/test-piece-2/1/some_package/IBar.aidl b/build/aidl_api/test-piece-2/1/some_package/IBar.aidl
new file mode 100644
index 0000000..d5c2619
--- /dev/null
+++ b/build/aidl_api/test-piece-2/1/some_package/IBar.aidl
@@ -0,0 +1,4 @@
+package some_package;
+interface IBar {
+  oneway void CanYouDealWithThisFoo(in some_package.IFoo foo);
+}
diff --git a/build/aidl_api/test-piece-2/current/INoPackage.aidl b/build/aidl_api/test-piece-2/current/INoPackage.aidl
new file mode 100644
index 0000000..b7c150f
--- /dev/null
+++ b/build/aidl_api/test-piece-2/current/INoPackage.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+interface INoPackage {
+  void CanYouDealWithThisBar(in some_package.IBar bar);
+}
diff --git a/build/aidl_api/test-piece-2/current/some_package/IBar.aidl b/build/aidl_api/test-piece-2/current/some_package/IBar.aidl
new file mode 100644
index 0000000..b60c537
--- /dev/null
+++ b/build/aidl_api/test-piece-2/current/some_package/IBar.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package some_package;
+interface IBar {
+  oneway void CanYouDealWithThisFoo(in some_package.IFoo foo);
+}
diff --git a/build/aidl_api/test-piece-3/1/.hash b/build/aidl_api/test-piece-3/1/.hash
new file mode 100644
index 0000000..f85682c
--- /dev/null
+++ b/build/aidl_api/test-piece-3/1/.hash
@@ -0,0 +1 @@
+f630cb120fa36f9f2507d730513a03b0cd4fbc0e
diff --git a/build/aidl_api/test-piece-3/1/other_package/IBaz.aidl b/build/aidl_api/test-piece-3/1/other_package/IBaz.aidl
new file mode 100644
index 0000000..8e6da40
--- /dev/null
+++ b/build/aidl_api/test-piece-3/1/other_package/IBaz.aidl
@@ -0,0 +1,4 @@
+package other_package;
+interface IBaz {
+  void CanYouDealWithThisBar(in some_package.IBar bar);
+}
diff --git a/build/aidl_api/test-piece-3/2/.hash b/build/aidl_api/test-piece-3/2/.hash
new file mode 100644
index 0000000..c815cf2
--- /dev/null
+++ b/build/aidl_api/test-piece-3/2/.hash
@@ -0,0 +1 @@
+4be68328b234e427de4c612783612c3eda330235
diff --git a/build/aidl_api/test-piece-3/2/other_package/Enum.aidl b/build/aidl_api/test-piece-3/2/other_package/Enum.aidl
new file mode 100644
index 0000000..cbfbaf9
--- /dev/null
+++ b/build/aidl_api/test-piece-3/2/other_package/Enum.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package other_package;
+enum Enum {
+  ZERO,
+  ONE,
+}
diff --git a/build/aidl_api/test-piece-3/2/other_package/IBaz.aidl b/build/aidl_api/test-piece-3/2/other_package/IBaz.aidl
new file mode 100644
index 0000000..7cba2e4
--- /dev/null
+++ b/build/aidl_api/test-piece-3/2/other_package/IBaz.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package other_package;
+interface IBaz {
+  void CanYouDealWithThisBar(in some_package.IBar bar);
+  const int ZERO = other_package.Enum.ZERO /* 0 */;
+}
diff --git a/build/aidl_api/test-piece-3/current/other_package/Enum.aidl b/build/aidl_api/test-piece-3/current/other_package/Enum.aidl
new file mode 100644
index 0000000..5862b2c
--- /dev/null
+++ b/build/aidl_api/test-piece-3/current/other_package/Enum.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package other_package;
+enum Enum {
+  ZERO = 0,
+  ONE = 1,
+}
diff --git a/build/aidl_api/test-piece-3/current/other_package/IBaz.aidl b/build/aidl_api/test-piece-3/current/other_package/IBaz.aidl
new file mode 100644
index 0000000..e64e56a
--- /dev/null
+++ b/build/aidl_api/test-piece-3/current/other_package/IBaz.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package other_package;
+interface IBaz {
+  void CanYouDealWithThisBar(in some_package.IBar bar);
+  const int ZERO = 0;
+}
diff --git a/build/aidl_api/test-piece-4/1/.hash b/build/aidl_api/test-piece-4/1/.hash
new file mode 100644
index 0000000..2982016
--- /dev/null
+++ b/build/aidl_api/test-piece-4/1/.hash
@@ -0,0 +1 @@
+29d4015ee2a4171396aecd925156aa2e47a42013
diff --git a/build/aidl_api/test-piece-4/1/another_package/IFaz.aidl b/build/aidl_api/test-piece-4/1/another_package/IFaz.aidl
new file mode 100644
index 0000000..e11bad8
--- /dev/null
+++ b/build/aidl_api/test-piece-4/1/another_package/IFaz.aidl
@@ -0,0 +1,4 @@
+package another_package;
+interface IFaz {
+  void CanYouDealWithThisFoo(in some_package.IFoo foo);
+}
diff --git a/build/aidl_api/test-piece-4/current/another_package/IFaz.aidl b/build/aidl_api/test-piece-4/current/another_package/IFaz.aidl
new file mode 100644
index 0000000..2eed6a7
--- /dev/null
+++ b/build/aidl_api/test-piece-4/current/another_package/IFaz.aidl
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package another_package;
+interface IFaz {
+  void CanYouDealWithThisFoo(in some_package.IFoo foo);
+}
diff --git a/build/aidl_api/test-root-package/1/.hash b/build/aidl_api/test-root-package/1/.hash
new file mode 100644
index 0000000..8cf35a7
--- /dev/null
+++ b/build/aidl_api/test-root-package/1/.hash
@@ -0,0 +1 @@
+1f59d8099e05dcc6ac47a9a12a1f2660dd60cfef
diff --git a/build/aidl_api/test-root-package/1/test_package/IBaz.aidl b/build/aidl_api/test-root-package/1/test_package/IBaz.aidl
new file mode 100644
index 0000000..8613daa
--- /dev/null
+++ b/build/aidl_api/test-root-package/1/test_package/IBaz.aidl
@@ -0,0 +1,4 @@
+package test_package;
+interface IBaz {
+  oneway void CanYouDealWithThisBar(in some_package.IBar bar);
+}
diff --git a/build/aidl_api/test-root-package/2/.hash b/build/aidl_api/test-root-package/2/.hash
new file mode 100644
index 0000000..5f9d7d9
--- /dev/null
+++ b/build/aidl_api/test-root-package/2/.hash
@@ -0,0 +1 @@
+7025642541e73177f105c6d5b62a980fa5b4ace3
diff --git a/build/aidl_api/test-root-package/2/test_package/IBaz.aidl b/build/aidl_api/test-root-package/2/test_package/IBaz.aidl
new file mode 100644
index 0000000..e7c180e
--- /dev/null
+++ b/build/aidl_api/test-root-package/2/test_package/IBaz.aidl
@@ -0,0 +1,8 @@
+package test_package;
+interface IBaz {
+  oneway void CanYouDealWithThisBar(in some_package.IBar bar);
+  void MethodAddedInVersion2();
+  ParcelFileDescriptor readPFD();
+  void writePFD(in ParcelFileDescriptor fd);
+  void readWritePFD(inout ParcelFileDescriptor fd);
+}
diff --git a/build/aidl_api/test-root-package/3/.hash b/build/aidl_api/test-root-package/3/.hash
new file mode 100644
index 0000000..2dfbe74
--- /dev/null
+++ b/build/aidl_api/test-root-package/3/.hash
@@ -0,0 +1 @@
+fe1b4b56b7263d121c36b566a5d6ddf7496261cc
diff --git a/build/aidl_api/test-root-package/3/test_package/IBaz.aidl b/build/aidl_api/test-root-package/3/test_package/IBaz.aidl
new file mode 100644
index 0000000..51e0abe
--- /dev/null
+++ b/build/aidl_api/test-root-package/3/test_package/IBaz.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package test_package;
+@SuppressWarnings(value={"mixed-oneway", "inout-parameter", "out-array"})
+interface IBaz {
+  oneway void CanYouDealWithThisBar(in some_package.IBar bar);
+  void MethodAddedInVersion2();
+  ParcelFileDescriptor readPFD();
+  void writePFD(in ParcelFileDescriptor fd);
+  void readWritePFD(inout ParcelFileDescriptor fd);
+  ParcelFileDescriptor[] readPFDArray();
+  void writePFDArray(in ParcelFileDescriptor[] fds);
+  void readWritePFDArray(inout ParcelFileDescriptor[] fds);
+}
diff --git a/build/aidl_api/test-root-package/current/test_package/IBaz.aidl b/build/aidl_api/test-root-package/current/test_package/IBaz.aidl
new file mode 100644
index 0000000..51e0abe
--- /dev/null
+++ b/build/aidl_api/test-root-package/current/test_package/IBaz.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package test_package;
+@SuppressWarnings(value={"mixed-oneway", "inout-parameter", "out-array"})
+interface IBaz {
+  oneway void CanYouDealWithThisBar(in some_package.IBar bar);
+  void MethodAddedInVersion2();
+  ParcelFileDescriptor readPFD();
+  void writePFD(in ParcelFileDescriptor fd);
+  void readWritePFD(inout ParcelFileDescriptor fd);
+  ParcelFileDescriptor[] readPFDArray();
+  void writePFDArray(in ParcelFileDescriptor[] fds);
+  void readWritePFDArray(inout ParcelFileDescriptor[] fds);
+}
diff --git a/build/aidl_api/tests-vintf/1/.hash b/build/aidl_api/tests-vintf/1/.hash
new file mode 100644
index 0000000..f7e48ad
--- /dev/null
+++ b/build/aidl_api/tests-vintf/1/.hash
@@ -0,0 +1 @@
+76be80502c7d4b9097cbed126e03a5a618c4cca3
diff --git a/build/aidl_api/tests-vintf/1/vintf/IFoo.aidl b/build/aidl_api/tests-vintf/1/vintf/IFoo.aidl
new file mode 100644
index 0000000..6661ebb
--- /dev/null
+++ b/build/aidl_api/tests-vintf/1/vintf/IFoo.aidl
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package vintf;
+@VintfStability
+interface IFoo {
+  vintf.IFoo.Foo[] abar(in vintf.IFoo.Foo[] f);
+  ParcelFileDescriptor afd(in ParcelFileDescriptor fd);
+  vintf.IFoo.E ae(in vintf.IFoo.E e);
+  vintf.IFoo.A aa(in vintf.IFoo.A a);
+  parcelable Foo {
+    String a;
+  }
+  union A {
+    String a;
+    int b;
+  }
+  enum E {
+    A = 0,
+    B = 1,
+    C = 2,
+  }
+}
diff --git a/build/aidl_api/tests-vintf/current/vintf/IFoo.aidl b/build/aidl_api/tests-vintf/current/vintf/IFoo.aidl
new file mode 100644
index 0000000..6661ebb
--- /dev/null
+++ b/build/aidl_api/tests-vintf/current/vintf/IFoo.aidl
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package vintf;
+@VintfStability
+interface IFoo {
+  vintf.IFoo.Foo[] abar(in vintf.IFoo.Foo[] f);
+  ParcelFileDescriptor afd(in ParcelFileDescriptor fd);
+  vintf.IFoo.E ae(in vintf.IFoo.E e);
+  vintf.IFoo.A aa(in vintf.IFoo.A a);
+  parcelable Foo {
+    String a;
+  }
+  union A {
+    String a;
+    int b;
+  }
+  enum E {
+    A = 0,
+    B = 1,
+    C = 2,
+  }
+}
diff --git a/build/aidl_gen_rule.go b/build/aidl_gen_rule.go
new file mode 100644
index 0000000..119aeed
--- /dev/null
+++ b/build/aidl_gen_rule.go
@@ -0,0 +1,385 @@
+// Copyright (C) 2021 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package aidl
+
+import (
+	"android/soong/android"
+	"android/soong/genrule"
+	"android/soong/ui/metrics/bp2build_metrics_proto"
+	"fmt"
+	"strconv"
+
+	"path/filepath"
+	"strings"
+
+	"github.com/google/blueprint"
+	"github.com/google/blueprint/pathtools"
+	"github.com/google/blueprint/proptools"
+)
+
+var (
+	aidlDirPrepareRule = pctx.StaticRule("aidlDirPrepareRule", blueprint.RuleParams{
+		Command:     `mkdir -p "${outDir}" && touch ${out} # ${in}`,
+		Description: "create ${out}",
+	}, "outDir")
+
+	aidlCppRule = pctx.StaticRule("aidlCppRule", blueprint.RuleParams{
+		Command: `mkdir -p "${headerDir}" && ` +
+			`mkdir -p "${outDir}/staging" && ` +
+			`mkdir -p "${headerDir}/staging" && ` +
+			`${aidlCmd} --lang=${lang} ${optionalFlags} --ninja -d ${outStagingFile}.d ` +
+			`-h ${headerDir}/staging -o ${outDir}/staging ${imports} ${nextImports} ${in} && ` +
+			`rsync --checksum ${outStagingFile}.d ${out}.d && ` +
+			`rsync --checksum ${outStagingFile} ${out} && ` +
+			`( [ -z "${stagingHeaders}" ] || rsync --checksum ${stagingHeaders} ${fullHeaderDir} ) && ` +
+			`sed -i 's/\/gen\/staging\//\/gen\//g' ${out}.d && ` +
+			`rm ${outStagingFile} ${outStagingFile}.d ${stagingHeaders}`,
+		Depfile:     "${out}.d",
+		Deps:        blueprint.DepsGCC,
+		CommandDeps: []string{"${aidlCmd}"},
+		Restat:      true,
+		Description: "AIDL ${lang} ${in}",
+	}, "imports", "nextImports", "lang", "headerDir", "outDir", "optionalFlags", "stagingHeaders", "outStagingFile",
+		"fullHeaderDir")
+
+	aidlJavaRule = pctx.StaticRule("aidlJavaRule", blueprint.RuleParams{
+		Command: `${aidlCmd} --lang=java ${optionalFlags} --ninja -d ${out}.d ` +
+			`-o ${outDir} ${imports} ${nextImports} ${in}`,
+		Depfile:     "${out}.d",
+		Deps:        blueprint.DepsGCC,
+		CommandDeps: []string{"${aidlCmd}"},
+		Restat:      true,
+		Description: "AIDL Java ${in}",
+	}, "imports", "nextImports", "outDir", "optionalFlags")
+
+	aidlRustRule = pctx.StaticRule("aidlRustRule", blueprint.RuleParams{
+		Command: `${aidlCmd} --lang=rust ${optionalFlags} --ninja -d ${out}.d ` +
+			`-o ${outDir} ${imports} ${nextImports} ${in}`,
+		Depfile:     "${out}.d",
+		Deps:        blueprint.DepsGCC,
+		CommandDeps: []string{"${aidlCmd}"},
+		Restat:      true,
+		Description: "AIDL Rust ${in}",
+	}, "imports", "nextImports", "outDir", "optionalFlags")
+)
+
+type aidlGenProperties struct {
+	Srcs                []string `android:"path"`
+	AidlRoot            string   // base directory for the input aidl file
+	Imports             []string
+	Headers             []string
+	Stability           *string
+	Min_sdk_version     *string
+	Platform_apis       bool
+	Lang                string // target language [java|cpp|ndk|rust]
+	BaseName            string
+	GenLog              bool
+	Version             string
+	GenRpc              bool
+	GenTrace            bool
+	Unstable            *bool
+	NotFrozen           bool
+	RequireFrozenReason string
+	Visibility          []string
+	Flags               []string
+}
+
+type aidlGenRule struct {
+	android.ModuleBase
+	android.BazelModuleBase
+
+	properties aidlGenProperties
+
+	deps            deps
+	implicitInputs  android.Paths
+	importFlags     string
+	nextImportFlags string
+
+	// A frozen aidl_interface always have a hash file
+	hashFile android.Path
+
+	genOutDir     android.ModuleGenPath
+	genHeaderDir  android.ModuleGenPath
+	genHeaderDeps android.Paths
+	genOutputs    android.WritablePaths
+}
+
+var _ android.SourceFileProducer = (*aidlGenRule)(nil)
+var _ genrule.SourceFileGenerator = (*aidlGenRule)(nil)
+
+func (g *aidlGenRule) aidlInterface(ctx android.BaseModuleContext) *aidlInterface {
+	return ctx.GetDirectDepWithTag(g.properties.BaseName, interfaceDep).(*aidlInterface)
+}
+
+func (g *aidlGenRule) getImports(ctx android.ModuleContext) map[string]string {
+	iface := g.aidlInterface(ctx)
+	return iface.getImports(g.properties.Version)
+}
+
+func (g *aidlGenRule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
+	srcs, nextImports := getPaths(ctx, g.properties.Srcs, g.properties.AidlRoot)
+
+	g.deps = getDeps(ctx, g.getImports(ctx))
+
+	if ctx.Failed() {
+		return
+	}
+
+	genDirTimestamp := android.PathForModuleGen(ctx, "timestamp") // $out/gen/timestamp
+	g.implicitInputs = append(g.implicitInputs, genDirTimestamp)
+	g.implicitInputs = append(g.implicitInputs, g.deps.implicits...)
+	g.implicitInputs = append(g.implicitInputs, g.deps.preprocessed...)
+
+	g.nextImportFlags = strings.Join(wrap("-N", nextImports, ""), " ")
+	g.importFlags = strings.Join(wrap("-I", g.deps.imports, ""), " ")
+
+	g.genOutDir = android.PathForModuleGen(ctx)
+	g.genHeaderDir = android.PathForModuleGen(ctx, "include")
+	for _, src := range srcs {
+		outFile, headers := g.generateBuildActionsForSingleAidl(ctx, src)
+		g.genOutputs = append(g.genOutputs, outFile)
+		g.genHeaderDeps = append(g.genHeaderDeps, headers...)
+	}
+
+	// This is to clean genOutDir before generating any file
+	ctx.Build(pctx, android.BuildParams{
+		Rule:   aidlDirPrepareRule,
+		Inputs: srcs,
+		Output: genDirTimestamp,
+		Args: map[string]string{
+			"outDir": g.genOutDir.String(),
+		},
+	})
+
+	// This is to trigger genrule alone
+	ctx.Build(pctx, android.BuildParams{
+		Rule:   android.Phony,
+		Output: android.PathForModuleOut(ctx, "timestamp"), // $out/timestamp
+		Inputs: g.genOutputs.Paths(),
+	})
+}
+
+func (g *aidlGenRule) generateBuildActionsForSingleAidl(ctx android.ModuleContext, src android.Path) (android.WritablePath, android.Paths) {
+	relPath := src.Rel()
+	baseDir := strings.TrimSuffix(strings.TrimSuffix(src.String(), relPath), "/")
+
+	var ext string
+	if g.properties.Lang == langJava {
+		ext = "java"
+	} else if g.properties.Lang == langRust {
+		ext = "rs"
+	} else {
+		ext = "cpp"
+	}
+	outFile := android.PathForModuleGen(ctx, pathtools.ReplaceExtension(relPath, ext))
+	outStagingFile := android.PathForModuleGen(ctx, pathtools.ReplaceExtension("staging/"+relPath, ext))
+	implicits := g.implicitInputs
+
+	// default version is 1 for any stable interface
+	version := "1"
+	previousVersion := ""
+	previousApiDir := ""
+	if g.properties.Version != "" {
+		version = g.properties.Version
+	}
+	versionInt, err := strconv.Atoi(version)
+	if err != nil && g.properties.Version != "" {
+		ctx.PropertyErrorf(g.properties.Version, "Invalid Version string: %s", g.properties.Version)
+	} else if err == nil && versionInt > 1 {
+		previousVersion = strconv.Itoa(versionInt - 1)
+		previousApiDir = filepath.Join(ctx.ModuleDir(), aidlApiDir, g.properties.BaseName, previousVersion)
+	}
+
+	optionalFlags := append([]string{}, g.properties.Flags...)
+	if proptools.Bool(g.properties.Unstable) != true {
+		optionalFlags = append(optionalFlags, "--structured")
+		optionalFlags = append(optionalFlags, "--version "+version)
+		hash := "notfrozen"
+		if !strings.HasPrefix(baseDir, ctx.Config().SoongOutDir()) {
+			hashFile := android.ExistentPathForSource(ctx, baseDir, ".hash")
+			if hashFile.Valid() {
+				hash = "$$(tail -1 '" + hashFile.Path().String() + "')"
+				implicits = append(implicits, hashFile.Path())
+
+				g.hashFile = hashFile.Path()
+			}
+		}
+		optionalFlags = append(optionalFlags, "--hash "+hash)
+	}
+	if g.properties.GenRpc {
+		optionalFlags = append(optionalFlags, "--rpc")
+	}
+	if g.properties.GenTrace {
+		optionalFlags = append(optionalFlags, "-t")
+	}
+	if g.properties.Stability != nil {
+		optionalFlags = append(optionalFlags, "--stability", *g.properties.Stability)
+	}
+	if g.properties.Platform_apis {
+		optionalFlags = append(optionalFlags, "--min_sdk_version platform_apis")
+	} else {
+		minSdkVer := proptools.StringDefault(g.properties.Min_sdk_version, "current")
+		optionalFlags = append(optionalFlags, "--min_sdk_version "+minSdkVer)
+	}
+	optionalFlags = append(optionalFlags, wrap("-p", g.deps.preprocessed.Strings(), "")...)
+
+	// If this is an unfrozen version of a previously frozen interface, we want (1) the location
+	// of the previously frozen source and (2) the previously frozen hash so the generated
+	// library can behave like both versions at run time.
+	if !ctx.DeviceConfig().Release_aidl_use_unfrozen() && previousVersion != "" &&
+		!proptools.Bool(g.properties.Unstable) && g.hashFile == nil {
+		apiDirPath := android.ExistentPathForSource(ctx, previousApiDir)
+		if apiDirPath.Valid() {
+			optionalFlags = append(optionalFlags, "--previous_api_dir="+apiDirPath.Path().String())
+		} else {
+			ctx.PropertyErrorf("--previous_api_dir is invalid: %s", apiDirPath.Path().String())
+		}
+		hashFile := android.ExistentPathForSource(ctx, previousApiDir, ".hash")
+		if hashFile.Valid() {
+			previousHash := "$$(tail -1 '" + hashFile.Path().String() + "')"
+			implicits = append(implicits, hashFile.Path())
+			optionalFlags = append(optionalFlags, "--previous_hash "+previousHash)
+		} else {
+			ctx.ModuleErrorf("Failed to find previous version's hash file in %s", previousApiDir)
+		}
+	}
+
+	var headers android.WritablePaths
+	if g.properties.Lang == langJava {
+		ctx.Build(pctx, android.BuildParams{
+			Rule:      aidlJavaRule,
+			Input:     src,
+			Implicits: implicits,
+			Output:    outFile,
+			Args: map[string]string{
+				"imports":       g.importFlags,
+				"nextImports":   g.nextImportFlags,
+				"outDir":        g.genOutDir.String(),
+				"optionalFlags": strings.Join(optionalFlags, " "),
+			},
+		})
+	} else if g.properties.Lang == langRust {
+		ctx.Build(pctx, android.BuildParams{
+			Rule:      aidlRustRule,
+			Input:     src,
+			Implicits: implicits,
+			Output:    outFile,
+			Args: map[string]string{
+				"imports":       g.importFlags,
+				"nextImports":   g.nextImportFlags,
+				"outDir":        g.genOutDir.String(),
+				"optionalFlags": strings.Join(optionalFlags, " "),
+			},
+		})
+	} else {
+		typeName := strings.TrimSuffix(filepath.Base(relPath), ".aidl")
+		packagePath := filepath.Dir(relPath)
+		baseName := typeName
+		// TODO(b/111362593): aidl_to_cpp_common.cpp uses heuristics to figure out if
+		//   an interface name has a leading I. Those same heuristics have been
+		//   moved here.
+		if len(baseName) >= 2 && baseName[0] == 'I' &&
+			strings.ToUpper(baseName)[1] == baseName[1] {
+			baseName = strings.TrimPrefix(typeName, "I")
+		}
+
+		prefix := ""
+		if g.properties.Lang == langNdk || g.properties.Lang == langNdkPlatform {
+			prefix = "aidl"
+		}
+
+		var stagingHeaders []string
+		var fullHeaderDir = g.genHeaderDir.Join(ctx, prefix, packagePath)
+		if g.properties.Lang != langCppAnalyzer {
+			headers = append(headers, g.genHeaderDir.Join(ctx, prefix, packagePath, typeName+".h"))
+			stagingHeaders = append(stagingHeaders, g.genHeaderDir.Join(ctx, "staging/"+prefix, packagePath, typeName+".h").String())
+			headers = append(headers, g.genHeaderDir.Join(ctx, prefix, packagePath, "Bp"+baseName+".h"))
+			stagingHeaders = append(stagingHeaders, g.genHeaderDir.Join(ctx, "staging/"+prefix, packagePath, "Bp"+baseName+".h").String())
+			headers = append(headers, g.genHeaderDir.Join(ctx, prefix, packagePath, "Bn"+baseName+".h"))
+			stagingHeaders = append(stagingHeaders, g.genHeaderDir.Join(ctx, "staging/"+prefix, packagePath, "Bn"+baseName+".h").String())
+		}
+
+		if g.properties.GenLog {
+			optionalFlags = append(optionalFlags, "--log")
+		}
+
+		aidlLang := g.properties.Lang
+		if aidlLang == langNdkPlatform {
+			aidlLang = "ndk"
+		}
+
+		ctx.Build(pctx, android.BuildParams{
+			Rule:            aidlCppRule,
+			Input:           src,
+			Implicits:       implicits,
+			Output:          outFile,
+			ImplicitOutputs: headers,
+			Args: map[string]string{
+				"imports":        g.importFlags,
+				"nextImports":    g.nextImportFlags,
+				"lang":           aidlLang,
+				"headerDir":      g.genHeaderDir.String(),
+				"fullHeaderDir":  fullHeaderDir.String(),
+				"outDir":         g.genOutDir.String(),
+				"outStagingFile": outStagingFile.String(),
+				"optionalFlags":  strings.Join(optionalFlags, " "),
+				"stagingHeaders": strings.Join(stagingHeaders, " "),
+			},
+		})
+	}
+
+	return outFile, headers.Paths()
+}
+
+func (g *aidlGenRule) GeneratedSourceFiles() android.Paths {
+	return g.genOutputs.Paths()
+}
+
+func (g *aidlGenRule) Srcs() android.Paths {
+	return g.genOutputs.Paths()
+}
+
+func (g *aidlGenRule) GeneratedDeps() android.Paths {
+	return g.genHeaderDeps
+}
+
+func (g *aidlGenRule) GeneratedHeaderDirs() android.Paths {
+	return android.Paths{g.genHeaderDir}
+}
+
+func (g *aidlGenRule) DepsMutator(ctx android.BottomUpMutatorContext) {
+	ctx.AddReverseDependency(ctx.Module(), nil, aidlMetadataSingletonName)
+}
+
+func (g *aidlGenRule) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
+	aidlLang := g.properties.Lang
+	switch aidlLang {
+	case langCpp, langNdk:
+		panic(fmt.Errorf("Conversion of %q is handled via macros in Bazel", ctx.ModuleName()))
+	case langJava:
+		// TODO: b/285574832 - re-enable Java backend
+		fallthrough
+	default:
+		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_PROPERTY_UNSUPPORTED, fmt.Sprintf("Lang: %q", aidlLang))
+	}
+}
+
+func aidlGenFactory() android.Module {
+	g := &aidlGenRule{}
+	g.AddProperties(&g.properties)
+	android.InitAndroidModule(g)
+	android.InitBazelModule(g)
+	return g
+}
diff --git a/build/aidl_interface.go b/build/aidl_interface.go
new file mode 100644
index 0000000..3634931
--- /dev/null
+++ b/build/aidl_interface.go
@@ -0,0 +1,1412 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package aidl
+
+import (
+	"android/soong/android"
+	"android/soong/bazel"
+	"android/soong/cc"
+	"android/soong/java"
+	"android/soong/rust"
+	"android/soong/ui/metrics/bp2build_metrics_proto"
+
+	"fmt"
+	"path/filepath"
+	"regexp"
+	"sort"
+	"strconv"
+	"strings"
+
+	"github.com/google/blueprint"
+	"github.com/google/blueprint/proptools"
+)
+
+const (
+	aidlInterfaceSuffix       = "_interface"
+	aidlMetadataSingletonName = "aidl_metadata_json"
+	aidlApiDir                = "aidl_api"
+	aidlApiSuffix             = "-api"
+	langCpp                   = "cpp"
+	langJava                  = "java"
+	langNdk                   = "ndk"
+	langRust                  = "rust"
+	langCppAnalyzer           = "cpp-analyzer"
+	// TODO(b/161456198) remove the NDK platform backend as the 'platform' variant of the NDK
+	// backend serves the same purpose.
+	langNdkPlatform = "ndk_platform"
+
+	currentVersion = "current"
+)
+
+var pctx = android.NewPackageContext("android/aidl")
+
+func init() {
+	pctx.Import("android/soong/android")
+	pctx.HostBinToolVariable("aidlCmd", "aidl")
+	pctx.HostBinToolVariable("aidlHashGen", "aidl_hash_gen")
+	pctx.SourcePathVariable("aidlToJniCmd", "system/tools/aidl/build/aidl_to_jni.py")
+	pctx.SourcePathVariable("aidlRustGlueCmd", "system/tools/aidl/build/aidl_rust_glue.py")
+	android.RegisterModuleType("aidl_interface", AidlInterfaceFactory)
+	android.PreArchMutators(registerPreArchMutators)
+	android.PreArchBp2BuildMutators(registerPreArchMutators)
+	android.PostDepsMutators(registerPostDepsMutators)
+}
+
+func registerPreArchMutators(ctx android.RegisterMutatorsContext) {
+	ctx.BottomUp("addInterfaceDeps", addInterfaceDeps).Parallel()
+	ctx.BottomUp("checkImports", checkImports).Parallel()
+	ctx.TopDown("createAidlInterface", createAidlInterfaceMutator).Parallel()
+}
+
+func registerPostDepsMutators(ctx android.RegisterMutatorsContext) {
+	ctx.BottomUp("checkAidlGeneratedModules", checkAidlGeneratedModules).Parallel()
+}
+
+func createAidlInterfaceMutator(mctx android.TopDownMutatorContext) {
+	if g, ok := mctx.Module().(*aidlImplementationGenerator); ok {
+		g.GenerateImplementation(mctx)
+	}
+}
+
+// A marker struct for AIDL-generated library modules
+type AidlGeneratedModuleProperties struct{}
+
+func wrapLibraryFactory(factory func() android.Module) func() android.Module {
+	return func() android.Module {
+		m := factory()
+		// put a marker struct for AIDL-generated modules
+		m.AddProperties(&AidlGeneratedModuleProperties{})
+		return m
+	}
+}
+
+func isAidlGeneratedModule(module android.Module) bool {
+	for _, props := range module.GetProperties() {
+		// check if there's a marker struct
+		if _, ok := props.(*AidlGeneratedModuleProperties); ok {
+			return true
+		}
+	}
+	return false
+}
+
+// AidlVersionInfo keeps the *-source module for each (aidl_interface & lang) and the list of
+// not-frozen versions (which shouldn't be used by other modules)
+type AidlVersionInfo struct {
+	notFrozen            []string
+	requireFrozenReasons []string
+	sourceMap            map[string]string
+}
+
+var AidlVersionInfoProvider = blueprint.NewMutatorProvider(AidlVersionInfo{}, "checkAidlGeneratedModules")
+
+// Merges `other` version info into this one.
+// Returns the pair of mismatching versions when there's conflict. Otherwise returns nil.
+// For example, when a module depends on 'foo-V2-ndk', the map contains an entry of (foo, foo-V2-ndk-source).
+// Merging (foo, foo-V1-ndk-source) and (foo, foo-V2-ndk-source) will fail and returns
+// {foo-V1-ndk-source, foo-V2-ndk-source}.
+func (info *AidlVersionInfo) merge(other AidlVersionInfo) []string {
+	info.notFrozen = append(info.notFrozen, other.notFrozen...)
+	info.requireFrozenReasons = append(info.requireFrozenReasons, other.requireFrozenReasons...)
+
+	if other.sourceMap == nil {
+		return nil
+	}
+	if info.sourceMap == nil {
+		info.sourceMap = make(map[string]string)
+	}
+	for ifaceName, otherSourceName := range other.sourceMap {
+		if sourceName, ok := info.sourceMap[ifaceName]; ok {
+			if sourceName != otherSourceName {
+				return []string{sourceName, otherSourceName}
+			}
+		} else {
+			info.sourceMap[ifaceName] = otherSourceName
+		}
+	}
+	return nil
+}
+
+func reportUsingNotFrozenError(ctx android.BaseModuleContext, notFrozen []string, requireFrozenReason []string) {
+	// TODO(b/154066686): Replace it with a common method instead of listing up module types.
+	// Test libraries are exempted.
+	if android.InList(ctx.ModuleType(), []string{"cc_test_library", "android_test", "cc_benchmark", "cc_test"}) {
+		return
+	}
+	for i, name := range notFrozen {
+		reason := requireFrozenReason[i]
+		ctx.ModuleErrorf("%v is an unfrozen development version, and it can't be used because %q", name, reason)
+	}
+}
+
+func reportMultipleVersionError(ctx android.BaseModuleContext, violators []string) {
+	sort.Strings(violators)
+	ctx.ModuleErrorf("depends on multiple versions of the same aidl_interface: %s", strings.Join(violators, ", "))
+	ctx.WalkDeps(func(child android.Module, parent android.Module) bool {
+		if android.InList(child.Name(), violators) {
+			ctx.ModuleErrorf("Dependency path: %s", ctx.GetPathString(true))
+			return false
+		}
+		return true
+	})
+}
+
+func checkAidlGeneratedModules(mctx android.BottomUpMutatorContext) {
+	switch mctx.Module().(type) {
+	case *java.Library:
+	case *cc.Module:
+	case *rust.Module:
+	case *aidlGenRule:
+	default:
+		return
+	}
+	if gen, ok := mctx.Module().(*aidlGenRule); ok {
+		var notFrozen []string
+		var requireFrozenReasons []string
+		if gen.properties.NotFrozen {
+			notFrozen = []string{strings.TrimSuffix(mctx.ModuleName(), "-source")}
+			requireFrozenReasons = []string{gen.properties.RequireFrozenReason}
+		}
+		mctx.SetProvider(AidlVersionInfoProvider, AidlVersionInfo{
+			notFrozen:            notFrozen,
+			requireFrozenReasons: requireFrozenReasons,
+			sourceMap: map[string]string{
+				gen.properties.BaseName + "-" + gen.properties.Lang: gen.Name(),
+			},
+		})
+		return
+	}
+	// Collect/merge AidlVersionInfos from direct dependencies
+	var info AidlVersionInfo
+	mctx.VisitDirectDeps(func(dep android.Module) {
+		if mctx.OtherModuleHasProvider(dep, AidlVersionInfoProvider) {
+			otherInfo := mctx.OtherModuleProvider(dep, AidlVersionInfoProvider).(AidlVersionInfo)
+			if violators := info.merge(otherInfo); violators != nil {
+				reportMultipleVersionError(mctx, violators)
+			}
+		}
+	})
+	if !isAidlGeneratedModule(mctx.Module()) && len(info.notFrozen) > 0 {
+		reportUsingNotFrozenError(mctx, info.notFrozen, info.requireFrozenReasons)
+	}
+	if mctx.Failed() {
+		return
+	}
+	if info.sourceMap != nil || len(info.notFrozen) > 0 {
+		mctx.SetProvider(AidlVersionInfoProvider, info)
+	}
+}
+
+func getPaths(ctx android.ModuleContext, rawSrcs []string, root string) (srcs android.Paths, imports []string) {
+	// TODO(b/189288369): move this to android.PathsForModuleSrcSubDir(ctx, srcs, subdir)
+	for _, src := range rawSrcs {
+		if m, _ := android.SrcIsModuleWithTag(src); m != "" {
+			srcs = append(srcs, android.PathsForModuleSrc(ctx, []string{src})...)
+		} else {
+			srcs = append(srcs, android.PathsWithModuleSrcSubDir(ctx, android.PathsForModuleSrc(ctx, []string{src}), root)...)
+		}
+	}
+
+	if len(srcs) == 0 {
+		ctx.PropertyErrorf("srcs", "No sources provided in %v", root)
+	}
+
+	// gather base directories from input .aidl files
+	for _, src := range srcs {
+		if src.Ext() != ".aidl" {
+			// Silently ignore non-aidl files as some filegroups have both java and aidl files together
+			continue
+		}
+		baseDir := strings.TrimSuffix(src.String(), src.Rel())
+		baseDir = strings.TrimSuffix(baseDir, "/")
+		if baseDir != "" && !android.InList(baseDir, imports) {
+			imports = append(imports, baseDir)
+		}
+	}
+
+	return srcs, imports
+}
+
+func isRelativePath(path string) bool {
+	if path == "" {
+		return true
+	}
+	return filepath.Clean(path) == path && path != ".." &&
+		!strings.HasPrefix(path, "../") && !strings.HasPrefix(path, "/")
+}
+
+type CommonBackendProperties struct {
+	// Whether to generate code in the corresponding backend.
+	// Default:
+	//   - for Java/NDK/CPP backends - True
+	//   - for Rust backend - False
+	Enabled        *bool
+	Apex_available []string
+
+	// The minimum version of the sdk that the compiled artifacts will run against
+	// For native modules, the property needs to be set when a module is a part of mainline modules(APEX).
+	// Forwarded to generated java/native module.
+	Min_sdk_version *string
+
+	// Whether tracing should be added to the interface.
+	Gen_trace *bool
+}
+
+type CommonNativeBackendProperties struct {
+	CommonBackendProperties
+
+	// Must be NDK libraries, for stable types.
+	Additional_shared_libraries []string
+
+	// cflags to forward to native compilation. This is expected to be
+	// used more for AIDL compiler developers than being actually
+	// practical.
+	Cflags []string
+
+	// Whether to generate additional code for gathering information
+	// about the transactions.
+	// Default: false
+	Gen_log *bool
+
+	// VNDK properties for corresponding backend.
+	cc.VndkProperties
+}
+
+type DumpApiProperties struct {
+	// Dumps without license header (assuming it is the first comment in .aidl file). Default: false
+	No_license *bool
+}
+
+type aidlInterfaceProperties struct {
+	// Vndk properties for C++/NDK libraries only (preferred to use backend-specific settings)
+	cc.VndkProperties
+
+	// How to interpret VNDK options. We only want one library in the VNDK (not multiple
+	// versions, since this would be a waste of space/unclear, and ultimately we want all
+	// code in a given release to be updated to use a specific version). By default, this
+	// puts either the latest stable version of the library or, if there is no stable
+	// version, the unstable version of the library in the VNDK. When using this field,
+	// explicitly set it to one of the values in the 'versions' field to put that version
+	// in the VNDK or set it to the next version (1 higher than this) to mean the version
+	// that will be frozen in the next update.
+	Vndk_use_version *string
+
+	// Whether the library can be installed on the vendor image.
+	Vendor_available *bool
+
+	// Whether the library can be installed on the odm image.
+	Odm_available *bool
+
+	// Whether the library can be installed on the product image.
+	Product_available *bool
+
+	// Whether the library can be installed on the recovery image.
+	Recovery_available *bool
+
+	// Whether the library can be loaded multiple times into the same process
+	Double_loadable *bool
+
+	// Whether the library can be used on host
+	Host_supported *bool
+
+	// Whether tracing should be added to the interface.
+	Gen_trace *bool
+
+	// Top level directories for includes.
+	// TODO(b/128940869): remove it if aidl_interface can depend on framework.aidl
+	Include_dirs []string
+	// Relative path for includes. By default assumes AIDL path is relative to current directory.
+	Local_include_dir string
+
+	// List of .aidl files which compose this interface.
+	Srcs []string `android:"path"`
+
+	// List of aidl_interface modules that this uses. If one of your AIDL interfaces uses an
+	// interface or parcelable from another aidl_interface, you should put its name here.
+	// It could be an aidl_interface solely or with version(such as -V1)
+	Imports []string
+
+	// Stability promise. Currently only supports "vintf".
+	// If this is unset, this corresponds to an interface with stability within
+	// this compilation context (so an interface loaded here can only be used
+	// with things compiled together, e.g. on the system.img).
+	// If this is set to "vintf", this corresponds to a stability promise: the
+	// interface must be kept stable as long as it is used.
+	Stability *string
+
+	// If true, this interface is frozen and does not have any changes since the last
+	// frozen version.
+	// If false, there are changes to this interface between the last frozen version (N) and
+	// the current version (N + 1).
+	Frozen *bool
+
+	// Deprecated: Use `versions_with_info` instead. Don't use `versions` property directly.
+	Versions []string
+
+	// Previous API versions that are now frozen. The version that is last in
+	// the list is considered as the most recent version.
+	// The struct contains both version and imports information per a version.
+	// Until versions property is removed, don't use `versions_with_info` directly.
+	Versions_with_info []struct {
+		Version string
+		Imports []string
+	}
+
+	// Use aidlInterface.getVersions()
+	VersionsInternal []string `blueprint:"mutated"`
+
+	// The minimum version of the sdk that the compiled artifacts will run against
+	// For native modules, the property needs to be set when a module is a part of mainline modules(APEX).
+	// Forwarded to generated java/native module. This can be overridden by
+	// backend.<name>.min_sdk_version.
+	Min_sdk_version *string
+
+	Backend struct {
+		// Backend of the compiler generating code for Java clients.
+		// When enabled, this creates a target called "<name>-java".
+		Java struct {
+			CommonBackendProperties
+			// Set to the version of the sdk to compile against
+			// Default: system_current
+			Sdk_version *string
+			// Whether to compile against platform APIs instead of
+			// an SDK.
+			Platform_apis *bool
+			// Whether RPC features are enabled (requires API level 32)
+			// TODO(b/175819535): enable this automatically?
+			Gen_rpc *bool
+			// Lint properties for generated java module
+			java.LintProperties
+		}
+		// Backend of the compiler generating code for C++ clients using
+		// libbinder (unstable C++ interface)
+		// When enabled, this creates a target called "<name>-cpp".
+		Cpp struct {
+			CommonNativeBackendProperties
+		}
+		// Backend of the compiler generating code for C++ clients using libbinder_ndk
+		// (stable C interface to system's libbinder) When enabled, this creates a target
+		// called "<name>-V<ver>-ndk" (for both apps and platform) and
+		// "<name>-V<ver>-ndk_platform" (for platform only).
+		// TODO(b/161456198): remove the ndk_platform backend as the ndk backend can serve
+		// the same purpose.
+		Ndk struct {
+			CommonNativeBackendProperties
+
+			// Set to the version of the sdk to compile against, for the NDK
+			// variant.
+			// Default: current
+			Sdk_version *string
+
+			// If set to false, the ndk backend is exclusive to platform and is not
+			// available to applications. Default is true (i.e. available to both
+			// applications and platform).
+			Apps_enabled *bool
+		}
+		// Backend of the compiler generating code for Rust clients.
+		// When enabled, this creates a target called "<name>-rust".
+		Rust struct {
+			CommonBackendProperties
+
+			// Rustlibs needed for unstructured parcelables.
+			Additional_rustlibs []string
+		}
+	}
+
+	// Marks that this interface does not need to be stable. When set to true, the build system
+	// doesn't create the API dump and require it to be updated. Default is false.
+	Unstable *bool
+
+	// Optional flags to be passed to the AIDL compiler for diagnostics. e.g. "-Weverything"
+	Flags []string
+
+	// --dumpapi options
+	Dumpapi DumpApiProperties
+
+	// List of aidl_library modules that provide aidl headers for the AIDL tool.
+	Headers []string
+}
+
+type aidlInterface struct {
+	android.ModuleBase
+	android.BazelModuleBase
+	android.DefaultableModuleBase
+
+	properties aidlInterfaceProperties
+
+	computedTypes []string
+
+	// list of module names that are created for this interface
+	internalModuleNames []string
+
+	// map for version to preprocessed.aidl file.
+	// There's two additional alias for versions:
+	// - ""(empty) is for ToT
+	// - "latest" is for i.latestVersion()
+	preprocessed map[string]android.WritablePath
+}
+
+func (i *aidlInterface) shouldGenerateJavaBackend() bool {
+	// explicitly true if not specified to give early warning to devs
+	return proptools.BoolDefault(i.properties.Backend.Java.Enabled, true)
+}
+
+func (i *aidlInterface) shouldGenerateCppBackend() bool {
+	// explicitly true if not specified to give early warning to devs
+	return proptools.BoolDefault(i.properties.Backend.Cpp.Enabled, true)
+}
+
+func (i *aidlInterface) shouldGenerateNdkBackend() bool {
+	// explicitly true if not specified to give early warning to devs
+	return proptools.BoolDefault(i.properties.Backend.Ndk.Enabled, true)
+}
+
+// Returns whether the ndk backend supports applications or not. Default is `true`. `false` is
+// returned when `apps_enabled` is explicitly set to false or the interface is exclusive to vendor
+// (i.e. `vendor: true`). Note that the ndk_platform backend (which will be removed in the future)
+// is not affected by this. In other words, it is always exclusive for the platform, as its name
+// clearly shows.
+func (i *aidlInterface) shouldGenerateAppNdkBackend() bool {
+	return i.shouldGenerateNdkBackend() &&
+		proptools.BoolDefault(i.properties.Backend.Ndk.Apps_enabled, true) &&
+		!i.SocSpecific()
+}
+
+func (i *aidlInterface) shouldGenerateRustBackend() bool {
+	return i.properties.Backend.Rust.Enabled != nil && *i.properties.Backend.Rust.Enabled
+}
+
+func (i *aidlInterface) minSdkVersion(lang string) *string {
+	var ver *string
+	switch lang {
+	case langCpp:
+		ver = i.properties.Backend.Cpp.Min_sdk_version
+	case langJava:
+		ver = i.properties.Backend.Java.Min_sdk_version
+	case langNdk, langNdkPlatform:
+		ver = i.properties.Backend.Ndk.Min_sdk_version
+	case langRust:
+		ver = i.properties.Backend.Rust.Min_sdk_version
+	default:
+		panic(fmt.Errorf("unsupported language backend %q\n", lang))
+	}
+	if ver == nil {
+		return i.properties.Min_sdk_version
+	}
+	return ver
+}
+
+func (i *aidlInterface) genTrace(lang string) bool {
+	var ver *bool
+	switch lang {
+	case langCpp:
+		ver = i.properties.Backend.Cpp.Gen_trace
+		if ver == nil {
+			// Enable tracing for all cpp backends by default
+			ver = proptools.BoolPtr(true)
+		}
+	case langJava:
+		ver = i.properties.Backend.Java.Gen_trace
+		if ver == nil && proptools.Bool(i.properties.Backend.Java.Platform_apis) {
+			// Enable tracing for all Java backends using platform APIs
+			// TODO(161393989) Once we generate ATRACE_TAG_APP instead of ATRACE_TAG_AIDL,
+			// this can be removed and we can start generating traces in all apps.
+			ver = proptools.BoolPtr(true)
+		}
+	case langNdk, langNdkPlatform:
+		ver = i.properties.Backend.Ndk.Gen_trace
+	case langRust: // unsupported b/236880829
+		ver = i.properties.Backend.Rust.Gen_trace
+	case langCppAnalyzer:
+		*ver = false
+	default:
+		panic(fmt.Errorf("unsupported language backend %q\n", lang))
+	}
+	if ver == nil {
+		ver = i.properties.Gen_trace
+	}
+	return proptools.Bool(ver)
+}
+
+// Dep to *-api module(aidlApi)
+type apiDepTag struct {
+	blueprint.BaseDependencyTag
+	name string
+}
+
+type importInterfaceDepTag struct {
+	blueprint.BaseDependencyTag
+	anImport string
+}
+
+type interfaceDepTag struct {
+	blueprint.BaseDependencyTag
+}
+
+type interfaceHeadersDepTag struct {
+	blueprint.BaseDependencyTag
+}
+
+var (
+	// Dep from *-source (aidlGenRule) to *-api (aidlApi)
+	apiDep = apiDepTag{name: "api"}
+	// Dep from *-api (aidlApi) to *-api (aidlApi), representing imported interfaces
+	importApiDep = apiDepTag{name: "imported-api"}
+	// Dep to original *-interface (aidlInterface)
+	interfaceDep = interfaceDepTag{}
+	// Dep for a header interface
+	interfaceHeadersDep = interfaceHeadersDepTag{}
+)
+
+func addImportedInterfaceDeps(ctx android.BottomUpMutatorContext, imports []string) {
+	for _, anImport := range imports {
+		name, _ := parseModuleWithVersion(anImport)
+		ctx.AddDependency(ctx.Module(), importInterfaceDepTag{anImport: anImport}, name+aidlInterfaceSuffix)
+	}
+}
+
+// Run custom "Deps" mutator between AIDL modules created at LoadHook stage.
+// We can't use the "DepsMutator" for these dependencies because
+// - We need to create library modules (cc/java/...) before "arch" mutator. Note that cc_library
+//
+//	should be mutated by os/image/arch mutators as well.
+//
+// - When creating library modules, we need to access the original interface and its imported
+//
+//	interfaces to determine which version to use. See aidlInterface.getImportWithVersion.
+func addInterfaceDeps(mctx android.BottomUpMutatorContext) {
+	switch i := mctx.Module().(type) {
+	case *aidlInterface:
+		// In fact this isn't necessary because soong checks dependencies on undefined modules.
+		// But since aidl_interface overrides its name internally, this provides better error message.
+		for _, anImportWithVersion := range i.properties.Imports {
+			anImport, _ := parseModuleWithVersion(anImportWithVersion)
+			if !mctx.OtherModuleExists(anImport + aidlInterfaceSuffix) {
+				if !mctx.Config().AllowMissingDependencies() {
+					mctx.PropertyErrorf("imports", "Import does not exist: "+anImport)
+				}
+			}
+		}
+		if mctx.Failed() {
+			return
+		}
+		addImportedInterfaceDeps(mctx, i.properties.Imports)
+
+		for _, header := range i.properties.Headers {
+			mctx.AddDependency(i, interfaceHeadersDep, header)
+		}
+	case *aidlImplementationGenerator:
+		mctx.AddDependency(i, interfaceDep, i.properties.AidlInterfaceName+aidlInterfaceSuffix)
+		addImportedInterfaceDeps(mctx, i.properties.Imports)
+	case *rust.Module:
+		for _, props := range i.GetProperties() {
+			if sp, ok := props.(*aidlRustSourceProviderProperties); ok {
+				mctx.AddDependency(i, interfaceDep, sp.AidlInterfaceName+aidlInterfaceSuffix)
+				addImportedInterfaceDeps(mctx, sp.Imports)
+				break
+			}
+		}
+	case *aidlApi:
+		mctx.AddDependency(i, interfaceDep, i.properties.BaseName+aidlInterfaceSuffix)
+		addImportedInterfaceDeps(mctx, i.properties.Imports)
+		for _, anImport := range i.properties.Imports {
+			name, _ := parseModuleWithVersion(anImport)
+			mctx.AddDependency(i, importApiDep, name+aidlApiSuffix)
+		}
+		for _, header := range i.properties.Headers {
+			mctx.AddDependency(i, interfaceHeadersDep, header)
+		}
+	case *aidlGenRule:
+		mctx.AddDependency(i, interfaceDep, i.properties.BaseName+aidlInterfaceSuffix)
+		addImportedInterfaceDeps(mctx, i.properties.Imports)
+		if !proptools.Bool(i.properties.Unstable) {
+			// for checkapi timestamps
+			mctx.AddDependency(i, apiDep, i.properties.BaseName+aidlApiSuffix)
+		}
+		for _, header := range i.properties.Headers {
+			mctx.AddDependency(i, interfaceHeadersDep, header)
+		}
+	}
+}
+
+// checkImports checks if "import:" property is valid.
+// In fact, this isn't necessary because Soong can check/report when we add a dependency to
+// undefined/unknown module. But module names are very implementation specific and may not be easy
+// to understand. For example, when foo (with java enabled) depends on bar (with java disabled), the
+// error message would look like "foo-V2-java depends on unknown module `bar-V3-java`", which isn't
+// clear that backend.java.enabled should be turned on.
+func checkImports(mctx android.BottomUpMutatorContext) {
+	if i, ok := mctx.Module().(*aidlInterface); ok {
+		mctx.VisitDirectDeps(func(dep android.Module) {
+			tag, ok := mctx.OtherModuleDependencyTag(dep).(importInterfaceDepTag)
+			if !ok {
+				return
+			}
+			other := dep.(*aidlInterface)
+			anImport := other.ModuleBase.Name()
+			anImportWithVersion := tag.anImport
+			_, version := parseModuleWithVersion(tag.anImport)
+
+			candidateVersions := other.getVersions()
+			if !proptools.Bool(other.properties.Frozen) {
+				candidateVersions = concat(candidateVersions, []string{other.nextVersion()})
+			}
+
+			if version == "" {
+				if !proptools.Bool(other.properties.Unstable) {
+					mctx.PropertyErrorf("imports", "%q depends on %q but does not specify a version (must be one of %q)", i.ModuleBase.Name(), anImport, candidateVersions)
+				}
+			} else {
+				if !android.InList(version, candidateVersions) {
+					mctx.PropertyErrorf("imports", "%q depends on %q version %q(%q), which doesn't exist. The version must be one of %q", i.ModuleBase.Name(), anImport, version, anImportWithVersion, candidateVersions)
+				}
+			}
+			if i.shouldGenerateJavaBackend() && !other.shouldGenerateJavaBackend() {
+				mctx.PropertyErrorf("backend.java.enabled",
+					"Java backend not enabled in the imported AIDL interface %q", anImport)
+			}
+
+			if i.shouldGenerateCppBackend() && !other.shouldGenerateCppBackend() {
+				mctx.PropertyErrorf("backend.cpp.enabled",
+					"C++ backend not enabled in the imported AIDL interface %q", anImport)
+			}
+
+			if i.shouldGenerateNdkBackend() && !other.shouldGenerateNdkBackend() {
+				mctx.PropertyErrorf("backend.ndk.enabled",
+					"NDK backend not enabled in the imported AIDL interface %q", anImport)
+			}
+
+			if i.shouldGenerateRustBackend() && !other.shouldGenerateRustBackend() {
+				mctx.PropertyErrorf("backend.rust.enabled",
+					"Rust backend not enabled in the imported AIDL interface %q", anImport)
+			}
+
+			if i.isFrozen() && other.isExplicitlyUnFrozen() && version == "" {
+				mctx.PropertyErrorf("frozen",
+					"%q imports %q which is not frozen. Either %q must set 'frozen: false' or must explicitly import %q where * is one of %q",
+					i.ModuleBase.Name(), anImport, i.ModuleBase.Name(), anImport+"-V*", candidateVersions)
+			}
+			if i.Owner() == "" && other.Owner() != "" {
+				mctx.PropertyErrorf("imports",
+					"%q imports %q which is an interface owned by %q. This is not allowed because the owned interface will not be frozen at the same time.",
+					i.ModuleBase.Name(), anImport, other.Owner())
+			}
+		})
+	}
+}
+
+func (i *aidlInterface) checkGenTrace(mctx android.DefaultableHookContext) {
+	if !proptools.Bool(i.properties.Gen_trace) {
+		return
+	}
+	if i.shouldGenerateJavaBackend() && !proptools.Bool(i.properties.Backend.Java.Platform_apis) {
+		mctx.PropertyErrorf("gen_trace", "must be false when Java backend is enabled and platform_apis is false")
+	}
+}
+
+func (i *aidlInterface) checkStability(mctx android.DefaultableHookContext) {
+	if i.properties.Stability == nil {
+		return
+	}
+
+	if proptools.Bool(i.properties.Unstable) {
+		mctx.PropertyErrorf("stability", "must be empty when \"unstable\" is true")
+	}
+
+	// TODO(b/136027762): should we allow more types of stability (e.g. for APEX) or
+	// should we switch this flag to be something like "vintf { enabled: true }"
+	isVintf := "vintf" == proptools.String(i.properties.Stability)
+	if !isVintf {
+		mctx.PropertyErrorf("stability", "must be empty or \"vintf\"")
+	}
+}
+func (i *aidlInterface) checkVersions(mctx android.DefaultableHookContext) {
+	if len(i.properties.Versions) > 0 && len(i.properties.Versions_with_info) > 0 {
+		mctx.ModuleErrorf("versions:%q and versions_with_info:%q cannot be used at the same time. Use versions_with_info instead of versions.", i.properties.Versions, i.properties.Versions_with_info)
+	}
+
+	if len(i.properties.Versions) > 0 {
+		i.properties.VersionsInternal = make([]string, len(i.properties.Versions))
+		copy(i.properties.VersionsInternal, i.properties.Versions)
+	} else if len(i.properties.Versions_with_info) > 0 {
+		i.properties.VersionsInternal = make([]string, len(i.properties.Versions_with_info))
+		for idx, value := range i.properties.Versions_with_info {
+			i.properties.VersionsInternal[idx] = value.Version
+			for _, im := range value.Imports {
+				if !hasVersionSuffix(im) {
+					mctx.ModuleErrorf("imports in versions_with_info must specify its version, but %s. Add a version suffix(such as %s-V1).", im, im)
+					return
+				}
+			}
+		}
+	}
+
+	versions := make(map[string]bool)
+	intVersions := make([]int, 0, len(i.getVersions()))
+	for _, ver := range i.getVersions() {
+		if _, dup := versions[ver]; dup {
+			mctx.PropertyErrorf("versions", "duplicate found", ver)
+			continue
+		}
+		versions[ver] = true
+		n, err := strconv.Atoi(ver)
+		if err != nil {
+			mctx.PropertyErrorf("versions", "%q is not an integer", ver)
+			continue
+		}
+		if n <= 0 {
+			mctx.PropertyErrorf("versions", "should be > 0, but is %v", ver)
+			continue
+		}
+		intVersions = append(intVersions, n)
+
+	}
+	if !mctx.Failed() && !sort.IntsAreSorted(intVersions) {
+		mctx.PropertyErrorf("versions", "should be sorted, but is %v", i.getVersions())
+	}
+}
+func (i *aidlInterface) checkVndkUseVersion(mctx android.DefaultableHookContext) {
+	if i.properties.Vndk_use_version == nil {
+		return
+	}
+	if *i.properties.Vndk_use_version == i.nextVersion() {
+		return
+	}
+	for _, ver := range i.getVersions() {
+		if *i.properties.Vndk_use_version == ver {
+			return
+		}
+	}
+	mctx.PropertyErrorf("vndk_use_version", "Specified version %q does not exist", *i.properties.Vndk_use_version)
+}
+
+func (i *aidlInterface) checkFlags(mctx android.DefaultableHookContext) {
+	for _, flag := range i.properties.Flags {
+		if !strings.HasPrefix(flag, "-W") {
+			mctx.PropertyErrorf("flags", "Unexpected flag type '%s'. Only flags starting with '-W' for diagnostics are supported.", flag)
+		}
+	}
+}
+
+func (i *aidlInterface) nextVersion() string {
+	if proptools.Bool(i.properties.Unstable) {
+		return ""
+	}
+	return nextVersion(i.getVersions())
+}
+
+func nextVersion(versions []string) string {
+	if len(versions) == 0 {
+		return "1"
+	}
+	ver := versions[len(versions)-1]
+	i, err := strconv.Atoi(ver)
+	if err != nil {
+		panic(err)
+	}
+	return strconv.Itoa(i + 1)
+}
+
+func (i *aidlInterface) latestVersion() string {
+	if !i.hasVersion() {
+		return "0"
+	}
+	return i.getVersions()[len(i.getVersions())-1]
+}
+
+func (i *aidlInterface) hasVersion() bool {
+	return len(i.getVersions()) > 0
+}
+
+func (i *aidlInterface) getVersions() []string {
+	return i.properties.VersionsInternal
+}
+
+func (i *aidlInterface) isFrozen() bool {
+	return proptools.Bool(i.properties.Frozen)
+}
+
+// in order to keep original behavior for certain operations, we may want to
+// check if frozen is set.
+func (i *aidlInterface) isExplicitlyUnFrozen() bool {
+	return i.properties.Frozen != nil && !proptools.Bool(i.properties.Frozen)
+}
+
+func hasVersionSuffix(moduleName string) bool {
+	hasVersionSuffix, _ := regexp.MatchString("-V\\d+$", moduleName)
+	return hasVersionSuffix
+}
+
+func parseModuleWithVersion(moduleName string) (string, string) {
+	if hasVersionSuffix(moduleName) {
+		versionIdx := strings.LastIndex(moduleName, "-V")
+		if versionIdx == -1 {
+			panic("-V must exist in this context")
+		}
+		return moduleName[:versionIdx], moduleName[versionIdx+len("-V"):]
+	}
+	return moduleName, ""
+}
+
+func trimVersionSuffixInList(moduleNames []string) []string {
+	return wrapFunc("", moduleNames, "", func(moduleName string) string {
+		moduleNameWithoutVersion, _ := parseModuleWithVersion(moduleName)
+		return moduleNameWithoutVersion
+	})
+}
+
+func (i *aidlInterface) checkRequireFrozenAndReason(mctx android.EarlyModuleContext) (bool, string) {
+	if proptools.Bool(i.properties.Unstable) {
+		return false, "it's an unstable interface"
+	}
+
+	if proptools.Bool(i.properties.Frozen) {
+		return true, "it's explicitly marked as `frozen: true`"
+	}
+
+	if i.Owner() == "" {
+		if mctx.Config().IsEnvTrue("AIDL_FROZEN_REL") {
+			return true, "this is a release branch (simulated by setting AIDL_FROZEN_REL) - freeze it or set 'owners:'"
+		}
+	} else {
+		// has an OWNER
+		// These interfaces are verified by other tests like vts_treble_vintf_vendor_test
+		// but this can be used to verify they are frozen at build time.
+		if android.InList(i.Owner(), strings.Fields(mctx.Config().Getenv("AIDL_FROZEN_OWNERS"))) {
+			return true, "the owner field is in environment variable AIDL_FROZEN_OWNERS"
+		}
+	}
+
+	return false, "by default, we don't require the interface to be frozen"
+}
+
+func aidlInterfaceHook(mctx android.DefaultableHookContext, i *aidlInterface) {
+	if hasVersionSuffix(i.ModuleBase.Name()) {
+		mctx.PropertyErrorf("name", "aidl_interface should not have '-V<number> suffix")
+	}
+	if !isRelativePath(i.properties.Local_include_dir) {
+		mctx.PropertyErrorf("local_include_dir", "must be relative path: "+i.properties.Local_include_dir)
+	}
+
+	i.checkStability(mctx)
+	i.checkVersions(mctx)
+	i.checkVndkUseVersion(mctx)
+	i.checkGenTrace(mctx)
+	i.checkFlags(mctx)
+
+	if mctx.Failed() {
+		return
+	}
+
+	var libs []string
+
+	unstable := proptools.Bool(i.properties.Unstable)
+
+	if unstable {
+		if i.hasVersion() {
+			mctx.PropertyErrorf("versions", "cannot have versions for an unstable interface")
+			return
+		}
+		if i.properties.Stability != nil {
+			mctx.ModuleErrorf("unstable:true and stability:%q cannot happen at the same time", i.properties.Stability)
+			return
+		}
+	}
+
+	if i.isFrozen() {
+		if !i.hasVersion() {
+			mctx.PropertyErrorf("frozen", "cannot be frozen without versions")
+			return
+		}
+	}
+
+	if !unstable && mctx.Namespace().Path != "." && i.Owner() == "" {
+		mctx.PropertyErrorf("owner", "aidl_interface in a soong_namespace must have the 'owner' property set.")
+	}
+
+	requireFrozenVersion, requireFrozenReason := i.checkRequireFrozenAndReason(mctx)
+
+	// surface error early, main check is via checkUnstableModuleMutator
+	if requireFrozenVersion && !i.hasVersion() {
+		mctx.PropertyErrorf("versions", "must be set (need to be frozen) because: %q", requireFrozenReason)
+	}
+
+	vndkEnabled := proptools.Bool(i.properties.VndkProperties.Vndk.Enabled) ||
+		proptools.Bool(i.properties.Backend.Cpp.CommonNativeBackendProperties.VndkProperties.Vndk.Enabled) ||
+		proptools.Bool(i.properties.Backend.Ndk.CommonNativeBackendProperties.VndkProperties.Vndk.Enabled)
+
+	if vndkEnabled && !proptools.Bool(i.properties.Unstable) {
+		if i.properties.Frozen == nil {
+			mctx.PropertyErrorf("frozen", "true or false must be specified when the VNDK is enabled on a versioned interface (not `unstable: true`)")
+		}
+		if !proptools.Bool(i.properties.Frozen) && i.properties.Vndk_use_version == nil {
+			mctx.PropertyErrorf("vndk_use_version", "must be specified if interface is unfrozen (or specify 'frozen: false')")
+		}
+	}
+
+	versions := i.getVersions()
+	nextVersion := i.nextVersion()
+	shouldGenerateLangBackendMap := map[string]bool{
+		langCpp:  i.shouldGenerateCppBackend(),
+		langNdk:  i.shouldGenerateNdkBackend(),
+		langJava: i.shouldGenerateJavaBackend(),
+		langRust: i.shouldGenerateRustBackend()}
+
+	// The ndk_platform backend is generated only when explicitly requested. This will
+	// eventually be completely removed the devices in the long tail are gone.
+	if mctx.DeviceConfig().GenerateAidlNdkPlatformBackend() {
+		shouldGenerateLangBackendMap[langNdkPlatform] = i.shouldGenerateNdkBackend()
+	}
+
+	var bp2build bool
+	// TODO: b/295566168 - this will need to change once build files are checked in to account for
+	// checked in modules in mixed builds
+	if b, ok := mctx.Module().(android.Bazelable); ok {
+		bp2build = b.ShouldConvertWithBp2build(mctx)
+	} else {
+		panic(fmt.Errorf("aidlInterface must support Bazelable"))
+	}
+
+	for lang, shouldGenerate := range shouldGenerateLangBackendMap {
+		if !shouldGenerate {
+			continue
+		}
+		libs = append(libs, addLibrary(mctx, i, nextVersion, lang, requireFrozenVersion, requireFrozenReason, bp2build))
+		for _, version := range versions {
+			libs = append(libs, addLibrary(mctx, i, version, lang, false, "this is a known frozen version", bp2build))
+		}
+	}
+
+	// In the future, we may want to force the -cpp backend to be on host,
+	// and limit its visibility, even if it's not created normally
+	if i.shouldGenerateCppBackend() && len(i.properties.Imports) == 0 {
+		libs = append(libs, addLibrary(mctx, i, nextVersion, langCppAnalyzer, false, "analysis always uses latest version even if frozen", bp2build))
+	}
+
+	if unstable {
+		apiDirRoot := filepath.Join(aidlApiDir, i.ModuleBase.Name())
+		aidlDumps, _ := mctx.GlobWithDeps(filepath.Join(mctx.ModuleDir(), apiDirRoot, "**/*.aidl"), nil)
+		if len(aidlDumps) != 0 {
+			mctx.PropertyErrorf("unstable", "The interface is configured as unstable, "+
+				"but API dumps exist under %q. Unstable interface cannot have dumps.", apiDirRoot)
+		}
+	} else {
+		addApiModule(mctx, i)
+	}
+
+	// Reserve this module name for future use, and make it responsible for
+	// generating a Bazel definition.
+	factoryFunc := func() android.Module {
+		result := &phonyAidlInterface{
+			origin: i,
+		}
+		android.InitAndroidModule(result)
+		android.InitBazelModule(result)
+		return result
+	}
+	mctx.CreateModule(factoryFunc, &phonyProperties{
+		Name: proptools.StringPtr(i.ModuleBase.Name()),
+	})
+
+	i.internalModuleNames = libs
+}
+
+func (p *phonyAidlInterface) GenerateAndroidBuildActions(_ android.ModuleContext) {
+	// No-op.
+}
+
+type phonyAidlInterface struct {
+	android.ModuleBase
+	android.BazelModuleBase
+	origin *aidlInterface
+}
+
+func (i *aidlInterface) commonBackendProperties(lang string) CommonBackendProperties {
+	switch lang {
+	case langCpp:
+		return i.properties.Backend.Cpp.CommonBackendProperties
+	case langJava:
+		return i.properties.Backend.Java.CommonBackendProperties
+	case langNdk, langNdkPlatform:
+		return i.properties.Backend.Ndk.CommonBackendProperties
+	case langRust:
+		return i.properties.Backend.Rust.CommonBackendProperties
+	default:
+		panic(fmt.Errorf("unsupported language backend %q\n", lang))
+	}
+}
+
+func (i *aidlInterface) Name() string {
+	return i.ModuleBase.Name() + aidlInterfaceSuffix
+}
+
+func (i *aidlInterface) GenerateAndroidBuildActions(ctx android.ModuleContext) {
+	srcs, _ := getPaths(ctx, i.properties.Srcs, i.properties.Local_include_dir)
+	for _, src := range srcs {
+		computedType := strings.TrimSuffix(strings.ReplaceAll(src.Rel(), "/", "."), ".aidl")
+		i.computedTypes = append(i.computedTypes, computedType)
+	}
+
+	i.preprocessed = make(map[string]android.WritablePath)
+	// generate (len(versions) + 1) preprocessed.aidl files
+	for _, version := range concat(i.getVersions(), []string{i.nextVersion()}) {
+		i.preprocessed[version] = i.buildPreprocessed(ctx, version)
+	}
+	// helpful aliases
+	if !proptools.Bool(i.properties.Unstable) {
+		if i.hasVersion() {
+			i.preprocessed["latest"] = i.preprocessed[i.latestVersion()]
+		} else {
+			// when we have no frozen versions yet, use "next version" as latest
+			i.preprocessed["latest"] = i.preprocessed[i.nextVersion()]
+		}
+		i.preprocessed[""] = i.preprocessed[i.nextVersion()]
+	}
+}
+
+func (i *aidlInterface) getImportsForVersion(version string) []string {
+	// `Imports` is used when version == i.nextVersion() or`versions` is defined instead of `versions_with_info`
+	importsSrc := i.properties.Imports
+	for _, v := range i.properties.Versions_with_info {
+		if v.Version == version {
+			importsSrc = v.Imports
+			break
+		}
+	}
+	imports := make([]string, len(importsSrc))
+	copy(imports, importsSrc)
+
+	return imports
+}
+
+func (i *aidlInterface) getImports(version string) map[string]string {
+	imports := make(map[string]string)
+	imports_src := i.getImportsForVersion(version)
+
+	useLatestStable := !proptools.Bool(i.properties.Unstable) && version != "" && version != i.nextVersion()
+	for _, importString := range imports_src {
+		name, targetVersion := parseModuleWithVersion(importString)
+		if targetVersion == "" && useLatestStable {
+			targetVersion = "latest"
+		}
+		imports[name] = targetVersion
+	}
+	return imports
+}
+
+// generate preprocessed.aidl which contains only types with evaluated constants.
+// "imports" will use preprocessed.aidl with -p flag to avoid parsing the entire transitive list
+// of dependencies.
+func (i *aidlInterface) buildPreprocessed(ctx android.ModuleContext, version string) android.WritablePath {
+	deps := getDeps(ctx, i.getImports(version))
+
+	preprocessed := android.PathForModuleOut(ctx, version, "preprocessed.aidl")
+	rb := android.NewRuleBuilder(pctx, ctx)
+	srcs, root_dir := i.srcsForVersion(ctx, version)
+
+	if len(srcs) == 0 {
+		ctx.PropertyErrorf("srcs", "No sources for a previous version in %v. Was a version manually added to .bp file? This is added automatically by <module>-freeze-api.", root_dir)
+	}
+
+	paths, imports := getPaths(ctx, srcs, root_dir)
+	imports = append(imports, deps.imports...)
+	imports = append(imports, i.properties.Include_dirs...)
+
+	preprocessCommand := rb.Command().BuiltTool("aidl").
+		FlagWithOutput("--preprocess ", preprocessed)
+
+	if !proptools.Bool(i.properties.Unstable) {
+		preprocessCommand.Flag("--structured")
+	}
+	if i.properties.Stability != nil {
+		preprocessCommand.FlagWithArg("--stability ", *i.properties.Stability)
+	}
+	preprocessCommand.FlagForEachInput("-p", deps.preprocessed)
+	preprocessCommand.FlagForEachArg("-I", imports)
+	preprocessCommand.Inputs(paths)
+	name := i.BaseModuleName()
+	if version != "" {
+		name += "/" + version
+	}
+	rb.Build("export_"+name, "export types for "+name)
+	return preprocessed
+}
+
+func (i *aidlInterface) DepsMutator(ctx android.BottomUpMutatorContext) {
+	ctx.AddReverseDependency(ctx.Module(), nil, aidlMetadataSingletonName)
+}
+
+func AidlInterfaceFactory() android.Module {
+	i := &aidlInterface{}
+	i.AddProperties(&i.properties)
+	android.InitAndroidModule(i)
+	android.InitDefaultableModule(i)
+	android.InitBazelModule(i)
+	android.AddBazelHandcraftedHook(i, func(ctx android.LoadHookContext) string {
+		return strings.TrimSuffix(i.Name(), "_interface")
+	})
+	i.SetDefaultableHook(func(ctx android.DefaultableHookContext) { aidlInterfaceHook(ctx, i) })
+	return i
+}
+
+type aidlInterfaceAttributes struct {
+	aidlLibraryAttributes
+	Stability          *string
+	Versions_with_info []versionWithInfoAttribute
+	Java_config        *javaConfigAttributes
+	Cpp_config         *cppConfigAttributes
+	Ndk_config         *ndkConfigAttributes
+	// Backend_Configs    backendConfigAttributes
+	Unstable *bool
+	Frozen   *bool
+}
+
+type javaConfigAttributes struct {
+	commonBackendAttributes
+}
+type cppConfigAttributes struct {
+	commonNativeBackendAttributes
+}
+type ndkConfigAttributes struct {
+	commonNativeBackendAttributes
+}
+
+type commonBackendAttributes struct {
+	Enabled         bool
+	Min_sdk_version *string
+	Tags            []string
+}
+
+type commonNativeBackendAttributes struct {
+	commonBackendAttributes
+	Additional_dynamic_deps bazel.LabelListAttribute
+}
+
+type versionWithInfoAttribute struct {
+	Version string
+	// Versions_with_info.Deps in Bazel is analogous to Versions_with_info.Imports in Soong.
+	// Deps is chosen to be consistent with other Bazel rules/macros for AIDL
+	Deps bazel.LabelListAttribute
+}
+
+type aidlLibraryAttributes struct {
+	Srcs                bazel.LabelListAttribute
+	Hdrs                bazel.LabelListAttribute
+	Deps                bazel.LabelListAttribute
+	Strip_import_prefix *string
+	Flags               []string
+}
+
+// getBazelLabelListForImports returns a bazel label list converted from
+// aidl_interface.imports or aidl_interface.versions_with_info.imports prop
+func getBazelLabelListForImports(ctx android.Bp2buildMutatorContext, imports []string) bazel.LabelList {
+	type nameAndVersion struct {
+		name    string
+		version string
+	}
+	// An aidl_interface with a version designation doesn't correspond to a specific
+	// module, but rather just imforms Soong on which collection of sources to provide
+	// from a particular interface module.
+	// However in Bazel, we will be creating an aidl_library for each version, so we can
+	// depend directly on a "versioned" module. But, we must look up the "unversioned"
+	// module name in BazelLabelForModuleDeps and then re-attach the version information.
+	namesAndVersions := make([]nameAndVersion, len(imports))
+	names := make([]string, len(imports))
+	for i, dep := range imports {
+		// Split dep into two parts
+		name, version := parseModuleWithVersion(dep)
+		if version == "" {
+			version = "-latest"
+		} else {
+			version = "-V" + version
+		}
+		namesAndVersions[i] = nameAndVersion{
+			name:    name,
+			version: version,
+		}
+		names[i] = name
+	}
+	// Look up bazel label by name without version
+	bazelLabels := android.BazelLabelForModuleDeps(ctx, names)
+	for i := range bazelLabels.Includes {
+		// Re-attach the version to the name
+		bazelLabels.Includes[i].Label = bazelLabels.Includes[i].Label + namesAndVersions[i].version
+	}
+	return bazelLabels
+}
+
+func (p *aidlInterface) ConvertWithBp2build(_ android.Bp2buildMutatorContext) {
+	// aidlInterface should have a label set by its load hook; modules it creates
+	// are responsible for generating the actual definition.
+	panic("aidlInterface should always appear to have an existing label")
+}
+
+func (p *phonyAidlInterface) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
+	i := p.origin
+	var javaConfig *javaConfigAttributes
+	var cppConfig *cppConfigAttributes
+	var ndkConfig *ndkConfigAttributes
+	var deps bazel.LabelListAttribute
+
+	if i.shouldGenerateJavaBackend() {
+		javaConfig = &javaConfigAttributes{}
+		javaConfig.Enabled = true
+		javaConfig.Min_sdk_version = i.minSdkVersion(langJava)
+		javaConfig.Tags = android.ConvertApexAvailableToTagsWithoutTestApexes(ctx, i.properties.Backend.Java.Apex_available)
+	}
+	if i.shouldGenerateCppBackend() {
+		cppConfig = &cppConfigAttributes{}
+		cppConfig.Enabled = true
+		cppConfig.Min_sdk_version = i.minSdkVersion(langCpp)
+		apexAvailable := i.properties.Backend.Cpp.Apex_available
+		cppConfig.Tags = android.ConvertApexAvailableToTagsWithoutTestApexes(ctx, apexAvailable)
+		cppConfig.Additional_dynamic_deps = bazel.LabelListAttribute{}
+		additionalSharedLabels := android.BazelLabelForModuleDeps(ctx, i.properties.Backend.Cpp.Additional_shared_libraries)
+		for _, l := range additionalSharedLabels.Includes {
+			dep, _ := ctx.ModuleFromName(l.OriginalModuleName)
+			if c, ok := dep.(*cc.Module); !ok || !c.HasStubsVariants() {
+				cppConfig.Additional_dynamic_deps.Add(bazel.MakeLabelAttribute(l.Label))
+			}
+		}
+		cc.SetStubsForDynamicDeps(
+			ctx,
+			bazel.NoConfigAxis,
+			"",
+			apexAvailable,
+			additionalSharedLabels,
+			&cppConfig.Additional_dynamic_deps,
+			&deps,
+			0,
+			false,
+		)
+	}
+	if i.shouldGenerateNdkBackend() {
+		ndkConfig = &ndkConfigAttributes{}
+		ndkConfig.Enabled = true
+		ndkConfig.Min_sdk_version = i.minSdkVersion(langNdk)
+		apexAvailable := i.properties.Backend.Ndk.Apex_available
+		ndkConfig.Tags = android.ConvertApexAvailableToTagsWithoutTestApexes(ctx, apexAvailable)
+		ndkConfig.Additional_dynamic_deps = bazel.LabelListAttribute{}
+		additionalSharedLabels := android.BazelLabelForModuleDeps(ctx, i.properties.Backend.Ndk.Additional_shared_libraries)
+		for _, l := range additionalSharedLabels.Includes {
+			dep, _ := ctx.ModuleFromName(l.OriginalModuleName)
+			if c, ok := dep.(*cc.Module); !ok || !c.HasStubsVariants() {
+				ndkConfig.Additional_dynamic_deps.Add(bazel.MakeLabelAttribute(l.Label))
+			}
+		}
+		cc.SetStubsForDynamicDeps(
+			ctx,
+			bazel.NoConfigAxis,
+			"",
+			apexAvailable,
+			additionalSharedLabels,
+			&ndkConfig.Additional_dynamic_deps,
+			&deps,
+			0,
+			false,
+		)
+	}
+
+	imports := getBazelLabelListForImports(ctx, i.properties.Imports)
+
+	var versionsWithInfos []versionWithInfoAttribute
+
+	if len(i.properties.Versions_with_info) > 0 {
+		for _, versionWithInfo := range i.properties.Versions_with_info {
+			versionedImports := getBazelLabelListForImports(ctx, versionWithInfo.Imports)
+			if !versionedImports.IsEmpty() {
+				versionsWithInfos = append(
+					versionsWithInfos,
+					versionWithInfoAttribute{
+						Version: versionWithInfo.Version,
+						Deps:    bazel.MakeLabelListAttribute(versionedImports),
+					},
+				)
+			} else {
+				versionsWithInfos = append(
+					versionsWithInfos,
+					versionWithInfoAttribute{
+						Version: versionWithInfo.Version,
+					},
+				)
+			}
+		}
+	} else if len(i.properties.Versions) > 0 {
+		for _, version := range i.properties.Versions {
+			if !imports.IsEmpty() {
+				versionsWithInfos = append(
+					versionsWithInfos,
+					versionWithInfoAttribute{
+						Version: version,
+						Deps:    bazel.MakeLabelListAttribute(imports),
+					},
+				)
+			} else {
+				versionsWithInfos = append(
+					versionsWithInfos,
+					versionWithInfoAttribute{
+						Version: version,
+					},
+				)
+			}
+		}
+	}
+
+	if len(i.properties.Srcs) > 0 && !imports.IsEmpty() {
+		// imports is only needed for (non-frozen) srcs
+		// frozen verions use imports in versions_with_info
+		deps = bazel.MakeLabelListAttribute(imports)
+	}
+
+	srcsAttr := bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, i.properties.Srcs))
+	var stripImportPrefixAttr *string = nil
+	if i.properties.Local_include_dir != "" && !srcsAttr.IsEmpty() {
+		stripImportPrefixAttr = &i.properties.Local_include_dir
+	}
+
+	if len(i.properties.Include_dirs) != 0 {
+		// TODO(b/298246873) remove include_dirs property from aidl_interface
+		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_PROPERTY_UNSUPPORTED, "include_dirs not supported")
+		return
+	}
+
+	attrs := &aidlInterfaceAttributes{
+		aidlLibraryAttributes: aidlLibraryAttributes{
+			Srcs:                srcsAttr,
+			Flags:               i.properties.Flags,
+			Deps:                deps,
+			Hdrs:                bazel.MakeLabelListAttribute(android.BazelLabelForModuleDeps(ctx, i.properties.Headers)),
+			Strip_import_prefix: stripImportPrefixAttr,
+		},
+		Stability:          i.properties.Stability,
+		Versions_with_info: versionsWithInfos,
+		Java_config:        javaConfig,
+		Cpp_config:         cppConfig,
+		Ndk_config:         ndkConfig,
+		Unstable:           i.properties.Unstable,
+		Frozen:             i.properties.Frozen,
+	}
+
+	interfaceName := strings.TrimSuffix(i.Name(), "_interface")
+
+	ctx.CreateBazelTargetModule(
+		bazel.BazelTargetModuleProperties{
+			Rule_class:        "aidl_interface",
+			Bzl_load_location: "//build/bazel/rules/aidl:aidl_interface.bzl",
+		},
+		android.CommonAttributes{Name: interfaceName},
+		attrs,
+	)
+}
diff --git a/build/aidl_interface_backends.go b/build/aidl_interface_backends.go
new file mode 100644
index 0000000..76fd85b
--- /dev/null
+++ b/build/aidl_interface_backends.go
@@ -0,0 +1,613 @@
+// Copyright (C) 2021 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package aidl
+
+import (
+	"android/soong/android"
+	"android/soong/cc"
+	"android/soong/java"
+	"android/soong/rust"
+
+	"fmt"
+	"path/filepath"
+	"strings"
+
+	"github.com/google/blueprint/proptools"
+)
+
+func addLibrary(mctx android.DefaultableHookContext, i *aidlInterface, version string, lang string, notFrozen bool, requireFrozenReason string, bp2build bool) string {
+	if lang == langJava {
+		return addJavaLibrary(mctx, i, version, notFrozen, requireFrozenReason, bp2build)
+	} else if lang == langRust {
+		return addRustLibrary(mctx, i, version, notFrozen, requireFrozenReason)
+	} else if lang == langCppAnalyzer {
+		return addCppAnalyzerLibrary(mctx, i, version, notFrozen, requireFrozenReason)
+	} else if lang == langCpp || lang == langNdk || lang == langNdkPlatform {
+		return addCppLibrary(mctx, i, version, lang, notFrozen, requireFrozenReason, bp2build)
+	} else {
+		panic(fmt.Errorf("unsupported language backend %q\n", lang))
+	}
+}
+
+func addCppLibrary(mctx android.DefaultableHookContext, i *aidlInterface, version string, lang string, notFrozen bool, requireFrozenReason string, bp2build bool) string {
+	cppSourceGen := i.versionedName(version) + "-" + lang + "-source"
+	cppModuleGen := i.versionedName(version) + "-" + lang
+
+	srcs, aidlRoot := i.srcsForVersion(mctx, version)
+	if len(srcs) == 0 {
+		// This can happen when the version is about to be frozen; the version
+		// directory is created but API dump hasn't been copied there.
+		// Don't create a library for the yet-to-be-frozen version.
+		return ""
+	}
+
+	var overrideVndkProperties cc.VndkProperties
+
+	if !i.isModuleForVndk(version) {
+		// We only want the VNDK to include the latest interface. For interfaces in
+		// development, they will be frozen, so we put their latest version in the
+		// VNDK. For interfaces which are already frozen, we put their latest version
+		// in the VNDK, and when that version is frozen, the version in the VNDK can
+		// be updated. Otherwise, we remove this library from the VNDK, to avoid adding
+		// multiple versions of the same library to the VNDK.
+		overrideVndkProperties.Vndk.Enabled = proptools.BoolPtr(false)
+		overrideVndkProperties.Vndk.Support_system_process = proptools.BoolPtr(false)
+	}
+
+	var commonProperties *CommonNativeBackendProperties
+	if lang == langCpp {
+		commonProperties = &i.properties.Backend.Cpp.CommonNativeBackendProperties
+	} else if lang == langNdk || lang == langNdkPlatform {
+		commonProperties = &i.properties.Backend.Ndk.CommonNativeBackendProperties
+	}
+
+	genLog := proptools.Bool(commonProperties.Gen_log)
+	genTrace := i.genTrace(lang)
+
+	var cppGenLabel, cppLabel *string
+	var bp2buildAvailable *bool
+	if bp2build {
+		cppGenLabel = proptools.StringPtr(fmt.Sprintf("//%s:%s", mctx.ModuleDir(), cppSourceGen))
+		cppLabel = proptools.StringPtr(fmt.Sprintf("//%s:%s", mctx.ModuleDir(), cppModuleGen))
+	} else {
+		bp2buildAvailable = proptools.BoolPtr(false)
+	}
+
+	mctx.CreateModule(aidlGenFactory, &nameProperties{
+		Name: proptools.StringPtr(cppSourceGen),
+	}, &aidlGenProperties{
+		Srcs:                srcs,
+		AidlRoot:            aidlRoot,
+		Imports:             i.getImportsForVersion(version),
+		Headers:             i.properties.Headers,
+		Stability:           i.properties.Stability,
+		Min_sdk_version:     i.minSdkVersion(lang),
+		Lang:                lang,
+		BaseName:            i.ModuleBase.Name(),
+		GenLog:              genLog,
+		Version:             i.versionForInitVersionCompat(version),
+		GenTrace:            genTrace,
+		Unstable:            i.properties.Unstable,
+		NotFrozen:           notFrozen,
+		RequireFrozenReason: requireFrozenReason,
+		Flags:               i.flagsForAidlGenRule(version),
+	},
+		&bazelProperties{
+			&Bazel_module{
+				Label:              cppGenLabel,
+				Bp2build_available: bp2buildAvailable,
+			},
+		},
+	)
+
+	importExportDependencies := []string{}
+	sharedLibDependency := commonProperties.Additional_shared_libraries
+	var headerLibs []string
+	var sdkVersion *string
+	var stl *string
+	var cpp_std *string
+	var hostSupported *bool
+	addCflags := commonProperties.Cflags
+	targetProp := ccTargetProperties{
+		Darwin: darwinProperties{Enabled: proptools.BoolPtr(false)},
+	}
+
+	if lang == langCpp {
+		importExportDependencies = append(importExportDependencies, "libbinder", "libutils")
+		if genTrace {
+			sharedLibDependency = append(sharedLibDependency, "libcutils")
+		}
+		hostSupported = i.properties.Host_supported
+	} else if lang == langNdk || lang == langNdkPlatform {
+		importExportDependencies = append(importExportDependencies, "libbinder_ndk")
+		nonAppProps := imageProperties{
+			Cflags: []string{"-DBINDER_STABILITY_SUPPORT"},
+		}
+		if genTrace {
+			sharedLibDependency = append(sharedLibDependency, "libandroid")
+			nonAppProps.Exclude_shared_libs = []string{"libandroid"}
+			nonAppProps.Header_libs = []string{"libandroid_aidltrace"}
+			nonAppProps.Shared_libs = []string{"libcutils"}
+		}
+		targetProp.Platform = nonAppProps
+		targetProp.Vendor = nonAppProps
+		targetProp.Product = nonAppProps
+		hostSupported = i.properties.Host_supported
+		if lang == langNdk && i.shouldGenerateAppNdkBackend() {
+			sdkVersion = i.properties.Backend.Ndk.Sdk_version
+			if sdkVersion == nil {
+				sdkVersion = proptools.StringPtr("current")
+			}
+
+			// Don't worry! This maps to libc++.so for the platform variant.
+			stl = proptools.StringPtr("c++_shared")
+		}
+	} else {
+		panic("Unrecognized language: " + lang)
+	}
+
+	vendorAvailable := i.properties.Vendor_available
+	odmAvailable := i.properties.Odm_available
+	productAvailable := i.properties.Product_available
+	recoveryAvailable := i.properties.Recovery_available
+	if lang == langCpp {
+		// Vendor and product modules cannot use the libbinder (cpp) backend of AIDL in a
+		// way that is stable. So, in order to prevent accidental usage of these library by
+		// vendor and product forcibly disabling this version of the library.
+		//
+		// It may be the case in the future that we will want to enable this (if some generic
+		// helper should be used by both libbinder vendor things using /dev/vndbinder as well
+		// as those things using /dev/binder + libbinder_ndk to talk to stable interfaces).
+		if "vintf" == proptools.String(i.properties.Stability) {
+			overrideVndkProperties.Vndk.Private = proptools.BoolPtr(true)
+		}
+		// As libbinder is not available for the product processes, we must not create
+		// product variant for the aidl_interface
+		productAvailable = nil
+	}
+
+	mctx.CreateModule(aidlImplementationGeneratorFactory, &nameProperties{
+		Name: proptools.StringPtr(cppModuleGen + "-generator"),
+	}, &aidlImplementationGeneratorProperties{
+		Lang:              lang,
+		AidlInterfaceName: i.ModuleBase.Name(),
+		Version:           version,
+		Imports:           i.getImportsForVersion(version),
+		ModuleProperties: []interface{}{
+			&ccProperties{
+				Name:                      proptools.StringPtr(cppModuleGen),
+				Vendor_available:          vendorAvailable,
+				Odm_available:             odmAvailable,
+				Product_available:         productAvailable,
+				Recovery_available:        recoveryAvailable,
+				Host_supported:            hostSupported,
+				Defaults:                  []string{"aidl-cpp-module-defaults"},
+				Double_loadable:           i.properties.Double_loadable,
+				Generated_sources:         []string{cppSourceGen},
+				Generated_headers:         []string{cppSourceGen},
+				Export_generated_headers:  []string{cppSourceGen},
+				Shared_libs:               append(importExportDependencies, sharedLibDependency...),
+				Header_libs:               headerLibs,
+				Export_shared_lib_headers: importExportDependencies,
+				Sdk_version:               sdkVersion,
+				Stl:                       stl,
+				Cpp_std:                   cpp_std,
+				Cflags:                    append(addCflags, "-Wextra", "-Wall", "-Werror", "-Wextra-semi"),
+				Apex_available:            commonProperties.Apex_available,
+				Min_sdk_version:           i.minSdkVersion(lang),
+				Target:                    targetProp,
+				Tidy:                      proptools.BoolPtr(true),
+				// Do the tidy check only for the generated headers
+				Tidy_flags: []string{"--header-filter=" + android.PathForOutput(mctx).String() + ".*"},
+				Tidy_checks_as_errors: []string{
+					"*",
+					"-clang-analyzer-deadcode.DeadStores", // b/253079031
+					"-clang-analyzer-cplusplus.NewDeleteLeaks",  // b/253079031
+					"-clang-analyzer-optin.performance.Padding", // b/253079031
+				},
+				Include_build_directory: proptools.BoolPtr(false), // b/254682497
+			}, &i.properties.VndkProperties,
+			&commonProperties.VndkProperties,
+			&overrideVndkProperties,
+			// the logic to create implementation libraries has been reimplemented
+			// in a Bazel macro, so these libraries should not be converted with
+			// bp2build
+			// TODO(b/237810289) perhaps do something different here so that we aren't
+			// also disabling these modules in mixed builds
+			&bazelProperties{
+				&Bazel_module{
+					Label:              cppLabel,
+					Bp2build_available: bp2buildAvailable,
+				},
+			},
+		},
+	})
+
+	return cppModuleGen
+}
+
+func addCppAnalyzerLibrary(mctx android.DefaultableHookContext, i *aidlInterface, version string, notFrozen bool, requireFrozenReason string) string {
+	cppAnalyzerSourceGen := i.versionedName("") + "-cpp-analyzer-source"
+	cppAnalyzerModuleGen := i.versionedName("") + "-cpp-analyzer"
+
+	srcs, aidlRoot := i.srcsForVersion(mctx, version)
+	if len(srcs) == 0 {
+		return ""
+	}
+
+	mctx.CreateModule(aidlGenFactory, &nameProperties{
+		Name: proptools.StringPtr(cppAnalyzerSourceGen),
+	}, &aidlGenProperties{
+		Srcs:                srcs,
+		AidlRoot:            aidlRoot,
+		Imports:             i.getImportsForVersion(version),
+		Stability:           i.properties.Stability,
+		Min_sdk_version:     i.minSdkVersion(langCpp),
+		Lang:                langCppAnalyzer,
+		BaseName:            i.ModuleBase.Name(),
+		Version:             i.versionForInitVersionCompat(version),
+		Unstable:            i.properties.Unstable,
+		NotFrozen:           notFrozen,
+		RequireFrozenReason: requireFrozenReason,
+		Flags:               i.flagsForAidlGenRule(version),
+	})
+
+	importExportDependencies := []string{}
+	var hostSupported *bool
+	var addCflags []string // not using cpp backend cflags for now
+	targetProp := ccTargetProperties{
+		Darwin: darwinProperties{Enabled: proptools.BoolPtr(false)},
+	}
+
+	importExportDependencies = append(importExportDependencies, "libbinder", "libutils")
+	hostSupported = i.properties.Host_supported
+
+	vendorAvailable := i.properties.Vendor_available
+	odmAvailable := i.properties.Odm_available
+	productAvailable := i.properties.Product_available
+	recoveryAvailable := i.properties.Recovery_available
+	productAvailable = nil
+
+	g := aidlImplementationGeneratorProperties{
+		ModuleProperties: []interface{}{
+			&ccProperties{
+				Name:                      proptools.StringPtr(cppAnalyzerModuleGen),
+				Vendor_available:          vendorAvailable,
+				Odm_available:             odmAvailable,
+				Product_available:         productAvailable,
+				Recovery_available:        recoveryAvailable,
+				Host_supported:            hostSupported,
+				Defaults:                  []string{"aidl-cpp-module-defaults"},
+				Double_loadable:           i.properties.Double_loadable,
+				Installable:               proptools.BoolPtr(true),
+				Generated_sources:         []string{cppAnalyzerSourceGen},
+				Generated_headers:         []string{cppAnalyzerSourceGen},
+				Export_generated_headers:  []string{cppAnalyzerSourceGen},
+				Shared_libs:               append(importExportDependencies, i.versionedName(version)+"-"+langCpp),
+				Static_libs:               []string{"aidl-analyzer-main"},
+				Export_shared_lib_headers: importExportDependencies,
+				Cflags:                    append(addCflags, "-Wextra", "-Wall", "-Werror", "-Wextra-semi"),
+				Min_sdk_version:           i.minSdkVersion(langCpp),
+				Target:                    targetProp,
+				Tidy:                      proptools.BoolPtr(true),
+				// Do the tidy check only for the generated headers
+				Tidy_flags: []string{"--header-filter=" + android.PathForOutput(mctx).String() + ".*"},
+				Tidy_checks_as_errors: []string{
+					"*",
+					"-clang-diagnostic-deprecated-declarations", // b/253081572
+					"-clang-analyzer-deadcode.DeadStores",       // b/253079031
+					"-clang-analyzer-cplusplus.NewDeleteLeaks",  // b/253079031
+					"-clang-analyzer-optin.performance.Padding", // b/253079031
+				},
+			},
+			// TODO(b/237810289) disable converting -cpp-analyzer module in bp2build
+			&bazelProperties{
+				&Bazel_module{
+					Bp2build_available: proptools.BoolPtr(false),
+				},
+			},
+		},
+	}
+
+	mctx.CreateModule(wrapLibraryFactory(cc.BinaryFactory), g.ModuleProperties...)
+	return cppAnalyzerModuleGen
+}
+
+func addJavaLibrary(mctx android.DefaultableHookContext, i *aidlInterface, version string, notFrozen bool, requireFrozenReason string, bp2build bool) string {
+	javaSourceGen := i.versionedName(version) + "-java-source"
+	javaModuleGen := i.versionedName(version) + "-java"
+	srcs, aidlRoot := i.srcsForVersion(mctx, version)
+	if len(srcs) == 0 {
+		// This can happen when the version is about to be frozen; the version
+		// directory is created but API dump hasn't been copied there.
+		// Don't create a library for the yet-to-be-frozen version.
+		return ""
+	}
+	minSdkVersion := i.minSdkVersion(langJava)
+	sdkVersion := i.properties.Backend.Java.Sdk_version
+	if !proptools.Bool(i.properties.Backend.Java.Platform_apis) && sdkVersion == nil {
+		// platform apis requires no default
+		sdkVersion = proptools.StringPtr("system_current")
+	}
+	// use sdkVersion if minSdkVersion is not set
+	if sdkVersion != nil && minSdkVersion == nil {
+		minSdkVersion = proptools.StringPtr(android.SdkSpecFrom(mctx, *sdkVersion).ApiLevel.String())
+	}
+
+	mctx.CreateModule(aidlGenFactory, &nameProperties{
+		Name: proptools.StringPtr(javaSourceGen),
+	}, &aidlGenProperties{
+		Srcs:                srcs,
+		AidlRoot:            aidlRoot,
+		Imports:             i.getImportsForVersion(version),
+		Headers:             i.properties.Headers,
+		Stability:           i.properties.Stability,
+		Min_sdk_version:     minSdkVersion,
+		Platform_apis:       proptools.Bool(i.properties.Backend.Java.Platform_apis),
+		Lang:                langJava,
+		BaseName:            i.ModuleBase.Name(),
+		Version:             version,
+		GenRpc:              proptools.Bool(i.properties.Backend.Java.Gen_rpc),
+		GenTrace:            i.genTrace(langJava),
+		Unstable:            i.properties.Unstable,
+		NotFrozen:           notFrozen,
+		RequireFrozenReason: requireFrozenReason,
+		Flags:               i.flagsForAidlGenRule(version),
+	})
+
+	var javaLabel *string
+	// TODO: b/285574832 - re-enable Java backend
+	if false && bp2build {
+		javaLabel = proptools.StringPtr(fmt.Sprintf("//%s:%s", mctx.ModuleDir(), javaModuleGen))
+	}
+
+	mctx.CreateModule(aidlImplementationGeneratorFactory, &nameProperties{
+		Name: proptools.StringPtr(javaModuleGen + "-generator"),
+	}, &aidlImplementationGeneratorProperties{
+		Lang:              langJava,
+		AidlInterfaceName: i.ModuleBase.Name(),
+		Version:           version,
+		Imports:           i.getImportsForVersion(version),
+		ModuleProperties: []interface{}{
+			&javaProperties{
+				Name:            proptools.StringPtr(javaModuleGen),
+				Installable:     proptools.BoolPtr(true),
+				Defaults:        []string{"aidl-java-module-defaults"},
+				Sdk_version:     sdkVersion,
+				Platform_apis:   i.properties.Backend.Java.Platform_apis,
+				Srcs:            []string{":" + javaSourceGen},
+				Apex_available:  i.properties.Backend.Java.Apex_available,
+				Min_sdk_version: i.minSdkVersion(langJava),
+			},
+			&i.properties.Backend.Java.LintProperties,
+			// the logic to create implementation libraries has been reimplemented
+			// in a Bazel macro, so these libraries should not be converted with
+			// bp2build
+			// TODO(b/237810289) perhaps do something different here so that we aren't
+			// also disabling these modules in mixed builds
+			&bazelProperties{
+				&Bazel_module{
+					Label: javaLabel,
+				},
+			},
+		},
+	})
+
+	return javaModuleGen
+}
+
+func addRustLibrary(mctx android.DefaultableHookContext, i *aidlInterface, version string, notFrozen bool, requireFrozenReason string) string {
+	rustSourceGen := i.versionedName(version) + "-rust-source"
+	rustModuleGen := i.versionedName(version) + "-rust"
+	srcs, aidlRoot := i.srcsForVersion(mctx, version)
+	if len(srcs) == 0 {
+		// This can happen when the version is about to be frozen; the version
+		// directory is created but API dump hasn't been copied there.
+		// Don't create a library for the yet-to-be-frozen version.
+		return ""
+	}
+
+	mctx.CreateModule(aidlGenFactory, &nameProperties{
+		Name: proptools.StringPtr(rustSourceGen),
+	}, &aidlGenProperties{
+		Srcs:                srcs,
+		AidlRoot:            aidlRoot,
+		Imports:             i.getImportsForVersion(version),
+		Headers:             i.properties.Headers,
+		Stability:           i.properties.Stability,
+		Min_sdk_version:     i.minSdkVersion(langRust),
+		Lang:                langRust,
+		BaseName:            i.ModuleBase.Name(),
+		Version:             i.versionForInitVersionCompat(version),
+		Unstable:            i.properties.Unstable,
+		NotFrozen:           notFrozen,
+		RequireFrozenReason: requireFrozenReason,
+		Flags:               i.flagsForAidlGenRule(version),
+	})
+
+	versionedRustName := fixRustName(i.versionedName(version))
+	rustCrateName := fixRustName(i.ModuleBase.Name())
+
+	mctx.CreateModule(wrapLibraryFactory(aidlRustLibraryFactory), &rustProperties{
+		Name:              proptools.StringPtr(rustModuleGen),
+		Crate_name:        rustCrateName,
+		Stem:              proptools.StringPtr("lib" + versionedRustName),
+		Defaults:          []string{"aidl-rust-module-defaults"},
+		Host_supported:    i.properties.Host_supported,
+		Vendor_available:  i.properties.Vendor_available,
+		Product_available: i.properties.Product_available,
+		Apex_available:    i.properties.Backend.Rust.Apex_available,
+		Min_sdk_version:   i.minSdkVersion(langRust),
+		Target:            rustTargetProperties{Darwin: darwinProperties{Enabled: proptools.BoolPtr(false)}},
+		Rustlibs:          i.properties.Backend.Rust.Additional_rustlibs,
+	}, &rust.SourceProviderProperties{
+		Source_stem: proptools.StringPtr(versionedRustName),
+	}, &aidlRustSourceProviderProperties{
+		SourceGen:         rustSourceGen,
+		Imports:           i.getImportsForVersion(version),
+		Version:           version,
+		AidlInterfaceName: i.ModuleBase.Name(),
+	})
+
+	return rustModuleGen
+}
+
+// This function returns module name with version. Assume that there is foo of which latest version is 2
+// Version -> Module name
+// "1"->foo-V1
+// "2"->foo-V2
+// "3"->foo-V3
+// And assume that there is 'bar' which is an 'unstable' interface.
+// ""->bar
+func (i *aidlInterface) versionedName(version string) string {
+	name := i.ModuleBase.Name()
+	if version == "" {
+		return name
+	}
+	return name + "-V" + version
+}
+
+func (i *aidlInterface) srcsForVersion(mctx android.EarlyModuleContext, version string) (srcs []string, aidlRoot string) {
+	if version == i.nextVersion() {
+		return i.properties.Srcs, i.properties.Local_include_dir
+	} else {
+		aidlRoot = filepath.Join(aidlApiDir, i.ModuleBase.Name(), version)
+		full_paths, err := mctx.GlobWithDeps(filepath.Join(mctx.ModuleDir(), aidlRoot, "**/*.aidl"), nil)
+		if err != nil {
+			panic(err)
+		}
+		for _, path := range full_paths {
+			// Here, we need path local to the module
+			srcs = append(srcs, strings.TrimPrefix(path, mctx.ModuleDir()+"/"))
+		}
+		return srcs, aidlRoot
+	}
+}
+
+// For certain backend, avoid a difference between the initial version of a versioned
+// interface and an unversioned interface. This ensures that prebuilts can't prevent
+// an interface from switching from unversioned to versioned.
+func (i *aidlInterface) versionForInitVersionCompat(version string) string {
+	if !i.hasVersion() {
+		return ""
+	}
+	return version
+}
+
+func (i *aidlInterface) flagsForAidlGenRule(version string) (flags []string) {
+	// For the latest unfrozen version of an interface we turn on all warnings and use
+	// all flags supplied by the 'flags' field in the aidl_interface module
+	if version == i.nextVersion() && !i.isFrozen() {
+		flags = append(flags, "-Weverything -Wno-missing-permission-annotation")
+		flags = append(flags, i.properties.Flags...)
+	}
+	return
+}
+
+func (i *aidlInterface) isModuleForVndk(version string) bool {
+	if i.properties.Vndk_use_version != nil {
+		if !i.hasVersion() && version != *i.properties.Vndk_use_version {
+			panic("unrecognized vndk_use_version")
+		}
+		// Will be exactly one of the version numbers
+		return version == *i.properties.Vndk_use_version
+	}
+
+	// For an interface with no versions, this is the ToT interface.
+	if !i.hasVersion() {
+		return version == i.nextVersion()
+	}
+
+	return version == i.latestVersion()
+}
+
+// importing aidl_interface's version  | imported aidl_interface | imported aidl_interface's version
+// --------------------------------------------------------------------------------------------------
+// whatever                            | unstable                | unstable version
+// ToT version(including unstable)     | whatever                | ToT version(unstable if unstable)
+// otherwise                           | whatever                | the latest stable version
+// In the case that import specifies the version which it wants to use, use that version.
+func (i *aidlInterface) getImportWithVersion(version string, anImport string, other *aidlInterface) string {
+	if hasVersionSuffix(anImport) {
+		return anImport
+	}
+	if proptools.Bool(other.properties.Unstable) {
+		return anImport
+	}
+	if version == i.nextVersion() || !other.hasVersion() {
+		return other.versionedName(other.nextVersion())
+	}
+	return other.versionedName(other.latestVersion())
+}
+
+// Assuming that the context module has deps to its original aidl_interface and imported
+// aidl_interface modules with interfaceDepTag and importInterfaceDepTag, returns the list of
+// imported interfaces with versions.
+func getImportsWithVersion(ctx android.BaseMutatorContext, interfaceName, version string) []string {
+	i := ctx.GetDirectDepWithTag(interfaceName+aidlInterfaceSuffix, interfaceDep).(*aidlInterface)
+	var imports []string
+	ctx.VisitDirectDeps(func(dep android.Module) {
+		if tag, ok := ctx.OtherModuleDependencyTag(dep).(importInterfaceDepTag); ok {
+			other := dep.(*aidlInterface)
+			imports = append(imports, i.getImportWithVersion(version, tag.anImport, other))
+		}
+	})
+	return imports
+}
+
+func aidlImplementationGeneratorFactory() android.Module {
+	g := &aidlImplementationGenerator{}
+	g.AddProperties(&g.properties)
+	android.InitAndroidModule(g)
+	return g
+}
+
+type aidlImplementationGenerator struct {
+	android.ModuleBase
+	properties aidlImplementationGeneratorProperties
+}
+
+type aidlImplementationGeneratorProperties struct {
+	Lang              string
+	AidlInterfaceName string
+	Version           string
+	Imports           []string
+	ModuleProperties  []interface{}
+}
+
+func (g *aidlImplementationGenerator) DepsMutator(ctx android.BottomUpMutatorContext) {
+}
+
+func (g *aidlImplementationGenerator) GenerateAndroidBuildActions(ctx android.ModuleContext) {
+}
+
+func (g *aidlImplementationGenerator) GenerateImplementation(ctx android.TopDownMutatorContext) {
+	imports := wrap("", getImportsWithVersion(ctx, g.properties.AidlInterfaceName, g.properties.Version), "-"+g.properties.Lang)
+	if g.properties.Lang == langJava {
+		if p, ok := g.properties.ModuleProperties[0].(*javaProperties); ok {
+			p.Static_libs = imports
+		}
+		ctx.CreateModule(wrapLibraryFactory(java.LibraryFactory), g.properties.ModuleProperties...)
+	} else {
+		if p, ok := g.properties.ModuleProperties[0].(*ccProperties); ok {
+			p.Shared_libs = append(p.Shared_libs, imports...)
+			p.Export_shared_lib_headers = append(p.Export_shared_lib_headers, imports...)
+		}
+		module := ctx.CreateModule(wrapLibraryFactory(cc.LibraryFactory), g.properties.ModuleProperties...)
+		// AIDL-generated CC modules can't be used across system/vendor boundary. So marking it
+		// as MustUseVendorVariant. See build/soong/cc/config/vndk.go
+		module.(*cc.Module).Properties.MustUseVendorVariant = true
+	}
+}
diff --git a/build/aidl_interface_bp2build_test.go b/build/aidl_interface_bp2build_test.go
new file mode 100644
index 0000000..ac4be1c
--- /dev/null
+++ b/build/aidl_interface_bp2build_test.go
@@ -0,0 +1,561 @@
+package aidl
+
+import (
+	"testing"
+
+	"android/soong/aidl_library"
+	"android/soong/android"
+	"android/soong/bp2build"
+	"android/soong/cc"
+)
+
+func runAidlInterfaceTestCase(t *testing.T, tc bp2build.Bp2buildTestCase) {
+	t.Helper()
+	bp2build.RunBp2BuildTestCaseExtraContext(
+		t,
+		func(ctx android.RegistrationContext) {
+			ctx.RegisterModuleType("aidl_interface", AidlInterfaceFactory)
+			ctx.RegisterModuleType("aidl_library", aidl_library.AidlLibraryFactory)
+			ctx.RegisterModuleType("cc_library_shared", cc.LibrarySharedFactory)
+		},
+		func(ctx *android.TestContext) {
+			ctx.PreArchBp2BuildMutators(registerPreArchMutators)
+		},
+		tc,
+	)
+}
+
+func TestAidlInterface(t *testing.T) {
+	runAidlInterfaceTestCase(t, bp2build.Bp2buildTestCase{
+		Description: `aidl_interface with single "latest" aidl_interface import`,
+		Blueprint: `
+			aidl_library {
+				name: "aidl-interface-headers",
+			}
+			aidl_interface {
+				name: "aidl-interface-import",
+				versions: [
+					"1",
+					"2",
+				],
+			}
+			aidl_interface {
+				name: "aidl-interface1",
+				flags: ["-Wsomething"],
+				imports: [
+					"aidl-interface-import-V1",
+				],
+				headers: [
+					"aidl-interface-headers",
+				],
+				versions: [
+					"1",
+					"2",
+					"3",
+				],
+			}`,
+		ExpectedConvertedModules: []string{"aidl-interface1", "aidl-interface-headers", "aidl-interface-import"},
+		ExpectedBazelTargets: []string{
+			bp2build.MakeBazelTargetNoRestrictions("aidl_library", "aidl-interface-headers", bp2build.AttrNameToString{
+				"tags": `["apex_available=//apex_available:anyapex"]`,
+			}),
+			bp2build.MakeBazelTargetNoRestrictions("aidl_interface", "aidl-interface-import", bp2build.AttrNameToString{
+				"java_config": `{
+        "enabled": True,
+    }`,
+				"cpp_config": `{
+        "enabled": True,
+    }`,
+				"ndk_config": `{
+        "enabled": True,
+    }`,
+				"versions_with_info": `[
+        {
+        "version": "1",
+    },
+        {
+        "version": "2",
+    },
+    ]`,
+			}),
+			bp2build.MakeBazelTargetNoRestrictions("aidl_interface", "aidl-interface1", bp2build.AttrNameToString{
+				"java_config": `{
+        "enabled": True,
+    }`,
+				"cpp_config": `{
+        "enabled": True,
+    }`,
+				"ndk_config": `{
+        "enabled": True,
+    }`,
+				"hdrs":  `[":aidl-interface-headers"]`,
+				"flags": `["-Wsomething"]`,
+				"versions_with_info": `[
+        {
+        "deps": [":aidl-interface-import-V1"],
+        "version": "1",
+    },
+        {
+        "deps": [":aidl-interface-import-V1"],
+        "version": "2",
+    },
+        {
+        "deps": [":aidl-interface-import-V1"],
+        "version": "3",
+    },
+    ]`,
+			}),
+		},
+	})
+}
+
+func TestAidlInterfaceWithIncludeDirsNotGenerated(t *testing.T) {
+	runAidlInterfaceTestCase(t,
+		bp2build.Bp2buildTestCase{
+			Description: `aidl_interface with include_dirs property does not generate a Bazel target`,
+			Blueprint: `
+				aidl_interface {
+					name: "aidl-interface1",
+					include_dirs: ["dir1"],
+				}
+			`,
+			ExpectedBazelTargets: []string{},
+		},
+	)
+}
+
+func TestAidlInterfaceWithNoProperties(t *testing.T) {
+	runAidlInterfaceTestCase(t, bp2build.Bp2buildTestCase{
+		Description: `aidl_interface no properties set`,
+		Blueprint: `
+			aidl_interface {
+				name: "aidl-interface1",
+			}`,
+		ExpectedBazelTargets: []string{
+			bp2build.MakeBazelTargetNoRestrictions("aidl_interface", "aidl-interface1", bp2build.AttrNameToString{
+				"java_config": `{
+        "enabled": True,
+    }`,
+				"cpp_config": `{
+        "enabled": True,
+    }`,
+				"ndk_config": `{
+        "enabled": True,
+    }`,
+			}),
+		},
+	})
+}
+
+func TestAidlInterfaceWithDisabledBackends(t *testing.T) {
+	runAidlInterfaceTestCase(t, bp2build.Bp2buildTestCase{
+		Description: `aidl_interface with some backends disabled`,
+		Blueprint: `
+			aidl_interface {
+				name: "aidl-interface1",
+				backend: {
+					ndk: {
+						enabled: false,
+					},
+					cpp: {
+						enabled: false,
+					},
+				},
+			}`,
+		ExpectedBazelTargets: []string{
+			bp2build.MakeBazelTargetNoRestrictions("aidl_interface", "aidl-interface1", bp2build.AttrNameToString{
+				"java_config": `{
+        "enabled": True,
+    }`,
+			}),
+		},
+	})
+}
+
+func TestAidlInterfaceWithVersionImport(t *testing.T) {
+	runAidlInterfaceTestCase(t, bp2build.Bp2buildTestCase{
+		Description: `aidl_interface with version aidl_interface import`,
+		Blueprint: `
+			aidl_interface {
+				name: "aidl-interface-import",
+				versions: [
+					"1",
+					"2",
+				],
+			}
+			aidl_interface {
+				name: "aidl-interface1",
+				imports: [
+					"aidl-interface-import-V1",
+				],
+				versions: [
+					"1",
+					"2",
+					"3",
+				],
+			}`,
+		ExpectedConvertedModules:   []string{"aidl-interface-import", "aidl-interface1"},
+		ExpectedHandcraftedModules: []string{"aidl-interface1_interface"},
+		ExpectedBazelTargets: []string{
+			bp2build.MakeBazelTargetNoRestrictions("aidl_interface", "aidl-interface-import", bp2build.AttrNameToString{
+				"java_config": `{
+        "enabled": True,
+    }`,
+				"cpp_config": `{
+        "enabled": True,
+    }`,
+				"ndk_config": `{
+        "enabled": True,
+    }`,
+				"versions_with_info": `[
+        {
+        "version": "1",
+    },
+        {
+        "version": "2",
+    },
+    ]`,
+			}),
+			bp2build.MakeBazelTargetNoRestrictions("aidl_interface", "aidl-interface1", bp2build.AttrNameToString{
+				"java_config": `{
+        "enabled": True,
+    }`,
+				"cpp_config": `{
+        "enabled": True,
+    }`,
+				"ndk_config": `{
+        "enabled": True,
+    }`,
+				"versions_with_info": `[
+        {
+        "deps": [":aidl-interface-import-V1"],
+        "version": "1",
+    },
+        {
+        "deps": [":aidl-interface-import-V1"],
+        "version": "2",
+    },
+        {
+        "deps": [":aidl-interface-import-V1"],
+        "version": "3",
+    },
+    ]`,
+			}),
+		},
+	})
+}
+
+func TestAidlInterfaceWithVersionedImport(t *testing.T) {
+	runAidlInterfaceTestCase(t, bp2build.Bp2buildTestCase{
+		Description: `aidl_interface with single versioned aidl_interface import`,
+		Blueprint: `
+			aidl_interface {
+				name: "aidl-interface-import",
+				versions: [
+					"1",
+					"2",
+				],
+			}
+			aidl_interface {
+				name: "aidl-interface1",
+				imports: [
+					"aidl-interface-import-V2",
+				],
+				versions: [
+					"1",
+					"2",
+					"3",
+				],
+			}`,
+		ExpectedBazelTargets: []string{
+			bp2build.MakeBazelTargetNoRestrictions("aidl_interface", "aidl-interface-import", bp2build.AttrNameToString{
+				"java_config": `{
+        "enabled": True,
+    }`,
+				"cpp_config": `{
+        "enabled": True,
+    }`,
+				"ndk_config": `{
+        "enabled": True,
+    }`,
+				"versions_with_info": `[
+        {
+        "version": "1",
+    },
+        {
+        "version": "2",
+    },
+    ]`,
+			}),
+			bp2build.MakeBazelTargetNoRestrictions("aidl_interface", "aidl-interface1", bp2build.AttrNameToString{
+				"java_config": `{
+        "enabled": True,
+    }`,
+				"cpp_config": `{
+        "enabled": True,
+    }`,
+				"ndk_config": `{
+        "enabled": True,
+    }`,
+				"versions_with_info": `[
+        {
+        "deps": [":aidl-interface-import-V2"],
+        "version": "1",
+    },
+        {
+        "deps": [":aidl-interface-import-V2"],
+        "version": "2",
+    },
+        {
+        "deps": [":aidl-interface-import-V2"],
+        "version": "3",
+    },
+    ]`,
+			}),
+		},
+	})
+}
+
+func TestAidlInterfaceWithCppAndNdkConfigs(t *testing.T) {
+	runAidlInterfaceTestCase(t, bp2build.Bp2buildTestCase{
+		Description: `aidl_interface with cpp and ndk configs`,
+		Blueprint: `
+			aidl_interface {
+				name: "foo",
+                backend: {
+                    java: {
+                        enabled: false,
+                    },
+                    cpp: {
+                        min_sdk_version: "2",
+                    },
+                    ndk: {
+                        min_sdk_version: "1",
+                    },
+                }
+			}`,
+		ExpectedBazelTargets: []string{
+			bp2build.MakeBazelTargetNoRestrictions("aidl_interface", "foo", bp2build.AttrNameToString{
+				"cpp_config": `{
+        "enabled": True,
+        "min_sdk_version": "2",
+    }`,
+				"ndk_config": `{
+        "enabled": True,
+        "min_sdk_version": "1",
+    }`,
+			}),
+		},
+	})
+}
+
+func TestAidlInterfaceWithUnstablePropSet(t *testing.T) {
+	runAidlInterfaceTestCase(t, bp2build.Bp2buildTestCase{
+		Description: `aidl_interface with unstable prop set`,
+		Blueprint: `
+			aidl_interface {
+				name: "foo",
+				unstable: true,
+                backend: {
+                    java: {
+                        enabled: false,
+                    },
+                    cpp: {
+                        enabled: false,
+                    },
+                }
+			}`,
+		ExpectedBazelTargets: []string{
+			bp2build.MakeBazelTargetNoRestrictions("aidl_interface", "foo", bp2build.AttrNameToString{
+				"unstable": "True",
+				"ndk_config": `{
+        "enabled": True,
+    }`,
+			}),
+		},
+	})
+}
+
+func TestAidlInterfaceWithFrozenPropSet(t *testing.T) {
+	runAidlInterfaceTestCase(t, bp2build.Bp2buildTestCase{
+		Description: `aidl_interface with frozen prop set`,
+		Blueprint: `
+			aidl_interface {
+				name: "foo",
+				frozen: true,
+				versions: ["1"],
+                backend: {
+                    java: {
+                        enabled: false,
+                    },
+                    cpp: {
+                        enabled: false,
+                    },
+                }
+			}`,
+		ExpectedBazelTargets: []string{
+			bp2build.MakeBazelTargetNoRestrictions("aidl_interface", "foo", bp2build.AttrNameToString{
+				"frozen": "True",
+				"versions_with_info": `[{
+        "version": "1",
+    }]`,
+				"ndk_config": `{
+        "enabled": True,
+    }`,
+			}),
+		},
+	})
+}
+
+func TestAidlInterfaceWithApexAvailable(t *testing.T) {
+	runAidlInterfaceTestCase(t, bp2build.Bp2buildTestCase{
+		Description: `aidl_interface apex_available`,
+		Blueprint: `
+			aidl_interface {
+				name: "aidl-interface1",
+                backend: {
+                    java: {
+                        enabled: false,
+                    },
+                    cpp: {
+                        enabled: false,
+                    },
+                    ndk: {
+                        enabled: true,
+                        apex_available: [
+                            "com.android.abd",
+                            "//apex_available:platform",
+                        ],
+                    },
+                }
+			}`,
+		ExpectedBazelTargets: []string{
+			bp2build.MakeBazelTargetNoRestrictions("aidl_interface", "aidl-interface1", bp2build.AttrNameToString{
+				"ndk_config": `{
+        "enabled": True,
+        "tags": [
+            "apex_available=com.android.abd",
+            "apex_available=//apex_available:platform",
+        ],
+    }`,
+			}),
+		},
+	})
+}
+
+func TestAidlInterfaceWithAdditionalDynamicDeps(t *testing.T) {
+	runAidlInterfaceTestCase(t, bp2build.Bp2buildTestCase{
+		Description:             `aidl_interface apex_available`,
+		StubbedBuildDefinitions: []string{"shared_dep", "shared_stub_dep"},
+		Blueprint: `
+			cc_library_shared {
+				name: "shared_dep",
+			}
+			cc_library_shared {
+				name: "shared_stub_dep",
+				stubs: {
+				    symbol_file: "libnativewindow.map.txt",
+				    versions: ["29"],
+				},
+			}
+			aidl_interface {
+				name: "aidl-interface1",
+				backend: {
+					java: {
+						enabled: false,
+					},
+					cpp: {
+						enabled: true,
+						apex_available: ["com.android.myapex"],
+						additional_shared_libraries: [
+							"shared_dep",
+							"shared_stub_dep",
+						],
+					},
+					ndk: {
+						enabled: true,
+						apex_available: ["com.android.myapex"],
+						additional_shared_libraries: [
+							"shared_dep",
+							"shared_stub_dep",
+						],
+					},
+				}
+			}`,
+		ExpectedBazelTargets: []string{
+			bp2build.MakeBazelTargetNoRestrictions("aidl_interface", "aidl-interface1", bp2build.AttrNameToString{
+				"cpp_config": `{
+        "additional_dynamic_deps": [":shared_dep"] + select({
+            "//build/bazel/rules/apex:com.android.myapex": ["@api_surfaces//module-libapi/current:shared_stub_dep"],
+            "//conditions:default": [":shared_stub_dep"],
+        }),
+        "enabled": True,
+        "tags": ["apex_available=com.android.myapex"],
+    }`,
+				"ndk_config": `{
+        "additional_dynamic_deps": [":shared_dep"] + select({
+            "//build/bazel/rules/apex:com.android.myapex": ["@api_surfaces//module-libapi/current:shared_stub_dep"],
+            "//conditions:default": [":shared_stub_dep"],
+        }),
+        "enabled": True,
+        "tags": ["apex_available=com.android.myapex"],
+    }`,
+			}),
+		},
+	})
+}
+
+func TestAidlInterfaceWithCppBackend(t *testing.T) {
+	runAidlInterfaceTestCase(t, bp2build.Bp2buildTestCase{
+		Description: `aidl_interface apex_available`,
+		Blueprint: `
+			cc_library_shared {
+				name: "shared_dep",
+				bazel_module: {bp2build_available: false},
+			}
+			cc_library_shared {
+				name: "shared_stub_dep",
+				stubs: {
+				    symbol_file: "libnativewindow.map.txt",
+				    versions: ["29"],
+				},
+				bazel_module: {bp2build_available: false},
+			}
+			aidl_interface {
+				name: "aidl-interface1",
+				srcs: [
+					"IFoo.aidl",
+				],
+				backend: {
+					java: {
+						enabled: false,
+					},
+					cpp: {
+						enabled: true,
+						apex_available: ["com.android.myapex"],
+						additional_shared_libraries: [
+							"shared_dep",
+							"shared_stub_dep",
+						],
+					},
+					ndk: {
+						enabled: false,
+					},
+				}
+			}`,
+		ExpectedHandcraftedModules: []string{"aidl-interface1_interface", "aidl-interface1-V1-cpp"},
+		ExpectedBazelTargets: []string{
+			bp2build.MakeBazelTargetNoRestrictions("aidl_interface", "aidl-interface1", bp2build.AttrNameToString{
+				"cpp_config": `{
+        "additional_dynamic_deps": [":shared_dep"] + select({
+            "//build/bazel/rules/apex:com.android.myapex": ["@api_surfaces//module-libapi/current:shared_stub_dep"],
+            "//conditions:default": [":shared_stub_dep"],
+        }),
+        "enabled": True,
+        "tags": ["apex_available=com.android.myapex"],
+    }`,
+				"srcs": `["IFoo.aidl"]`,
+			}),
+		},
+	})
+}
diff --git a/build/aidl_interface_defaults.go b/build/aidl_interface_defaults.go
new file mode 100644
index 0000000..50d93e3
--- /dev/null
+++ b/build/aidl_interface_defaults.go
@@ -0,0 +1,32 @@
+package aidl
+
+import (
+	"android/soong/android"
+)
+
+func init() {
+	android.RegisterModuleType("aidl_interface_defaults", AidlInterfaceDefaultsFactory)
+}
+
+type Defaults struct {
+	android.ModuleBase
+	android.DefaultsModuleBase
+}
+
+func (d *Defaults) GenerateAndroidBuildActions(ctx android.ModuleContext) {
+}
+
+func (d *Defaults) DepsMutator(ctx android.BottomUpMutatorContext) {
+}
+
+func AidlInterfaceDefaultsFactory() android.Module {
+	module := &Defaults{}
+
+	module.AddProperties(
+		&aidlInterfaceProperties{},
+	)
+
+	android.InitDefaultsModule(module)
+
+	return module
+}
diff --git a/build/aidl_interface_metadata_singleton.go b/build/aidl_interface_metadata_singleton.go
new file mode 100644
index 0000000..ef3af3c
--- /dev/null
+++ b/build/aidl_interface_metadata_singleton.go
@@ -0,0 +1,175 @@
+// Copyright (C) 2021 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package aidl
+
+import (
+	"android/soong/android"
+
+	"fmt"
+	"strings"
+
+	"github.com/google/blueprint"
+	"github.com/google/blueprint/proptools"
+)
+
+var (
+	aidlMetadataRule = pctx.StaticRule("aidlMetadataRule", blueprint.RuleParams{
+		Command: `rm -f ${out} && { ` +
+			`echo '{' && ` +
+			`echo "\"name\": \"${name}\"," && ` +
+			`echo "\"stability\": \"${stability}\"," && ` +
+			`echo "\"types\": [${types}]," && ` +
+			`echo "\"hashes\": [${hashes}]," && ` +
+			`echo "\"has_development\": ${has_development}," && ` +
+			`echo "\"versions\": [${versions}]" && ` +
+			`echo '}' ` +
+			`;} >> ${out}`,
+		Description: "AIDL metadata: ${out}",
+	}, "name", "stability", "types", "hashes", "has_development", "versions")
+
+	joinJsonObjectsToArrayRule = pctx.StaticRule("joinJsonObjectsToArrayRule", blueprint.RuleParams{
+		Rspfile:        "$out.rsp",
+		RspfileContent: "$files",
+		Command: "rm -rf ${out} && " +
+			// Start the output array with an opening bracket.
+			"echo '[' >> ${out} && " +
+			// Append each input file and a comma to the output.
+			"for file in $$(cat ${out}.rsp); do " +
+			"cat $$file >> ${out}; echo ',' >> ${out}; " +
+			"done && " +
+			// Remove the last comma, replacing it with the closing bracket.
+			"sed -i '$$d' ${out} && echo ']' >> ${out}",
+		Description: "Joining JSON objects into array ${out}",
+	}, "files")
+)
+
+func init() {
+	android.RegisterModuleType("aidl_interfaces_metadata", aidlInterfacesMetadataSingletonFactory)
+}
+
+func aidlInterfacesMetadataSingletonFactory() android.Module {
+	i := &aidlInterfacesMetadataSingleton{}
+	android.InitAndroidModule(i)
+	return i
+}
+
+type aidlInterfacesMetadataSingleton struct {
+	android.ModuleBase
+
+	metadataPath android.WritablePath
+}
+
+var _ android.OutputFileProducer = (*aidlInterfacesMetadataSingleton)(nil)
+
+func (m *aidlInterfacesMetadataSingleton) GenerateAndroidBuildActions(ctx android.ModuleContext) {
+	if m.Name() != aidlMetadataSingletonName {
+		ctx.PropertyErrorf("name", "must be %s", aidlMetadataSingletonName)
+		return
+	}
+
+	type ModuleInfo struct {
+		Stability      string
+		ComputedTypes  []string
+		HashFiles      []string
+		HasDevelopment android.WritablePath
+		Versions       []string
+	}
+
+	// name -> ModuleInfo
+	moduleInfos := map[string]ModuleInfo{}
+	ctx.VisitDirectDeps(func(m android.Module) {
+		if !m.ExportedToMake() {
+			return
+		}
+
+		switch t := m.(type) {
+		case *aidlInterface:
+			info := moduleInfos[t.ModuleBase.Name()]
+			info.Stability = proptools.StringDefault(t.properties.Stability, "")
+			info.ComputedTypes = t.computedTypes
+			info.Versions = t.getVersions()
+			moduleInfos[t.ModuleBase.Name()] = info
+		case *aidlGenRule:
+			info := moduleInfos[t.properties.BaseName]
+			if t.hashFile != nil {
+				info.HashFiles = append(info.HashFiles, t.hashFile.String())
+			}
+			moduleInfos[t.properties.BaseName] = info
+		case *aidlApi:
+			info := moduleInfos[t.properties.BaseName]
+			info.HasDevelopment = t.hasDevelopment
+			moduleInfos[t.properties.BaseName] = info
+		}
+
+	})
+
+	var metadataOutputs android.Paths
+	for _, name := range android.SortedKeys(moduleInfos) {
+		info := moduleInfos[name]
+		metadataPath := android.PathForModuleOut(ctx, "metadata_"+name)
+		metadataOutputs = append(metadataOutputs, metadataPath)
+
+		// There is one aidlGenRule per-version per-backend. If we had
+		// objects per version and sub-objects per backend, we could
+		// avoid needing to filter out duplicates.
+		info.HashFiles = android.FirstUniqueStrings(info.HashFiles)
+		readHashes := ""
+		if len(info.HashFiles) > 0 {
+			readHashes = "$$(sed 's/.*/\"&\",/' " + strings.Join(info.HashFiles, " ") +
+				"| tr '\\n' ' ' | sed 's/, $$//')"
+		}
+
+		implicits := android.PathsForSource(ctx, info.HashFiles)
+		hasDevelopmentValue := "true"
+		if info.HasDevelopment != nil {
+			hasDevelopmentValue = "$$(if [ \"$$(cat " + info.HasDevelopment.String() +
+				")\" = \"1\" ]; then echo true; else echo false; fi)"
+		}
+
+		ctx.Build(pctx, android.BuildParams{
+			Rule:      aidlMetadataRule,
+			Implicits: implicits,
+			Input:     info.HasDevelopment,
+			Output:    metadataPath,
+			Args: map[string]string{
+				"name":            name,
+				"stability":       info.Stability,
+				"types":           strings.Join(wrap(`\"`, info.ComputedTypes, `\"`), ", "),
+				"hashes":          readHashes,
+				"has_development": hasDevelopmentValue,
+				"versions":        strings.Join(info.Versions, ", "),
+			},
+		})
+	}
+
+	m.metadataPath = android.PathForModuleOut(ctx, "aidl_metadata.json")
+
+	ctx.Build(pctx, android.BuildParams{
+		Rule:   joinJsonObjectsToArrayRule,
+		Inputs: metadataOutputs,
+		Output: m.metadataPath,
+		Args: map[string]string{
+			"files": strings.Join(metadataOutputs.Strings(), " "),
+		},
+	})
+}
+
+func (m *aidlInterfacesMetadataSingleton) OutputFiles(tag string) (android.Paths, error) {
+	if tag != "" {
+		return nil, fmt.Errorf("unsupported tag %q", tag)
+	}
+
+	return android.Paths{m.metadataPath}, nil
+}
diff --git a/build/aidl_rust_glue.py b/build/aidl_rust_glue.py
new file mode 100755
index 0000000..434a48d
--- /dev/null
+++ b/build/aidl_rust_glue.py
@@ -0,0 +1,105 @@
+#!/usr/bin/env python3
+
+#
+# Copyright (C) 2020 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import argparse
+import collections
+import os
+import pathlib
+import sys
+
+class RustModule:
+    def __init__(self):
+        self.files = []
+        self.nested = collections.defaultdict(RustModule)
+
+    def emit(self, output_file, indent=""):
+        for (input_name, input_path) in self.files:
+            output_file.write(indent)
+            output_file.write("pub mod %s {\n" % input_name)
+            # Copy the contents of the input file into the output
+            with open(input_path, "r") as input_file:
+                for l in input_file:
+                    output_file.write(indent)
+                    output_file.write("  ")
+                    output_file.write(l)
+
+            output_file.write(indent)
+            output_file.write("}\n")
+
+        for name, mod in self.nested.items():
+            output_file.write(indent)
+            output_file.write("pub mod %s {\n" % name)
+            mod.emit(output_file, indent + "  ")
+            output_file.write(indent)
+            output_file.write("}\n")
+
+    def emit_mangled(self, output_file, indent="", prefix=""):
+        for (input_name, _) in self.files:
+            output_file.write(indent)
+            output_file.write("pub use %s::%s::mangled::*;\n" % (prefix, input_name))
+        for name, mod in self.nested.items():
+            new_prefix = prefix + "::" + name
+            mod.emit_mangled(output_file, indent, prefix=new_prefix)
+
+def main(output, root, inputs, imports):
+  root_module = RustModule()
+  for inp in inputs:
+    in_rel = os.path.relpath(inp, root)
+    in_path = pathlib.PurePath(in_rel)
+
+    node = root_module
+    for part in in_path.parts[:-1]:
+        node = node.nested[part]
+
+    if os.path.isfile(inp):
+        in_name, in_ext = os.path.splitext(in_path.parts[-1])
+        node.files.append((in_name, inp))
+
+  with open(output, "w") as lib_rs_file:
+    lib_rs_file.write("#![allow(non_snake_case)]\n")
+    lib_rs_file.write("#![allow(missing_docs)]\n")
+    lib_rs_file.write("#[deprecated(note = \"Please access via libbinder_rs binder::\")]\n")
+    lib_rs_file.write("pub use binder;\n")
+
+    lib_rs_file.write("pub mod aidl {\n")
+    root_module.emit(lib_rs_file, indent="  ")
+    lib_rs_file.write("}\n")
+
+    lib_rs_file.write("pub mod mangled {\n")
+    root_module.emit_mangled(lib_rs_file, indent="  ", prefix="super::aidl")
+    for imp in imports:
+      lib_rs_file.write("  pub(crate) use %s::mangled::*;\n" % imp)
+    lib_rs_file.write("}\n")
+
+def execute():
+  parser = argparse.ArgumentParser(description='Generate the top-level lib.rs.',
+                                   fromfile_prefix_chars='@')
+  parser.add_argument('output', help='Path to output .rs file')
+  parser.add_argument('root', help='Common ancestor of all input files')
+  parser.add_argument('inputs', nargs='+', help='Input .rs files')
+  parser.add_argument('-I', '--import', action='append', dest='imports',
+                      default=[], help='Crates to import')
+
+  args = parser.parse_args()
+  if args is None:
+    sys.exit(1)
+
+  sys.exit(main(args.output, args.root, args.inputs, args.imports))
+
+if __name__ == "__main__":
+  execute()
diff --git a/build/aidl_rust_source_provider.go b/build/aidl_rust_source_provider.go
new file mode 100644
index 0000000..1b91600
--- /dev/null
+++ b/build/aidl_rust_source_provider.go
@@ -0,0 +1,125 @@
+// Copyright (C) 2021 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package aidl
+
+import (
+	"android/soong/android"
+	"android/soong/rust"
+
+	"strings"
+
+	"github.com/google/blueprint"
+	"github.com/google/blueprint/proptools"
+)
+
+var (
+	aidlRustGlueRule = pctx.StaticRule("aidlRustGlueRule", blueprint.RuleParams{
+		Command:     `${aidlRustGlueCmd} ${out} ${root} ${in} ${imports}`,
+		CommandDeps: []string{"${aidlRustGlueCmd}"},
+	}, "root", "imports")
+)
+
+type aidlRustSourceProviderProperties struct {
+	SourceGen         string `android:"path"`
+	Imports           []string
+	Version           string
+	AidlInterfaceName string
+}
+
+type aidlRustSourceProvider struct {
+	*rust.BaseSourceProvider
+
+	properties aidlRustSourceProviderProperties
+}
+
+var aidlRustSourceTag = struct {
+	blueprint.DependencyTag
+}{}
+
+func (sp *aidlRustSourceProvider) GenerateSource(ctx rust.ModuleContext, _ rust.PathDeps) android.Path {
+	sourceStem := proptools.String(sp.BaseSourceProvider.Properties.Source_stem)
+	topLevelOutputFile := android.PathForModuleOut(ctx, sourceStem+".rs")
+
+	aidlGenModule := ctx.GetDirectDepWithTag(sp.properties.SourceGen, aidlRustSourceTag)
+	// Find the gen directory for the source module
+	srcGenDir := aidlGenModule.(*aidlGenRule).genOutDir
+	srcPaths := aidlGenModule.(*aidlGenRule).genOutputs.Paths()
+
+	// In Rust, we import our dependency crates into `mangled`:
+	//   use dependency::mangled::*;
+	// so we can use the crate:: Rust path prefix to refer to
+	// both crate-local and imported paths (from dependencies)
+	importFlags := make([]string, len(sp.properties.Imports))
+	for i, dep := range trimVersionSuffixInList(sp.properties.Imports) {
+		importFlags[i] = "-I" + fixRustName(dep)
+	}
+
+	// In Rust, we need to do some extra post-processing:
+	// emit a top-level foo.rs that includes all the generated .rs
+	// files verbatim ("glued" together). The generated glue file
+	// replicates the AIDL package hierarchy from the input
+	// .aidl files in two ways:
+	//   * 1:1 mapping in the crate::aidl namespace, used by downstream users
+	//   * mangled in the crate::mangled namespace, used internally
+	//     to resolve AIDL package paths between dependencies
+	ctx.Build(pctx, android.BuildParams{
+		Rule:   aidlRustGlueRule,
+		Inputs: srcPaths,
+		Output: topLevelOutputFile,
+		Args: map[string]string{
+			"root":    srcGenDir.String(),
+			"imports": strings.Join(importFlags, " "),
+		},
+	})
+
+	sp.BaseSourceProvider.OutputFiles = android.Paths{topLevelOutputFile}
+	return topLevelOutputFile
+}
+
+func (sp *aidlRustSourceProvider) SourceProviderProps() []interface{} {
+	return append(sp.BaseSourceProvider.SourceProviderProps(),
+		&sp.properties)
+}
+
+func (sp *aidlRustSourceProvider) SourceProviderDeps(ctx rust.DepsContext, deps rust.Deps) rust.Deps {
+	deps = sp.BaseSourceProvider.SourceProviderDeps(ctx, deps)
+	deps.Rustlibs = append(deps.Rustlibs, "libbinder_rs", "liblazy_static")
+	deps.Rustlibs = append(deps.Rustlibs, wrap("", getImportsWithVersion(ctx, sp.properties.AidlInterfaceName, sp.properties.Version), "-"+langRust)...)
+	deps.ProcMacros = append(deps.ProcMacros, "libasync_trait")
+	// Add a depencency to the source module (*-rust-source) directly via `ctx` because
+	// the source module is specific to aidlRustSourceProvider and we don't want the rust module
+	// to know about it.
+	ctx.AddDependency(ctx.Module(), aidlRustSourceTag, sp.properties.SourceGen)
+
+	return deps
+}
+
+func (sp *aidlRustSourceProvider) AndroidMk(ctx rust.AndroidMkContext, ret *android.AndroidMkEntries) {
+	ctx.SubAndroidMk(ret, sp.BaseSourceProvider)
+	ret.ExtraEntries = append(ret.ExtraEntries,
+		func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
+			entries.SetBool("LOCAL_UNINSTALLABLE_MODULE", true)
+		})
+}
+
+func aidlRustLibraryFactory() android.Module {
+	sourceProvider := &aidlRustSourceProvider{
+		BaseSourceProvider: rust.NewSourceProvider(),
+		properties:         aidlRustSourceProviderProperties{},
+	}
+
+	module := rust.NewSourceProviderModule(android.HostAndDeviceSupported, sourceProvider, false, false)
+	return module.Init()
+}
diff --git a/build/aidl_test.go b/build/aidl_test.go
new file mode 100644
index 0000000..42d2489
--- /dev/null
+++ b/build/aidl_test.go
@@ -0,0 +1,2346 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package aidl
+
+import (
+	"fmt"
+	"os"
+	"path/filepath"
+	"strings"
+	"testing"
+
+	"github.com/google/blueprint"
+	"github.com/google/blueprint/proptools"
+
+	"android/soong/aidl_library"
+	"android/soong/android"
+	"android/soong/cc"
+	"android/soong/genrule"
+	"android/soong/java"
+	"android/soong/rust"
+)
+
+func TestMain(m *testing.M) {
+	os.Exit(m.Run())
+}
+
+func withFiles(files map[string][]byte) android.FixturePreparer {
+	return android.FixtureMergeMockFs(files)
+}
+
+func intPtr(v int) *int {
+	return &v
+}
+
+func setReleaseEnv() android.FixturePreparer {
+	return android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
+		variables.Release_aidl_use_unfrozen = proptools.BoolPtr(false)
+	})
+}
+
+func setTestFreezeEnv() android.FixturePreparer {
+	return android.FixtureMergeEnv(map[string]string{
+		"AIDL_FROZEN_REL":    "true",
+		"AIDL_FROZEN_OWNERS": "aosp test",
+	})
+}
+
+func setTransitiveFreezeEnv() android.FixturePreparer {
+	return android.FixtureMergeEnv(map[string]string{
+		"AIDL_TRANSITIVE_FREEZE": "true",
+	})
+}
+
+func _testAidl(t *testing.T, bp string, customizers ...android.FixturePreparer) android.FixturePreparer {
+	t.Helper()
+
+	preparers := []android.FixturePreparer{}
+
+	preparers = append(preparers,
+		cc.PrepareForTestWithCcDefaultModules,
+		java.PrepareForTestWithJavaDefaultModules,
+		genrule.PrepareForTestWithGenRuleBuildComponents,
+		android.PrepareForTestWithNamespace,
+	)
+
+	bp = bp + `
+		package {
+			default_visibility: ["//visibility:public"],
+		}
+		java_defaults {
+			name: "aidl-java-module-defaults",
+		}
+		cc_defaults {
+			name: "aidl-cpp-module-defaults",
+		}
+		rust_defaults {
+			name: "aidl-rust-module-defaults",
+		}
+		cc_library {
+			name: "libbinder",
+			recovery_available: true,
+		}
+		cc_library_static {
+			name: "aidl-analyzer-main",
+			host_supported: true,
+			vendor_available: true,
+			recovery_available: true,
+		}
+		cc_library {
+			name: "libutils",
+			recovery_available: true,
+		}
+		cc_library {
+			name: "libcutils",
+			recovery_available: true,
+		}
+		cc_library {
+			name: "libbinder_ndk",
+			recovery_available: true,
+			stubs: {
+				versions: ["29"],
+			}
+		}
+		ndk_library {
+			name: "libbinder_ndk",
+			symbol_file: "libbinder_ndk.map.txt",
+			first_version: "29",
+		}
+		cc_library {
+			name: "liblog",
+			no_libcrt: true,
+			nocrt: true,
+			system_shared_libs: [],
+		}
+		rust_library {
+			name: "libstd",
+			crate_name: "std",
+			srcs: [""],
+			no_stdlibs: true,
+			sysroot: true,
+		}
+		rust_library {
+			name: "libtest",
+			crate_name: "test",
+			srcs: [""],
+			no_stdlibs: true,
+			sysroot: true,
+		}
+		rust_library {
+			name: "liblazy_static",
+			crate_name: "lazy_static",
+			srcs: [""],
+		}
+		rust_library {
+			name: "libbinder_rs",
+			crate_name: "binder",
+			srcs: [""],
+		}
+		rust_proc_macro {
+			name: "libasync_trait",
+			crate_name: "async_trait",
+			srcs: [""],
+			no_stdlibs: true,
+		}
+	`
+	preparers = append(preparers, android.FixtureWithRootAndroidBp(bp))
+	preparers = append(preparers, android.FixtureAddTextFile("system/tools/aidl/build/Android.bp", `
+		aidl_interfaces_metadata {
+			name: "aidl_metadata_json",
+			visibility: ["//system/tools/aidl:__subpackages__"],
+		}
+	`))
+
+	preparers = append(preparers, android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
+		variables.Release_aidl_use_unfrozen = proptools.BoolPtr(true)
+	}))
+
+	preparers = append(preparers, customizers...)
+
+	preparers = append(preparers,
+		rust.PrepareForTestWithRustBuildComponents,
+		android.FixtureRegisterWithContext(func(ctx android.RegistrationContext) {
+			ctx.RegisterModuleType("aidl_interface", AidlInterfaceFactory)
+			ctx.RegisterModuleType("aidl_interface_defaults", AidlInterfaceDefaultsFactory)
+			ctx.RegisterModuleType("aidl_interfaces_metadata", aidlInterfacesMetadataSingletonFactory)
+			ctx.RegisterModuleType("rust_defaults", func() android.Module {
+				return rust.DefaultsFactory()
+			})
+			ctx.RegisterModuleType("aidl_library", aidl_library.AidlLibraryFactory)
+
+			ctx.PreArchMutators(registerPreArchMutators)
+			ctx.PostDepsMutators(registerPostDepsMutators)
+		}),
+	)
+
+	return android.GroupFixturePreparers(preparers...)
+}
+
+func testAidl(t *testing.T, bp string, customizers ...android.FixturePreparer) (*android.TestContext, android.Config) {
+	t.Helper()
+	preparer := _testAidl(t, bp, customizers...)
+	result := preparer.RunTest(t)
+	return result.TestContext, result.Config
+}
+
+func testAidlError(t *testing.T, pattern, bp string, customizers ...android.FixturePreparer) {
+	t.Helper()
+	preparer := _testAidl(t, bp, customizers...)
+	preparer.
+		ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern(pattern)).
+		RunTest(t)
+}
+
+// asserts that there are expected module regardless of variants
+func assertModulesExists(t *testing.T, ctx *android.TestContext, names ...string) {
+	t.Helper()
+	missing := []string{}
+	for _, name := range names {
+		variants := ctx.ModuleVariantsForTests(name)
+		if len(variants) == 0 {
+			missing = append(missing, name)
+		}
+	}
+	if len(missing) > 0 {
+		// find all the modules that do exist
+		allModuleNames := make(map[string]bool)
+		ctx.VisitAllModules(func(m blueprint.Module) {
+			allModuleNames[ctx.ModuleName(m)] = true
+		})
+		t.Errorf("expected modules(%v) not found. all modules: %v", missing, android.SortedKeys(allModuleNames))
+	}
+}
+
+func assertContains(t *testing.T, actual, expected string) {
+	t.Helper()
+	if !strings.Contains(actual, expected) {
+		t.Errorf("%q is not found in %q.", expected, actual)
+	}
+}
+
+func assertListContains(t *testing.T, actual []string, expected string) {
+	t.Helper()
+	for _, a := range actual {
+		if strings.Contains(a, expected) {
+			return
+		}
+	}
+	t.Errorf("%q is not found in %v.", expected, actual)
+}
+
+// Vintf module must have versions in release version
+func TestVintfWithoutVersionInRelease(t *testing.T) {
+	vintfWithoutVersionBp := `
+	aidl_interface {
+		name: "foo",
+		stability: "vintf",
+		srcs: [
+			"IFoo.aidl",
+		],
+		owner: "test",
+		backend: {
+			rust: {
+				enabled: true,
+			},
+		},
+	}`
+	expectedError := `module "foo_interface": versions: must be set \(need to be frozen\) because`
+	testAidlError(t, expectedError, vintfWithoutVersionBp, setTestFreezeEnv())
+
+	ctx, _ := testAidl(t, vintfWithoutVersionBp, setReleaseEnv())
+	assertModulesExists(t, ctx, "foo-V1-java", "foo-V1-rust", "foo-V1-cpp", "foo-V1-ndk")
+	ctx, _ = testAidl(t, vintfWithoutVersionBp)
+	assertModulesExists(t, ctx, "foo-V1-java", "foo-V1-rust", "foo-V1-cpp", "foo-V1-ndk")
+}
+
+// Check if using unstable version in release cause an error.
+func TestUnstableVersionUsageInRelease(t *testing.T) {
+	unstableVersionUsageInJavaBp := `
+	aidl_interface {
+		name: "foo",
+		versions: [
+			"1",
+		],
+		srcs: [
+			"IFoo.aidl",
+		],
+	}
+	java_library {
+		name: "bar",
+		libs: ["foo-V2-java"],
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+	})
+
+	expectedError := `foo-V2-java is an unfrozen development version, and it can't be used because`
+	testAidlError(t, expectedError, unstableVersionUsageInJavaBp, setTestFreezeEnv(), files)
+	testAidl(t, unstableVersionUsageInJavaBp, setReleaseEnv(), files)
+	testAidl(t, unstableVersionUsageInJavaBp, files)
+
+	// A stable version can be used in release version
+	stableVersionUsageInJavaBp := `
+	aidl_interface {
+		name: "foo",
+		versions: [
+			"1",
+		],
+		srcs: [
+			"IFoo.aidl",
+		],
+	}
+	java_library {
+		name: "bar",
+		libs: ["foo-V1-java"],
+	}`
+
+	testAidl(t, stableVersionUsageInJavaBp, setReleaseEnv(), files)
+	testAidl(t, stableVersionUsageInJavaBp, setTestFreezeEnv(), files)
+	testAidl(t, stableVersionUsageInJavaBp, files)
+}
+
+func TestUsingUnstableVersionIndirectlyInRelease(t *testing.T) {
+	unstableVersionUsageInJavaBp := `
+	aidl_interface {
+		name: "xxx",
+		srcs: ["IFoo.aidl"],
+		versions: ["1"],
+	}
+	aidl_interface {
+		name: "foo",
+		imports: ["xxx-V2"],    // not OK
+		versions: ["1"],
+		srcs: ["IFoo.aidl"],
+	}
+	java_library {
+		name: "bar",
+		libs: ["foo-V1-java"],  // OK
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+		"aidl_api/xxx/1/foo.1.aidl": nil,
+		"aidl_api/xxx/1/.hash":      nil,
+	})
+
+	expectedError := `xxx-V2-java is an unfrozen development version`
+	testAidlError(t, expectedError, unstableVersionUsageInJavaBp, setTestFreezeEnv(), files)
+	testAidl(t, unstableVersionUsageInJavaBp, setReleaseEnv(), files)
+	testAidl(t, unstableVersionUsageInJavaBp, files)
+}
+
+func TestFrozenTrueSimple(t *testing.T) {
+	frozenTest := `
+	aidl_interface {
+		name: "foo",
+		versions: ["1"],
+		frozen: true,
+		srcs: ["IFoo.aidl"],
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+	})
+
+	testAidl(t, frozenTest, files, setReleaseEnv())
+	testAidl(t, frozenTest, files, setTestFreezeEnv())
+	testAidl(t, frozenTest, files)
+}
+
+func TestFrozenWithNoVersions(t *testing.T) {
+	frozenTest := `
+	aidl_interface {
+		name: "foo",
+		frozen: true,
+		srcs: ["IFoo.aidl"],
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+	})
+
+	expectedError := `cannot be frozen without versions`
+	testAidlError(t, expectedError, frozenTest, files, setReleaseEnv())
+	testAidlError(t, expectedError, frozenTest, files, setTestFreezeEnv())
+	testAidlError(t, expectedError, frozenTest, files)
+}
+
+func TestFrozenImportingFrozen(t *testing.T) {
+	frozenTest := `
+	aidl_interface {
+		name: "xxx",
+		srcs: ["IFoo.aidl"],
+		frozen: true,
+		versions: ["1"],
+	}
+	aidl_interface {
+		name: "foo",
+		imports: ["xxx-V1"],
+		versions: ["1"],
+		frozen: true,
+		srcs: ["IFoo.aidl"],
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+		"aidl_api/xxx/1/foo.1.aidl": nil,
+		"aidl_api/xxx/1/.hash":      nil,
+	})
+
+	testAidl(t, frozenTest, files, setReleaseEnv())
+	testAidl(t, frozenTest, files, setTestFreezeEnv())
+	testAidl(t, frozenTest, files)
+}
+
+func TestFrozenImportingVersionUnfrozen(t *testing.T) {
+	frozenTest := `
+	aidl_interface {
+		name: "xxx",
+		srcs: ["IFoo.aidl"],
+		frozen: false,
+		versions: ["1"],
+	}
+	aidl_interface {
+		name: "foo",
+		imports: ["xxx-V1"],
+		versions: ["1"],
+		frozen: true,
+		srcs: ["IFoo.aidl"],
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+		"aidl_api/xxx/1/foo.1.aidl": nil,
+		"aidl_api/xxx/1/.hash":      nil,
+	})
+
+	testAidl(t, frozenTest, files, setReleaseEnv())
+	testAidl(t, frozenTest, files, setTestFreezeEnv())
+	testAidl(t, frozenTest, files)
+}
+
+func TestFrozenImportingUnfrozenWithFrozen(t *testing.T) {
+	frozenTest := `
+	aidl_interface {
+		name: "xxx",
+		srcs: ["IFoo.aidl"],
+		frozen: false,
+		versions: ["1"],
+	}
+	aidl_interface {
+		name: "foo",
+		imports: ["xxx"],
+		versions: ["1"],
+		frozen: true,
+		srcs: ["IFoo.aidl"],
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+		"aidl_api/xxx/1/foo.1.aidl": nil,
+		"aidl_api/xxx/1/.hash":      nil,
+	})
+
+	expectedError := `"foo" imports "xxx" which is not frozen. Either "foo" must`
+	testAidlError(t, expectedError, frozenTest, files, setReleaseEnv())
+	testAidlError(t, expectedError, frozenTest, files, setTestFreezeEnv())
+	testAidlError(t, expectedError, frozenTest, files)
+}
+
+func TestFrozenImportingUnfrozen(t *testing.T) {
+	frozenTest := `
+	aidl_interface {
+		name: "xxx",
+		srcs: ["IFoo.aidl"],
+		owner: "test",
+		frozen: false,
+	}
+	aidl_interface {
+		name: "foo",
+		imports: ["xxx"],
+		versions: ["1"],
+		frozen: true,
+		srcs: ["IFoo.aidl"],
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+		"aidl_api/xxx/1/foo.1.aidl": nil,
+		"aidl_api/xxx/1/.hash":      nil,
+	})
+
+	expectedError := `versions: must be set \(need to be frozen\) because`
+	testAidlError(t, expectedError, frozenTest, files, setTestFreezeEnv())
+
+	expectedError = `"foo" imports "xxx" which is not frozen. Either "foo" must`
+	testAidlError(t, expectedError, frozenTest, files, setReleaseEnv())
+	testAidlError(t, expectedError, frozenTest, files)
+}
+
+// This is allowed to keep legacy behavior. It could be prevented directly after API-freeze
+// if all frozen interfaces are explicitly marked `frozen: true,`.
+func TestFrozenImportingUnSpecified(t *testing.T) {
+	frozenTrueSimple := `
+	aidl_interface {
+		name: "xxx",
+		srcs: ["IFoo.aidl"],
+		versions: ["1"],
+	}
+	aidl_interface {
+		name: "foo",
+		imports: ["xxx-V1"],
+		versions: ["1"],
+		frozen: true,
+		srcs: ["IFoo.aidl"],
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+		"aidl_api/xxx/1/foo.1.aidl": nil,
+		"aidl_api/xxx/1/.hash":      nil,
+	})
+
+	testAidl(t, frozenTrueSimple, files, setReleaseEnv())
+	testAidl(t, frozenTrueSimple, files, setTestFreezeEnv())
+	testAidl(t, frozenTrueSimple, files)
+}
+
+// Keeping legacy behavior if "frozen" is not specified
+func TestImportingNewLegacy(t *testing.T) {
+	frozenTest := `
+	aidl_interface {
+		name: "xxx",
+		srcs: ["IFoo.aidl"],
+		versions: ["1"],
+	}
+	aidl_interface {
+		name: "foo",
+		imports: ["xxx-V2"],
+		versions_with_info: [
+			{version: "1", imports: ["xxx-V1"]},
+		],
+		srcs: ["IFoo.aidl"],
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+		"aidl_api/xxx/1/foo.1.aidl": nil,
+		"aidl_api/xxx/1/.hash":      nil,
+	})
+
+	testAidl(t, frozenTest, files, setReleaseEnv())
+	testAidl(t, frozenTest, files, setTestFreezeEnv())
+	testAidl(t, frozenTest, files)
+}
+
+// We don't have a way to know if if "xxx" has changes to it and will
+// need a new version without the "frozen" attribute. So we keep the
+// legacy behavior and assume "foo" is still importing the old version.
+func TestFrozenImportingNewLegacy(t *testing.T) {
+	frozenTest := `
+	aidl_interface {
+		name: "xxx",
+		srcs: ["IFoo.aidl"],
+		versions: ["1"],
+	}
+	aidl_interface {
+		name: "foo",
+		imports: ["xxx-V1"],
+		frozen: true,
+		versions_with_info: [
+			{version: "1", imports: ["xxx-V1"]},
+		],
+		srcs: ["IFoo.aidl"],
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+		"aidl_api/xxx/1/foo.1.aidl": nil,
+		"aidl_api/xxx/1/.hash":      nil,
+	})
+
+	testAidl(t, frozenTest, files, setReleaseEnv())
+	testAidl(t, frozenTest, files, setTestFreezeEnv())
+	testAidl(t, frozenTest, files)
+}
+
+func TestFrozenImportingNewImplicit(t *testing.T) {
+	frozenTest := `
+	aidl_interface {
+		name: "xxx",
+		srcs: ["IFoo.aidl"],
+		frozen: false,
+		versions: ["1"],
+	}
+	aidl_interface {
+		name: "foo",
+		imports: ["xxx"],
+		frozen: true,
+		versions_with_info: [
+			{version: "1", imports: ["xxx-V1"]},
+		],
+		srcs: ["IFoo.aidl"],
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+		"aidl_api/xxx/1/foo.1.aidl": nil,
+		"aidl_api/xxx/1/.hash":      nil,
+	})
+
+	expectedError := `"foo" imports "xxx" which is not frozen. Either "foo" must`
+	testAidlError(t, expectedError, frozenTest, files, setReleaseEnv())
+	testAidlError(t, expectedError, frozenTest, files, setTestFreezeEnv())
+	testAidlError(t, expectedError, frozenTest, files)
+}
+
+func TestImportingOwned(t *testing.T) {
+	frozenTest := `
+	aidl_interface {
+		name: "xxx",
+		srcs: ["IFoo.aidl"],
+		owner: "unknown-owner",
+		frozen: false,
+	}
+	aidl_interface {
+		name: "foo",
+		imports: ["xxx-V1"],
+		frozen: false,
+		versions_with_info: [
+			{version: "1", imports: []},
+		],
+		srcs: ["IFoo.aidl"],
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+	})
+
+	expectedError := "Android.bp:10:10: module \"foo_interface\": imports: \"foo\" imports \"xxx\" which is an interface owned by \"unknown-owner\". This is not allowed because the owned interface will not be frozen at the same time."
+	testAidlError(t, expectedError, frozenTest, files, setReleaseEnv())
+	testAidlError(t, expectedError, frozenTest, files, setTestFreezeEnv())
+	testAidlError(t, expectedError, frozenTest, files)
+}
+
+func TestImportingOwnedBothOwned(t *testing.T) {
+	frozenTest := `
+	aidl_interface {
+		name: "xxx",
+		srcs: ["IFoo.aidl"],
+		owner: "unknown-owner",
+		frozen: false,
+	}
+	aidl_interface {
+		name: "foo",
+		imports: ["xxx-V1"],
+		frozen: false,
+		versions_with_info: [
+			{version: "1", imports: []},
+		],
+		srcs: ["IFoo.aidl"],
+		owner: "unknown-owner-any",
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+	})
+
+	testAidl(t, frozenTest, files, setReleaseEnv())
+	testAidl(t, frozenTest, files, setTestFreezeEnv())
+	testAidl(t, frozenTest, files)
+}
+
+func TestFrozenImportingNewExplicit(t *testing.T) {
+	frozenTest := `
+	aidl_interface {
+		name: "xxx",
+		srcs: ["IFoo.aidl"],
+		frozen: false,
+		versions: ["1"],
+	}
+	aidl_interface {
+		name: "foo",
+		imports: ["xxx-V2"],
+		frozen: true,
+		versions_with_info: [
+			{version: "1", imports: ["xxx-V1"]},
+		],
+		srcs: ["IFoo.aidl"],
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+		"aidl_api/xxx/1/foo.1.aidl": nil,
+		"aidl_api/xxx/1/.hash":      nil,
+	})
+
+	expectedError := "This interface is 'frozen: true' but the imports have changed. Set 'frozen: false' to allow changes: \\n Version current imports: map\\[xxx:2\\]\\n Version 1 imports: map\\[xxx:1\\]\\n"
+	testAidlError(t, expectedError, frozenTest, files, setReleaseEnv())
+	testAidlError(t, expectedError, frozenTest, files, setTestFreezeEnv())
+	testAidlError(t, expectedError, frozenTest, files)
+}
+
+func TestNonFrozenImportingNewImplicit(t *testing.T) {
+	frozenTest := `
+	aidl_interface {
+		name: "xxx",
+		srcs: ["IFoo.aidl"],
+		frozen: false,
+		versions: ["1"],
+	}
+	aidl_interface {
+		name: "foo",
+		imports: ["xxx-V1"],
+		frozen: false,
+		versions_with_info: [
+			{version: "1", imports: ["xxx-V1"]},
+		],
+		srcs: ["IFoo.aidl"],
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+		"aidl_api/xxx/1/foo.1.aidl": nil,
+		"aidl_api/xxx/1/.hash":      nil,
+	})
+
+	testAidl(t, frozenTest, files, setReleaseEnv())
+	testAidl(t, frozenTest, files, setTestFreezeEnv())
+	testAidl(t, frozenTest, files)
+}
+
+// The module which has never been frozen and is not "unstable" is not allowed in release version.
+func TestNonVersionedModuleUsageInRelease(t *testing.T) {
+	nonVersionedModuleUsageInJavaBp := `
+	aidl_interface {
+		name: "foo",
+		srcs: [
+			"IFoo.aidl",
+		],
+		owner: "test",
+	}
+
+	java_library {
+		name: "bar",
+		libs: ["foo-V1-java"],
+	}`
+
+	expectedError := `"foo_interface": versions: must be set \(need to be frozen\) because`
+	testAidlError(t, expectedError, nonVersionedModuleUsageInJavaBp, setTestFreezeEnv())
+	testAidl(t, nonVersionedModuleUsageInJavaBp, setReleaseEnv())
+	testAidl(t, nonVersionedModuleUsageInJavaBp)
+
+	nonVersionedUnstableModuleUsageInJavaBp := `
+	aidl_interface {
+		name: "foo",
+		srcs: [
+			"IFoo.aidl",
+		],
+		unstable: true,
+	}
+
+	java_library {
+		name: "bar",
+		libs: ["foo-java"],
+	}`
+
+	testAidl(t, nonVersionedUnstableModuleUsageInJavaBp, setReleaseEnv())
+	testAidl(t, nonVersionedUnstableModuleUsageInJavaBp, setTestFreezeEnv())
+	testAidl(t, nonVersionedUnstableModuleUsageInJavaBp)
+}
+
+func TestNonVersionedModuleOwnedByTestUsageInRelease(t *testing.T) {
+	nonVersionedModuleUsageInJavaBp := `
+	aidl_interface {
+		name: "foo",
+		owner: "test",
+		srcs: [
+			"IFoo.aidl",
+		],
+	}
+
+	java_library {
+		name: "bar",
+		libs: ["foo-V1-java"],
+	}`
+
+	expectedError := `"foo_interface": versions: must be set \(need to be frozen\) because`
+	testAidl(t, nonVersionedModuleUsageInJavaBp, setReleaseEnv())
+	testAidlError(t, expectedError, nonVersionedModuleUsageInJavaBp, setTestFreezeEnv())
+	testAidl(t, nonVersionedModuleUsageInJavaBp)
+}
+
+func TestNonVersionedModuleOwnedByOtherUsageInRelease(t *testing.T) {
+	nonVersionedModuleUsageInJavaBp := `
+	aidl_interface {
+		name: "foo",
+		owner: "unknown-owner",
+		srcs: [
+			"IFoo.aidl",
+		],
+	}
+
+	java_library {
+		name: "bar",
+		libs: ["foo-V1-java"],
+	}`
+
+	testAidl(t, nonVersionedModuleUsageInJavaBp, setReleaseEnv())
+	testAidl(t, nonVersionedModuleUsageInJavaBp, setTestFreezeEnv())
+	testAidl(t, nonVersionedModuleUsageInJavaBp)
+}
+
+func TestImportInRelease(t *testing.T) {
+	importInRelease := `
+	aidl_interface {
+		name: "foo",
+		srcs: [
+			"IFoo.aidl",
+		],
+		imports: ["bar-V1"],
+		versions: ["1"],
+	}
+
+	aidl_interface {
+		name: "bar",
+		srcs: [
+			"IBar.aidl",
+		],
+		versions: ["1"],
+	}
+	`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+		"aidl_api/bar/1/bar.1.aidl": nil,
+		"aidl_api/bar/1/.hash":      nil,
+	})
+
+	testAidl(t, importInRelease, setReleaseEnv(), files)
+	testAidl(t, importInRelease, setTestFreezeEnv(), files)
+	testAidl(t, importInRelease, files)
+}
+
+func TestUnstableVersionedModuleUsageInRelease(t *testing.T) {
+	nonVersionedModuleUsageInJavaBp := `
+	aidl_interface {
+		name: "foo",
+		srcs: [
+			"IFoo.aidl",
+		],
+		versions: ["1"],
+	}
+
+	java_library {
+		name: "bar",
+		libs: ["foo-V2-java"],
+	}`
+
+	expectedError := `module \"bar\" variant \"android_common\": foo-V2-java is an unfrozen development version`
+	testAidlError(t, expectedError, nonVersionedModuleUsageInJavaBp, setTestFreezeEnv())
+	testAidl(t, nonVersionedModuleUsageInJavaBp, withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+	}), setReleaseEnv())
+	testAidl(t, nonVersionedModuleUsageInJavaBp, withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+	}))
+}
+
+func TestUnstableVersionedModuleOwnedByTestUsageInRelease(t *testing.T) {
+	nonVersionedModuleUsageInJavaBp := `
+	aidl_interface {
+		name: "foo",
+		owner: "test",
+		srcs: [
+			"IFoo.aidl",
+		],
+		versions: ["1"],
+	}
+
+	java_library {
+		name: "bar",
+		libs: ["foo-V2-java"],
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+	})
+
+	expectedError := `Android.bp:11:2: module \"bar\" variant \"android_common\": foo-V2-java is an unfrozen development version`
+	testAidl(t, nonVersionedModuleUsageInJavaBp, setReleaseEnv(), files)
+	testAidlError(t, expectedError, nonVersionedModuleUsageInJavaBp, setTestFreezeEnv(), files)
+	testAidl(t, nonVersionedModuleUsageInJavaBp, files)
+}
+
+func TestFrozenModuleUsageInAllEnvs(t *testing.T) {
+	bp := `
+	aidl_interface {
+		name: "foo",
+        frozen: true,
+		srcs: [
+			"IFoo.aidl",
+		],
+		versions: ["1"],
+	}
+
+	java_library {
+		name: "bar",
+		libs: ["foo-V2-java"],
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+	})
+
+	expectedError := `Android.bp:11:2: module \"bar\" variant \"android_common\": foo-V2-java is an unfrozen development version`
+	testAidlError(t, expectedError, bp, setReleaseEnv(), files)
+	testAidlError(t, expectedError, bp, setTestFreezeEnv(), files)
+	testAidlError(t, expectedError, bp, files)
+}
+
+func TestUnstableVersionedModuleOwnedByOtherUsageInRelease(t *testing.T) {
+	nonVersionedModuleUsageInJavaBp := `
+	aidl_interface {
+		name: "foo",
+		owner: "unknown-owner",
+		srcs: [
+			"IFoo.aidl",
+		],
+		versions: ["1"],
+	}
+
+	java_library {
+		name: "bar",
+		libs: ["foo-V2-java"],
+	}`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+	})
+
+	testAidl(t, nonVersionedModuleUsageInJavaBp, setReleaseEnv(), files)
+	testAidl(t, nonVersionedModuleUsageInJavaBp, setTestFreezeEnv(), files)
+	testAidl(t, nonVersionedModuleUsageInJavaBp, files)
+}
+
+func TestUnstableModules(t *testing.T) {
+	testAidlError(t, `module "foo_interface": stability: must be empty when "unstable" is true`, `
+		aidl_interface {
+			name: "foo",
+			stability: "vintf",
+			unstable: true,
+			srcs: [
+				"IFoo.aidl",
+			],
+			backend: {
+				rust: {
+					enabled: true,
+				},
+			},
+		}
+	`)
+
+	testAidlError(t, `module "foo_interface": versions: cannot have versions for an unstable interface`, `
+		aidl_interface {
+			name: "foo",
+			versions: [
+				"1",
+			],
+			unstable: true,
+			srcs: [
+				"IFoo.aidl",
+			],
+			backend: {
+				rust: {
+					enabled: true,
+				},
+			},
+		}
+	`)
+
+	ctx, _ := testAidl(t, `
+		aidl_interface {
+			name: "foo",
+			unstable: true,
+			srcs: [
+				"IFoo.aidl",
+			],
+			backend: {
+				rust: {
+					enabled: true,
+				},
+			},
+		}
+	`)
+
+	assertModulesExists(t, ctx, "foo-java", "foo-rust", "foo-cpp", "foo-ndk")
+}
+
+func TestCreatesModulesWithNoVersions(t *testing.T) {
+	ctx, _ := testAidl(t, `
+		aidl_interface {
+			name: "foo",
+			srcs: [
+				"IFoo.aidl",
+			],
+			backend: {
+				rust: {
+					enabled: true,
+				},
+			},
+		}
+	`)
+
+	assertModulesExists(t, ctx, "foo-V1-java", "foo-V1-rust", "foo-V1-cpp", "foo-V1-ndk")
+}
+
+func TestCreatesModulesWithFrozenVersions(t *testing.T) {
+	// Each version should be under aidl_api/<name>/<ver>
+	testAidlError(t, `No sources for a previous version in aidl_api/foo/1. Was a version manually added to .bp file?`, `
+		aidl_interface {
+			name: "foo",
+			srcs: [
+				"IFoo.aidl",
+			],
+			versions: [
+				"1",
+			],
+			backend: {
+				rust: {
+					enabled: true,
+				},
+			},
+		}
+	`)
+
+	ctx, _ := testAidl(t, `
+		aidl_interface {
+			name: "foo",
+			srcs: [
+				"IFoo.aidl",
+			],
+			versions: [
+				"1",
+			],
+			backend: {
+				rust: {
+					enabled: true,
+				},
+			},
+		}
+	`, withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+	}))
+
+	// For frozen version "1"
+	assertModulesExists(t, ctx, "foo-V1-java", "foo-V1-rust", "foo-V1-cpp", "foo-V1-ndk")
+
+	// For ToT (current)
+	assertModulesExists(t, ctx, "foo-V2-java", "foo-V2-rust", "foo-V2-cpp", "foo-V2-ndk")
+}
+
+func TestErrorsWithUnsortedVersions(t *testing.T) {
+	testAidlError(t, `versions: should be sorted`, `
+		aidl_interface {
+			name: "foo",
+			srcs: [
+				"IFoo.aidl",
+			],
+			versions: [
+				"2",
+				"1",
+			],
+			backend: {
+				rust: {
+					enabled: true,
+				},
+			},
+		}
+	`)
+}
+
+func TestErrorsWithDuplicateVersions(t *testing.T) {
+	testAidlError(t, `versions: duplicate`, `
+		aidl_interface {
+			name: "foo",
+			srcs: [
+				"IFoo.aidl",
+			],
+			versions: [
+				"1",
+				"1",
+			],
+		}
+	`)
+}
+
+func TestErrorsWithNonPositiveVersions(t *testing.T) {
+	testAidlError(t, `versions: should be > 0`, `
+		aidl_interface {
+			name: "foo",
+			srcs: [
+				"IFoo.aidl",
+			],
+			versions: [
+				"-1",
+				"1",
+			],
+		}
+	`)
+}
+
+func TestErrorsWithNonIntegerVersions(t *testing.T) {
+	testAidlError(t, `versions: "first" is not an integer`, `
+		aidl_interface {
+			name: "foo",
+			srcs: [
+				"IFoo.aidl",
+			],
+			versions: [
+				"first",
+			],
+		}
+	`)
+}
+
+const (
+	androidVariant    = "android_common"
+	nativeVariant     = "android_arm_armv7-a-neon_shared"
+	nativeRustVariant = "android_arm_armv7-a-neon_dylib"
+)
+
+func TestNativeOutputIsAlwaysVersioned(t *testing.T) {
+	var ctx *android.TestContext
+	assertOutput := func(moduleName, variant, outputFilename string) {
+		t.Helper()
+		producer, ok := ctx.ModuleForTests(moduleName, variant).Module().(android.OutputFileProducer)
+		if !ok {
+			t.Errorf("%s(%s): should be OutputFileProducer.", moduleName, variant)
+		}
+		paths, err := producer.OutputFiles("")
+		if err != nil {
+			t.Errorf("%s(%s): failed to get OutputFiles: %v", moduleName, variant, err)
+		}
+		if len(paths) != 1 || paths[0].Base() != outputFilename {
+			t.Errorf("%s(%s): expected output %q, but got %v", moduleName, variant, outputFilename, paths)
+		}
+	}
+
+	// No versions
+	ctx, _ = testAidl(t, `
+		aidl_interface {
+			name: "foo",
+			srcs: [
+				"IFoo.aidl",
+			],
+			backend: {
+				rust: {
+					enabled: true,
+				},
+			},
+		}
+	`)
+	// Even though there is no version, generated modules have version(V1) unless it isn't an unstable interface.
+	assertOutput("foo-V1-java", androidVariant, "foo-V1-java.jar")
+
+	assertOutput("foo-V1-cpp", nativeVariant, "foo-V1-cpp.so")
+	assertOutput("foo-V1-rust", nativeRustVariant, "libfoo_V1.dylib.so")
+
+	// With versions: "1", "2"
+	ctx, _ = testAidl(t, `
+		aidl_interface {
+			name: "foo",
+			srcs: [
+				"IFoo.aidl",
+			],
+			versions: [
+				"1", "2",
+			],
+			backend: {
+				rust: {
+					enabled: true,
+				},
+			},
+		}
+	`, withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+		"aidl_api/foo/2/foo.2.aidl": nil,
+		"aidl_api/foo/2/.hash":      nil,
+	}))
+
+	// alias for the latest frozen version (=2)
+	assertOutput("foo-V2-java", androidVariant, "foo-V2-java.jar")
+	assertOutput("foo-V2-cpp", nativeVariant, "foo-V2-cpp.so")
+	assertOutput("foo-V2-rust", nativeRustVariant, "libfoo_V2.dylib.so")
+
+	// frozen "1"
+	assertOutput("foo-V1-java", androidVariant, "foo-V1-java.jar")
+	assertOutput("foo-V1-cpp", nativeVariant, "foo-V1-cpp.so")
+	assertOutput("foo-V1-rust", nativeRustVariant, "libfoo_V1.dylib.so")
+
+	// tot
+	assertOutput("foo-V3-java", androidVariant, "foo-V3-java.jar")
+	assertOutput("foo-V3-cpp", nativeVariant, "foo-V3-cpp.so")
+	assertOutput("foo-V3-rust", nativeRustVariant, "libfoo_V3.dylib.so")
+
+	// skip ndk since they follow the same rule with cpp
+}
+
+func TestImports(t *testing.T) {
+	testAidlError(t, `Import does not exist:`, `
+		aidl_interface {
+			name: "foo",
+			srcs: [
+				"IFoo.aidl",
+			],
+			imports: [
+				"bar",
+			]
+		}
+	`)
+
+	testAidlError(t, `backend.java.enabled: Java backend not enabled in the imported AIDL interface "bar"`, `
+		aidl_interface {
+			name: "foo",
+			srcs: [
+				"IFoo.aidl",
+			],
+			imports: [
+				"bar-V1",
+			]
+		}
+		aidl_interface {
+			name: "bar",
+			srcs: [
+				"IBar.aidl",
+			],
+			backend: {
+				java: {
+					enabled: false,
+				},
+			},
+		}
+	`)
+
+	testAidlError(t, `backend.cpp.enabled: C\+\+ backend not enabled in the imported AIDL interface "bar"`, `
+		aidl_interface {
+			name: "foo",
+			srcs: [
+				"IFoo.aidl",
+			],
+			imports: [
+				"bar-V1",
+			]
+		}
+		aidl_interface {
+			name: "bar",
+			srcs: [
+				"IBar.aidl",
+			],
+			backend: {
+				cpp: {
+					enabled: false,
+				},
+			},
+		}
+	`)
+
+	testAidlError(t, `imports: "foo" depends on "bar" but does not specify a version`, `
+		aidl_interface {
+			name: "foo",
+            unstable: true,
+			srcs: [
+				"IFoo.aidl",
+			],
+			imports: [
+				"bar",
+			]
+		}
+		aidl_interface {
+			name: "bar",
+			srcs: [
+				"IBar.aidl",
+			],
+		}
+	`)
+
+	ctx, _ := testAidl(t, `
+		aidl_interface_defaults {
+			name: "foo-defaults",
+			srcs: [
+				"IFoo.aidl",
+			],
+			backend: {
+				rust: {
+					enabled: true,
+				},
+			},
+			imports: [
+				"bar.1-V1",
+			]
+		}
+		aidl_interface {
+			name: "foo",
+			defaults: ["foo-defaults"],
+		}
+		aidl_interface {
+			name: "bar.1",
+			srcs: [
+				"IBar.aidl",
+			],
+			backend: {
+				rust: {
+					enabled: true,
+				},
+			},
+		}
+	`)
+
+	ldRule := ctx.ModuleForTests("foo-V1-cpp", nativeVariant).Rule("ld")
+	libFlags := ldRule.Args["libFlags"]
+	libBar := filepath.Join("bar.1-V1-cpp", nativeVariant, "bar.1-V1-cpp.so")
+	if !strings.Contains(libFlags, libBar) {
+		t.Errorf("%q is not found in %q", libBar, libFlags)
+	}
+
+	rustcRule := ctx.ModuleForTests("foo-V1-rust", nativeRustVariant).Rule("rustc")
+	libFlags = rustcRule.Args["libFlags"]
+	libBar = filepath.Join("out", "soong", ".intermediates", "bar.1-V1-rust", nativeRustVariant, "unstripped", "libbar_1_V1.dylib.so")
+	libBarFlag := "--extern bar_1=" + libBar
+	if !strings.Contains(libFlags, libBarFlag) {
+		t.Errorf("%q is not found in %q", libBarFlag, libFlags)
+	}
+}
+
+func TestDuplicatedVersions(t *testing.T) {
+	// foo depends on myiface-V2-ndk via direct dep and also on
+	// myiface-V1-ndk via indirect dep. This should be prohibited.
+	testAidlError(t, `depends on multiple versions of the same aidl_interface: myiface-V1-.*, myiface-V2-.*`, `
+		aidl_interface {
+			name: "myiface",
+			srcs: ["IFoo.aidl"],
+			versions: ["1", "2"],
+		}
+
+		cc_library {
+			name: "foo",
+			shared_libs: ["myiface-V2-ndk", "bar"],
+		}
+
+		cc_library {
+			name: "bar",
+			shared_libs: ["myiface-V1-ndk"],
+		}
+
+	`, withFiles(map[string][]byte{
+		"aidl_api/myiface/1/myiface.1.aidl": nil,
+		"aidl_api/myiface/1/.hash":          nil,
+		"aidl_api/myiface/2/myiface.2.aidl": nil,
+		"aidl_api/myiface/2/.hash":          nil,
+	}))
+	testAidlError(t, `depends on multiple versions of the same aidl_interface: myiface-V1-.*, myiface-V2-.*`, `
+		aidl_interface {
+			name: "myiface",
+			srcs: ["IFoo.aidl"],
+			versions: ["1"],
+		}
+
+		aidl_interface {
+			name: "myiface2",
+			srcs: ["IBar.aidl"],
+			imports: ["myiface-V2"]
+		}
+
+		cc_library {
+			name: "foobar",
+			shared_libs: ["myiface-V1-ndk", "myiface2-V1-ndk"],
+		}
+
+	`, withFiles(map[string][]byte{
+		"aidl_api/myiface/1/myiface.1.aidl": nil,
+		"aidl_api/myiface/1/.hash":          nil,
+	}))
+	testAidlError(t, `depends on multiple versions of the same aidl_interface: myiface-V1-.*, myiface-V2-.*`, `
+		aidl_interface {
+			name: "myiface",
+			srcs: ["IFoo.aidl"],
+			versions: ["1"],
+		}
+
+		aidl_interface {
+			name: "myiface2",
+			srcs: ["IBar.aidl"],
+			imports: ["myiface-V2"]
+		}
+
+		cc_library {
+			name: "foobar",
+			srcs: [":myiface-V1-ndk-source"],
+			shared_libs: ["myiface2-V1-ndk"],
+		}
+
+	`, withFiles(map[string][]byte{
+		"aidl_api/myiface/1/myiface.1.aidl": nil,
+		"aidl_api/myiface/1/.hash":          nil,
+	}))
+	// Okay to reference two different
+	testAidl(t, `
+		aidl_interface {
+			name: "myiface",
+			srcs: ["IFoo.aidl"],
+			versions: ["1"],
+		}
+		cc_library {
+			name: "foobar",
+			shared_libs: ["myiface-V1-cpp", "myiface-V1-ndk"],
+		}
+	`, withFiles(map[string][]byte{
+		"aidl_api/myiface/1/myiface.1.aidl": nil,
+		"aidl_api/myiface/1/.hash":          nil,
+	}))
+	testAidl(t, `
+		aidl_interface {
+			name: "myiface",
+			srcs: ["IFoo.aidl"],
+			versions: ["1"],
+		}
+
+		aidl_interface {
+			name: "myiface2",
+			srcs: ["IBar.aidl"],
+			imports: ["myiface-V2"]
+		}
+
+		cc_library {
+			name: "foobar",
+			srcs: [":myiface-V2-ndk-source"],
+			shared_libs: ["myiface2-V1-ndk"],
+		}
+
+	`, withFiles(map[string][]byte{
+		"aidl_api/myiface/1/myiface.1.aidl": nil,
+		"aidl_api/myiface/1/.hash":          nil,
+	}))
+	testAidl(t, `
+		aidl_interface {
+			name: "myiface",
+			srcs: ["IFoo.aidl"],
+			versions: ["1"],
+		}
+
+		aidl_interface {
+			name: "myiface2",
+			srcs: ["IBar.aidl"],
+			imports: ["myiface-V2"]
+		}
+
+		cc_library {
+			name: "foobar",
+			shared_libs: ["myiface-V2-ndk", "myiface2-V1-ndk"],
+		}
+
+	`, withFiles(map[string][]byte{
+		"aidl_api/myiface/1/myiface.1.aidl": nil,
+		"aidl_api/myiface/1/.hash":          nil,
+	}))
+}
+
+func TestVndkRequiresFrozen(t *testing.T) {
+	testAidlError(t, `frozen: true or false must be specified when the VNDK is enabled on a versioned interface`, `
+		aidl_interface {
+			name: "myiface",
+			vendor_available: true,
+			product_available: true,
+			srcs: ["IFoo.aidl"],
+			vndk: {
+				enabled: true,
+			},
+		}
+	`)
+	testAidlError(t, `vndk_use_version: must be specified if interface is unfrozen`, `
+		aidl_interface {
+			name: "myiface",
+			vendor_available: true,
+			product_available: true,
+			srcs: ["IFoo.aidl"],
+			stability: "vintf",
+			frozen: false,
+			vndk: {
+				enabled: true,
+			},
+		}
+	`)
+	testAidl(t, `
+		aidl_interface {
+			name: "myiface",
+			vendor_available: true,
+			product_available: true,
+			srcs: ["IFoo.aidl"],
+			stability: "vintf",
+			frozen: false,
+			vndk_use_version: "1",
+			vndk: {
+				enabled: true,
+			},
+		}
+	`)
+}
+
+func TestRecoveryAvailable(t *testing.T) {
+	ctx, _ := testAidl(t, `
+		aidl_interface {
+			name: "myiface",
+			recovery_available: true,
+			srcs: ["IFoo.aidl"],
+		}
+	`)
+	ctx.ModuleForTests("myiface-V1-ndk", "android_recovery_arm64_armv8-a_shared")
+	ctx.ModuleForTests("myiface-V1-cpp", "android_recovery_arm64_armv8-a_shared")
+}
+
+func TestRustDuplicateNames(t *testing.T) {
+	testAidl(t, `
+		aidl_interface {
+			name: "myiface",
+			srcs: ["dir/a/Foo.aidl", "dir/b/Foo.aidl"],
+			backend: {
+				rust: {
+					enabled: true,
+				},
+			},
+		}
+	`)
+}
+
+func TestAidlImportFlagsForImportedModules(t *testing.T) {
+	customizer := withFiles(map[string][]byte{
+		"foo/Android.bp": []byte(`
+			aidl_interface {
+				name: "foo-iface",
+				srcs: ["a/Foo.aidl"],
+				imports: ["bar-iface-V2"],
+				versions: ["1"],
+				headers: ["boq-iface-headers"],
+			}
+		`),
+		"foo/a/Foo.aidl": nil,
+		"foo/aidl_api/foo-iface/current/a/Foo.aidl": nil,
+		"foo/aidl_api/foo-iface/1/a/Foo.aidl":       nil,
+		"foo/aidl_api/foo-iface/1/.hash":            nil,
+
+		"bar/Android.bp": []byte(`
+			aidl_interface {
+				name: "bar-iface",
+				srcs: ["b/Bar.aidl"],
+				imports: ["baz-iface-V1"],
+				versions: ["1"],
+			}
+		`),
+		"bar/b/Bar.aidl": nil,
+		"bar/aidl_api/bar-iface/current/b/Bar.aidl": nil,
+		"bar/aidl_api/bar-iface/1/b/Bar.aidl":       nil,
+		"bar/aidl_api/bar-iface/1/.hash":            nil,
+
+		"baz/Android.bp": []byte(`
+			aidl_interface {
+				name: "baz-iface",
+				srcs: ["b/Baz.aidl"],
+				include_dirs: ["baz-include"],
+				versions: ["1"],
+			}
+		`),
+		"baz/b/Baz.aidl": nil,
+		"baz/aidl_api/baz-iface/current/b/Baz.aidl": nil,
+		"baz/aidl_api/baz-iface/1/b/Baz.aidl":       nil,
+		"baz/aidl_api/baz-iface/1/.hash":            nil,
+
+		"boq/Android.bp": []byte(`
+			aidl_library {
+				name: "boq-iface-headers",
+				srcs: ["b/Boq.aidl"],
+			}
+		`),
+		"boq/b/Baz.aidl": nil,
+	})
+	ctx, _ := testAidl(t, ``, customizer)
+
+	// checkapidump rule is to compare "compatibility" between ToT(dump) and "current"
+	{
+		rule := ctx.ModuleForTests("foo-iface-api", "").Output("checkapi_dump.timestamp")
+		android.AssertStringEquals(t, "checkapi(dump == current) imports", "-Iboq", rule.Args["imports"])
+		android.AssertStringDoesContain(t, "checkapi(dump == current) optionalFlags",
+			rule.Args["optionalFlags"],
+			"-pout/soong/.intermediates/bar/bar-iface_interface/2/preprocessed.aidl")
+	}
+
+	// has_development rule runs --checkapi for equality between latest("1")
+	// and ToT
+	{
+		rule := ctx.ModuleForTests("foo-iface-api", "").Output("has_development")
+		android.AssertStringDoesContain(t, "checkapi(dump == latest(1)) should import import's preprocessed",
+			rule.RuleParams.Command,
+			"-pout/soong/.intermediates/bar/bar-iface_interface/2/preprocessed.aidl")
+	}
+
+	// compile (v1)
+	{
+		rule := ctx.ModuleForTests("foo-iface-V1-cpp-source", "").Output("a/Foo.cpp")
+		android.AssertStringEquals(t, "compile(old=1) should import aidl_api/1",
+			"-Iboq -Nfoo/aidl_api/foo-iface/1",
+			rule.Args["imports"]+" "+rule.Args["nextImports"])
+		android.AssertStringDoesContain(t, "compile(old=1) should import bar.preprocessed",
+			rule.Args["optionalFlags"],
+			"-pout/soong/.intermediates/bar/bar-iface_interface/2/preprocessed.aidl")
+	}
+	// compile ToT(v2)
+	{
+		rule := ctx.ModuleForTests("foo-iface-V2-cpp-source", "").Output("a/Foo.cpp")
+		android.AssertStringEquals(t, "compile(tot=2) should import base dirs of srcs", "-Iboq -Nfoo", rule.Args["imports"]+" "+rule.Args["nextImports"])
+		android.AssertStringDoesContain(t, "compile(tot=2) should import bar.preprocessed",
+			rule.Args["optionalFlags"],
+			"-pout/soong/.intermediates/bar/bar-iface_interface/2/preprocessed.aidl")
+	}
+}
+
+func TestAidlPreprocess(t *testing.T) {
+	customizer := withFiles(map[string][]byte{
+		"foo/Android.bp": []byte(`
+			aidl_interface {
+				name: "foo-iface",
+				local_include_dir: "src",
+				include_dirs: [
+						"path1",
+						"path2/sub",
+				],
+				srcs: [
+						"src/foo/Foo.aidl",
+				],
+				imports: [
+					"bar-iface",
+				],
+				unstable: true,
+			}
+			aidl_interface {
+				name: "bar-iface",
+				local_include_dir: "src",
+				srcs: [
+						"src/bar/Bar.aidl",
+				],
+				unstable: true,
+			}
+		`),
+		"foo/src/foo/Foo.aidl": nil,
+		"foo/src/bar/Bar.aidl": nil,
+	})
+	ctx, _ := testAidl(t, ``, customizer)
+
+	rule := ctx.ModuleForTests("foo-iface_interface", "").Output("preprocessed.aidl")
+	android.AssertStringDoesContain(t, "preprocessing should import srcs and include_dirs",
+		rule.RuleParams.Command,
+		"-Ifoo/src -Ipath1 -Ipath2/sub")
+	android.AssertStringDoesContain(t, "preprocessing should import import's preprocess",
+		rule.RuleParams.Command,
+		"-pout/soong/.intermediates/foo/bar-iface_interface/preprocessed.aidl")
+}
+
+func TestAidlImportFlagsForUnstable(t *testing.T) {
+	customizer := withFiles(map[string][]byte{
+		"foo/Android.bp": []byte(`
+			aidl_interface {
+				name: "foo-iface",
+				local_include_dir: "src",
+				include_dirs: [
+						"path1",
+						"path2/sub",
+				],
+				srcs: [
+						"src/foo/Foo.aidl",
+				],
+				imports: [
+					"bar-iface",
+				],
+				unstable: true,
+			}
+			aidl_interface {
+				name: "bar-iface",
+				local_include_dir: "src",
+				srcs: [
+						"src/bar/Bar.aidl",
+				],
+				unstable: true,
+			}
+		`),
+		"foo/src/foo/Foo.aidl": nil,
+		"foo/src/bar/Bar.aidl": nil,
+	})
+	ctx, _ := testAidl(t, ``, customizer)
+
+	rule := ctx.ModuleForTests("foo-iface-cpp-source", "").Output("foo/Foo.cpp")
+	android.AssertStringEquals(t, "compile(unstable) should import foo/base_dirs(target) and bar/base_dirs(imported)",
+		"-Ipath1 -Ipath2/sub -Nfoo/src",
+		rule.Args["imports"]+" "+rule.Args["nextImports"])
+	android.AssertStringDoesContain(t, "compile(unstable) should import bar.preprocessed",
+		rule.Args["optionalFlags"],
+		"-pout/soong/.intermediates/foo/bar-iface_interface/preprocessed.aidl")
+}
+
+func TestSupportsGenruleAndFilegroup(t *testing.T) {
+	customizer := withFiles(map[string][]byte{
+		"foo/Android.bp": []byte(`
+			aidl_interface {
+				name: "foo-iface",
+				local_include_dir: "src",
+				include_dirs: [
+						"path1",
+						"path2/sub",
+				],
+				srcs: [
+						"src/foo/Foo.aidl",
+						":filegroup1",
+						":gen1",
+				],
+				imports: [
+						"bar-iface-V1",
+				],
+				versions: ["1"],
+			}
+			filegroup {
+				name: "filegroup1",
+				path: "filegroup/sub",
+				srcs: [
+						"filegroup/sub/pkg/Bar.aidl",
+				],
+			}
+			genrule {
+				name: "gen1",
+				cmd: "generate baz/Baz.aidl",
+				out: [
+					"baz/Baz.aidl",
+				]
+			}
+			aidl_interface {
+				name: "bar-iface",
+				local_include_dir: "src",
+				srcs: [
+						"src/bar/Bar.aidl",
+						":gen-bar",
+				],
+			}
+			genrule {
+				name: "gen-bar",
+				cmd: "generate gen/GenBar.aidl",
+				out: [
+					"gen/GenBar.aidl",
+				]
+			}
+		`),
+		"foo/aidl_api/foo-iface/1/foo/Foo.aidl": nil,
+		"foo/aidl_api/foo-iface/1/.hash":        nil,
+		"foo/filegroup/sub/pkg/Bar.aidl":        nil,
+		"foo/src/foo/Foo.aidl":                  nil,
+	})
+	ctx, _ := testAidl(t, ``, customizer)
+
+	// aidlCompile for snapshots (v1)
+	{
+		rule := ctx.ModuleForTests("foo-iface-V1-cpp-source", "").Output("foo/Foo.cpp")
+		android.AssertStringEquals(t, "compile(1) should import foo/aidl_api/1",
+			"-Ipath1 -Ipath2/sub -Nfoo/aidl_api/foo-iface/1",
+			rule.Args["imports"]+" "+rule.Args["nextImports"])
+		android.AssertStringDoesContain(t, "compile(1) should import bar.preprocessed",
+			rule.Args["optionalFlags"],
+			"-pout/soong/.intermediates/foo/bar-iface_interface/1/preprocessed.aidl")
+	}
+	// aidlCompile for ToT (v2)
+	{
+		rule := ctx.ModuleForTests("foo-iface-V2-cpp-source", "").Output("foo/Foo.cpp")
+		android.AssertStringEquals(t, "compile(tot=2) should import foo.base_dirs",
+			"-Ipath1 -Ipath2/sub -Nfoo/src -Nfoo/filegroup/sub -Nout/soong/.intermediates/foo/gen1/gen",
+			rule.Args["imports"]+" "+rule.Args["nextImports"])
+		android.AssertStringDoesContain(t, "compile(tot=2) should import bar.preprocessed",
+			rule.Args["optionalFlags"],
+			"-pout/soong/.intermediates/foo/bar-iface_interface/1/preprocessed.aidl")
+	}
+
+	// dumpapi
+	{
+		rule := ctx.ModuleForTests("foo-iface-api", "").Rule("aidlDumpApiRule")
+		android.AssertPathsRelativeToTopEquals(t, "dumpapi should dump srcs/filegroups/genrules", []string{
+			"foo/src/foo/Foo.aidl",
+			"foo/filegroup/sub/pkg/Bar.aidl",
+			"out/soong/.intermediates/foo/gen1/gen/baz/Baz.aidl",
+		}, rule.Inputs)
+
+		dumpDir := "out/soong/.intermediates/foo/foo-iface-api/dump"
+		android.AssertPathsRelativeToTopEquals(t, "dumpapi should dump with rel paths", []string{
+			dumpDir + "/foo/Foo.aidl",
+			dumpDir + "/pkg/Bar.aidl",
+			dumpDir + "/baz/Baz.aidl",
+			dumpDir + "/.hash",
+		}, rule.Outputs.Paths())
+
+		android.AssertStringEquals(t, "dumpapi should import base_dirs and include_dirs",
+			"-Ifoo/src -Ifoo/filegroup/sub -Iout/soong/.intermediates/foo/gen1/gen -Ipath1 -Ipath2/sub",
+			rule.Args["imports"])
+		android.AssertStringDoesContain(t, "dumpapi should import bar.preprocessed",
+			rule.Args["optionalFlags"],
+			"-pout/soong/.intermediates/foo/bar-iface_interface/1/preprocessed.aidl")
+	}
+}
+
+func TestAidlFlags(t *testing.T) {
+	ctx, _ := testAidl(t, `
+		aidl_interface {
+			name: "myiface",
+			srcs: ["a/Foo.aidl", "b/Bar.aidl"],
+			flags: ["-Weverything", "-Werror"],
+			backend: { rust: { enabled: true }}
+		}
+	`)
+	for module, outputs := range map[string][]string{
+		"myiface-V1-cpp-source":  {"a/Foo.h", "b/Bar.h"},
+		"myiface-V1-java-source": {"a/Foo.java", "b/Bar.java"},
+		"myiface-V1-ndk-source":  {"aidl/a/Foo.h", "aidl/b/Bar.h"},
+		"myiface-V1-rust-source": {"a/Foo.rs", "b/Bar.rs"},
+	} {
+		for _, output := range outputs {
+			t.Run(module+"/"+output, func(t *testing.T) {
+				params := ctx.ModuleForTests(module, "").Output(output)
+				assertContains(t, params.Args["optionalFlags"], "-Weverything")
+				assertContains(t, params.Args["optionalFlags"], "-Werror")
+			})
+		}
+	}
+}
+
+func TestAidlModuleJavaSdkVersionDeterminesMinSdkVersion(t *testing.T) {
+	ctx, _ := testAidl(t, `
+		aidl_interface {
+			name: "myiface",
+			srcs: ["a/Foo.aidl"],
+			backend: {
+				java: {
+					sdk_version: "28",
+				},
+			},
+		}
+	`, java.FixtureWithPrebuiltApis(map[string][]string{"28": {"foo"}}))
+	params := ctx.ModuleForTests("myiface-V1-java-source", "").Output("a/Foo.java")
+	assertContains(t, params.Args["optionalFlags"], "--min_sdk_version 28")
+}
+
+func TestAidlModuleNameContainsVersion(t *testing.T) {
+	testAidlError(t, "aidl_interface should not have '-V<number> suffix", `
+		aidl_interface {
+			name: "myiface-V2",
+			srcs: ["a/Foo.aidl", "b/Bar.aidl"],
+		}
+	`)
+	// Ugly, but okay
+	testAidl(t, `
+		aidl_interface {
+			name: "myiface-V2aa",
+			srcs: ["a/Foo.aidl", "b/Bar.aidl"],
+		}
+	`)
+}
+
+func TestExplicitAidlModuleImport(t *testing.T) {
+	for _, importVersion := range []string{"V1", "V2"} {
+
+		ctx, _ := testAidl(t, `
+			aidl_interface {
+				name: "foo",
+				srcs: ["Foo.aidl"],
+				versions: [
+					"1",
+				],
+				imports: ["bar-`+importVersion+`"]
+			}
+
+			aidl_interface {
+				name: "bar",
+				srcs: ["Bar.aidl"],
+				versions: [
+					"1",
+				],
+			}
+		`, withFiles(map[string][]byte{
+			"aidl_api/foo/1/Foo.aidl": nil,
+			"aidl_api/foo/1/.hash":    nil,
+			"aidl_api/bar/1/Bar.aidl": nil,
+			"aidl_api/bar/1/.hash":    nil,
+		}))
+		for _, foo := range []string{"foo-V1-cpp", "foo-V2-cpp"} {
+			ldRule := ctx.ModuleForTests(foo, nativeVariant).Rule("ld")
+			libFlags := ldRule.Args["libFlags"]
+			libBar := filepath.Join("bar-"+importVersion+"-cpp", nativeVariant, "bar-"+importVersion+"-cpp.so")
+			if !strings.Contains(libFlags, libBar) {
+				t.Errorf("%q is not found in %q", libBar, libFlags)
+			}
+
+		}
+	}
+
+	testAidlError(t, "module \"foo_interface\": imports: \"foo\" depends on \"bar\" version \"3\"", `
+		aidl_interface {
+			name: "foo",
+			srcs: ["Foo.aidl"],
+			versions: [
+				"1",
+			],
+			imports: ["bar-V3"]
+		}
+
+		aidl_interface {
+			name: "bar",
+			srcs: ["Bar.aidl"],
+			versions: [
+				"1",
+			],
+		}
+	`, withFiles(map[string][]byte{
+		"aidl_api/foo/1/Foo.aidl": nil,
+		"aidl_api/foo/1/.hash":    nil,
+		"aidl_api/bar/1/Bar.aidl": nil,
+		"aidl_api/bar/1/.hash":    nil,
+	}))
+}
+
+func TestUseVersionedPreprocessedWhenImporotedWithVersions(t *testing.T) {
+	ctx, _ := testAidl(t, `
+		aidl_interface {
+			name: "unstable-foo",
+			srcs: ["foo/Foo.aidl"],
+			imports: [
+					"bar-V2",
+					"baz-V1",
+					"unstable-bar",
+			],
+			unstable: true,
+		}
+		aidl_interface {
+			name: "foo",
+			srcs: ["foo/Foo.aidl"],
+			imports: [
+					"bar-V1",
+					"baz-V1",
+			],
+			versions: ["1"],
+		}
+		aidl_interface {
+			name: "foo-no-versions",
+			srcs: ["foo/Foo.aidl"],
+			imports: [
+					"bar-V2",
+			],
+		}
+		aidl_interface {
+			name: "bar",
+			srcs: ["bar/Bar.aidl"],
+			versions: ["1"],
+		}
+		aidl_interface {
+			name: "unstable-bar",
+			srcs: ["bar/Bar.aidl"],
+			unstable: true,
+		}
+		aidl_interface {
+			name: "baz",
+			srcs: ["baz/Baz.aidl"],
+			versions: ["1"],
+		}
+	`, withFiles(map[string][]byte{
+		"foo/Foo.aidl":                nil,
+		"bar/Bar.aidl":                nil,
+		"baz/Baz.aidl":                nil,
+		"aidl_api/foo/1/foo/Foo.aidl": nil,
+		"aidl_api/foo/1/.hash":        nil,
+		"aidl_api/bar/1/bar/Bar.aidl": nil,
+		"aidl_api/bar/1/.hash":        nil,
+		"aidl_api/baz/1/baz/Baz.aidl": nil,
+		"aidl_api/baz/1/.hash":        nil,
+	}))
+	{
+		rule := ctx.ModuleForTests("foo-V2-java-source", "").Output("foo/Foo.java")
+		android.AssertStringDoesContain(t, "foo-V2(tot) imports bar-V1 for 'bar-V1'", rule.Args["optionalFlags"],
+			"-pout/soong/.intermediates/bar_interface/1/preprocessed.aidl")
+		android.AssertStringDoesContain(t, "foo-V2(tot) imports baz-V1 for 'baz-V1'", rule.Args["optionalFlags"],
+			"-pout/soong/.intermediates/baz_interface/1/preprocessed.aidl")
+	}
+	{
+		rule := ctx.ModuleForTests("foo-V1-java-source", "").Output("foo/Foo.java")
+		android.AssertStringDoesContain(t, "foo-V1 imports bar-V1(latest) for 'bar'", rule.Args["optionalFlags"],
+			"-pout/soong/.intermediates/bar_interface/1/preprocessed.aidl")
+		android.AssertStringDoesContain(t, "foo-V1 imports baz-V1 for 'baz-V1'", rule.Args["optionalFlags"],
+			"-pout/soong/.intermediates/baz_interface/1/preprocessed.aidl")
+	}
+	{
+		rule := ctx.ModuleForTests("unstable-foo-java-source", "").Output("foo/Foo.java")
+		android.AssertStringDoesContain(t, "unstable-foo imports bar-V2(latest) for 'bar'", rule.Args["optionalFlags"],
+			"-pout/soong/.intermediates/bar_interface/2/preprocessed.aidl")
+		android.AssertStringDoesContain(t, "unstable-foo imports baz-V1 for 'baz-V1'", rule.Args["optionalFlags"],
+			"-pout/soong/.intermediates/baz_interface/1/preprocessed.aidl")
+		android.AssertStringDoesContain(t, "unstable-foo imports unstable-bar(ToT) for 'unstable-bar'", rule.Args["optionalFlags"],
+			"-pout/soong/.intermediates/unstable-bar_interface/preprocessed.aidl")
+	}
+	{
+		rule := ctx.ModuleForTests("foo-no-versions-V1-java-source", "").Output("foo/Foo.java")
+		android.AssertStringDoesContain(t, "foo-no-versions-V1(latest) imports bar-V2(latest) for 'bar'", rule.Args["optionalFlags"],
+			"-pout/soong/.intermediates/bar_interface/2/preprocessed.aidl")
+	}
+}
+
+func FindModule(ctx *android.TestContext, name, variant, dir string) android.Module {
+	var module android.Module
+	ctx.VisitAllModules(func(m blueprint.Module) {
+		if ctx.ModuleName(m) == name && ctx.ModuleSubDir(m) == variant && ctx.ModuleDir(m) == dir {
+			module = m.(android.Module)
+		}
+	})
+	if module == nil {
+		m := ctx.ModuleForTests(name, variant).Module()
+		panic(fmt.Errorf("failed to find module %q variant %q dir %q, but found one in %q",
+			name, variant, dir, ctx.ModuleDir(m)))
+	}
+	return module
+}
+
+func TestDuplicateInterfacesWithTheSameNameInDifferentSoongNamespaces(t *testing.T) {
+	ctx, _ := testAidl(t, ``, withFiles(map[string][]byte{
+		"common/Android.bp": []byte(`
+		  aidl_interface {
+				name: "common",
+				srcs: ["ICommon.aidl"],
+				versions: ["1", "2"],
+			}
+		`),
+		"common/aidl_api/common/1/ICommon.aidl": nil,
+		"common/aidl_api/common/1/.hash":        nil,
+		"common/aidl_api/common/2/ICommon.aidl": nil,
+		"common/aidl_api/common/2/.hash":        nil,
+		"vendor/a/Android.bp": []byte(`
+			soong_namespace {}
+		`),
+		"vendor/a/foo/Android.bp": []byte(`
+			aidl_interface {
+				name: "foo",
+				owner: "vendor",
+				srcs: ["IFoo.aidl"],
+				imports: ["common-V1"],
+			}
+		`),
+		"vendor/b/Android.bp": []byte(`
+			soong_namespace {}
+		`),
+		"vendor/b/foo/Android.bp": []byte(`
+			aidl_interface {
+				name: "foo",
+				owner: "vendor",
+				srcs: ["IFoo.aidl"],
+				imports: ["common-V2"],
+			}
+		`),
+	}))
+
+	aFooV1Java := FindModule(ctx, "foo-V1-java", "android_common", "vendor/a/foo").(*java.Library)
+	android.AssertStringListContains(t, "a/foo deps", aFooV1Java.CompilerDeps(), "common-V1-java")
+
+	bFooV1Java := FindModule(ctx, "foo-V1-java", "android_common", "vendor/b/foo").(*java.Library)
+	android.AssertStringListContains(t, "a/foo deps", bFooV1Java.CompilerDeps(), "common-V2-java")
+}
+
+func TestUnstableChecksForAidlInterfacesInDifferentNamespaces(t *testing.T) {
+	files := withFiles(map[string][]byte{
+		"vendor/a/Android.bp": []byte(`
+			soong_namespace {}
+		`),
+		"vendor/a/foo/Android.bp": []byte(`
+			aidl_interface {
+				name: "foo",
+				owner: "vendor",
+				srcs: ["IFoo.aidl"],
+				versions: ["1", "2"],
+			}
+			java_library {
+				name: "bar",
+				libs: ["foo-V2-java"],  // OK
+			}
+		`),
+		"vendor/a/foo/aidl_api/foo/1/IFoo.aidl": nil,
+		"vendor/a/foo/aidl_api/foo/1/.hash":     nil,
+		"vendor/a/foo/aidl_api/foo/2/IFoo.aidl": nil,
+		"vendor/a/foo/aidl_api/foo/2/.hash":     nil,
+		"vendor/b/Android.bp": []byte(`
+			soong_namespace {}
+		`),
+		"vendor/b/foo/Android.bp": []byte(`
+			aidl_interface {
+				name: "foo",
+				owner: "vendor",
+				srcs: ["IFoo.aidl"],
+				versions: ["1"],
+			}
+			java_library {
+				name: "bar",
+				libs: ["foo-V1-java"],  // OK
+			}
+		`),
+		"vendor/b/foo/aidl_api/foo/1/IFoo.aidl": nil,
+		"vendor/b/foo/aidl_api/foo/1/.hash":     nil,
+	})
+
+	testAidl(t, ``, files, setReleaseEnv())
+	testAidl(t, ``, files, setTestFreezeEnv())
+	testAidl(t, ``, files)
+}
+
+func TestVersionsWithInfoAndVersions(t *testing.T) {
+	conflictingFields := `
+	aidl_interface {
+		name: "foo",
+		versions: [
+			"1",
+		],
+		versions_with_info: [
+			{
+				version: "1",
+			}
+		],
+	}
+	`
+	files := withFiles(map[string][]byte{
+		"aidl_api/foo/1/foo.1.aidl": nil,
+		"aidl_api/foo/1/.hash":      nil,
+	})
+
+	expectedError := `Use versions_with_info instead of versions.`
+	testAidlError(t, expectedError, conflictingFields, files)
+}
+
+func TestVersionsWithInfo(t *testing.T) {
+	ctx, _ := testAidl(t, ``, withFiles(map[string][]byte{
+		"common/Android.bp": []byte(`
+		  aidl_interface {
+				name: "common",
+				srcs: ["ICommon.aidl"],
+				versions: ["1", "2"],
+			}
+		`),
+		"common/aidl_api/common/1/ICommon.aidl": nil,
+		"common/aidl_api/common/1/.hash":        nil,
+		"common/aidl_api/common/2/ICommon.aidl": nil,
+		"common/aidl_api/common/2/.hash":        nil,
+		"foo/Android.bp": []byte(`
+			aidl_interface {
+				name: "foo",
+				srcs: ["IFoo.aidl"],
+				imports: ["common-V3"],
+				versions_with_info: [
+					{version: "1", imports: ["common-V1"]},
+					{version: "2", imports: ["common-V2"]},
+				]
+			}
+		`),
+		"foo/aidl_api/foo/1/IFoo.aidl": nil,
+		"foo/aidl_api/foo/1/.hash":     nil,
+		"foo/aidl_api/foo/2/IFoo.aidl": nil,
+		"foo/aidl_api/foo/2/.hash":     nil,
+	}))
+
+	fooV1Java := FindModule(ctx, "foo-V1-java", "android_common", "foo").(*java.Library)
+	android.AssertStringListContains(t, "a/foo-v1 deps", fooV1Java.CompilerDeps(), "common-V1-java")
+
+	fooV2Java := FindModule(ctx, "foo-V2-java", "android_common", "foo").(*java.Library)
+	android.AssertStringListContains(t, "a/foo-v2 deps", fooV2Java.CompilerDeps(), "common-V2-java")
+
+	fooV3Java := FindModule(ctx, "foo-V3-java", "android_common", "foo").(*java.Library)
+	android.AssertStringListContains(t, "a/foo-v3 deps", fooV3Java.CompilerDeps(), "common-V3-java")
+}
+
+func TestVersionsWithInfoImport(t *testing.T) {
+	testAidlError(t, "imports in versions_with_info must specify its version", ``, withFiles(map[string][]byte{
+		"common/Android.bp": []byte(`
+		  aidl_interface {
+				name: "common",
+				srcs: ["ICommon.aidl"],
+				versions: ["1", "2"],
+			}
+		`),
+		"common/aidl_api/common/1/ICommon.aidl": nil,
+		"common/aidl_api/common/1/.hash":        nil,
+		"common/aidl_api/common/2/ICommon.aidl": nil,
+		"common/aidl_api/common/2/.hash":        nil,
+		"foo/Android.bp": []byte(`
+			aidl_interface {
+				name: "foo",
+				srcs: ["IFoo.aidl"],
+				imports: ["common"],
+				versions_with_info: [
+					{version: "1", imports: ["common"]},
+					{version: "2", imports: ["common-V2"]},
+				]
+			}
+		`),
+		"foo/aidl_api/foo/1/IFoo.aidl": nil,
+		"foo/aidl_api/foo/1/.hash":     nil,
+		"foo/aidl_api/foo/2/IFoo.aidl": nil,
+		"foo/aidl_api/foo/2/.hash":     nil,
+	}))
+}
+
+func TestFreezeApiDeps(t *testing.T) {
+	for _, transitive := range []bool{true, false} {
+		for _, testcase := range []struct {
+			string
+			bool
+		}{{"common-V3", true}, {"common-V2", false}} {
+			im := testcase.string
+			customizers := []android.FixturePreparer{
+				withFiles(map[string][]byte{
+					"common/Android.bp": []byte(`
+				  aidl_interface {
+						name: "common",
+						frozen: false,
+						srcs: ["ICommon.aidl"],
+						versions: ["1", "2"],
+					}
+				`),
+					"common/aidl_api/common/1/ICommon.aidl": nil,
+					"common/aidl_api/common/1/.hash":        nil,
+					"common/aidl_api/common/2/ICommon.aidl": nil,
+					"common/aidl_api/common/2/.hash":        nil,
+					"foo/Android.bp": []byte(fmt.Sprintf(`
+					aidl_interface {
+						name: "foo",
+						srcs: ["IFoo.aidl"],
+						imports: ["%s"],
+						frozen: false,
+						versions_with_info: [
+							{version: "1", imports: ["common-V1"]},
+							{version: "2", imports: ["common-V2"]},
+						]
+					}
+				`, im)),
+					"foo/aidl_api/foo/1/IFoo.aidl": nil,
+					"foo/aidl_api/foo/1/.hash":     nil,
+					"foo/aidl_api/foo/2/IFoo.aidl": nil,
+					"foo/aidl_api/foo/2/.hash":     nil,
+				}),
+			}
+			if transitive {
+				customizers = append(customizers, setTransitiveFreezeEnv())
+			}
+
+			ctx, _ := testAidl(t, ``, customizers...)
+			shouldHaveDep := transitive && testcase.bool
+			fooFreezeApiRule := ctx.ModuleForTests("foo-api", "").Output("update_or_freeze_api_3.timestamp")
+			commonFreezeApiOutput := ctx.ModuleForTests("common-api", "").Output("update_or_freeze_api_3.timestamp").Output.String()
+			testMethod := android.AssertStringListDoesNotContain
+			if shouldHaveDep {
+				testMethod = android.AssertStringListContains
+			}
+			testMethod(t, "Only if AIDL_TRANSITIVE_FREEZE is set and an aidl_interface depends on an another aidl_interface's ToT version, an imported aidl_interface should be frozen as well.",
+				fooFreezeApiRule.Implicits.Strings(), commonFreezeApiOutput)
+		}
+	}
+}
+
+func TestAidlNoUnfrozen(t *testing.T) {
+	customizer := withFiles(map[string][]byte{
+		"foo/Android.bp": []byte(`
+			aidl_interface {
+				name: "foo-iface",
+				srcs: ["a/Foo.aidl"],
+				versions: ["1", "2"],
+			}
+		`),
+		"foo/a/Foo.aidl": nil,
+		"foo/aidl_api/foo-iface/current/a/Foo.aidl": nil,
+		"foo/aidl_api/foo-iface/1/a/Foo.aidl":       nil,
+		"foo/aidl_api/foo-iface/1/.hash":            nil,
+		"foo/aidl_api/foo-iface/2/a/Foo.aidl":       nil,
+		"foo/aidl_api/foo-iface/2/.hash":            nil,
+	})
+	// setReleaseEnv() to set RELEASE_AIDL_USE_UNFROZEN to false
+	ctx, _ := testAidl(t, ``, setReleaseEnv(), customizer)
+
+	// compile (v1)
+	{
+		rule := ctx.ModuleForTests("foo-iface-V1-cpp-source", "").Output("a/Foo.cpp")
+		android.AssertStringDoesNotContain(t, "Frozen versions should not have the -previous_api_dir set",
+			rule.Args["optionalFlags"],
+			"-previous")
+	}
+	// compile (v2)
+	{
+		rule := ctx.ModuleForTests("foo-iface-V2-cpp-source", "").Output("a/Foo.cpp")
+		android.AssertStringDoesNotContain(t, "Frozen versions should not have the -previous_api_dir set",
+			rule.Args["optionalFlags"],
+			"-previous")
+	}
+	// compile ToT(v3)
+	{
+		rule := ctx.ModuleForTests("foo-iface-V3-cpp-source", "").Output("a/Foo.cpp")
+		android.AssertStringDoesContain(t, "An unfrozen interface with previously frozen version must have --previous_api_dir when RELEASE_AIDL_USE_UNFROZEN is false (setReleaseEnv())",
+			rule.Args["optionalFlags"],
+			"-previous_api_dir")
+		android.AssertStringDoesContain(t, "An unfrozen interface with previously frozen version must have --previous_hash when RELEASE_AIDL_USE_UNFROZEN is false (setReleaseEnv())",
+			rule.Args["optionalFlags"],
+			"-previous_hash")
+		android.AssertStringDoesContain(t, "--previous_hash must use the last frozen version's hash file",
+			rule.Args["optionalFlags"],
+			"foo-iface/2/.hash")
+	}
+}
+
+func TestAidlUsingUnfrozen(t *testing.T) {
+	customizer := withFiles(map[string][]byte{
+		"foo/Android.bp": []byte(`
+			aidl_interface {
+				name: "foo-iface",
+				srcs: ["a/Foo.aidl"],
+				versions: ["1", "2"],
+			}
+		`),
+		"foo/a/Foo.aidl": nil,
+		"foo/aidl_api/foo-iface/current/a/Foo.aidl": nil,
+		"foo/aidl_api/foo-iface/1/a/Foo.aidl":       nil,
+		"foo/aidl_api/foo-iface/1/.hash":            nil,
+		"foo/aidl_api/foo-iface/2/a/Foo.aidl":       nil,
+		"foo/aidl_api/foo-iface/2/.hash":            nil,
+	})
+	ctx, _ := testAidl(t, ``, customizer)
+
+	// compile (v2)
+	{
+		rule := ctx.ModuleForTests("foo-iface-V2-cpp-source", "").Output("a/Foo.cpp")
+		android.AssertStringDoesNotContain(t, "Frozen versions should not have the -previous_api_dir set",
+			rule.Args["optionalFlags"],
+			"-previous")
+	}
+	// compile ToT(v3)
+	{
+		rule := ctx.ModuleForTests("foo-iface-V3-cpp-source", "").Output("a/Foo.cpp")
+		android.AssertStringDoesNotContain(t, "Unfrozen versions should not have the -previous options when RELEASE_AIDL_USE_UNFROZEN is true (default)",
+			rule.Args["optionalFlags"],
+			"-previous")
+	}
+}
diff --git a/build/aidl_to_jni.py b/build/aidl_to_jni.py
new file mode 100755
index 0000000..55b1d52
--- /dev/null
+++ b/build/aidl_to_jni.py
@@ -0,0 +1,92 @@
+#!/usr/bin/env python3
+
+#
+# Copyright (C) 2019 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import sys
+
+DEFAULT_TYPES_TO_JNI = {
+  "boolean": "Z",
+  "byte": "B",
+  "char": "C",
+  "short": "S",
+  "int": "I",
+  "long": "J",
+  "float": "F",
+  "double": "D",
+  "void": "V",
+  "String": "Ljava/lang/String;"
+}
+
+class AIDLMalformedSignatureException(Exception):
+  """Line containing AIDL signature is invalid"""
+
+def convert_type(aidl_type):
+  if aidl_type.endswith("[]"):
+    return "[" + convert_type(aidl_type[:-2])
+  if aidl_type in DEFAULT_TYPES_TO_JNI:
+    return DEFAULT_TYPES_TO_JNI[aidl_type]
+  elif aidl_type.startswith("List<") | aidl_type.startswith("java.util.List<"):
+    return "Ljava/util/List;"
+  else:
+    return "L" + aidl_type.replace(".", "/") + ";"
+
+def convert_method(aidl_signature):
+  aidl_signature = aidl_signature.split("|")
+  if len(aidl_signature) != 4:
+    raise AIDLMalformedSignatureException()
+  class_name, method_name, args, return_type = aidl_signature
+  # Filter out empty arguments since there will be trailing commas
+  args = [x for x in args.split(",") if x]
+  jni_signature = convert_type(class_name)
+  jni_signature += "->"
+  jni_signature += method_name
+  jni_signature += "("
+  params = [convert_type(x) for x in args]
+  jni_signature += "".join(params)
+  jni_signature += ")"
+  jni_signature += convert_type(return_type)
+  return jni_signature
+
+def main(argv):
+  if len(argv) != 3:
+    print("Usage: %s <aidl-mappings> <jni-signature-mappings>" % argv[0])
+    return -1
+
+  aidl_mappings, jni_signature_mappings = argv[1:]
+
+  line_index = 0
+  skip_line = False
+  with open(aidl_mappings) as input_file:
+    with open(jni_signature_mappings, "w") as output_file:
+      for line in input_file:
+        if skip_line:
+          skip_line = False
+        elif line_index % 2 == 1:
+          output_file.write(line)
+        else:
+          try:
+            stripped_line = line.strip()
+            output_file.write(convert_method(line.strip()))
+            output_file.write("\n")
+          except AIDLMalformedSignatureException:
+            print("Malformed signature %s . Skipping..." % stripped_line)
+            # The next line contains the location, need to skip it
+            skip_line = True
+        line_index += 1
+
+if __name__ == "__main__":
+  sys.exit(main(sys.argv))
diff --git a/build/aidl_utils.go b/build/aidl_utils.go
new file mode 100644
index 0000000..4e0fba9
--- /dev/null
+++ b/build/aidl_utils.go
@@ -0,0 +1,57 @@
+// Copyright (C) 2021 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package aidl
+
+import (
+	"strings"
+)
+
+// wrap(p, a, s) = [p + v + s for v in a]
+func wrap(prefix string, strs []string, suffix string) []string {
+	ret := make([]string, len(strs))
+	for i, v := range strs {
+		ret[i] = prefix + v + suffix
+	}
+	return ret
+}
+
+// wrapFunc(p, a, s, f) = [p + f(v) + s for v in a]
+func wrapFunc(prefix string, strs []string, suffix string, f func(string) string) []string {
+	ret := make([]string, len(strs))
+	for i, v := range strs {
+		ret[i] = prefix + f(v) + suffix
+	}
+	return ret
+}
+
+// concat(a...) = sum((i for i in a), [])
+func concat(sstrs ...[]string) []string {
+	var ret []string
+	for _, v := range sstrs {
+		ret = append(ret, v...)
+	}
+	return ret
+}
+
+func fixRustName(name string) string {
+	return strings.Map(func(r rune) rune {
+		switch r {
+		case '-', '.':
+			return '_'
+		default:
+			return r
+		}
+	}, name)
+}
diff --git a/build/client-using-test-piece-3.cpp b/build/client-using-test-piece-3.cpp
new file mode 100644
index 0000000..dd52b2e
--- /dev/null
+++ b/build/client-using-test-piece-3.cpp
@@ -0,0 +1,6 @@
+#include <other_package/IBaz.h>
+
+// Enum type should be available here since IBaz.h includes Enum.h
+void acceptEnum(other_package::Enum n) {
+  (void)n;
+}
diff --git a/build/go.mod b/build/go.mod
new file mode 100644
index 0000000..f8bb1c0
--- /dev/null
+++ b/build/go.mod
@@ -0,0 +1,12 @@
+module android/soong/aidl
+
+go 1.18
+
+require (
+	android/soong v0.0.0
+	github.com/google/blueprint v0.0.0
+	google.golang.org/protobuf v0.0.0
+	prebuilts/bazel/common/proto/analysis_v2 v0.0.0
+	prebuilts/bazel/common/proto/build v0.0.0
+	go.starlark.net v0.0.0
+)
diff --git a/build/go.work b/build/go.work
new file mode 100644
index 0000000..7e3f386
--- /dev/null
+++ b/build/go.work
@@ -0,0 +1,19 @@
+go 1.18
+
+use (
+	.
+	../../../../build/soong
+	../../../../build/blueprint
+	../../../../external/go-cmp
+	../../../../external/golang-protobuf
+)
+
+replace (
+	android/soong v0.0.0 => ../../../../build/soong
+	google.golang.org/protobuf v0.0.0 => ../../../../external/golang-protobuf
+	github.com/google/blueprint v0.0.0 => ../../../../build/blueprint
+	github.com/google/go-cmp v0.0.0 => ../../../../external/go-cmp
+	prebuilts/bazel/common/proto/analysis_v2 v0.0.0 => ../../../../prebuilts/bazel/common/proto/analysis_v2
+	prebuilts/bazel/common/proto/build v0.0.0 => ../../../../prebuilts/bazel/common/proto/build
+	go.starlark.net v0.0.0 => ../../../../external/starlark-go
+)
diff --git a/build/go.work.sum b/build/go.work.sum
new file mode 100644
index 0000000..d00184f
--- /dev/null
+++ b/build/go.work.sum
@@ -0,0 +1,66 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
+github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
+github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
+honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/build/hash_gen.sh b/build/hash_gen.sh
new file mode 100755
index 0000000..536cded
--- /dev/null
+++ b/build/hash_gen.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2021 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -e
+
+if [ $# != 3 ]; then
+  echo "Usage: hash_gen.sh <api_path> <latest-version> <hash_file_path>"
+  exit 1
+fi
+
+# This adds a new hash to the file if one already exists.
+# We can have multiple hashes in a hash file so we can still identify previous
+# iterations of this interfaces that were released.
+(cd $1 && find ./ -name "*.aidl" -print0 | LC_ALL=C sort -z | xargs -0 sha1sum && echo $2) | sha1sum | cut -d " " -f 1 >> $3
diff --git a/build/message_check_compatibility.txt b/build/message_check_compatibility.txt
new file mode 100644
index 0000000..1df7544
--- /dev/null
+++ b/build/message_check_compatibility.txt
@@ -0,0 +1,7 @@
+###############################################################################
+# ERROR: Backward incompatible change detected on AIDL API                    #
+###############################################################################
+Above AIDL file(s) has changed in a backward-incompatible way, e.g. removing
+a method from an interface or a field from a parcelable. If a device is shipped
+with this change by ignoring this message, it has a high risk of breaking later
+when a module using the interface is updated, e.g., Maineline modules.
diff --git a/build/message_check_equality.txt b/build/message_check_equality.txt
new file mode 100644
index 0000000..c76a3b4
--- /dev/null
+++ b/build/message_check_equality.txt
@@ -0,0 +1,8 @@
+###############################################################################
+# ERROR: AIDL API change detected                                             #
+###############################################################################
+Above AIDL file(s) has changed. Run `m %s-update-api` to reflect the changes
+to the current version so that it is reviewed by
+android-aidl-api-council@google.com
+And then you need to change dependency on %s-V(n)-* to %s-V(n+1)-* to use
+new APIs.
diff --git a/build/message_check_equality_frozen.txt b/build/message_check_equality_frozen.txt
new file mode 100644
index 0000000..08b169a
--- /dev/null
+++ b/build/message_check_equality_frozen.txt
@@ -0,0 +1,9 @@
+###############################################################################
+# ERROR: AIDL API change detected on frozen interface                         #
+###############################################################################
+Above AIDL file(s) has changed. The AIDL API is marked `frozen: true` so it
+cannot be modified. Change this to `frozen: false`, then run `m %s-update-api`
+to reflect the changes to the current version so that it is reviewed by
+android-aidl-api-council@google.com.
+And then you need to change dependency on %s-V(n)-* to %s-V(n+1)-* to use
+new APIs.
diff --git a/build/message_check_integrity.txt b/build/message_check_integrity.txt
new file mode 100644
index 0000000..57aaa90
--- /dev/null
+++ b/build/message_check_integrity.txt
@@ -0,0 +1,7 @@
+###############################################################################
+# ERROR: Modification detected of stable AIDL API file                        #
+###############################################################################
+Above AIDL file(s) has changed, resulting in a different hash. Hash values may
+be checked at runtime to verify interface stability. If a device is shipped
+with this change by ignoring this message, it has a high risk of breaking later
+when a module using the interface is updated, e.g., Mainline modules.
diff --git a/build/properties.go b/build/properties.go
new file mode 100644
index 0000000..f4cfc9a
--- /dev/null
+++ b/build/properties.go
@@ -0,0 +1,120 @@
+// Copyright (C) 2017 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package aidl
+
+type nameProperties struct {
+	Name *string
+}
+
+type hostProperties struct {
+	Cflags []string
+}
+
+type darwinProperties struct {
+	Enabled *bool
+}
+
+type imageProperties struct {
+	Shared_libs         []string
+	Header_libs         []string
+	Exclude_shared_libs []string
+	Cflags              []string
+}
+
+type ccTargetProperties struct {
+	Host     hostProperties
+	Darwin   darwinProperties
+	Platform imageProperties
+	Vendor   imageProperties
+	Product  imageProperties
+}
+
+type rustTargetProperties struct {
+	Darwin darwinProperties
+}
+
+type ccProperties struct {
+	Name                      *string
+	Owner                     *string
+	Defaults                  []string
+	Double_loadable           *bool
+	Vendor_available          *bool
+	Odm_available             *bool
+	Product_available         *bool
+	Recovery_available        *bool
+	Host_supported            *bool
+	Installable               *bool
+	Generated_sources         []string
+	Generated_headers         []string
+	Shared_libs               []string
+	Static_libs               []string
+	Export_shared_lib_headers []string
+	Export_generated_headers  []string
+	Header_libs               []string
+	Sdk_version               *string
+	Stl                       *string
+	Cpp_std                   *string
+	Cflags                    []string
+	Stem                      *string
+	Apex_available            []string
+	Min_sdk_version           *string
+	Target                    ccTargetProperties
+	Tidy                      *bool
+	Tidy_flags                []string
+	Tidy_checks_as_errors     []string
+	Include_build_directory   *bool
+}
+
+type javaProperties struct {
+	Name            *string
+	Owner           *string
+	Defaults        []string
+	Installable     *bool
+	Sdk_version     *string
+	Platform_apis   *bool
+	Srcs            []string
+	Static_libs     []string
+	Apex_available  []string
+	Min_sdk_version *string
+}
+
+type rustProperties struct {
+	Name              *string
+	Crate_name        string
+	Owner             *string
+	Defaults          []string
+	Host_supported    *bool
+	Vendor_available  *bool
+	Product_available *bool
+	Srcs              []string
+	Rustlibs          []string
+	Stem              *string
+	Target            rustTargetProperties
+	Apex_available    []string
+	Min_sdk_version   *string
+}
+
+type Bazel_module struct {
+	Bp2build_available *bool
+	Label              *string
+}
+type bazelProperties struct {
+	*Bazel_module
+}
+
+type phonyProperties struct {
+	Name     *string
+	Required []string
+}
diff --git a/build/test_package/IBaz.aidl b/build/test_package/IBaz.aidl
new file mode 100644
index 0000000..599ef90
--- /dev/null
+++ b/build/test_package/IBaz.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package test_package;
+
+import some_package.IBar;
+
+@SuppressWarnings(value={"mixed-oneway", "inout-parameter", "out-array"})
+interface IBaz {
+    oneway void CanYouDealWithThisBar(in IBar bar);
+    void MethodAddedInVersion2();
+
+    ParcelFileDescriptor readPFD();
+    void writePFD(in ParcelFileDescriptor fd);
+    void readWritePFD(inout ParcelFileDescriptor fd);
+
+    ParcelFileDescriptor[] readPFDArray();
+    void writePFDArray(in ParcelFileDescriptor[] fds);
+    void readWritePFDArray(inout ParcelFileDescriptor[] fds);
+}
diff --git a/build/tests_1/INoPackage.aidl b/build/tests_1/INoPackage.aidl
new file mode 100644
index 0000000..2ce68f3
--- /dev/null
+++ b/build/tests_1/INoPackage.aidl
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import some_package.IBar;
+
+interface INoPackage {
+    void CanYouDealWithThisBar(in IBar bar);
+}
diff --git a/build/tests_1/other_package/Enum.aidl b/build/tests_1/other_package/Enum.aidl
new file mode 100644
index 0000000..dc005a5
--- /dev/null
+++ b/build/tests_1/other_package/Enum.aidl
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package other_package;
+
+enum Enum { ZERO, ONE }
diff --git a/build/tests_1/other_package/IBaz.aidl b/build/tests_1/other_package/IBaz.aidl
new file mode 100644
index 0000000..9d04692
--- /dev/null
+++ b/build/tests_1/other_package/IBaz.aidl
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package other_package;
+
+import other_package.Enum;
+import some_package.IBar;
+
+interface IBaz {
+    const int ZERO = Enum.ZERO;
+    void CanYouDealWithThisBar(in IBar bar);
+}
diff --git a/build/tests_1/some_package/IBar.aidl b/build/tests_1/some_package/IBar.aidl
new file mode 100644
index 0000000..3d752c1
--- /dev/null
+++ b/build/tests_1/some_package/IBar.aidl
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package some_package;
+
+import some_package.IFoo;
+
+oneway interface IBar {
+    void CanYouDealWithThisFoo(in IFoo foo);
+}
diff --git a/build/tests_1/some_package/IFoo.aidl b/build/tests_1/some_package/IFoo.aidl
new file mode 100644
index 0000000..4aa63b8
--- /dev/null
+++ b/build/tests_1/some_package/IFoo.aidl
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package some_package;
+
+import some_package.Thing;
+import some_package.sub_package.SubThing;
+
+@SuppressWarnings(value={"inout-parameter"})
+interface IFoo {
+    void CanYouDealWithThisThing(inout Thing parcel);
+    void CanYouDealWithThisSubThing(inout SubThing parcel);
+}
diff --git a/build/tests_1/some_package/Thing.aidl b/build/tests_1/some_package/Thing.aidl
new file mode 100644
index 0000000..0ffd7b6
--- /dev/null
+++ b/build/tests_1/some_package/Thing.aidl
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package some_package;
+
+parcelable Thing {
+    int a;
+    int b;
+}
diff --git a/build/tests_1/some_package/sub_package/IFoo.aidl b/build/tests_1/some_package/sub_package/IFoo.aidl
new file mode 100644
index 0000000..26a71f4
--- /dev/null
+++ b/build/tests_1/some_package/sub_package/IFoo.aidl
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package some_package.sub_package;
+
+import some_package.Thing;
+import some_package.sub_package.SubThing;
+
+@SuppressWarnings(value={"inout-parameter"})
+interface IFoo {
+    void CanYouDealWithThisThing(inout Thing parcel);
+    void CanYouDealWithThisSubThing(inout SubThing parcel);
+}
diff --git a/build/tests_1/some_package/sub_package/SubThing.aidl b/build/tests_1/some_package/sub_package/SubThing.aidl
new file mode 100644
index 0000000..fc50dc6
--- /dev/null
+++ b/build/tests_1/some_package/sub_package/SubThing.aidl
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package some_package.sub_package;
+
+parcelable SubThing {
+    int a;
+    int b;
+}
diff --git a/build/tests_2/another_package/IFaz.aidl b/build/tests_2/another_package/IFaz.aidl
new file mode 100644
index 0000000..14de2dd
--- /dev/null
+++ b/build/tests_2/another_package/IFaz.aidl
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package another_package;
+
+import some_package.IFoo;
+
+interface IFaz {
+    void CanYouDealWithThisFoo(in IFoo foo);
+}
diff --git a/build/tests_3/EmptyParcelable.aidl b/build/tests_3/EmptyParcelable.aidl
new file mode 100644
index 0000000..1809305
--- /dev/null
+++ b/build/tests_3/EmptyParcelable.aidl
@@ -0,0 +1 @@
+parcelable EmptyParcelable {}
diff --git a/build/tests_3/IEmptyInterface.aidl b/build/tests_3/IEmptyInterface.aidl
new file mode 100644
index 0000000..6d95630
--- /dev/null
+++ b/build/tests_3/IEmptyInterface.aidl
@@ -0,0 +1 @@
+interface IEmptyInterface {}
diff --git a/build/tests_6/test6/Bar.aidl b/build/tests_6/test6/Bar.aidl
new file mode 100644
index 0000000..671efac
--- /dev/null
+++ b/build/tests_6/test6/Bar.aidl
@@ -0,0 +1,7 @@
+package test6;
+
+import test6.Foo;
+
+parcelable Bar {
+    Foo[] foos;
+}
diff --git a/build/tests_6/test6/Foo.aidl b/build/tests_6/test6/Foo.aidl
new file mode 100644
index 0000000..143d9f2
--- /dev/null
+++ b/build/tests_6/test6/Foo.aidl
@@ -0,0 +1,6 @@
+package test6;
+
+parcelable Foo {
+    ParcelableHolder ph;
+    ParcelFileDescriptor[] pfds; // not moveable
+}
diff --git a/build/tests_bp2build/Android.bp b/build/tests_bp2build/Android.bp
new file mode 100644
index 0000000..8451a46
--- /dev/null
+++ b/build/tests_bp2build/Android.bp
@@ -0,0 +1,92 @@
+// Copyright (C) 2022 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "system_tools_aidl_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["system_tools_aidl_license"],
+}
+
+aidl_interface {
+    name: "example-dep-aidl-interfaces",
+    local_include_dir: "src",
+    srcs: [
+        "src/a/b/AB.aidl",
+    ],
+    backend: {
+        java: {
+            // TODO(b/285574832) reenable aidl tests
+            enabled: false,
+            min_sdk_version: "29",
+        },
+        ndk: {
+            enabled: false,
+        },
+        cpp: {
+            enabled: false,
+        },
+    },
+    versions: [
+        "1",
+    ],
+
+}
+
+aidl_interface {
+    name: "example-aidl-interfaces",
+    local_include_dir: "src",
+    srcs: [
+        "src/c/d/CD.aidl",
+        "src/c/d/CD2.aidl",
+    ],
+    backend: {
+        java: {
+            // TODO(b/285574832) reenable aidl tests
+            enabled: false,
+            min_sdk_version: "29",
+        },
+        ndk: {
+            enabled: false,
+        },
+        cpp: {
+            enabled: false,
+        },
+    },
+    imports: ["example-dep-aidl-interfaces-V1"],
+    versions: [
+        "1",
+        "2",
+    ],
+}
+
+// TODO(b/285574832) reenable aidl tests
+//java_library {
+//    name: "example-aidl-latest",
+//    sdk_version: "system_current",
+//    min_sdk_version: "29",
+//    static_libs: [
+//        "example-aidl-interfaces-V2-java",
+//    ],
+//}
+//
+//java_library {
+//    name: "example-aidl-test",
+//    sdk_version: "system_current",
+//    min_sdk_version: "29",
+//    srcs: ["src/android/Test.java"],
+//    static_libs: ["example-aidl-latest"],
+//}
diff --git a/build/tests_bp2build/aidl_api/example-aidl-interfaces/1/.hash b/build/tests_bp2build/aidl_api/example-aidl-interfaces/1/.hash
new file mode 100644
index 0000000..0dc8683
--- /dev/null
+++ b/build/tests_bp2build/aidl_api/example-aidl-interfaces/1/.hash
@@ -0,0 +1 @@
+75e4c4fe9993977f16577571a51e8f40468ab7bf
diff --git a/build/tests_bp2build/aidl_api/example-aidl-interfaces/1/c/d/CD.aidl b/build/tests_bp2build/aidl_api/example-aidl-interfaces/1/c/d/CD.aidl
new file mode 100644
index 0000000..412a297
--- /dev/null
+++ b/build/tests_bp2build/aidl_api/example-aidl-interfaces/1/c/d/CD.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package c.d;
+parcelable CD {
+    int cd;
+    a.b.AB ab;
+}
diff --git a/build/tests_bp2build/aidl_api/example-aidl-interfaces/2/.hash b/build/tests_bp2build/aidl_api/example-aidl-interfaces/2/.hash
new file mode 100644
index 0000000..f340630
--- /dev/null
+++ b/build/tests_bp2build/aidl_api/example-aidl-interfaces/2/.hash
@@ -0,0 +1 @@
+b40733528cd90cf1c4457b08e3be2cc05ea146bd
diff --git a/build/tests_bp2build/aidl_api/example-aidl-interfaces/2/c/d/CD.aidl b/build/tests_bp2build/aidl_api/example-aidl-interfaces/2/c/d/CD.aidl
new file mode 100644
index 0000000..412a297
--- /dev/null
+++ b/build/tests_bp2build/aidl_api/example-aidl-interfaces/2/c/d/CD.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package c.d;
+parcelable CD {
+    int cd;
+    a.b.AB ab;
+}
diff --git a/build/tests_bp2build/aidl_api/example-aidl-interfaces/2/c/d/CD2.aidl b/build/tests_bp2build/aidl_api/example-aidl-interfaces/2/c/d/CD2.aidl
new file mode 100644
index 0000000..392354c
--- /dev/null
+++ b/build/tests_bp2build/aidl_api/example-aidl-interfaces/2/c/d/CD2.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package c.d;
+parcelable CD2 {
+    int cd;
+    a.b.AB ab;
+}
diff --git a/build/tests_bp2build/aidl_api/example-aidl-interfaces/current/c/d/CD.aidl b/build/tests_bp2build/aidl_api/example-aidl-interfaces/current/c/d/CD.aidl
new file mode 100644
index 0000000..412a297
--- /dev/null
+++ b/build/tests_bp2build/aidl_api/example-aidl-interfaces/current/c/d/CD.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package c.d;
+parcelable CD {
+    int cd;
+    a.b.AB ab;
+}
diff --git a/build/tests_bp2build/aidl_api/example-aidl-interfaces/current/c/d/CD2.aidl b/build/tests_bp2build/aidl_api/example-aidl-interfaces/current/c/d/CD2.aidl
new file mode 100644
index 0000000..392354c
--- /dev/null
+++ b/build/tests_bp2build/aidl_api/example-aidl-interfaces/current/c/d/CD2.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package c.d;
+parcelable CD2 {
+    int cd;
+    a.b.AB ab;
+}
diff --git a/build/tests_bp2build/aidl_api/example-dep-aidl-interfaces/1/.hash b/build/tests_bp2build/aidl_api/example-dep-aidl-interfaces/1/.hash
new file mode 100644
index 0000000..f76e098
--- /dev/null
+++ b/build/tests_bp2build/aidl_api/example-dep-aidl-interfaces/1/.hash
@@ -0,0 +1 @@
+19b952f31738360300aa261bef511d97d6001196
diff --git a/build/tests_bp2build/aidl_api/example-dep-aidl-interfaces/1/a/b/AB.aidl b/build/tests_bp2build/aidl_api/example-dep-aidl-interfaces/1/a/b/AB.aidl
new file mode 100644
index 0000000..5293957
--- /dev/null
+++ b/build/tests_bp2build/aidl_api/example-dep-aidl-interfaces/1/a/b/AB.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package a.b;
+parcelable AB {
+    int ab;
+}
diff --git a/build/tests_bp2build/aidl_api/example-dep-aidl-interfaces/current/a/b/AB.aidl b/build/tests_bp2build/aidl_api/example-dep-aidl-interfaces/current/a/b/AB.aidl
new file mode 100644
index 0000000..5293957
--- /dev/null
+++ b/build/tests_bp2build/aidl_api/example-dep-aidl-interfaces/current/a/b/AB.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package a.b;
+parcelable AB {
+    int ab;
+}
diff --git a/build/tests_bp2build/src/a/b/AB.aidl b/build/tests_bp2build/src/a/b/AB.aidl
new file mode 100644
index 0000000..8665cbc
--- /dev/null
+++ b/build/tests_bp2build/src/a/b/AB.aidl
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package a.b;
+
+parcelable AB {
+    int ab;
+}
diff --git a/build/tests_bp2build/src/a/b/AB2.aidl b/build/tests_bp2build/src/a/b/AB2.aidl
new file mode 100644
index 0000000..31d0cbc
--- /dev/null
+++ b/build/tests_bp2build/src/a/b/AB2.aidl
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package a.b;
+
+parcelable AB2 {
+    int ab;
+}
diff --git a/build/tests_bp2build/src/android/Test.java b/build/tests_bp2build/src/android/Test.java
new file mode 100644
index 0000000..3238977
--- /dev/null
+++ b/build/tests_bp2build/src/android/Test.java
@@ -0,0 +1,23 @@
+// Copyright (C) 2022 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package android;
+
+import c.d.CD;
+import c.d.CD2;
+
+class Test {
+  CD cd;
+  CD2 cd2;
+}
diff --git a/build/tests_bp2build/src/c/d/CD.aidl b/build/tests_bp2build/src/c/d/CD.aidl
new file mode 100644
index 0000000..17a3af4
--- /dev/null
+++ b/build/tests_bp2build/src/c/d/CD.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package c.d;
+
+import a.b.AB;
+
+parcelable CD {
+    int cd;
+    AB ab;
+}
diff --git a/build/tests_bp2build/src/c/d/CD2.aidl b/build/tests_bp2build/src/c/d/CD2.aidl
new file mode 100644
index 0000000..e10f959
--- /dev/null
+++ b/build/tests_bp2build/src/c/d/CD2.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package c.d;
+
+import a.b.AB;
+
+parcelable CD2 {
+    int cd;
+    AB ab;
+}
diff --git a/build/tests_transitive_parcel/a/IA.aidl b/build/tests_transitive_parcel/a/IA.aidl
new file mode 100644
index 0000000..ff097f0
--- /dev/null
+++ b/build/tests_transitive_parcel/a/IA.aidl
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package tests_transitive_parcel.a;
+
+import tests_transitive_parcel.b.B;
+
+interface IA {
+    B getB();
+}
diff --git a/build/tests_transitive_parcel/b/B.aidl b/build/tests_transitive_parcel/b/B.aidl
new file mode 100644
index 0000000..3468d30
--- /dev/null
+++ b/build/tests_transitive_parcel/b/B.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package tests_transitive_parcel.b;
+
+import tests_transitive_parcel.c.C;
+
+parcelable B {
+    int i;
+    C c;
+}
diff --git a/build/tests_transitive_parcel/c/C.aidl b/build/tests_transitive_parcel/c/C.aidl
new file mode 100644
index 0000000..697a9f1
--- /dev/null
+++ b/build/tests_transitive_parcel/c/C.aidl
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package tests_transitive_parcel.c;
+
+parcelable C {
+    int i;
+}
diff --git a/build/tests_vintf/vintf/IFoo.aidl b/build/tests_vintf/vintf/IFoo.aidl
new file mode 100644
index 0000000..67d3ab1
--- /dev/null
+++ b/build/tests_vintf/vintf/IFoo.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package vintf;
+
+@VintfStability
+interface IFoo {
+    parcelable Foo {
+        String a;
+    }
+    union A {
+        String a;
+        int b;
+    }
+    enum E { A, B, C }
+
+    Foo[] abar(in Foo[] f);
+    ParcelFileDescriptor afd(in ParcelFileDescriptor fd);
+    E ae(in E e);
+    A aa(in A a);
+}
diff --git a/check_valid.cpp b/check_valid.cpp
new file mode 100644
index 0000000..b572d7d
--- /dev/null
+++ b/check_valid.cpp
@@ -0,0 +1,173 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "check_valid.h"
+#include "aidl.h"
+
+#include <vector>
+
+namespace android {
+namespace aidl {
+
+using TypePredicate = std::function<bool(const AidlTypeSpecifier&)>;
+using DefinedTypePredicate = std::function<bool(const AidlDefinedType&)>;
+
+namespace {
+bool IsListOf(const AidlTypeSpecifier& type, TypePredicate pred) {
+  return type.GetName() == "List" && type.IsGeneric() && type.GetTypeParameters().size() == 1 &&
+         pred(*type.GetTypeParameters().at(0));
+}
+bool IsArrayOf(const AidlTypeSpecifier& type, TypePredicate pred) {
+  return type.IsArray() && pred(type);
+}
+bool IsInterface(const AidlTypeSpecifier& type) {
+  return type.GetDefinedType() && type.GetDefinedType()->AsInterface();
+}
+}  // namespace
+
+struct CheckTypeVisitor : AidlVisitor {
+  bool success = true;
+  std::vector<TypePredicate> checkers;
+  std::vector<DefinedTypePredicate> defined_checkers;
+
+  void Visit(const AidlTypeSpecifier& type) override {
+    for (auto& checker : checkers) {
+      if (!checker(type)) {
+        success = false;
+      }
+    }
+  }
+  void Visit(const AidlInterface& t) override { CheckDefinedType(t); }
+  void Visit(const AidlEnumDeclaration& t) override { CheckDefinedType(t); }
+  void Visit(const AidlStructuredParcelable& t) override { CheckDefinedType(t); }
+  void Visit(const AidlUnionDecl& t) override { CheckDefinedType(t); }
+  void Visit(const AidlParcelable& t) override { CheckDefinedType(t); }
+
+  void Check(TypePredicate checker) { checkers.push_back(std::move(checker)); }
+  void Check(DefinedTypePredicate checker) { defined_checkers.push_back(std::move(checker)); }
+
+ private:
+  void CheckDefinedType(const AidlDefinedType& type) {
+    for (auto& checker : defined_checkers) {
+      if (!checker(type)) {
+        success = false;
+      }
+    }
+  }
+};
+
+bool CheckValid(const AidlDocument& doc, const Options& options) {
+  const auto lang = options.TargetLanguage();
+  const auto min_sdk_version = options.GetMinSdkVersion();
+
+  CheckTypeVisitor v;
+
+  v.Check([&](const AidlTypeSpecifier& type) {
+    const auto valid_version = MinSdkVersionFromString("Tiramisu").value();
+    if ((IsListOf(type, IsInterface) || IsArrayOf(type, IsInterface)) &&
+        lang == Options::Language::JAVA && min_sdk_version < valid_version) {
+      const auto kind = IsListOf(type, IsInterface) ? "List" : "Array";
+      AIDL_ERROR(type) << kind << " of interfaces is available since SDK = " << valid_version
+                       << " in Java. Current min_sdk_version is " << min_sdk_version << ".";
+      return false;
+    }
+    return true;
+  });
+
+  v.Check([&](const AidlTypeSpecifier& type) {
+    const auto valid_version = MinSdkVersionFromString("S").value();
+    if (type.GetName() == "ParcelableHolder" && min_sdk_version < valid_version) {
+      AIDL_ERROR(type) << " ParcelableHolder is available since SDK = " << valid_version
+                       << ". Current min_sdk_version is " << min_sdk_version << ".";
+      return false;
+    }
+    return true;
+  });
+
+  // Check all nested types for potential #include cycles that would contain
+  // them. The algorithm performs a depth-first search on a graph with the
+  // following properties:
+  //
+  // * Graph nodes are top-level (non-nested) types, under the assumption that
+  //   there is a 1:1 mapping between top-level types and included headers. This
+  //   implies that a cycle between these types will be equivalent to a cycle
+  //   between headers.
+  //
+  // * Each edge U -> V represents a "declare V before U" relationship between
+  //   types. This means that V.h needs to be included by U.h, or the V type
+  //   needs to be forward-declared before U. For any type U, its neighbors
+  //   are all nodes V such that U or its nested types have a reference to V
+  //   or any type nested in it.
+  //
+  // * The algorithm tries to find a cycle containing start_type. Such a
+  //   cycle exists if the following hold true:
+  //   * There exists a path from start_type to another top-level type T
+  //     (different from start_type)
+  //   * There is a back edge from T to start_type which closes the cycle
+  v.Check([&](const AidlDefinedType& start_type) {
+    if (start_type.GetParentType() == nullptr) {
+      return true;
+    }
+
+    std::set<const AidlDefinedType*> visited;
+    std::function<bool(const AidlDefinedType*)> dfs = [&](const AidlDefinedType* type) {
+      if (!visited.insert(type).second) {
+        // Already visited
+        return false;
+      }
+
+      for (const auto& t : Collect<AidlTypeSpecifier>(*type)) {
+        auto defined_type = t->GetDefinedType();
+        if (!defined_type) {
+          // Skip primitive/builtin types
+          continue;
+        }
+
+        auto top_type = defined_type->GetRootType();
+        if (top_type == type) {
+          // Skip type references within the same top-level type
+          continue;
+        }
+
+        if (defined_type == &start_type) {
+          // Found a cycle back to the starting nested type
+          return true;
+        }
+
+        if (dfs(top_type)) {
+          // Found a cycle while visiting the top type for the next node
+          return true;
+        }
+      }
+
+      return false;
+    };
+
+    bool has_cycle = dfs(start_type.GetRootType());
+    if (has_cycle) {
+      AIDL_ERROR(start_type) << "has cyclic references to nested types.";
+      return false;
+    }
+
+    return true;
+  });
+
+  VisitTopDown(v, doc);
+  return v.success;
+}
+
+}  // namespace aidl
+}  // namespace android
diff --git a/check_valid.h b/check_valid.h
new file mode 100644
index 0000000..0fdd220
--- /dev/null
+++ b/check_valid.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "aidl_language.h"
+#include "options.h"
+
+namespace android {
+namespace aidl {
+
+bool CheckValid(const AidlDocument& doc, const Options& options);
+
+}
+}  // namespace android
\ No newline at end of file
diff --git a/code_writer.cpp b/code_writer.cpp
new file mode 100644
index 0000000..773a598
--- /dev/null
+++ b/code_writer.cpp
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "code_writer.h"
+
+#include "logging.h"
+
+#include <stdarg.h>
+#include <fstream>
+#include <iostream>
+#include <sstream>
+#include <unordered_map>
+#include <vector>
+
+#include <android-base/stringprintf.h>
+
+namespace android {
+namespace aidl {
+
+CodeWriter::CodeWriter(std::unique_ptr<std::ostream> ostream) : ostream_(std::move(ostream)) {}
+
+std::string CodeWriter::ApplyIndent(const std::string& str) {
+  std::string output;
+  if (!start_of_line_ || str == "\n") {
+    output = str;
+  } else {
+    output = std::string(indent_level_ * 2, ' ') + str;
+  }
+  start_of_line_ = !output.empty() && output.back() == '\n';
+  return output;
+}
+
+bool CodeWriter::Write(const char* format, ...) {
+  va_list ap;
+  va_start(ap, format);
+  std::string formatted;
+  android::base::StringAppendV(&formatted, format, ap);
+  va_end(ap);
+
+  // extract lines. empty line is preserved.
+  std::vector<std::string> lines;
+  size_t pos = 0;
+  while (pos < formatted.size()) {
+    size_t line_end = formatted.find('\n', pos);
+    if (line_end != std::string::npos) {
+      lines.push_back(formatted.substr(pos, (line_end - pos) + 1));
+      pos = line_end + 1;
+    } else {
+      lines.push_back(formatted.substr(pos));
+      break;
+    }
+  }
+
+  std::string indented;
+  for (const auto& line : lines) {
+    indented.append(ApplyIndent(line));
+  }
+
+  (*ostream_) << indented;
+  return !ostream_->fail();
+}
+
+void CodeWriter::Indent() {
+  indent_level_++;
+}
+void CodeWriter::Dedent() {
+  AIDL_FATAL_IF(indent_level_ <= 0, "Mismatched dedent");
+
+  indent_level_--;
+}
+
+bool CodeWriter::Close() {
+  if (ostream_.get()->rdbuf() != std::cout.rdbuf()) {
+    // if the steam is for file (not stdout), do the close.
+    static_cast<std::fstream*>(ostream_.get())->close();
+    return !ostream_->fail();
+  }
+  return true;
+}
+
+CodeWriter& CodeWriter::operator<<(const char* s) {
+  Write("%s", s);
+  return *this;
+}
+
+CodeWriter& CodeWriter::operator<<(const std::string& str) {
+  Write("%s", str.c_str());
+  return *this;
+}
+
+CodeWriterPtr CodeWriter::ForFile(const std::string& filename) {
+  std::unique_ptr<std::ostream> stream;
+  if (filename == "-") {
+    stream = std::unique_ptr<std::ostream>(new std::ostream(std::cout.rdbuf()));
+  } else {
+    stream = std::unique_ptr<std::ostream>(
+        new std::fstream(filename, std::fstream::out | std::fstream::binary));
+  }
+  return CodeWriterPtr(new CodeWriter(std::move(stream)));
+}
+
+CodeWriterPtr CodeWriter::ForString(std::string* buf) {
+  // This class is defined inside this static function of CodeWriter
+  // in order to have access to private constructor and private member
+  // ostream_.
+  class StringCodeWriter : public CodeWriter {
+   public:
+    StringCodeWriter(std::string* buf)
+        : CodeWriter(std::unique_ptr<std::ostream>(new std::stringstream())), buf_(buf) {}
+    ~StringCodeWriter() override { Close(); }
+    bool Close() override {
+      // extract whats written to the stringstream to the external buffer.
+      // we are sure that ostream_ is indeed stringstream.
+      *buf_ = static_cast<std::stringstream*>(ostream_.get())->str();
+      return true;
+    }
+
+   private:
+    std::string* buf_;
+  };
+  return CodeWriterPtr(new StringCodeWriter(buf));
+}
+
+std::string QuotedEscape(const std::string& str) {
+  std::string result;
+  result += '"';
+  static const std::unordered_map<char, std::string> escape = {
+      {'"', "\\\""}, {'\\', "\\\\"}, {'\n', "\\n"}, {'\r', "\\r"}, {'\t', "\\t"}, {'\v', "\\v"},
+  };
+  for (auto c : str) {
+    auto it = escape.find(c);
+    if (it != escape.end()) {
+      result += it->second;
+    } else {
+      result += c;
+    }
+  }
+  result += '"';
+  return result;
+}
+
+}  // namespace aidl
+}  // namespace android
diff --git a/code_writer.h b/code_writer.h
new file mode 100644
index 0000000..7501385
--- /dev/null
+++ b/code_writer.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <stdio.h>
+
+#include <functional>
+#include <memory>
+#include <ostream>
+#include <string>
+#include <utility>
+
+namespace android {
+namespace aidl {
+
+class CodeWriter;
+using CodeWriterPtr = std::unique_ptr<CodeWriter>;
+
+class CodeWriter {
+ public:
+  // Get a CodeWriter that writes to a file. When filename is "-",
+  // it is written to stdout.
+  static CodeWriterPtr ForFile(const std::string& filename);
+  // Get a CodeWriter that writes to a string buffer.
+  // The buffer gets updated only after Close() is called or the CodeWriter
+  // is deleted -- much like a real file.
+  static CodeWriterPtr ForString(std::string* buf);
+  // Write a formatted string to this writer in the usual printf sense.
+  // Returns false on error.
+  virtual bool Write(const char* format, ...) __attribute__((format(printf, 2, 3)));
+  void Indent();
+  void Dedent();
+  virtual bool Close();
+  virtual ~CodeWriter() = default;
+  CodeWriter() = default;
+
+  CodeWriter& operator<<(const char* s);
+  CodeWriter& operator<<(const std::string& str);
+
+ private:
+  CodeWriter(std::unique_ptr<std::ostream> ostream);
+  std::string ApplyIndent(const std::string& str);
+  const std::unique_ptr<std::ostream> ostream_;
+  int indent_level_ {0};
+  bool start_of_line_ {true};
+};
+
+std::string QuotedEscape(const std::string& str);
+
+}  // namespace aidl
+}  // namespace android
diff --git a/code_writer_unittest.cpp b/code_writer_unittest.cpp
new file mode 100644
index 0000000..76a2af5
--- /dev/null
+++ b/code_writer_unittest.cpp
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "code_writer.h"
+
+#include <gtest/gtest.h>
+#include <string>
+
+using android::aidl::CodeWriter;
+using std::string;
+using std::unique_ptr;
+
+namespace android {
+namespace aidl {
+
+TEST(CodeWriterTest, AppendOperator) {
+  string str;
+  CodeWriterPtr ptr = CodeWriter::ForString(&str);
+  CodeWriter& writer = *ptr;
+  writer << "Write this";
+  writer.Close();
+  EXPECT_EQ(str, "Write this");
+}
+
+TEST(CodeWriterTest, AppendOperatorCascade) {
+  string str;
+  CodeWriterPtr ptr = CodeWriter::ForString(&str);
+  CodeWriter& writer = *ptr;
+  writer << "Write this " << "and that";
+  writer.Close();
+  EXPECT_EQ(str, "Write this and that");
+}
+
+TEST(CodeWriterTest, WorksWithNonAscii) {
+  // Due to b/174366536(basic_stringbuf implicit-conversion), the following snippet crashes
+  //   std::stringstream s;
+  //   s << "ê°€";
+  std::string str;
+  CodeWriterPtr ptr = CodeWriter::ForString(&str);
+  CodeWriter& writer = *ptr;
+  writer << "ê°€";
+  writer.Close();
+  EXPECT_EQ(str, "ê°€");
+}
+
+}  // namespace aidl
+}  // namespace android
diff --git a/comments.cpp b/comments.cpp
new file mode 100644
index 0000000..8feee28
--- /dev/null
+++ b/comments.cpp
@@ -0,0 +1,253 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "comments.h"
+
+#include <android-base/result.h>
+#include <android-base/strings.h>
+
+#include <optional>
+#include <regex>
+#include <string>
+#include <vector>
+
+#include "logging.h"
+
+using android::base::EndsWith;
+using android::base::Error;
+using android::base::Join;
+using android::base::Result;
+using android::base::Split;
+using android::base::StartsWith;
+using android::base::Trim;
+
+namespace android {
+namespace aidl {
+
+namespace {
+
+static const std::string_view kLineCommentBegin = "//";
+static const std::string_view kBlockCommentBegin = "/*";
+static const std::string_view kBlockCommentMid = " *";
+static const std::string_view kBlockCommentEnd = "*/";
+static const std::string_view kDocCommentBegin = "/**";
+static const std::string kTagDeprecated = "@deprecated";
+static const std::regex kTagHideRegex{"@hide\\b"};
+
+std::string ConsumePrefix(const std::string& s, std::string_view prefix) {
+  AIDL_FATAL_IF(!StartsWith(s, prefix), AIDL_LOCATION_HERE)
+      << "'" << s << "' has no prefix '" << prefix << "'";
+  return s.substr(prefix.size());
+}
+
+std::string ConsumeSuffix(const std::string& s, std::string_view suffix) {
+  AIDL_FATAL_IF(!EndsWith(s, suffix), AIDL_LOCATION_HERE);
+  return s.substr(0, s.size() - suffix.size());
+}
+
+struct BlockTag {
+  std::string name;
+  std::string description;
+};
+
+// Removes comment markers: //, /*, */, optional leading "*" in block comments
+// - keeps leading spaces, but trims trailing spaces
+// - keeps empty lines
+std::vector<std::string> TrimmedLines(const Comment& c) {
+  if (c.type == Comment::Type::LINE) {
+    return std::vector{ConsumePrefix(c.body, kLineCommentBegin)};
+  }
+
+  std::string stripped = ConsumeSuffix(ConsumePrefix(c.body, kBlockCommentBegin), kBlockCommentEnd);
+
+  std::vector<std::string> lines;
+  bool found_first_line = false;
+
+  for (auto& line : Split(stripped, "\n")) {
+    // Delete prefixes like "    * ", "   *", or "    ".
+    size_t idx = 0;
+    for (; idx < line.size() && isspace(line[idx]); idx++)
+      ;
+    if (idx < line.size() && line[idx] == '*') idx++;
+    if (idx < line.size() && line[idx] == ' ') idx++;
+
+    const std::string& sanitized_line = line.substr(idx);
+    size_t i = sanitized_line.size();
+    for (; i > 0 && isspace(sanitized_line[i - 1]); i--)
+      ;
+
+    // Either the size is 0 or everything was whitespace.
+    bool is_empty_line = i == 0;
+
+    found_first_line = found_first_line || !is_empty_line;
+    if (!found_first_line) continue;
+
+    // if is_empty_line, i == 0 so substr == ""
+    lines.push_back(sanitized_line.substr(0, i));
+  }
+  // remove trailing empty lines
+  while (!lines.empty() && Trim(lines.back()).empty()) {
+    lines.pop_back();
+  }
+  return lines;
+}
+
+// Parses a block comment and returns block tags in the comment.
+std::vector<BlockTag> BlockTags(const Comment& c) {
+  AIDL_FATAL_IF(c.type != Comment::Type::BLOCK, AIDL_LOCATION_HERE);
+
+  std::vector<BlockTag> tags;
+
+  // current tag and paragraph
+  std::string tag;
+  std::vector<std::string> paragraph;
+
+  auto end_paragraph = [&]() {
+    if (tag.empty()) {
+      paragraph.clear();
+      return;
+    }
+    // paragraph lines are trimed at both ends
+    tags.push_back({tag, Join(paragraph, " ")});
+    tag.clear();
+    paragraph.clear();
+  };
+
+  for (const auto& line : TrimmedLines(c)) {
+    size_t idx = 0;
+    // skip leading spaces
+    for (; idx < line.size() && isspace(line[idx]); idx++)
+      ;
+
+    if (idx == line.size()) {
+      // skip empty lines
+    } else if (line[idx] == '@') {
+      // end the current paragraph before reading a new block tag (+ description paragraph)
+      end_paragraph();
+
+      size_t end_idx = idx + 1;
+      for (; end_idx < line.size() && isalpha(line[end_idx]); end_idx++)
+        ;
+
+      tag = line.substr(idx, end_idx - idx);
+
+      if (end_idx < line.size() && line[end_idx] == ' ') end_idx++;
+      // skip empty line
+      if (end_idx < line.size()) {
+        paragraph.push_back(line.substr(end_idx));
+      }
+    } else {
+      // gather paragraph lines with leading spaces trimmed
+      paragraph.push_back(line.substr(idx));
+    }
+  }
+
+  end_paragraph();
+
+  return tags;
+}
+
+}  // namespace
+
+Comment::Comment(const std::string& body) : body(body) {
+  if (StartsWith(body, kLineCommentBegin)) {
+    type = Type::LINE;
+  } else if (StartsWith(body, kBlockCommentBegin) && EndsWith(body, kBlockCommentEnd)) {
+    type = Type::BLOCK;
+  } else {
+    AIDL_FATAL(AIDL_LOCATION_HERE) << "invalid comments body:" << body;
+  }
+}
+
+// Returns the immediate block comment from the list of comments.
+// Only the last/block comment can have the tag.
+//
+//   /* @hide */
+//   int x;
+//
+// But tags in line or distant comments don't count. In the following,
+// the variable 'x' is not hidden.
+//
+//    // @hide
+//    int x;
+//
+//    /* @hide */
+//    /* this is the immemediate comment to 'x' */
+//    int x;
+//
+static std::optional<Comment> GetValidComment(const Comments& comments) {
+  if (!comments.empty() && comments.back().type == Comment::Type::BLOCK) {
+    return comments.back();
+  }
+  return std::nullopt;
+}
+
+// Sees if comments have the @hide tag.
+// Example: /** @hide */
+bool HasHideInComments(const Comments& comments) {
+  const auto valid_comment = GetValidComment(comments);
+  return valid_comment && std::regex_search(valid_comment->body, kTagHideRegex);
+}
+
+// Finds the @deprecated tag in comments and returns it with optional note which
+// follows the tag.
+// Example: /** @deprecated reason */
+std::optional<Deprecated> FindDeprecated(const Comments& comments) {
+  if (const auto valid_comment = GetValidComment(comments); valid_comment) {
+    for (const auto& [name, description] : BlockTags(comments.back())) {
+      // take the first @deprecated
+      if (kTagDeprecated == name) {
+        return Deprecated{description};
+      }
+    }
+  }
+  return std::nullopt;
+}
+
+// Formats comments for the Java backend.
+// The last/block comment is transformed into javadoc(/** */)
+// and others are used as they are.
+std::string FormatCommentsForJava(const Comments& comments) {
+  std::stringstream out;
+  for (auto it = begin(comments); it != end(comments); it++) {
+    const bool last = next(it) == end(comments);
+    auto lines = TrimmedLines(*it);
+
+    if (it->type == Comment::Type::LINE) {
+      for (const auto& line : lines) {
+        out << kLineCommentBegin << line;
+      }
+    } else {
+      if (last || StartsWith(it->body, kDocCommentBegin)) {
+        out << kDocCommentBegin;
+      } else {
+        out << kBlockCommentBegin;
+      }
+      bool multiline = lines.size() > 1;
+
+      if (multiline) out << "\n";
+      for (const auto& line : lines) {
+        if (multiline) out << kBlockCommentMid;
+        out << " " << line;
+        if (multiline) out << "\n";
+      }
+      out << " " << kBlockCommentEnd << "\n";
+    }
+  }
+  return out.str();
+}
+
+}  // namespace aidl
+}  // namespace android
diff --git a/comments.h b/comments.h
new file mode 100644
index 0000000..8bf7b30
--- /dev/null
+++ b/comments.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include <iostream>
+#include <optional>
+#include <string>
+#include <vector>
+
+namespace android {
+namespace aidl {
+
+// Represents a single comment
+struct Comment {
+  enum class Type { LINE, BLOCK };
+  Type type;
+  std::string body;
+
+  Comment(const std::string& body);
+
+  // for GTest assertions
+  friend inline bool operator==(const Comment& lhs, const Comment& rhs) {
+    return lhs.body == rhs.body;
+  }
+  friend std::ostream& operator<<(std::ostream& out, const Comment& c) { return out << c.body; }
+};
+
+using Comments = std::vector<Comment>;
+
+bool HasHideInComments(const Comments& comments);
+
+struct Deprecated {
+  std::string note;  // can be empty("")
+};
+
+std::optional<Deprecated> FindDeprecated(const Comments& comments);
+
+std::string FormatCommentsForJava(const Comments& comments);
+
+}  // namespace aidl
+}  // namespace android
\ No newline at end of file
diff --git a/diagnostics.cpp b/diagnostics.cpp
new file mode 100644
index 0000000..5c51f03
--- /dev/null
+++ b/diagnostics.cpp
@@ -0,0 +1,468 @@
+/*
+ * Copyright (C) 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "diagnostics.h"
+
+#include <functional>
+#include <stack>
+
+#include "aidl_language.h"
+#include "logging.h"
+
+using std::placeholders::_1;
+
+namespace android {
+namespace aidl {
+
+const std::map<std::string, DiagnosticOption> kAllDiagnostics = {
+#define DIAG(ENUM, NAME, ENABLED) {NAME, DiagnosticOption{DiagnosticID::ENUM, NAME, ENABLED}},
+#include "diagnostics.inc"
+#undef DIAG
+};
+
+static const std::map<DiagnosticID, std::string> kDiagnosticsNames = {
+#define DIAG(ENUM, NAME, ENABLED) {DiagnosticID::ENUM, NAME},
+#include "diagnostics.inc"
+#undef DIAG
+};
+
+void DiagnosticMapping::Severity(DiagnosticID id, DiagnosticSeverity severity) {
+  mapping_[id] = severity;
+}
+
+DiagnosticSeverity DiagnosticMapping::Severity(DiagnosticID id) const {
+  return mapping_.at(id);
+}
+
+std::string to_string(DiagnosticID id) {
+  return kDiagnosticsNames.at(id);
+}
+
+static std::string ToUpper(const std::string& name) {
+  std::string nameCopy(name);
+  for (auto& c : nameCopy) c = std::toupper(c);
+  return nameCopy;
+}
+
+class DiagnosticsContext {
+ public:
+  DiagnosticsContext(DiagnosticMapping mapping) : mapping_({std::move(mapping)}) {}
+  AidlErrorLog Report(const AidlLocation& loc, DiagnosticID id,
+                      DiagnosticSeverity force_severity = DiagnosticSeverity::DISABLED) {
+    if (loc.IsInternal()) {
+      return AidlErrorLog(AidlErrorLog::NO_OP, loc);
+    }
+    const std::string suffix = " [-W" + to_string(id) + "]";
+    auto severity = std::max(force_severity, mapping_.top().Severity(id));
+    switch (severity) {
+      case DiagnosticSeverity::DISABLED:
+        return AidlErrorLog(AidlErrorLog::NO_OP, loc);
+      case DiagnosticSeverity::WARNING:
+        return AidlErrorLog(AidlErrorLog::WARNING, loc, suffix);
+      case DiagnosticSeverity::ERROR:
+        error_count_++;
+        return AidlErrorLog(AidlErrorLog::ERROR, loc, suffix);
+    }
+  }
+  size_t ErrorCount() const { return error_count_; }
+  void Suppress(const AidlAnnotatable& a) {
+    const auto& warnings = a.SuppressWarnings();
+    DiagnosticMapping new_mapping = mapping_.top();
+    for (const auto& w : warnings) {
+      auto it = kAllDiagnostics.find(w);
+      if (it == kAllDiagnostics.end()) {
+        Report(a.GetLocation(), DiagnosticID::unknown_warning, DiagnosticSeverity::ERROR)
+            << "unknown warning: " << w;
+        continue;
+      }
+      new_mapping.Severity(it->second.id, DiagnosticSeverity::DISABLED);
+    }
+    mapping_.push(std::move(new_mapping));
+  }
+  void Restore(const AidlAnnotatable&) {
+    mapping_.pop();
+  }
+ private:
+  std::stack<DiagnosticMapping> mapping_;
+  size_t error_count_ = {};
+};
+
+class DiagnosticsVisitor : public AidlVisitor {
+ public:
+  DiagnosticsVisitor(DiagnosticsContext& diag) : diag(diag) {}
+  void Check(const AidlDocument& doc) {
+    DiagnosticsVisitor* visitor = this;
+    using Fun = std::function<void(const AidlAnnotatable&)>;
+    struct Hook : public AidlVisitor {
+      Fun fun;
+      Hook(Fun fun) : fun(fun) {}
+      void Visit(const AidlInterface& a) override { fun(a); }
+      void Visit(const AidlEnumDeclaration& a) override { fun(a); }
+      void Visit(const AidlStructuredParcelable& a) override { fun(a); }
+      void Visit(const AidlUnionDecl& a) override { fun(a); }
+      void Visit(const AidlParcelable& a) override { fun(a); }
+      void Visit(const AidlMethod& a) override { fun(a.GetType()); }
+    };
+    Hook suppress{std::bind(&DiagnosticsContext::Suppress, &diag, _1)};
+    Hook restore{std::bind(&DiagnosticsContext::Restore, &diag, _1)};
+    std::function<void(const AidlNode&)> top_down = [&top_down, &suppress, &restore,
+                                                     visitor](const AidlNode& a) {
+      a.DispatchVisit(suppress);
+      a.DispatchVisit(*visitor);
+      a.TraverseChildren(top_down);
+      a.DispatchVisit(restore);
+    };
+    top_down(doc);
+  }
+ protected:
+  DiagnosticsContext& diag;
+};
+
+struct DiagnoseInterfaceName : DiagnosticsVisitor {
+  DiagnoseInterfaceName(DiagnosticsContext& diag) : DiagnosticsVisitor(diag) {}
+  void Visit(const AidlInterface& i) override {
+    if (auto name = i.GetName(); name.size() < 1 || name[0] != 'I') {
+      diag.Report(i.GetLocation(), DiagnosticID::interface_name)
+          << "Interface names should start with I.";
+    }
+  }
+};
+
+struct DiagnoseInoutParameter : DiagnosticsVisitor {
+  DiagnoseInoutParameter(DiagnosticsContext& diag) : DiagnosticsVisitor(diag) {}
+  void Visit(const AidlArgument& a) override {
+    if (a.GetDirection() == AidlArgument::INOUT_DIR) {
+      diag.Report(a.GetLocation(), DiagnosticID::inout_parameter)
+          << a.GetName()
+          << " is 'inout'. Avoid inout parameters. This is somewhat confusing for clients "
+             "because although the parameters are 'in', they look out 'out' parameters.";
+    }
+  }
+};
+
+struct DiagnoseConstName : DiagnosticsVisitor {
+  DiagnoseConstName(DiagnosticsContext& diag) : DiagnosticsVisitor(diag) {}
+  void Visit(const AidlEnumerator& e) override {
+    if (ToUpper(e.GetName()) != e.GetName()) {
+      diag.Report(e.GetLocation(), DiagnosticID::const_name)
+          << "Enum values should be named in upper case: " << e.GetName();
+    }
+  }
+  void Visit(const AidlConstantDeclaration& c) override {
+    if (ToUpper(c.GetName()) != c.GetName()) {
+      diag.Report(c.GetLocation(), DiagnosticID::const_name)
+          << "Constants should be named in upper case: " << c.GetName();
+    }
+  }
+};
+
+struct DiagnoseExplicitDefault : DiagnosticsVisitor {
+  DiagnoseExplicitDefault(DiagnosticsContext& diag) : DiagnosticsVisitor(diag) {}
+  void Visit(const AidlStructuredParcelable& p) override {
+    for (const auto& var : p.GetFields()) {
+      CheckExplicitDefault(*var);
+    }
+  }
+  void Visit(const AidlUnionDecl& u) override {
+    AIDL_FATAL_IF(u.GetFields().empty(), u) << "The union '" << u.GetName() << "' has no fields.";
+    const auto& first = u.GetFields()[0];
+    CheckExplicitDefault(*first);
+  }
+  void CheckExplicitDefault(const AidlVariableDeclaration& v) {
+    if (v.IsDefaultUserSpecified()) return;
+    if (v.GetType().IsNullable()) return;
+    if (v.GetType().IsArray()) return;
+    const auto defined_type = v.GetType().GetDefinedType();
+    if (defined_type && defined_type->AsEnumDeclaration()) {
+      diag.Report(v.GetLocation(), DiagnosticID::enum_explicit_default)
+          << "The enum field '" << v.GetName() << "' has no explicit value.";
+      return;
+    }
+  }
+};
+
+struct DiagnoseMixedOneway : DiagnosticsVisitor {
+  DiagnoseMixedOneway(DiagnosticsContext& diag) : DiagnosticsVisitor(diag) {}
+  void Visit(const AidlInterface& i) override {
+    bool has_oneway = false;
+    bool has_twoway = false;
+    for (const auto& m : i.GetMethods()) {
+      if (!m->IsUserDefined()) continue;
+      if (Suppressed(*m)) continue;
+      if (m->IsOneway()) {
+        has_oneway = true;
+      } else {
+        has_twoway = true;
+      }
+    }
+    if (has_oneway && has_twoway) {
+      diag.Report(i.GetLocation(), DiagnosticID::mixed_oneway)
+          << "The interface '" << i.GetName()
+          << "' has both one-way and two-way methods. This makes it hard to reason about threading "
+             "of client code.";
+    }
+  }
+  bool Suppressed(const AidlMethod& m) const {
+    for (const auto& w : m.GetType().SuppressWarnings()) {
+      if (w == to_string(DiagnosticID::mixed_oneway)) {
+        return true;
+      }
+    }
+    return false;
+  }
+};
+
+struct DiagnoseRedundantOneway : DiagnosticsVisitor {
+  DiagnoseRedundantOneway(DiagnosticsContext& diag) : DiagnosticsVisitor(diag) {}
+  void Visit(const AidlInterface& i) override {
+    if (i.HasOnewayAnnotation()) {
+      for (const auto& m : i.GetMethods()) {
+        if (!m->IsUserDefined()) continue;
+        if (Suppressed(*m)) continue;
+        if (m->HasOnewayAnnotation()) {
+          diag.Report(i.GetLocation(), DiagnosticID::redundant_oneway)
+              << "The interface '" << i.GetName()
+              << "' is oneway. Redundant oneway annotation for method '" << m->GetName() << "'.";
+        }
+      }
+    }
+  }
+  bool Suppressed(const AidlMethod& m) const {
+    for (const auto& w : m.GetType().SuppressWarnings()) {
+      if (w == to_string(DiagnosticID::redundant_oneway)) {
+        return true;
+      }
+    }
+    return false;
+  }
+};
+
+struct DiagnoseOutArray : DiagnosticsVisitor {
+  DiagnoseOutArray(DiagnosticsContext& diag) : DiagnosticsVisitor(diag) {}
+  void Visit(const AidlMethod& m) override {
+    for (const auto& a : m.GetArguments()) {
+      if (a->GetType().IsArray() && a->IsOut()) {
+        diag.Report(m.GetLocation(), DiagnosticID::out_array)
+            << "The method '" << m.GetName() << "' an array output parameter '" << a->GetName()
+            << "'. Instead prefer APIs like '" << a->GetType().Signature() << " " << m.GetName()
+            << "(...).";
+      }
+    }
+  }
+};
+
+struct DiagnoseFileDescriptor : DiagnosticsVisitor {
+  DiagnoseFileDescriptor(DiagnosticsContext& diag) : DiagnosticsVisitor(diag) {}
+  void Visit(const AidlTypeSpecifier& t) override {
+    if (t.GetName() == "FileDescriptor") {
+      diag.Report(t.GetLocation(), DiagnosticID::file_descriptor)
+          << "Please use ParcelFileDescriptor instead of FileDescriptor.";
+    }
+  }
+};
+
+struct DiagnoseOutNullable : DiagnosticsVisitor {
+  DiagnoseOutNullable(DiagnosticsContext& diag) : DiagnosticsVisitor(diag) {}
+  void Visit(const AidlArgument& a) override {
+    if (a.GetType().IsArray()) return;
+    if (a.IsOut() && a.GetType().IsNullable()) {
+      diag.Report(a.GetLocation(), DiagnosticID::out_nullable)
+          << "'" << a.GetName() << "' is an " << a.GetDirectionSpecifier()
+          << " parameter and also nullable. Some backends don't support setting null value to out "
+             "parameters. Please use it as return value or drop @nullable to avoid potential "
+             "errors.";
+    }
+  }
+};
+
+struct DiagnoseImports : DiagnosticsVisitor {
+  DiagnoseImports(DiagnosticsContext& diag) : DiagnosticsVisitor(diag) {}
+  void Visit(const AidlDocument& doc) override {
+    auto collide_with_decls = [&](const auto& import) {
+      for (const auto& type : doc.DefinedTypes()) {
+        if (type->GetCanonicalName() != import && type->GetName() == SimpleName(import)) {
+          return true;
+        }
+      }
+      return false;
+    };
+
+    std::set<std::string> imported_names;
+    for (const auto& import : doc.Imports()) {
+      if (collide_with_decls(import)) {
+        diag.Report(doc.GetLocation(), DiagnosticID::unique_import)
+            << SimpleName(import) << " is already defined in this file.";
+      }
+      auto [_, inserted] = imported_names.insert(SimpleName(import));
+      if (!inserted) {
+        diag.Report(doc.GetLocation(), DiagnosticID::unique_import)
+            << SimpleName(import) << " is already imported.";
+      }
+    }
+  }
+};
+
+struct DiagnoseUntypedCollection : DiagnosticsVisitor {
+  DiagnoseUntypedCollection(DiagnosticsContext& diag) : DiagnosticsVisitor(diag) {}
+  void Visit(const AidlTypeSpecifier& t) override {
+    if (t.GetName() == "List" || t.GetName() == "Map") {
+      if (!t.IsGeneric()) {
+        diag.Report(t.GetLocation(), DiagnosticID::untyped_collection)
+            << "Use List<V> or Map<K,V> instead.";
+      }
+    }
+  }
+};
+
+struct DiagnosePermissionAnnotations : DiagnosticsVisitor {
+  DiagnosePermissionAnnotations(DiagnosticsContext& diag) : DiagnosticsVisitor(diag) {}
+  void Visit(const AidlInterface& intf) override {
+    const std::string diag_message =
+        " is not annotated for permissions. Declare which permissions are "
+        "required using @EnforcePermission. If permissions are manually "
+        "verified within the implementation, use @PermissionManuallyEnforced. "
+        "If no permissions are required, use @RequiresNoPermission.";
+    if (intf.IsPermissionAnnotated()) {
+      return;
+    }
+    const auto& methods = intf.GetMethods();
+    std::vector<size_t> methods_without_annotations;
+    size_t num_user_defined_methods = 0;
+    for (size_t i = 0; i < methods.size(); ++i) {
+      auto& m = methods[i];
+      if (!m->IsUserDefined()) continue;
+      num_user_defined_methods++;
+      if (m->GetType().IsPermissionAnnotated()) {
+        continue;
+      }
+      methods_without_annotations.push_back(i);
+    }
+    if (methods_without_annotations.size() == num_user_defined_methods) {
+      diag.Report(intf.GetLocation(), DiagnosticID::missing_permission_annotation)
+          << intf.GetName() << diag_message
+          << " This can be done for the whole interface or for each method.";
+    } else {
+      for (size_t i : methods_without_annotations) {
+        auto& m = methods[i];
+        diag.Report(m->GetLocation(), DiagnosticID::missing_permission_annotation)
+            << m->GetName() << diag_message;
+      }
+    }
+  }
+};
+
+struct DiagnoseRedundantNames : DiagnosticsVisitor {
+  DiagnoseRedundantNames(DiagnosticsContext& diag) : DiagnosticsVisitor(diag) {}
+
+  // tokenize the name with either capital letters or '_' being the delimiters
+  static std::vector<std::string> TokenizeName(const std::string& name) {
+    // if a name is all capitals with no '_', then we don't want to tokenize it.
+    if (std::all_of(name.begin(), name.end(), [](unsigned char c) { return isupper(c); })) {
+      return {name};
+    }
+    // if a name has an `_` in it, it will be tokenized based on '_',
+    // otherwise based on capital letters
+    if (name.find('_') != std::string::npos) {
+      return base::Tokenize(name, "_");
+    }
+
+    std::vector<std::string> tokens;
+    size_t size = name.size();
+    std::string tmp{name.front()};
+    // Skip the first character to avoid an empty substring for common cases
+    for (size_t i = 1; i < size; i++) {
+      if (std::isupper(name[i])) {
+        tokens.push_back(tmp);
+        tmp.clear();
+        // This uppercase letter belongs to the next token
+        tmp += name[i];
+      } else {
+        tmp += name[i];
+      }
+    }
+
+    if (!tmp.empty()) tokens.push_back(tmp);
+
+    return tokens;
+  }
+
+  void Visit(const AidlEnumDeclaration& e) override {
+    const std::vector<std::string> parent = TokenizeName(e.GetName());
+    for (const auto& enumerator : e.GetEnumerators()) {
+      const std::vector<std::string> child = TokenizeName(enumerator->GetName());
+      for (const auto& parentSubStr : parent) {
+        for (const auto& childSubStr : child) {
+          if (ToUpper(parentSubStr) == ToUpper(childSubStr)) {
+            diag.Report(e.GetLocation(), DiagnosticID::redundant_name)
+                << "The enumerator '" << enumerator->GetName() << "' has a redundant substring '"
+                << childSubStr << "' being defined in '" << e.GetName() << "'";
+          }
+        }
+      }
+    }
+  }
+
+  void CheckConstantDeclarations(
+      const std::string& name,
+      const std::vector<std::unique_ptr<AidlConstantDeclaration>>& consts) {
+    const std::vector<std::string> parent = TokenizeName(name);
+    for (const auto& member : consts) {
+      const std::vector<std::string> child = TokenizeName(member->GetName());
+      for (const auto& parentSubStr : parent) {
+        for (const auto& childSubStr : child) {
+          if (ToUpper(parentSubStr) == ToUpper(childSubStr)) {
+            diag.Report(member->GetLocation(), DiagnosticID::redundant_name)
+                << "The constant '" << member->GetName() << "' has a redundant substring '"
+                << childSubStr << "' being defined in '" << name << "'";
+          }
+        }
+      }
+    }
+  }
+
+  void Visit(const AidlInterface& t) override {
+    CheckConstantDeclarations(t.GetName(), t.GetConstantDeclarations());
+  }
+
+  void Visit(const AidlUnionDecl& t) override {
+    CheckConstantDeclarations(t.GetName(), t.GetConstantDeclarations());
+  }
+
+  void Visit(const AidlStructuredParcelable& t) override {
+    CheckConstantDeclarations(t.GetName(), t.GetConstantDeclarations());
+  }
+};
+
+bool Diagnose(const AidlDocument& doc, const DiagnosticMapping& mapping) {
+  DiagnosticsContext diag(mapping);
+
+  DiagnoseInterfaceName{diag}.Check(doc);
+  DiagnoseInoutParameter{diag}.Check(doc);
+  DiagnoseConstName{diag}.Check(doc);
+  DiagnoseExplicitDefault{diag}.Check(doc);
+  DiagnoseMixedOneway{diag}.Check(doc);
+  DiagnoseOutArray{diag}.Check(doc);
+  DiagnoseFileDescriptor{diag}.Check(doc);
+  DiagnoseOutNullable{diag}.Check(doc);
+  DiagnoseImports{diag}.Check(doc);
+  DiagnoseUntypedCollection{diag}.Check(doc);
+  DiagnosePermissionAnnotations{diag}.Check(doc);
+  DiagnoseRedundantNames{diag}.Check(doc);
+  DiagnoseRedundantOneway{diag}.Check(doc);
+
+  return diag.ErrorCount() == 0;
+}
+}  // namespace aidl
+}  // namespace android
diff --git a/diagnostics.h b/diagnostics.h
new file mode 100644
index 0000000..d9c40ea
--- /dev/null
+++ b/diagnostics.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include <map>
+#include <stack>
+#include <string>
+#include <vector>
+
+#include <android-base/scopeguard.h>
+#include <android-base/strings.h>
+
+class AidlDocument;
+class AidlLocation;
+class AidlErrorLog;
+
+namespace android {
+namespace aidl {
+
+enum class DiagnosticSeverity {
+  DISABLED,
+  WARNING,
+  ERROR,
+};
+
+enum class DiagnosticID {
+#define DIAG(ENUM, NAME, ENABLED) ENUM,
+#include "diagnostics.inc"
+#undef DIAG
+};
+
+class DiagnosticMapping {
+ public:
+  DiagnosticSeverity Severity(DiagnosticID id) const;
+  void Severity(DiagnosticID id, DiagnosticSeverity severity);
+
+ private:
+  std::map<DiagnosticID, DiagnosticSeverity> mapping_;
+};
+
+struct DiagnosticOption {
+  DiagnosticID id;
+  const std::string name;
+  bool default_enabled;
+};
+
+extern const std::map<std::string, DiagnosticOption> kAllDiagnostics;
+
+// relying on Argument-dependent lookup
+std::string to_string(DiagnosticID id);
+
+bool Diagnose(const AidlDocument& doc, const DiagnosticMapping& mapping);
+
+}  // namespace aidl
+}  // namespace android
diff --git a/diagnostics.inc b/diagnostics.inc
new file mode 100644
index 0000000..9abdee8
--- /dev/null
+++ b/diagnostics.inc
@@ -0,0 +1,15 @@
+// DIAG(enum, name, enable-by-default)
+DIAG(const_name, "const-name", false)
+DIAG(enum_explicit_default, "enum-explicit-default", false)
+DIAG(file_descriptor, "file-descriptor", false)
+DIAG(inout_parameter, "inout-parameter", false)
+DIAG(interface_name, "interface-name", false)
+DIAG(missing_permission_annotation, "missing-permission-annotation", false)
+DIAG(mixed_oneway, "mixed-oneway", false)
+DIAG(out_array, "out-array", false)
+DIAG(out_nullable, "out-nullable", false)
+DIAG(unique_import, "unique-import", false)
+DIAG(unknown_warning, "unknown-warning", false)
+DIAG(untyped_collection, "untyped-collection", false)
+DIAG(redundant_name, "redundant-name", false)
+DIAG(redundant_oneway, "redundant-oneway", false)
diff --git a/diagnostics_unittest.cpp b/diagnostics_unittest.cpp
new file mode 100644
index 0000000..feb8189
--- /dev/null
+++ b/diagnostics_unittest.cpp
@@ -0,0 +1,353 @@
+/*
+ * Copyright (C) 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "diagnostics.h"
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <string>
+#include <vector>
+
+#include "aidl.h"
+#include "parser.h"
+#include "tests/fake_io_delegate.h"
+
+using android::aidl::AidlTypenames;
+using android::aidl::DiagnosticID;
+using android::aidl::Options;
+using android::aidl::internals::load_and_validate_aidl;
+using android::aidl::test::FakeIoDelegate;
+using testing::internal::CaptureStderr;
+using testing::internal::GetCapturedStderr;
+
+struct DiagnosticsTest : testing::Test {
+  void ParseFiles(std::vector<std::pair<std::string, std::string>>&& files) {
+    ASSERT_TRUE(files.size() > 0);
+    const std::string main = files.begin()->first;
+    for (const auto& [file, contents] : files) {
+      io.SetFileContents(file, contents);
+    }
+    if (!enable_diagnostic) {
+      ASSERT_TRUE(expect_diagnostic);
+      enable_diagnostic = expect_diagnostic;
+    }
+    // emit diagnostics as warnings.
+    // "java" has no specific meaning here because we're testing CheckValid()
+    const Options options = Options::From("aidl " + optional_args + " -I . --lang java -o out -W" +
+                                          to_string(*enable_diagnostic) + " " + main);
+    CaptureStderr();
+    load_and_validate_aidl(main, options, io, &typenames, nullptr);
+    const std::string err = GetCapturedStderr();
+    if (expect_diagnostic) {
+      EXPECT_THAT(err, testing::HasSubstr("-W" + to_string(*expect_diagnostic)));
+    } else {
+      EXPECT_EQ("", err);
+    }
+  }
+
+  AidlTypenames typenames;
+  FakeIoDelegate io;
+  std::string optional_args;
+  // The type of diagnostic to enable for the test. If expect_diagnostic is
+  // set, use the same value.
+  std::optional<DiagnosticID> enable_diagnostic;
+  // The expected diagnostic. Must be set.
+  std::optional<DiagnosticID> expect_diagnostic;
+};
+
+TEST_F(DiagnosticsTest, const_name_ForEnumerator) {
+  expect_diagnostic = DiagnosticID::const_name;
+  ParseFiles({{"Foo.aidl", "enum Foo { foo }"}});
+}
+
+TEST_F(DiagnosticsTest, const_name_ForConstants) {
+  expect_diagnostic = DiagnosticID::const_name;
+  ParseFiles({{"IFoo.aidl", "interface IFoo { const int foo = 1; }"}});
+}
+
+TEST_F(DiagnosticsTest, interface_name) {
+  expect_diagnostic = DiagnosticID::interface_name;
+  ParseFiles({{"Foo.aidl", "interface Foo { }"}});
+}
+
+TEST_F(DiagnosticsTest, enum_explicit_default) {
+  expect_diagnostic = DiagnosticID::enum_explicit_default;
+  ParseFiles({{"Foo.aidl", "parcelable Foo { E e; }"}, {"E.aidl", "enum E { A }"}});
+}
+
+TEST_F(DiagnosticsTest, inout_parameter) {
+  expect_diagnostic = DiagnosticID::inout_parameter;
+  ParseFiles({{"IFoo.aidl", "interface IFoo { void foo(inout Bar bar); }"},
+              {"Bar.aidl", "parcelable Bar {}"}});
+}
+
+TEST_F(DiagnosticsTest, inout_parameter_SuppressAtMethodLevel) {
+  enable_diagnostic = DiagnosticID::inout_parameter;
+  expect_diagnostic = {};
+  ParseFiles({
+      {"IFoo.aidl",
+       "interface IFoo { @SuppressWarnings(value={\"inout-parameter\"}) void foo(inout Bar b); }"},
+      {"Bar.aidl", "parcelable Bar {}"},
+  });
+}
+
+TEST_F(DiagnosticsTest, inout_parameter_SuppressAtDeclLevel) {
+  enable_diagnostic = DiagnosticID::inout_parameter;
+  expect_diagnostic = {};
+  ParseFiles({
+      {"IFoo.aidl",
+       "@SuppressWarnings(value={\"inout-parameter\"}) interface IFoo { void foo(inout Bar b); }"},
+      {"Bar.aidl", "parcelable Bar {}"},
+  });
+}
+
+TEST_F(DiagnosticsTest, UnknownWarning) {
+  expect_diagnostic = DiagnosticID::unknown_warning;
+  ParseFiles({
+      {"IFoo.aidl", "@SuppressWarnings(value={\"blahblah\"}) interface IFoo { void foo(); }"},
+  });
+}
+
+TEST_F(DiagnosticsTest, CantSuppressUnknownWarning) {
+  expect_diagnostic = DiagnosticID::unknown_warning;
+  ParseFiles({
+      {"IFoo.aidl",
+       "@SuppressWarnings(value={\"unknown-warning\"})\n"
+       "interface IFoo { @SuppressWarnings(value={\"blah-blah\"}) void foo(); }"},
+  });
+}
+
+TEST_F(DiagnosticsTest, DontMixOnewayWithTwowayMethods) {
+  expect_diagnostic = DiagnosticID::mixed_oneway;
+  ParseFiles({
+      {"IFoo.aidl", "interface IFoo { void foo(); oneway void bar(); }"},
+  });
+}
+
+TEST_F(DiagnosticsTest, DontMixOnewayWithTwowayMethodsSuppressedAtMethod) {
+  enable_diagnostic = DiagnosticID::mixed_oneway;
+  expect_diagnostic = {};
+  ParseFiles({
+      {"IFoo.aidl",
+       "interface IFoo {\n"
+       "  void foo();\n"
+       "  @SuppressWarnings(value={\"mixed-oneway\"}) oneway void bar();\n"
+       "}"},
+  });
+}
+
+TEST_F(DiagnosticsTest, OnewayInterfaceIsOkayWithSyntheticMethods) {
+  optional_args = "--version 2";  // will add getInterfaceVersion() synthetic method
+  enable_diagnostic = DiagnosticID::mixed_oneway;
+  expect_diagnostic = {};
+  ParseFiles({
+      {"IFoo.aidl", "oneway interface IFoo { void foo(); }"},
+  });
+}
+
+TEST_F(DiagnosticsTest, RedundantOnewayMethodAnnotationInOnewayInterface) {
+  expect_diagnostic = DiagnosticID::redundant_oneway;
+  ParseFiles({
+      {"IFoo.aidl", "oneway interface IFoo { oneway void foo(int a); }"},
+  });
+}
+
+TEST_F(DiagnosticsTest, RedundantOnewayMethodSuppressedAtMethod) {
+  enable_diagnostic = DiagnosticID::redundant_oneway;
+  expect_diagnostic = {};
+  ParseFiles({
+      {"IFoo.aidl",
+       "oneway interface IFoo {\n"
+       "  @SuppressWarnings(value={\"redundant-oneway\"}) oneway void bar();\n"
+       "}"},
+  });
+}
+
+TEST_F(DiagnosticsTest, ArraysAsOutputParametersConsideredHarmful) {
+  expect_diagnostic = DiagnosticID::out_array;
+  ParseFiles({
+      {"IFoo.aidl", "interface IFoo { void foo(out String[] ret); }"},
+  });
+}
+
+TEST_F(DiagnosticsTest, file_descriptor) {
+  expect_diagnostic = DiagnosticID::file_descriptor;
+  ParseFiles({{"IFoo.aidl",
+               "interface IFoo {\n"
+               "  void foo(in FileDescriptor fd);\n"
+               "}"}});
+}
+
+TEST_F(DiagnosticsTest, out_nullable) {
+  expect_diagnostic = DiagnosticID::out_nullable;
+  ParseFiles({{"IFoo.aidl",
+               "interface IFoo {\n"
+               "  void foo(out @nullable Bar bar);\n"
+               "}"},
+              {"Bar.aidl", "parcelable Bar {}"}});
+}
+
+TEST_F(DiagnosticsTest, inout_nullable) {
+  expect_diagnostic = DiagnosticID::out_nullable;
+  ParseFiles({{"IFoo.aidl",
+               "interface IFoo {\n"
+               "  void foo(inout @nullable Bar bar);\n"
+               "}"},
+              {"Bar.aidl", "parcelable Bar {}"}});
+}
+
+TEST_F(DiagnosticsTest, out_nullable_OkayForArrays) {
+  expect_diagnostic = DiagnosticID::out_array;  // not triggering out_nullable
+  ParseFiles({{"IFoo.aidl",
+               "interface IFoo {\n"
+               "  void foo(inout @nullable Bar[] bar1, out @nullable Bar[] bar2);\n"
+               "}"},
+              {"Bar.aidl", "parcelable Bar {}"}});
+}
+
+TEST_F(DiagnosticsTest, RejectImportsCollisionWithTopLevelDecl) {
+  expect_diagnostic = DiagnosticID::unique_import;
+  ParseFiles({{"p/IFoo.aidl",
+               "package p;\n"
+               "import q.IFoo;\n"  // should collide with previous import
+               "interface IFoo{}"},
+              {"q/IFoo.aidl", "package q; interface IFoo{}"}});
+}
+
+TEST_F(DiagnosticsTest, RejectImportsCollision) {
+  expect_diagnostic = DiagnosticID::unique_import;
+  ParseFiles({{"p/IFoo.aidl",
+               "package p;\n"
+               "import q.IBar;\n"
+               "import r.IBar;\n"  // should collide with previous import
+               "interface IFoo{}"},
+              {"q/IBar.aidl", "package q; interface IBar{}"},
+              {"r/IBar.aidl", "package r; interface IBar{}"}});
+}
+
+TEST_F(DiagnosticsTest, AllowImportingSelf) {
+  enable_diagnostic = DiagnosticID::unique_import;
+  expect_diagnostic = {};
+  ParseFiles({{"p/IFoo.aidl",
+               "package p;\n"
+               "import p.IFoo;\n"
+               "interface IFoo{}"}});
+}
+
+TEST_F(DiagnosticsTest, RedundantImports) {
+  expect_diagnostic = DiagnosticID::unique_import;
+  ParseFiles({{"p/IFoo.aidl",
+               "package p;\n"
+               "import q.IBar;\n"
+               "import q.IBar;\n"
+               "interface IFoo{}"},
+              {"q/IBar.aidl", "package q; interface IBar{}"}});
+}
+
+TEST_F(DiagnosticsTest, UntypedCollectionInterface) {
+  expect_diagnostic = DiagnosticID::untyped_collection;
+  ParseFiles({{"IFoo.aidl", "interface IFoo { void foo(in Map m); }"}});
+}
+
+TEST_F(DiagnosticsTest, UntypedCollectionParcelable) {
+  expect_diagnostic = DiagnosticID::untyped_collection;
+  ParseFiles({{"Foo.aidl", "parcelable Foo { Map m; }"}});
+}
+
+TEST_F(DiagnosticsTest, UntypedCollectionUnion) {
+  expect_diagnostic = DiagnosticID::untyped_collection;
+  ParseFiles({{"Foo.aidl", "union Foo { List l; }"}});
+}
+
+TEST_F(DiagnosticsTest, UntypedCollectionInTypeArg) {
+  expect_diagnostic = DiagnosticID::untyped_collection;
+  ParseFiles({{"IFoo.aidl", "interface IFoo { void foo(in Bar<Map> m); }"},
+              {"Bar.aidl", "parcelable Bar<T> {}"}});
+}
+
+TEST_F(DiagnosticsTest, PermissionMissing) {
+  expect_diagnostic = DiagnosticID::missing_permission_annotation;
+  ParseFiles({{"IFoo.aidl", "interface IFoo { void food(); }"}});
+}
+
+TEST_F(DiagnosticsTest, PermissionMethod) {
+  enable_diagnostic = DiagnosticID::missing_permission_annotation;
+  expect_diagnostic = {};
+  ParseFiles({{"IFoo.aidl", "interface IFoo { @EnforcePermission(\"INTERNET\") void food(); }"}});
+}
+
+TEST_F(DiagnosticsTest, PermissionMethodMissing) {
+  expect_diagnostic = DiagnosticID::missing_permission_annotation;
+  ParseFiles({{"IFoo.aidl",
+               "interface IFoo { @EnforcePermission(\"INTERNET\") void food(); void foo2(); }"}});
+}
+
+TEST_F(DiagnosticsTest, PermissionInterface) {
+  enable_diagnostic = DiagnosticID::missing_permission_annotation;
+  expect_diagnostic = {};
+  ParseFiles({{"IFoo.aidl", "@EnforcePermission(\"INTERNET\") interface IFoo { void food(); }"}});
+}
+
+TEST_F(DiagnosticsTest, RedundantPrefixConstantInterface) {
+  enable_diagnostic = DiagnosticID::redundant_name;
+  expect_diagnostic = DiagnosticID::redundant_name;
+  ParseFiles({{"SomethingStatus.aidl", "interface SomethingStatus { const int STATUS_ONE = 1; }"}});
+}
+
+TEST_F(DiagnosticsTest, RedundantPrefixConstantParcelable) {
+  enable_diagnostic = DiagnosticID::redundant_name;
+  expect_diagnostic = DiagnosticID::redundant_name;
+  ParseFiles(
+      {{"SomethingStatus.aidl", "parcelable SomethingStatus { const int STATUS_ONE = 1; }"}});
+}
+
+TEST_F(DiagnosticsTest, RedundantSuffixConstantParcelable) {
+  enable_diagnostic = DiagnosticID::redundant_name;
+  expect_diagnostic = DiagnosticID::redundant_name;
+  ParseFiles(
+      {{"SomethingStatus.aidl", "parcelable SomethingStatus { const int ONE_STATUS = 1; }"}});
+}
+
+TEST_F(DiagnosticsTest, RedundantSuffixConstantParcelable2) {
+  enable_diagnostic = DiagnosticID::redundant_name;
+  expect_diagnostic = DiagnosticID::redundant_name;
+  ParseFiles(
+      {{"SomethingStatus.aidl", "parcelable SomethingStatus { const int ONE_SOMETHING = 1; }"}});
+}
+
+TEST_F(DiagnosticsTest, RedundantConstantUnion) {
+  enable_diagnostic = DiagnosticID::redundant_name;
+  expect_diagnostic = DiagnosticID::redundant_name;
+  ParseFiles({{"SomethingStatus.aidl",
+               "union SomethingStatus { const int ONE_SOMETHING = 1; int a; int b;}"}});
+}
+
+TEST_F(DiagnosticsTest, RedundantPrefixEnum) {
+  enable_diagnostic = DiagnosticID::redundant_name;
+  expect_diagnostic = DiagnosticID::redundant_name;
+  ParseFiles({{"SomethingStatus.aidl", "enum SomethingStatus { STATUS_ONE = 1, }"}});
+}
+
+TEST_F(DiagnosticsTest, RedundantSuffixEnum) {
+  enable_diagnostic = DiagnosticID::redundant_name;
+  expect_diagnostic = DiagnosticID::redundant_name;
+  ParseFiles({{"SomethingStatus.aidl", "enum SomethingStatus { ONE_STATUS = 1, }"}});
+}
+
+TEST_F(DiagnosticsTest, RedundantSuffixEnum2) {
+  enable_diagnostic = DiagnosticID::redundant_name;
+  expect_diagnostic = DiagnosticID::redundant_name;
+  ParseFiles({{"SomethingStatus.aidl", "enum SomethingStatus { ONE_SOMETHING = 1, }"}});
+}
diff --git a/generate_aidl_mappings.cpp b/generate_aidl_mappings.cpp
new file mode 100644
index 0000000..4d2a5a0
--- /dev/null
+++ b/generate_aidl_mappings.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2019, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "generate_aidl_mappings.h"
+#include "aidl_to_java.h"
+
+#include <sstream>
+
+namespace android {
+namespace aidl {
+namespace mappings {
+
+std::string dump_location(const AidlNode& method) {
+  return method.PrintLine();
+}
+
+SignatureMap generate_mappings(const AidlDefinedType* defined_type) {
+  const AidlInterface* interface = defined_type->AsInterface();
+  SignatureMap mappings;
+  if (interface == nullptr) {
+    return mappings;
+  }
+  for (const auto& method : interface->GetMethods()) {
+    if (method->IsUserDefined()) {
+      std::stringstream signature;
+      signature << interface->GetCanonicalName() << "|";
+      signature << method->GetName() << "|";
+      for (const auto& arg : method->GetArguments()) {
+        signature << java::JavaSignatureOf(arg->GetType()) << ",";
+      }
+      signature << "|";
+      signature << java::JavaSignatureOf(method->GetType());
+      mappings[signature.str()] = dump_location(*method);
+    }
+  }
+  return mappings;
+}
+
+}  // namespace mappings
+}  // namespace aidl
+}  // namespace android
diff --git a/generate_aidl_mappings.h b/generate_aidl_mappings.h
new file mode 100644
index 0000000..09f611e
--- /dev/null
+++ b/generate_aidl_mappings.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2019, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <string>
+#include <unordered_map>
+#include "aidl_language.h"
+
+namespace android {
+namespace aidl {
+namespace mappings {
+
+using SignatureMap = std::unordered_map<std::string, std::string>;
+
+SignatureMap generate_mappings(const AidlDefinedType* iface);
+}  // namespace mappings
+}  // namespace aidl
+}  // namespace android
diff --git a/generate_cpp.cpp b/generate_cpp.cpp
new file mode 100644
index 0000000..68326d5
--- /dev/null
+++ b/generate_cpp.cpp
@@ -0,0 +1,1593 @@
+/**
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "generate_cpp.h"
+#include "aidl.h"
+
+#include <algorithm>
+#include <cctype>
+#include <cstring>
+#include <memory>
+#include <random>
+#include <set>
+#include <string>
+
+#include <android-base/format.h>
+#include <android-base/stringprintf.h>
+#include <android-base/strings.h>
+
+#include "aidl_language.h"
+#include "aidl_to_common.h"
+#include "aidl_to_cpp.h"
+
+#include "aidl_typenames.h"
+#include "logging.h"
+#include "os.h"
+
+using android::base::Join;
+using android::base::StringPrintf;
+using std::set;
+using std::string;
+using std::unique_ptr;
+using std::vector;
+
+namespace android {
+namespace aidl {
+namespace cpp {
+namespace internals {
+namespace {
+
+const char kAndroidStatusVarName[] = "_aidl_ret_status";
+const char kCodeVarName[] = "_aidl_code";
+const char kFlagsVarName[] = "_aidl_flags";
+const char kDataVarName[] = "_aidl_data";
+const char kErrorLabel[] = "_aidl_error";
+const char kImplVarName[] = "_aidl_impl";
+const char kDelegateImplVarName[] = "_aidl_delegate";
+const char kParcelVarName[] = "_aidl_parcel";
+const char kReplyVarName[] = "_aidl_reply";
+const char kReturnVarName[] = "_aidl_return";
+const char kStatusVarName[] = "_aidl_status";
+const char kTraceVarName[] = "_aidl_trace";
+const char kAndroidParcelLiteral[] = "::android::Parcel";
+const char kAndroidStatusLiteral[] = "::android::status_t";
+const char kAndroidStatusOk[] = "::android::OK";
+const char kAndroidStatusBadValue[] = "::android::BAD_VALUE";
+const char kBinderStatusLiteral[] = "::android::binder::Status";
+const char kIBinderHeader[] = "binder/IBinder.h";
+const char kIInterfaceHeader[] = "binder/IInterface.h";
+const char kBinderDelegateHeader[] = "binder/Delegate.h";
+const char kParcelHeader[] = "binder/Parcel.h";
+const char kStabilityHeader[] = "binder/Stability.h";
+const char kStatusHeader[] = "binder/Status.h";
+const char kString16Header[] = "utils/String16.h";
+const char kTraceHeader[] = "binder/Trace.h";
+const char kStrongPointerHeader[] = "utils/StrongPointer.h";
+const char kAndroidBaseMacrosHeader[] = "android-base/macros.h";
+
+void GenerateBreakOnStatusNotOk(CodeWriter& out) {
+  out.Write("if (((%s) != (%s))) {\n", kAndroidStatusVarName, kAndroidStatusOk);
+  out.Write("  break;\n");
+  out.Write("}\n");
+}
+
+void GenerateGotoErrorOnBadStatus(CodeWriter& out) {
+  out.Write("if (((%s) != (%s))) {\n", kAndroidStatusVarName, kAndroidStatusOk);
+  out.Write("  goto %s;\n", kErrorLabel);
+  out.Write("}\n");
+}
+
+// Format three types of arg list for method.
+//  for_declaration & !type_name_only: int a      // for method decl with type and arg
+//  for_declaration &  type_name_only: int /*a*/  // for method decl with type
+// !for_declaration                  :     a      // for method call with arg (with direction)
+string GenerateArgList(const AidlTypenames& typenames, const AidlMethod& method,
+                       bool for_declaration, bool type_name_only) {
+  vector<string> method_arguments;
+  for (const unique_ptr<AidlArgument>& a : method.GetArguments()) {
+    string literal;
+    // b/144943748: CppNameOf FileDescriptor is unique_fd. Don't pass it by
+    // const reference but by value to make it easier for the user to keep
+    // it beyond the scope of the call. unique_fd is a thin wrapper for an
+    // int (fd) so passing by value is not expensive.
+    const bool non_copyable = IsNonCopyableType(a->GetType(), typenames);
+    if (for_declaration) {
+      // Method declarations need typenames, pointers to out params, and variable
+      // names that match the .aidl specification.
+      literal = CppNameOf(a->GetType(), typenames);
+
+      if (a->IsOut()) {
+        literal = literal + "*";
+      } else {
+        const auto defined_type = typenames.TryGetDefinedType(a->GetType().GetName());
+
+        const bool is_enum = defined_type && defined_type->AsEnumDeclaration() != nullptr;
+        const bool is_primitive = AidlTypenames::IsPrimitiveTypename(a->GetType().GetName());
+
+        // We pass in parameters that are not primitives by const reference.
+        // Arrays of primitives are not primitives.
+        if (!(is_primitive || is_enum || non_copyable) || a->GetType().IsArray()) {
+          literal = "const " + literal + "&";
+        }
+      }
+      if (type_name_only) {
+        literal += " /*" + a->GetName() + "*/";
+      } else {
+        literal += " " + a->GetName();
+      }
+    } else {
+      std::string var_name = BuildVarName(*a);
+      if (a->IsOut()) {
+        literal = "&" + var_name;
+      } else if (non_copyable) {
+        literal = "std::move(" + var_name + ")";
+      } else {
+        literal = var_name;
+      }
+    }
+    method_arguments.push_back(literal);
+  }
+
+  if (method.GetType().GetName() != "void") {
+    string literal;
+    if (for_declaration) {
+      literal = CppNameOf(method.GetType(), typenames) + "*";
+      if (type_name_only) {
+        literal += " /*" + string(kReturnVarName) + "*/";
+      } else {
+        literal += " " + string(kReturnVarName);
+      }
+    } else {
+      literal = string{"&"} + kReturnVarName;
+    }
+    method_arguments.push_back(literal);
+  }
+
+  return Join(method_arguments, ", ");
+}
+
+void GenerateMethodDecl(CodeWriter& out, const AidlTypenames& types, const AidlMethod& method,
+                        const string& clazz) {
+  string clazz_prefix = clazz.empty() ? "" : clazz + "::";
+  out << "::android::binder::Status " << clazz_prefix << method.GetName() << "("
+      << GenerateArgList(types, method, /*for_declartion=*/true, /*type_name_only=*/false) << ")";
+}
+
+void GenerateClientTransaction(CodeWriter& out, const AidlTypenames& typenames,
+                               const AidlInterface& interface, const AidlMethod& method,
+                               const Options& options) {
+  const string i_name = ClassName(interface, ClassNames::INTERFACE);
+  const string bp_name = GetQualifiedName(interface, ClassNames::CLIENT);
+  const string bn_name = GetQualifiedName(interface, ClassNames::SERVER);
+
+  GenerateMethodDecl(out, typenames, method, bp_name);
+  out << " {\n";
+  out.Indent();
+
+  // Declare parcels to hold our query and the response.
+  out.Write("%s %s;\n", kAndroidParcelLiteral, kDataVarName);
+  if (interface.IsSensitiveData()) {
+    out.Write("%s.markSensitive();\n", kDataVarName);
+  }
+  out.Write("%s.markForBinder(remoteStrong());\n", kDataVarName);
+
+  // Even if we're oneway, the transact method still takes a parcel.
+  out.Write("%s %s;\n", kAndroidParcelLiteral, kReplyVarName);
+
+  // Declare the status_t variable we need for error handling.
+  out.Write("%s %s = %s;\n", kAndroidStatusLiteral, kAndroidStatusVarName, kAndroidStatusOk);
+  // We unconditionally return a Status object.
+  out.Write("%s %s;\n", kBinderStatusLiteral, kStatusVarName);
+
+  if (options.GenTraces()) {
+    out.Write(
+        "::android::binder::ScopedTrace %s(ATRACE_TAG_AIDL, \"AIDL::cpp::%s::%s::cppClient\");\n",
+        kTraceVarName, interface.GetName().c_str(), method.GetName().c_str());
+  }
+
+  if (options.GenLog()) {
+    out << GenLogBeforeExecute(bp_name, method, false /* isServer */, false /* isNdk */);
+  }
+
+  if (method.IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE)) {
+    out << "if (true) {\n";
+    out.Write("  %s = ::android::UNKNOWN_TRANSACTION;\n", kAndroidStatusVarName);
+    out << "} else {\n";
+    out.Indent();
+  }
+
+  // Add the name of the interface we're hoping to call.
+  out.Write("%s = %s.writeInterfaceToken(getInterfaceDescriptor());\n", kAndroidStatusVarName,
+            kDataVarName);
+  GenerateGotoErrorOnBadStatus(out);
+
+  for (const auto& a : method.GetArguments()) {
+    const string var_name = ((a->IsOut()) ? "*" : "") + a->GetName();
+
+    if (a->IsIn()) {
+      // Serialization looks roughly like:
+      //     _aidl_ret_status = _aidl_data.WriteInt32(in_param_name);
+      //     if (_aidl_ret_status != ::android::OK) { goto error; }
+      out.Write("%s = %s.%s(%s);\n", kAndroidStatusVarName, kDataVarName,
+                ParcelWriteMethodOf(a->GetType(), typenames).c_str(),
+                ParcelWriteCastOf(a->GetType(), typenames, var_name).c_str());
+      GenerateGotoErrorOnBadStatus(out);
+    } else if (a->IsOut() && a->GetType().IsDynamicArray()) {
+      // Special case, the length of the out array is written into the parcel.
+      //     _aidl_ret_status = _aidl_data.writeVectorSize(&out_param_name);
+      //     if (_aidl_ret_status != ::android::OK) { goto error; }
+      out.Write("%s = %s.writeVectorSize(%s);\n", kAndroidStatusVarName, kDataVarName,
+                var_name.c_str());
+      GenerateGotoErrorOnBadStatus(out);
+    }
+  }
+
+  // Invoke the transaction on the remote binder and confirm status.
+  std::vector<std::string> flags;
+  if (method.IsOneway()) flags.push_back("::android::IBinder::FLAG_ONEWAY");
+  if (interface.IsSensitiveData()) flags.push_back("::android::IBinder::FLAG_CLEAR_BUF");
+
+  out.Write("%s = remote()->transact(%s, %s, &%s, %s);\n", kAndroidStatusVarName,
+            GetTransactionIdFor(bn_name, method).c_str(), kDataVarName, kReplyVarName,
+            flags.empty() ? "0" : Join(flags, " | ").c_str());
+
+  // If the method is not implemented in the remote side, try to call the
+  // default implementation, if provided.
+  vector<string> arg_names;
+  for (const auto& a : method.GetArguments()) {
+    if (IsNonCopyableType(a->GetType(), typenames)) {
+      arg_names.emplace_back(StringPrintf("std::move(%s)", a->GetName().c_str()));
+    } else {
+      arg_names.emplace_back(a->GetName());
+    }
+  }
+  if (method.GetType().GetName() != "void") {
+    arg_names.emplace_back(kReturnVarName);
+  }
+  if (method.IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE)) {
+    out.Dedent();
+    out << "}\n";
+  }
+  out.Write("if (UNLIKELY(%s == ::android::UNKNOWN_TRANSACTION && %s::getDefaultImpl())) {\n",
+            kAndroidStatusVarName, i_name.c_str());
+  out.Write("   return %s::getDefaultImpl()->%s(%s);\n", i_name.c_str(), method.GetName().c_str(),
+            Join(arg_names, ", ").c_str());
+  out.Write("}\n");
+  GenerateGotoErrorOnBadStatus(out);
+
+  if (!method.IsOneway()) {
+    // Strip off the exception header and fail if we see a remote exception.
+    // _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+    // if (_aidl_ret_status != ::android::OK) { goto error; }
+    // if (!_aidl_status.isOk()) { return _aidl_ret_status; }
+    out.Write("%s = %s.readFromParcel(%s);\n", kAndroidStatusVarName, kStatusVarName,
+              kReplyVarName);
+    GenerateGotoErrorOnBadStatus(out);
+    out.Write("if (!%s.isOk()) {\n", kStatusVarName);
+    out.Write("  return %s;\n", kStatusVarName);
+    out.Write("}\n");
+  }
+
+  // Type checking should guarantee that nothing below emits code until "return
+  // status" if we are a oneway method, so no more fear of accessing reply.
+
+  // If the method is expected to return something, read it first by convention.
+  if (method.GetType().GetName() != "void") {
+    out.Write("%s = %s.%s(%s);\n", kAndroidStatusVarName, kReplyVarName,
+              ParcelReadMethodOf(method.GetType(), typenames).c_str(),
+              ParcelReadCastOf(method.GetType(), typenames, kReturnVarName).c_str());
+    GenerateGotoErrorOnBadStatus(out);
+  }
+
+  for (const AidlArgument* a : method.GetOutArguments()) {
+    // Deserialization looks roughly like:
+    //     _aidl_ret_status = _aidl_reply.ReadInt32(out_param_name);
+    //     if (_aidl_status != ::android::OK) { goto _aidl_error; }
+    out.Write("%s = %s.%s(%s);\n", kAndroidStatusVarName, kReplyVarName,
+              ParcelReadMethodOf(a->GetType(), typenames).c_str(),
+              ParcelReadCastOf(a->GetType(), typenames, a->GetName()).c_str());
+    GenerateGotoErrorOnBadStatus(out);
+  }
+
+  // If we've gotten to here, one of two things is true:
+  //   1) We've read some bad status_t
+  //   2) We've only read status_t == OK and there was no exception in the
+  //      response.
+  // In both cases, we're free to set Status from the status_t and return.
+  out.Write("%s:\n", kErrorLabel);
+  out.Write("%s.setFromStatusT(%s);\n", kStatusVarName, kAndroidStatusVarName);
+
+  if (options.GenLog()) {
+    out << GenLogAfterExecute(bp_name, interface, method, kStatusVarName, kReturnVarName,
+                              false /* isServer */, false /* isNdk */);
+  }
+
+  out.Write("return %s;\n", kStatusVarName);
+  out.Dedent();
+  out << "}\n";
+}
+
+void GenerateClientMetaTransaction(CodeWriter& out, const AidlInterface& interface,
+                                   const AidlMethod& method, const Options& options) {
+  AIDL_FATAL_IF(method.IsUserDefined(), method);
+  const string bp_name = GetQualifiedName(interface, ClassNames::CLIENT);
+  const string bn_name = GetQualifiedName(interface, ClassNames::SERVER);
+  if (method.GetName() == kGetInterfaceVersion && options.Version() > 0) {
+    // Note: race condition can happen here, but no locking is required
+    // because 1) writing an interger is atomic and 2) this transaction
+    // will always return the same value, i.e., competing threads will
+    // give write the same value to cached_version_.
+    out << "int32_t " << bp_name << "::" << kGetInterfaceVersion << "() {\n"
+        << "  if (cached_version_ == -1) {\n"
+        << "    ::android::Parcel data;\n"
+        << "    ::android::Parcel reply;\n"
+        << "    data.writeInterfaceToken(getInterfaceDescriptor());\n"
+        << "    ::android::status_t err = remote()->transact("
+        << GetTransactionIdFor(bn_name, method) << ", data, &reply);\n"
+        << "    if (err == ::android::OK) {\n"
+        << "      ::android::binder::Status _aidl_status;\n"
+        << "      err = _aidl_status.readFromParcel(reply);\n"
+        << "      if (err == ::android::OK && _aidl_status.isOk()) {\n"
+        << "        cached_version_ = reply.readInt32();\n"
+        << "      }\n"
+        << "    }\n"
+        << "  }\n"
+        << "  return cached_version_;\n"
+        << "}\n";
+    out << "\n";
+  }
+  if (method.GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+    out << "std::string " << bp_name << "::" << kGetInterfaceHash << "() {\n"
+        << "  std::lock_guard<std::mutex> lockGuard(cached_hash_mutex_);\n"
+        << "  if (cached_hash_ == \"-1\") {\n"
+        << "    ::android::Parcel data;\n"
+        << "    ::android::Parcel reply;\n"
+        << "    data.writeInterfaceToken(getInterfaceDescriptor());\n"
+        << "    ::android::status_t err = remote()->transact("
+        << GetTransactionIdFor(bn_name, method) << ", data, &reply);\n"
+        << "    if (err == ::android::OK) {\n"
+        << "      ::android::binder::Status _aidl_status;\n"
+        << "      err = _aidl_status.readFromParcel(reply);\n"
+        << "      if (err == ::android::OK && _aidl_status.isOk()) {\n"
+        << "        reply.readUtf8FromUtf16(&cached_hash_);\n"
+        << "      }\n"
+        << "    }\n"
+        << "  }\n"
+        << "  return cached_hash_;\n"
+        << "}\n";
+  }
+}
+
+}  // namespace
+
+void GenerateClientSource(CodeWriter& out, const AidlInterface& interface,
+                          const AidlTypenames& typenames, const Options& options) {
+  vector<string> include_list = {
+      HeaderFile(interface, ClassNames::CLIENT, false),
+      HeaderFile(interface, ClassNames::SERVER, false),  // for TRANSACTION_* consts
+      kParcelHeader, kAndroidBaseMacrosHeader};
+  if (options.GenLog()) {
+    include_list.emplace_back("chrono");
+    include_list.emplace_back("functional");
+  }
+  for (const auto& path : include_list) {
+    out << "#include <" << path << ">\n";
+  }
+  out << "\n";
+
+  const string i_name = ClassName(interface, ClassNames::INTERFACE);
+  const string bp_name = ClassName(interface, ClassNames::CLIENT);
+  const string q_name = GetQualifiedName(interface, ClassNames::CLIENT);
+
+  EnterNamespace(out, interface);
+  out << "\n";
+
+  // The constructor just passes the IBinder instance up to the super
+  // class.
+  out << q_name << "::" << bp_name << "(const ::android::sp<::android::IBinder>& _aidl_impl)\n";
+  out << "    : BpInterface<" + i_name + ">(_aidl_impl){\n";
+  out << "}\n";
+  out << "\n";
+
+  if (options.GenLog()) {
+    out << "std::function<void(const " + q_name + "::TransactionLog&)> " << q_name
+        << "::logFunc;\n";
+    out << "\n";
+  }
+
+  // Clients define a method per transaction.
+  for (const auto& method : interface.GetMethods()) {
+    if (method->IsUserDefined()) {
+      GenerateClientTransaction(out, typenames, interface, *method, options);
+    } else {
+      GenerateClientMetaTransaction(out, interface, *method, options);
+    }
+    out << "\n";
+  }
+
+  LeaveNamespace(out, interface);
+}
+
+namespace {
+
+void GenerateConstantDefinitions(CodeWriter& out, const AidlDefinedType& type,
+                                 const AidlTypenames& typenames, const string& template_decl,
+                                 const string& q_name) {
+  for (const auto& constant : type.GetConstantDeclarations()) {
+    const AidlConstantValue& value = constant->GetValue();
+    if (value.GetType() != AidlConstantValue::Type::STRING) continue;
+
+    std::string cpp_type = CppNameOf(constant->GetType(), typenames);
+    out << template_decl;
+    out << "const " << cpp_type << "& " << q_name << "::" << constant->GetName() << "() {\n";
+    out << "  static const " << cpp_type << " value("
+        << constant->ValueString(ConstantValueDecorator) << ");\n";
+    out << "  return value;\n";
+    out << "}\n";
+  }
+}
+
+void GenerateConstantDeclarations(CodeWriter& out, const AidlDefinedType& type,
+                                  const AidlTypenames& typenames) {
+  for (const auto& constant : type.GetConstantDeclarations()) {
+    const AidlTypeSpecifier& type = constant->GetType();
+    const auto cpp_type = CppNameOf(type, typenames);
+    if (type.Signature() == "String") {
+      out << "static const " << cpp_type << "& " << constant->GetName() << "()";
+      GenerateDeprecated(out, *constant);
+      out << ";\n";
+    } else if (type.Signature() == "float" || type.Signature() == "double") {
+      out << "static constexpr " << cpp_type << " " << constant->GetName();
+      GenerateDeprecated(out, *constant);
+      out << " = " << constant->ValueString(ConstantValueDecorator) << ";\n";
+    } else {
+      out << "enum : " << cpp_type << " { " << constant->GetName();
+      GenerateDeprecated(out, *constant);
+      out << " = " << constant->ValueString(ConstantValueDecorator) << " };\n";
+    }
+  }
+}
+
+void GenerateServerTransaction(CodeWriter& out, const AidlInterface& interface,
+                               const AidlMethod& method, const AidlTypenames& typenames,
+                               const Options& options) {
+  const string bn_name = GetQualifiedName(interface, ClassNames::SERVER);
+  if (method.IsNew() && ShouldForceDowngradeFor(CommunicationSide::READ)) {
+    out << "if (true) {\n";
+    out << "  _aidl_ret_status = ::android::UNKNOWN_TRANSACTION;\n";
+    out << "  break;\n";
+    out << "}\n";
+  }
+
+  // Declare all the parameters now.  In the common case, we expect no errors
+  // in serialization.
+  for (const unique_ptr<AidlArgument>& a : method.GetArguments()) {
+    out.Write("%s %s;\n", CppNameOf(a->GetType(), typenames).c_str(), BuildVarName(*a).c_str());
+  }
+
+  // Declare a variable to hold the return value.
+  if (method.GetType().GetName() != "void") {
+    out.Write("%s %s;\n", CppNameOf(method.GetType(), typenames).c_str(), kReturnVarName);
+  }
+
+  // Check that the client is calling the correct interface.
+  out.Write("if (!(%s.checkInterface(this))) {\n", kDataVarName);
+  out.Write("  %s = ::android::BAD_TYPE;\n", kAndroidStatusVarName);
+  out.Write("  break;\n");
+  out.Write("}\n");
+
+  if (options.GenTraces()) {
+    out.Write(
+        "::android::binder::ScopedTrace %s(ATRACE_TAG_AIDL, \"AIDL::cpp::%s::%s::cppServer\");\n",
+        kTraceVarName, interface.GetName().c_str(), method.GetName().c_str());
+  }
+
+  if (interface.EnforceExpression() || method.GetType().EnforceExpression()) {
+    out.Write("#error Permission checks not implemented for the cpp backend\n");
+  }
+
+  // Deserialize each "in" parameter to the transaction.
+  for (const auto& a: method.GetArguments()) {
+    // Deserialization looks roughly like:
+    //     _aidl_ret_status = _aidl_data.ReadInt32(&in_param_name);
+    //     if (_aidl_ret_status != ::android::OK) { break; }
+    const string& var_name = "&" + BuildVarName(*a);
+    if (a->IsIn()) {
+      out.Write("%s = %s.%s(%s);\n", kAndroidStatusVarName, kDataVarName,
+                ParcelReadMethodOf(a->GetType(), typenames).c_str(),
+                ParcelReadCastOf(a->GetType(), typenames, var_name).c_str());
+      GenerateBreakOnStatusNotOk(out);
+    } else if (a->IsOut() && a->GetType().IsDynamicArray()) {
+      // Special case, the length of the out array is written into the parcel.
+      //     _aidl_ret_status = _aidl_data.resizeOutVector(&out_param_name);
+      //     if (_aidl_ret_status != ::android::OK) { break; }
+      out.Write("%s = %s.resizeOutVector(%s);\n", kAndroidStatusVarName, kDataVarName,
+                var_name.c_str());
+      GenerateBreakOnStatusNotOk(out);
+    }
+  }
+
+  if (options.GenLog()) {
+    out << GenLogBeforeExecute(bn_name, method, true /* isServer */, false /* isNdk */);
+  }
+
+  if (!method.GetArguments().empty() && options.GetMinSdkVersion() >= SDK_VERSION_Tiramisu) {
+    out << "if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {\n";
+    out << "  _aidl_ret_status = st.writeToParcel(_aidl_reply);\n";
+    out << "  break;\n";
+    out << "}\n";
+  }
+
+  // Call the actual method.  This is implemented by the subclass.
+  out.Write("%s %s(%s(%s));\n", kBinderStatusLiteral, kStatusVarName, method.GetName().c_str(),
+            GenerateArgList(typenames, method, /*for_declaration=*/false, /*type_name_only=*/false)
+                .c_str());
+
+  if (options.GenLog()) {
+    out << GenLogAfterExecute(bn_name, interface, method, kStatusVarName, kReturnVarName,
+                              true /* isServer */, false /* isNdk */);
+  }
+
+  // Write exceptions during transaction handling to parcel.
+  if (!method.IsOneway()) {
+    out.Write("%s = %s.writeToParcel(%s);\n", kAndroidStatusVarName, kStatusVarName, kReplyVarName);
+    GenerateBreakOnStatusNotOk(out);
+    out.Write("if (!%s.isOk()) {\n", kStatusVarName);
+    out.Write("  break;\n");
+    out.Write("}\n");
+  }
+
+  // If we have a return value, write it first.
+  if (method.GetType().GetName() != "void") {
+    out.Write("%s = %s->%s(%s);\n", kAndroidStatusVarName, kReplyVarName,
+              ParcelWriteMethodOf(method.GetType(), typenames).c_str(),
+              ParcelWriteCastOf(method.GetType(), typenames, kReturnVarName).c_str());
+    GenerateBreakOnStatusNotOk(out);
+  }
+  // Write each out parameter to the reply parcel.
+  for (const AidlArgument* a : method.GetOutArguments()) {
+    // Serialization looks roughly like:
+    //     _aidl_ret_status = data.WriteInt32(out_param_name);
+    //     if (_aidl_ret_status != ::android::OK) { break; }
+    out.Write("%s = %s->%s(%s);\n", kAndroidStatusVarName, kReplyVarName,
+              ParcelWriteMethodOf(a->GetType(), typenames).c_str(),
+              ParcelWriteCastOf(a->GetType(), typenames, BuildVarName(*a)).c_str());
+    GenerateBreakOnStatusNotOk(out);
+  }
+}
+
+void GenerateServerMetaTransaction(CodeWriter& out, const AidlInterface& interface,
+                                   const AidlMethod& method, const Options& options) {
+  AIDL_FATAL_IF(method.IsUserDefined(), method);
+
+  string iface = ClassName(interface, ClassNames::INTERFACE);
+  if (method.GetName() == kGetInterfaceVersion && options.Version() > 0) {
+    out << "_aidl_data.checkInterface(this);\n"
+        << "_aidl_reply->writeNoException();\n";
+    out << "_aidl_reply->writeInt32(" << iface << "::VERSION);\n";
+  }
+  if (method.GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+    out << "_aidl_data.checkInterface(this);\n"
+        << "_aidl_reply->writeNoException();\n";
+    out << "_aidl_reply->writeUtf8AsUtf16(" << iface << "::HASH);\n";
+  }
+}
+
+}  // namespace
+
+void GenerateServerOnTransact(CodeWriter& out, const AidlInterface& interface,
+                              const AidlTypenames& typenames, const Options& options) {
+  const string bn_name = ClassName(interface, ClassNames::SERVER);
+  const string q_name = GetQualifiedName(interface, ClassNames::SERVER);
+
+  bool deprecated = interface.IsDeprecated() ||
+                    std::any_of(interface.GetMethods().begin(), interface.GetMethods().end(),
+                                [](const auto& m) { return m->IsDeprecated(); });
+  if (deprecated) {
+    out << "#pragma clang diagnostic push\n";
+    out << "#pragma clang diagnostic ignored \"-Wdeprecated\"\n";
+    out << "\n";
+  }
+
+  out.Write("%s %s::onTransact(uint32_t %s, const %s& %s, %s* %s, uint32_t %s) {\n",
+            kAndroidStatusLiteral, q_name.c_str(), kCodeVarName, kAndroidParcelLiteral,
+            kDataVarName, kAndroidParcelLiteral, kReplyVarName, kFlagsVarName);
+  out.Indent();
+  // Declare the status_t variable
+  out.Write("%s %s = %s;\n", kAndroidStatusLiteral, kAndroidStatusVarName, kAndroidStatusOk);
+
+  // Add the all important switch statement
+  out.Write("switch (%s) {\n", kCodeVarName);
+
+  // The switch statement has a case statement for each transaction code.
+  for (const auto& method : interface.GetMethods()) {
+    out.Write("case %s:\n", GetTransactionIdFor(bn_name, *method).c_str());
+    out << "{\n";
+    out.Indent();
+    if (method->IsUserDefined()) {
+      GenerateServerTransaction(out, interface, *method, typenames, options);
+    } else {
+      GenerateServerMetaTransaction(out, interface, *method, options);
+    }
+    out.Dedent();
+    out << "}\n";
+    out << "break;\n";
+  }
+
+  // The switch statement has a default case which defers to the super class.
+  // The superclass handles a few pre-defined transactions.
+  out << "default:\n";
+  out << "{\n";
+  out.Write("  %s = ::android::BBinder::onTransact(%s, %s, %s, %s);\n", kAndroidStatusVarName,
+            kCodeVarName, kDataVarName, kReplyVarName, kFlagsVarName);
+  out << "}\n";
+  out << "break;\n";
+  out << "}\n";  // switch
+
+  // If we saw a null reference, we can map that to an appropriate exception.
+  out.Write("if (%s == ::android::UNEXPECTED_NULL) {\n", kAndroidStatusVarName);
+  out.Write("  %s = %s::fromExceptionCode(%s::EX_NULL_POINTER).writeOverParcel(%s);\n",
+            kAndroidStatusVarName, kBinderStatusLiteral, kBinderStatusLiteral, kReplyVarName);
+  out.Write("}\n");
+
+  // Finally, the server's onTransact method just returns a status code.
+  out.Write("return %s;\n", kAndroidStatusVarName);
+
+  out.Dedent();
+  out << "}\n";
+  out << "\n";
+
+  if (deprecated) {
+    out << "#pragma clang diagnostic pop\n";
+    out << "\n";
+  }
+}
+
+void GenerateServerSource(CodeWriter& out, const AidlInterface& interface,
+                          const AidlTypenames& typenames, const Options& options) {
+  vector<string> include_list{
+      HeaderFile(interface, ClassNames::SERVER, false),
+      kParcelHeader,
+      kStabilityHeader,
+  };
+  if (options.GenLog()) {
+    include_list.emplace_back("chrono");
+    include_list.emplace_back("functional");
+  }
+  for (const auto& include : include_list) {
+    out << "#include <" << include << ">\n";
+  }
+  out << "\n";
+
+  const string i_name = ClassName(interface, ClassNames::INTERFACE);
+  const string bn_name = ClassName(interface, ClassNames::SERVER);
+  const string q_name = GetQualifiedName(interface, ClassNames::SERVER);
+
+  EnterNamespace(out, interface);
+  out << "\n";
+
+  // constructor
+  out.Write("%s::%s()\n", q_name.c_str(), bn_name.c_str());
+  out << "{\n";
+  out.Indent();
+  if (interface.IsVintfStability()) {
+    out << "::android::internal::Stability::markVintf(this);\n";
+  } else {
+    out << "::android::internal::Stability::markCompilationUnit(this);\n";
+  }
+  out.Dedent();
+  out << "}\n";
+  out << "\n";
+
+  GenerateServerOnTransact(out, interface, typenames, options);
+
+  if (options.Version() > 0) {
+    out << "int32_t " << q_name << "::" << kGetInterfaceVersion << "() {\n"
+        << "  return " << i_name << "::VERSION;\n"
+        << "}\n";
+  }
+  if (!options.Hash().empty()) {
+    out << "std::string " << q_name << "::" << kGetInterfaceHash << "() {\n"
+        << "  return " << i_name << "::HASH;\n"
+        << "}\n";
+  }
+  if (options.GenLog()) {
+    out << "std::function<void(const " + q_name + "::TransactionLog&)> " << q_name
+        << "::logFunc;\n";
+  }
+
+  LeaveNamespace(out, interface);
+}
+
+void GenerateInterfaceSource(CodeWriter& out, const AidlInterface& interface,
+                             const AidlTypenames& typenames, const Options&) {
+  out << "#include <" << HeaderFile(interface, ClassNames::RAW, false) << ">\n";
+  out << "#include <" << HeaderFile(interface, ClassNames::CLIENT, false) << ">\n";
+
+  EnterNamespace(out, interface);
+
+  if (auto parent = interface.GetParentType(); parent) {
+    out << fmt::format("DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE({}, {}, \"{}\")\n",
+                       GetQualifiedName(*parent, ClassNames::MAYBE_INTERFACE),
+                       ClassName(interface, ClassNames::BASE), interface.GetDescriptor());
+  } else {
+    out << fmt::format("DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE({}, \"{}\")\n",
+                       ClassName(interface, ClassNames::BASE), interface.GetDescriptor());
+  }
+
+  GenerateConstantDefinitions(out, interface, typenames, /*template_decl=*/"",
+                              ClassName(interface, ClassNames::INTERFACE));
+
+  LeaveNamespace(out, interface);
+}
+
+void GenerateClientClassDecl(CodeWriter& out, const AidlInterface& interface,
+                             const AidlTypenames& typenames, const Options& options) {
+  const string bp_name = ClassName(interface, ClassNames::CLIENT);
+  const string iface = ClassName(interface, ClassNames::INTERFACE);
+
+  out << "class";
+  GenerateDeprecated(out, interface);
+  out << " " << bp_name << " : public ::android::BpInterface<" << iface << "> {\n";
+  out << "public:\n";
+  out.Indent();
+  out << "explicit " << bp_name << "(const ::android::sp<::android::IBinder>& " << kImplVarName
+      << ");\n";
+  out << "virtual ~" << bp_name << "() = default;\n";
+
+  for (const auto& method : interface.GetMethods()) {
+    if (method->IsUserDefined()) {
+      GenerateMethodDecl(out, typenames, *method, /*clazz=*/"");
+      out << " override";
+      GenerateDeprecated(out, *method);
+      out << ";\n";
+    } else if (method->GetName() == kGetInterfaceVersion && options.Version() > 0) {
+      out << "int32_t " << method->GetName() << "() override;\n";
+    } else if (method->GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+      out << "std::string " << method->GetName() << "() override;\n";
+    }
+  }
+
+  if (options.GenLog()) {
+    out << kTransactionLogStruct;
+    out << "static std::function<void(const TransactionLog&)> logFunc;\n";
+  }
+  out.Dedent();
+
+  if (options.Version() > 0 || !options.Hash().empty()) {
+    out << "private:\n";
+    out.Indent();
+    if (options.Version() > 0) {
+      out << "int32_t cached_version_ = -1;\n";
+    }
+    if (!options.Hash().empty()) {
+      out << "std::string cached_hash_ = \"-1\";\n";
+      out << "std::mutex cached_hash_mutex_;\n";
+    }
+    out.Dedent();
+  }
+
+  out << "};  // class " << bp_name << "\n";
+}
+
+void GenerateClientHeader(CodeWriter& out, const AidlInterface& interface,
+                          const AidlTypenames& typenames, const Options& options) {
+  out << "#pragma once\n\n";
+  out << "#include <" << kIBinderHeader << ">\n";
+  out << "#include <" << kIInterfaceHeader << ">\n";
+  out << "#include <utils/Errors.h>\n";
+  out << "#include <" << HeaderFile(interface, ClassNames::RAW, false) << ">\n";
+  if (options.GenLog()) {
+    out << "#include <functional>\n";  // for std::function
+    out << "#include <android/binder_to_string.h>\n";
+  }
+  out << "\n";
+  EnterNamespace(out, interface);
+  GenerateClientClassDecl(out, interface, typenames, options);
+  LeaveNamespace(out, interface);
+}
+
+// Some interfaces are declared in .aidl files, but defined elsewhere.
+// These interfaces can not have Delegators and need to be avoided.
+// TODO(b/242920522) These should all be defined in .aidl files.
+bool isKnownUndefinedInterface(const std::string& canonicalName) {
+  static const auto* kKnownUndefinedInterfaces = new std::set<std::string>{
+      "android.hardware.ICamera", "android.hardware.ICameraClient",
+      "android.IOMXNode",         "android.IMediaExtractor",
+      "android.IDataSource",
+  };
+  return kKnownUndefinedInterfaces->find(canonicalName) != kKnownUndefinedInterfaces->end();
+};
+
+bool isDelegateable(const AidlTypeSpecifier& type) {
+  return type.GetDefinedType() && type.GetDefinedType()->AsInterface() &&
+         !isKnownUndefinedInterface(type.GetDefinedType()->GetCanonicalName()) && !type.IsArray();
+}
+
+void wrapDelegate(CodeWriter& out, const std::string& argName, const AidlTypeSpecifier& type,
+                  bool in) {
+  const std::string argRef = in ? argName : "*" + argName;
+  const std::string targetArgName = in ? "_" + argName : argName;
+  const std::string targetArgRef = in ? targetArgName : "*" + targetArgName;
+  // input binders need local variables for each arg to pass to the delegate
+  // because the parameters are const
+  if (in) {
+    out << "::android::sp<::" << Join(type.GetSplitName(), "::") << "Delegator> " << targetArgName
+        << ";\n";
+  }
+  out << "if (" << argRef << ") {\n";
+  out.Indent();
+  out << targetArgRef << " = ::android::sp<::" << Join(type.GetSplitName(), "::")
+      << "Delegator>::cast(delegate(" << argRef << "));\n";
+  out.Dedent();
+  out << "}\n";
+}
+
+void GenerateServerClassDecl(CodeWriter& out, const AidlInterface& interface,
+                             const AidlTypenames& typenames, const Options& options) {
+  const string bn_name = ClassName(interface, ClassNames::SERVER);
+  const string iface = ClassName(interface, ClassNames::INTERFACE);
+
+  out << "class";
+  GenerateDeprecated(out, interface);
+  out << " " << bn_name << " : public "
+      << "::android::BnInterface<" << iface << "> {\n";
+  out << "public:\n";
+  out.Indent();
+  for (const auto& method : interface.GetMethods()) {
+    out << "static constexpr uint32_t TRANSACTION_" << method->GetName() << " = "
+        << "::android::IBinder::FIRST_CALL_TRANSACTION + " << std::to_string(method->GetId())
+        << ";\n";
+  }
+  out << "explicit " << bn_name << "();\n";
+  out << fmt::format("{} onTransact(uint32_t {}, const {}& {}, {}* {}, uint32_t {}) override;\n",
+                     kAndroidStatusLiteral, kCodeVarName, kAndroidParcelLiteral, kDataVarName,
+                     kAndroidParcelLiteral, kReplyVarName, kFlagsVarName);
+  if (options.Version() > 0) {
+    out << "int32_t " << kGetInterfaceVersion << "();\n";
+  }
+  if (!options.Hash().empty()) {
+    out << "std::string " << kGetInterfaceHash << "();\n";
+  }
+  if (options.GenLog()) {
+    out << kTransactionLogStruct;
+    out << "static std::function<void(const TransactionLog&)> logFunc;\n";
+  }
+  out.Dedent();
+  out << "};  // class " << bn_name << "\n\n";
+
+  std::string d_name = ClassName(interface, ClassNames::DELEGATOR_IMPL);
+  out << "class";
+  GenerateDeprecated(out, interface);
+  out << " " << d_name << " : public " << bn_name << " {\n";
+  out << "public:\n";
+  out.Indent();
+  out << "explicit " << d_name << "("
+      << StringPrintf("const ::android::sp<%s> &impl", iface.c_str()) << ") "
+      << StringPrintf(": %s(impl)", kDelegateImplVarName) << " {}\n\n";
+  out << "::android::sp<" << iface << "> getImpl() { return " << kDelegateImplVarName << "; }\n";
+  for (const auto& method : interface.GetMethods()) {
+    if (method->IsUserDefined()) {
+      GenerateMethodDecl(out, typenames, *method, /*clazz=*/"");
+      out << " override";
+      GenerateDeprecated(out, *method);
+
+      std::vector<std::string> args;
+
+      // arg name, type
+      std::vector<pair<const std::string, const AidlTypeSpecifier&>> outBinders;
+      std::vector<pair<const std::string, const AidlTypeSpecifier&>> inBinders;
+      for (const auto& arg : method->GetArguments()) {
+        if (isDelegateable(arg->GetType())) {
+          if (arg->IsOut()) {
+            outBinders.push_back({arg->GetName(), arg->GetType()});
+          } else if (arg->IsIn()) {
+            inBinders.push_back({arg->GetName(), arg->GetType()});
+          } else {
+            AIDL_FATAL(*arg) << "inout interface?";
+          }
+          AIDL_FATAL_IF(!arg->IsIn() && !arg->IsOut(), *arg) << "Not in or out?";
+          args.push_back("_" + arg->GetName());
+        } else {
+          if (IsNonCopyableType(arg->GetType(), typenames)) {
+            args.push_back(StringPrintf("std::move(%s)", arg->GetName().c_str()));
+          } else {
+            args.push_back(arg->GetName());
+          }
+        }
+      }
+      if (method->GetType().GetName() != "void") {
+        if (isDelegateable(method->GetType())) {
+          outBinders.push_back({kReturnVarName, method->GetType()});
+        }
+        args.push_back(kReturnVarName);
+      }
+      out << " {\n";
+      out.Indent();
+      for (const auto binder : inBinders) {
+        wrapDelegate(out, binder.first, binder.second, true);
+      }
+      if (outBinders.empty()) {
+        out << "return " << kDelegateImplVarName << "->" << method->GetName() << "("
+            << base::Join(args, ", ") << ");\n";
+      } else {
+        out << "auto _status = " << kDelegateImplVarName << "->" << method->GetName() << "("
+            << base::Join(args, ", ") << ");\n";
+        for (const auto& binder : outBinders) {
+          wrapDelegate(out, binder.first, binder.second, false);
+        }
+        out << "return _status;\n";
+      }
+      out.Dedent();
+      out << "}\n";
+    } else if (method->GetName() == kGetInterfaceVersion && options.Version()) {
+      out << "int32_t " << kGetInterfaceVersion << "()"
+          << " override {\n";
+      out.Indent();
+      out << "int32_t _delegator_ver = " << bn_name << "::" << kGetInterfaceVersion << "();\n";
+      out << "int32_t _impl_ver = " << kDelegateImplVarName << "->" << kGetInterfaceVersion
+          << "();\n";
+      out << "return _delegator_ver < _impl_ver ? _delegator_ver : _impl_ver;\n";
+      out.Dedent();
+      out << "}\n";
+    } else if (method->GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+      out << "std::string " << kGetInterfaceHash << "()"
+          << " override {\n";
+      out << "  return " << kDelegateImplVarName << "->" << kGetInterfaceHash << "();\n";
+      out << "}\n";
+    }
+  }
+  out.Dedent();
+  out << "private:\n";
+  out.Indent();
+  out << "::android::sp<" << iface << "> " << kDelegateImplVarName << ";\n";
+  out.Dedent();
+  out << "};  // class " << d_name << "\n";
+}
+
+// Collect all includes for the type's server header. Nested types are visited as well via
+// VisitTopDown.
+void GenerateServerHeaderIncludes(CodeWriter& out, const AidlDefinedType& defined_type,
+                                  const AidlTypenames& typenames, const Options& options) {
+  struct Visitor : AidlVisitor {
+    const AidlTypenames& typenames;
+    const Options& options;
+    std::set<std::string> includes;
+    Visitor(const AidlTypenames& typenames, const Options& options)
+        : typenames(typenames), options(options) {}
+
+    // Collect includes for each type reference
+    void Visit(const AidlTypeSpecifier& type) override {
+      // Add Bn* header files for types used in this header. The *Delegator
+      // definitions require them.
+      const auto defined_type = type.GetDefinedType();
+      if (defined_type && defined_type->AsInterface()) {
+        if (!isKnownUndefinedInterface(defined_type->GetCanonicalName())) {
+          includes.insert(HeaderFile(*defined_type, ClassNames::SERVER, /*use_os_sep=*/false));
+        }
+      }
+    }
+
+    // Collect implementation-specific includes for each type definition
+    void Visit(const AidlInterface& iface) override {
+      includes.insert(HeaderFile(iface, ClassNames::SERVER, false));
+    }
+  } v(typenames, options);
+  VisitTopDown(v, defined_type);
+
+  v.includes.insert(kBinderDelegateHeader);
+  for (const auto& path : v.includes) {
+    out << "#include <" << path << ">\n";
+  }
+  out << "\n";
+}
+
+void GenerateServerHeader(CodeWriter& out, const AidlInterface& interface,
+                          const AidlTypenames& typenames, const Options& options) {
+  out << "#pragma once\n\n";
+  out << "#include <binder/IInterface.h>\n";
+  out << "#include <" << HeaderFile(interface, ClassNames::RAW, false) << ">\n";
+  if (options.GenLog()) {
+    out << "#include <functional>\n";  // for std::function
+    out << "#include <android/binder_to_string.h>\n";
+  }
+  GenerateServerHeaderIncludes(out, interface, typenames, options);
+  out << "\n";
+  EnterNamespace(out, interface);
+  GenerateServerClassDecl(out, interface, typenames, options);
+  LeaveNamespace(out, interface);
+}
+
+void GenerateClassDecl(CodeWriter& out, const AidlDefinedType& defined_type,
+                       const AidlTypenames& typenames, const Options& options);
+
+void GenerateNestedTypeDecls(CodeWriter& out, const AidlDefinedType& type,
+                             const AidlTypenames& typenames, const Options& options) {
+  auto visit = [&](const auto& nested) { GenerateClassDecl(out, nested, typenames, options); };
+  AIDL_FATAL_IF(!TopologicalVisit(type.GetNestedTypes(), visit), type) << "Cycle detected.";
+}
+
+void GenerateInterfaceClassDecl(CodeWriter& out, const AidlInterface& interface,
+                                const AidlTypenames& typenames, const Options& options) {
+  const string i_name = ClassName(interface, ClassNames::INTERFACE);
+  out << "class " << ClassName(interface, ClassNames::DELEGATOR_IMPL) << ";\n\n";
+  out << "class";
+  GenerateDeprecated(out, interface);
+  out << " " << i_name << " : public ::android::IInterface {\n";
+  out << "public:\n";
+  out.Indent();
+  out << "typedef " << ClassName(interface, ClassNames::DELEGATOR_IMPL) << " DefaultDelegator;\n";
+  out << "DECLARE_META_INTERFACE(" << ClassName(interface, ClassNames::BASE) << ")\n";
+  if (options.Version() > 0) {
+    if (options.IsLatestUnfrozenVersion()) {
+      out << "static inline const int32_t VERSION = true ? "
+          << std::to_string(options.PreviousVersion()) << " : " << std::to_string(options.Version())
+          << ";\n";
+    } else {
+      out << "static inline const int32_t VERSION = " << std::to_string(options.Version()) << ";\n";
+    }
+  }
+  if (!options.Hash().empty()) {
+    if (options.IsLatestUnfrozenVersion()) {
+      out << "static inline const std::string HASH = true ? \"" << options.PreviousHash()
+          << "\" : \"" << options.Hash() << "\";\n";
+    } else {
+      out << "static inline const std::string HASH = \"" << options.Hash() << "\";\n";
+    }
+  }
+  GenerateNestedTypeDecls(out, interface, typenames, options);
+  GenerateConstantDeclarations(out, interface, typenames);
+  for (const auto& method : interface.GetMethods()) {
+    if (method->IsUserDefined()) {
+      out << "virtual ";
+      GenerateMethodDecl(out, typenames, *method, /*clazz=*/"");
+      GenerateDeprecated(out, *method);
+      out << " = 0;\n";
+    } else if (method->GetName() == kGetInterfaceVersion && options.Version() > 0) {
+      out << "virtual int32_t " << method->GetName() << "() = 0;\n";
+    } else if (method->GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+      out << "virtual std::string " << method->GetName() << "() = 0;\n";
+    }
+  }
+  out.Dedent();
+  out << "};  // class " << i_name << "\n";
+  out << "\n";
+
+  // Implement the default impl class.
+  const string default_impl = ClassName(interface, ClassNames::DEFAULT_IMPL);
+  out << "class";
+  GenerateDeprecated(out, interface);
+  out << " " << default_impl << " : public " << i_name << " {\n";
+  out << "public:\n";
+  out.Indent();
+  // onAsBinder returns nullptr as this interface is not associated with a
+  // real binder.
+  out << "::android::IBinder* onAsBinder() override {\n"
+      << "  return nullptr;\n"
+      << "}\n";
+
+  // Each interface method by default returns UNKNOWN_TRANSACTION with is
+  // the same status that is returned by transact() when the method is
+  // not implemented in the server side. In other words, these default
+  // methods do nothing; they only exist to aid making a real default
+  // impl class without having to override all methods in an interface.
+  for (const auto& method : interface.GetMethods()) {
+    if (method->IsUserDefined()) {
+      out << "::android::binder::Status " << method->GetName() << "("
+          << GenerateArgList(typenames, *method, /*for_declaration=*/true, /*type_name_only=*/true)
+          << ") override";
+      GenerateDeprecated(out, *method);
+      out << " {\n"
+          << "  return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);\n"
+          << "}\n";
+    } else if (method->GetName() == kGetInterfaceVersion && options.Version() > 0) {
+      out << "int32_t " << kGetInterfaceVersion << "() override {\n"
+          << "  return 0;\n"
+          << "}\n";
+    } else if (method->GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+      out << "std::string " << kGetInterfaceHash << "() override {\n"
+          << "  return \"\";\n"
+          << "}\n";
+    }
+  }
+  out.Dedent();
+  out << "};  // class " << default_impl << "\n";
+
+  // When an interface is nested, every class should be defined together here
+  // because we don't have separate headers for them.
+  // (e.g. IFoo, IFooDefault, BpFoo, BnFoo, IFooDelegator)
+  if (interface.GetParentType()) {
+    GenerateClientClassDecl(out, interface, typenames, options);
+    GenerateServerClassDecl(out, interface, typenames, options);
+  }
+}
+
+void GenerateReadFromParcel(CodeWriter& out, const AidlStructuredParcelable& parcel,
+                            const AidlTypenames& typenames) {
+  out << "::android::status_t _aidl_ret_status = ::android::OK;\n";
+  out << "size_t _aidl_start_pos = _aidl_parcel->dataPosition();\n";
+  out << "int32_t _aidl_parcelable_raw_size = 0;\n";
+  out << "_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);\n";
+  out << "if (((_aidl_ret_status) != (::android::OK))) {\n";
+  out << "  return _aidl_ret_status;\n";
+  out << "}\n";
+  out << "if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;\n";
+  out << "size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);\n";
+  out << "if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;\n";
+  for (const auto& variable : parcel.GetFields()) {
+    string method = ParcelReadMethodOf(variable->GetType(), typenames);
+    string arg = ParcelReadCastOf(variable->GetType(), typenames, "&" + variable->GetName());
+    out << "if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {\n";
+    out << "  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);\n";
+    out << "  return _aidl_ret_status;\n";
+    out << "}\n";
+    if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::READ)) {
+      out << "if (false) {\n";
+      out.Indent();
+    }
+    out << "_aidl_ret_status = _aidl_parcel->" << method << "(" << arg << ");\n";
+    out << "if (((_aidl_ret_status) != (::android::OK))) {\n";
+    out << "  return _aidl_ret_status;\n";
+    out << "}\n";
+    if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::READ)) {
+      out.Dedent();
+      out << "}\n";
+    }
+  }
+  out << "_aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);\n";
+  out << "return _aidl_ret_status;\n";
+}
+
+void GenerateWriteToParcel(CodeWriter& out, const AidlStructuredParcelable& parcel,
+                           const AidlTypenames& typenames) {
+  out << "::android::status_t _aidl_ret_status = ::android::OK;\n";
+  out << "auto _aidl_start_pos = " << kParcelVarName << "->dataPosition();\n";
+  out << kParcelVarName << "->writeInt32(0);\n";
+  for (const auto& variable : parcel.GetFields()) {
+    string method = ParcelWriteMethodOf(variable->GetType(), typenames);
+    string arg = ParcelWriteCastOf(variable->GetType(), typenames, variable->GetName());
+    if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE)) {
+      out << "if (false) {\n";
+      out.Indent();
+    }
+    out << "_aidl_ret_status = " << kParcelVarName << "->" << method << "(" << arg << ");\n";
+    out << "if (((_aidl_ret_status) != (::android::OK))) {\n";
+    out << "  return _aidl_ret_status;\n";
+    out << "}\n";
+    if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE)) {
+      out.Dedent();
+      out << "}\n";
+    }
+  }
+  out << "auto _aidl_end_pos = " << kParcelVarName << "->dataPosition();\n";
+  out << kParcelVarName << "->setDataPosition(_aidl_start_pos);\n";
+  out << kParcelVarName << "->writeInt32(_aidl_end_pos - _aidl_start_pos);\n";
+  out << kParcelVarName << "->setDataPosition(_aidl_end_pos);\n";
+  out << "return _aidl_ret_status;\n";
+}
+
+ParcelWriterContext GetParcelWriterContext(const AidlTypenames& typenames) {
+  return ParcelWriterContext{
+      .status_type = kAndroidStatusLiteral,
+      .status_ok = kAndroidStatusOk,
+      .status_bad = kAndroidStatusBadValue,
+      .read_func =
+          [&](CodeWriter& out, const string& var, const AidlTypeSpecifier& type) {
+            out << fmt::format("{}->{}({})", kParcelVarName, ParcelReadMethodOf(type, typenames),
+                               ParcelReadCastOf(type, typenames, "&" + var));
+          },
+      .write_func =
+          [&](CodeWriter& out, const string& value, const AidlTypeSpecifier& type) {
+            out << fmt::format("{}->{}({})", kParcelVarName, ParcelWriteMethodOf(type, typenames),
+                               ParcelWriteCastOf(type, typenames, value));
+          },
+  };
+}
+
+void GenerateReadFromParcel(CodeWriter& out, const AidlUnionDecl& decl,
+                            const AidlTypenames& typenames) {
+  UnionWriter uw{decl, typenames, &CppNameOf, &ConstantValueDecorator};
+  uw.ReadFromParcel(out, GetParcelWriterContext(typenames));
+}
+
+void GenerateWriteToParcel(CodeWriter& out, const AidlUnionDecl& decl,
+                           const AidlTypenames& typenames) {
+  UnionWriter uw{decl, typenames, &CppNameOf, &ConstantValueDecorator};
+  uw.WriteToParcel(out, GetParcelWriterContext(typenames));
+}
+
+void GenerateParcelFields(CodeWriter& out, const AidlStructuredParcelable& decl,
+                          const AidlTypenames& typenames) {
+  for (const auto& variable : decl.GetFields()) {
+    const auto& type = variable->GetType();
+    std::string cpp_type = CppNameOf(type, typenames);
+    out << cpp_type;
+    GenerateDeprecated(out, *variable);
+    out << " " << variable->GetName();
+    if (variable->GetDefaultValue()) {
+      out << " = " << variable->ValueString(ConstantValueDecorator);
+    } else {
+      // Some types needs to be explicitly initialized even when no default value is set.
+      // - ParcelableHolder should be initialized with stability
+      // - enum should be zero initialized, otherwise the value will be indeterminate
+      // - fixed-size arrays should be initialized, otherwise the value will be indeterminate
+      if (type.GetName() == "ParcelableHolder") {
+        if (decl.IsVintfStability()) {
+          out << " { ::android::Parcelable::Stability::STABILITY_VINTF }";
+        } else {
+          out << " { ::android::Parcelable::Stability::STABILITY_LOCAL }";
+        }
+      } else if (typenames.GetEnumDeclaration(type) && !type.IsArray()) {
+        out << " = " << cpp_type << "(0)";
+      } else if (type.IsFixedSizeArray() && !type.IsNullable()) {
+        out << " = {{}}";
+      }
+    }
+    out << ";\n";
+  }
+}
+
+void GenerateParcelFields(CodeWriter& out, const AidlUnionDecl& decl,
+                          const AidlTypenames& typenames) {
+  UnionWriter uw{decl, typenames, &CppNameOf, &ConstantValueDecorator};
+  uw.PublicFields(out);
+}
+
+template <typename ParcelableType>
+void GenerateParcelClassDecl(CodeWriter& out, const ParcelableType& parcel,
+                             const AidlTypenames& typenames, const Options& options) {
+  const string clazz = parcel.GetName();
+
+  ClangDiagnosticIgnoreDeprecated guard(out, HasDeprecatedField(parcel));
+  out << TemplateDecl(parcel);
+  out << "class";
+  GenerateDeprecated(out, parcel);
+  out << " " << clazz << " : public ::android::Parcelable {\n";
+  out << "public:\n";
+  out.Indent();
+
+  GenerateNestedTypeDecls(out, parcel, typenames, options);
+  GenerateParcelFields(out, parcel, typenames);
+  GenerateParcelableComparisonOperators(out, parcel);
+  GenerateConstantDeclarations(out, parcel, typenames);
+
+  if (parcel.IsVintfStability()) {
+    out << "::android::Parcelable::Stability getStability() const override { return "
+           "::android::Parcelable::Stability::STABILITY_VINTF; }\n";
+  }
+
+  out << kAndroidStatusLiteral << " readFromParcel(const ::android::Parcel* _aidl_parcel) final;\n";
+  out << kAndroidStatusLiteral << " writeToParcel(::android::Parcel* _aidl_parcel) const final;\n";
+
+  const string canonical_name = parcel.GetCanonicalName();
+  out << "static const ::android::String16& getParcelableDescriptor() {\n"
+      << "  static const ::android::StaticString16 DESCRIPTOR (u\"" << canonical_name << "\");\n"
+      << "  return DESCRIPTOR;\n"
+      << "}\n";
+
+  GenerateToString(out, parcel);
+
+  out.Dedent();
+
+  if (auto decl = AidlCast<AidlUnionDecl>(parcel); decl) {
+    out << "private:\n";
+    out.Indent();
+    UnionWriter uw{*decl, typenames, &CppNameOf, &ConstantValueDecorator};
+    uw.PrivateFields(out);
+    out.Dedent();
+  }
+
+  out << "};  // class " << clazz << "\n";
+}
+
+template <typename T>
+void GenerateParcelSource(CodeWriter& out, const T& parcel, const AidlTypenames& typenames,
+                          const Options&) {
+  string q_name = GetQualifiedName(parcel);
+  if (parcel.IsGeneric()) {
+    q_name += "<" + Join(parcel.GetTypeParameters(), ",") + ">";
+  }
+
+  out << "#include <" << CppHeaderForType(parcel) << ">\n\n";
+
+  EnterNamespace(out, parcel);
+  GenerateConstantDefinitions(out, parcel, typenames, TemplateDecl(parcel), q_name);
+
+  {
+    ClangDiagnosticIgnoreDeprecated guard(out, HasDeprecatedField(parcel));
+    out << TemplateDecl(parcel);
+    out << "::android::status_t " << q_name << "::readFromParcel(const ::android::Parcel* "
+        << kParcelVarName << ") {\n";
+    out.Indent();
+    GenerateReadFromParcel(out, parcel, typenames);
+    out.Dedent();
+    out << "}\n";
+
+    out << TemplateDecl(parcel);
+    out << "::android::status_t " << q_name << "::writeToParcel(::android::Parcel* "
+        << kParcelVarName << ") const {\n";
+    out.Indent();
+    GenerateWriteToParcel(out, parcel, typenames);
+    out.Dedent();
+    out << "}\n";
+  }
+  LeaveNamespace(out, parcel);
+}
+
+void GenerateEnumClassDecl(CodeWriter& out, const AidlEnumDeclaration& enum_decl,
+                           const AidlTypenames& typenames) {
+  cpp::GenerateEnumClassDecl(out, enum_decl, CppNameOf(enum_decl.GetBackingType(), typenames),
+                             ConstantValueDecorator);
+}
+
+void GenerateClassDecl(CodeWriter& out, const AidlDefinedType& defined_type,
+                       const AidlTypenames& typenames, const Options& options) {
+  if (auto iface = AidlCast<AidlInterface>(defined_type); iface) {
+    GenerateInterfaceClassDecl(out, *iface, typenames, options);
+  } else if (auto parcelable = AidlCast<AidlStructuredParcelable>(defined_type); parcelable) {
+    GenerateParcelClassDecl(out, *parcelable, typenames, options);
+  } else if (auto union_decl = AidlCast<AidlUnionDecl>(defined_type); union_decl) {
+    GenerateParcelClassDecl(out, *union_decl, typenames, options);
+  } else if (auto enum_decl = AidlCast<AidlEnumDeclaration>(defined_type); enum_decl) {
+    GenerateEnumClassDecl(out, *enum_decl, typenames);
+  } else {
+    AIDL_FATAL(defined_type) << "Unrecognized type sent for CPP generation.";
+  }
+}
+
+}  // namespace internals
+
+using namespace internals;
+
+// Collect all includes for the type's header. Nested types are visited as well via VisitTopDown.
+void GenerateHeaderIncludes(CodeWriter& out, const AidlDefinedType& defined_type,
+                            const AidlTypenames& typenames, const Options& options) {
+  struct Visitor : AidlVisitor {
+    const AidlTypenames& typenames;
+    const Options& options;
+    std::set<std::string> includes;
+    Visitor(const AidlTypenames& typenames, const Options& options)
+        : typenames(typenames), options(options) {}
+
+    // Collect includes for each type reference including built-in type
+    void Visit(const AidlTypeSpecifier& type) override {
+      cpp::AddHeaders(type, typenames, &includes);
+    }
+
+    // Collect implementation-specific includes for each type definition
+    void Visit(const AidlInterface& iface) override {
+      includes.insert(kIBinderHeader);        // IBinder
+      includes.insert(kIInterfaceHeader);     // IInterface
+      includes.insert(kStatusHeader);         // Status
+      includes.insert(kStrongPointerHeader);  // sp<>
+
+      if (options.GenTraces()) {
+        includes.insert(kTraceHeader);
+      }
+
+      // For a nested interface, client/server classes are declared the same header as well.
+      if (iface.GetParentType()) {
+        includes.insert(kBinderDelegateHeader);  // Delegate.h
+        // client/server class provides logFunc when gen_log is on
+        if (options.GenLog()) {
+          includes.insert("functional");                  // std::function for logFunc
+          includes.insert("android/binder_to_string.h");  // Generic ToString helper
+        }
+      }
+    }
+
+    void Visit(const AidlStructuredParcelable&) override {
+      AddParcelableCommonHeaders();
+      includes.insert("tuple");  // std::tie in comparison operators
+    }
+
+    void Visit(const AidlUnionDecl& union_decl) override {
+      AddParcelableCommonHeaders();
+      auto union_headers = cpp::UnionWriter::GetHeaders(union_decl);
+      includes.insert(std::begin(union_headers), std::end(union_headers));
+    }
+
+    void Visit(const AidlEnumDeclaration&) override {
+      includes.insert("array");           // used in enum_values
+      includes.insert("binder/Enums.h");  // provides enum_range
+      includes.insert("string");          // toString() returns std::string
+    }
+
+    void AddParcelableCommonHeaders() {
+      includes.insert(kParcelHeader);                 // Parcel in readFromParcel/writeToParcel
+      includes.insert(kStatusHeader);                 // Status
+      includes.insert(kString16Header);               // String16 in getParcelableDescriptor
+      includes.insert("android/binder_to_string.h");  // toString()
+    }
+  } v(typenames, options);
+  VisitTopDown(v, defined_type);
+
+  for (const auto& path : v.includes) {
+    out << "#include <" << path << ">\n";
+  }
+  out << "\n";
+  if (v.includes.count("cassert")) {
+    // TODO(b/31559095) bionic on host should define __assert2
+    out << "#ifndef __BIONIC__\n#define __assert2(a,b,c,d) ((void)0)\n#endif\n\n";
+  }
+}
+
+// Generic parcelables and enum utilities should be defined in header.
+void GenerateHeaderDefinitions(CodeWriter& out, const AidlDefinedType& defined_type,
+                               const AidlTypenames& typenames, const Options& options) {
+  struct Visitor : AidlVisitor {
+    CodeWriter& out;
+    const AidlTypenames& typenames;
+    const Options& options;
+    Visitor(CodeWriter& out, const AidlTypenames& typenames, const Options& options)
+        : out(out), typenames(typenames), options(options) {}
+
+    void Visit(const AidlEnumDeclaration& enum_decl) override {
+      const auto backing_type = CppNameOf(enum_decl.GetBackingType(), typenames);
+      EnterNamespace(out, enum_decl);
+      out << GenerateEnumToString(enum_decl, backing_type);
+      LeaveNamespace(out, enum_decl);
+
+      out << "namespace android {\n";
+      out << "namespace internal {\n";
+      out << GenerateEnumValues(enum_decl, {""});
+      out << "}  // namespace internal\n";
+      out << "}  // namespace android\n";
+    }
+
+    void Visit(const AidlStructuredParcelable& parcelable) override {
+      if (parcelable.IsGeneric()) {
+        GenerateParcelSource(out, parcelable, typenames, options);
+      }
+    }
+
+    void Visit(const AidlUnionDecl& union_decl) override {
+      if (union_decl.IsGeneric()) {
+        GenerateParcelSource(out, union_decl, typenames, options);
+      }
+    }
+
+  } v(out, typenames, options);
+  VisitTopDown(v, defined_type);
+}
+
+void GenerateHeader(CodeWriter& out, const AidlDefinedType& defined_type,
+                    const AidlTypenames& typenames, const Options& options) {
+  if (auto parcelable = AidlCast<AidlParcelable>(defined_type); parcelable) {
+    out << "#error TODO(b/111362593) parcelables do not have headers";
+    return;
+  }
+  out << "#pragma once\n\n";
+  GenerateHeaderIncludes(out, defined_type, typenames, options);
+  GenerateForwardDecls(out, defined_type, false);
+  EnterNamespace(out, defined_type);
+  // Each class decl contains its own nested types' class decls
+  GenerateClassDecl(out, defined_type, typenames, options);
+  LeaveNamespace(out, defined_type);
+  GenerateHeaderDefinitions(out, defined_type, typenames, options);
+}
+
+void GenerateClientHeader(CodeWriter& out, const AidlDefinedType& defined_type,
+                          const AidlTypenames& typenames, const Options& options) {
+  if (auto iface = AidlCast<AidlInterface>(defined_type); iface) {
+    GenerateClientHeader(out, *iface, typenames, options);
+  } else if (auto parcelable = AidlCast<AidlStructuredParcelable>(defined_type); parcelable) {
+    out << "#error TODO(b/111362593) parcelables do not have bp classes";
+  } else if (auto union_decl = AidlCast<AidlUnionDecl>(defined_type); union_decl) {
+    out << "#error TODO(b/111362593) parcelables do not have bp classes";
+  } else if (auto enum_decl = AidlCast<AidlEnumDeclaration>(defined_type); enum_decl) {
+    out << "#error TODO(b/111362593) enums do not have bp classes";
+  } else if (auto parcelable = AidlCast<AidlParcelable>(defined_type); parcelable) {
+    out << "#error TODO(b/111362593) parcelables do not have bp classes";
+  } else {
+    AIDL_FATAL(defined_type) << "Unrecognized type sent for CPP generation.";
+  }
+}
+
+void GenerateServerHeader(CodeWriter& out, const AidlDefinedType& defined_type,
+                          const AidlTypenames& typenames, const Options& options) {
+  if (auto iface = AidlCast<AidlInterface>(defined_type); iface) {
+    GenerateServerHeader(out, *iface, typenames, options);
+  } else if (auto parcelable = AidlCast<AidlStructuredParcelable>(defined_type); parcelable) {
+    out << "#error TODO(b/111362593) parcelables do not have bn classes";
+  } else if (auto union_decl = AidlCast<AidlUnionDecl>(defined_type); union_decl) {
+    out << "#error TODO(b/111362593) parcelables do not have bn classes";
+  } else if (auto enum_decl = AidlCast<AidlEnumDeclaration>(defined_type); enum_decl) {
+    out << "#error TODO(b/111362593) enums do not have bn classes";
+  } else if (auto parcelable = AidlCast<AidlParcelable>(defined_type); parcelable) {
+    out << "#error TODO(b/111362593) parcelables do not have bn classes";
+  } else {
+    AIDL_FATAL(defined_type) << "Unrecognized type sent for CPP generation.";
+  }
+}
+
+void GenerateSource(CodeWriter& out, const AidlDefinedType& defined_type,
+                    const AidlTypenames& typenames, const Options& options) {
+  struct Visitor : AidlVisitor {
+    CodeWriter& out;
+    const AidlTypenames& typenames;
+    const Options& options;
+    Visitor(CodeWriter& out, const AidlTypenames& typenames, const Options& options)
+        : out(out), typenames(typenames), options(options) {}
+
+    void Visit(const AidlInterface& interface) override {
+      GenerateInterfaceSource(out, interface, typenames, options);
+      GenerateClientSource(out, interface, typenames, options);
+      GenerateServerSource(out, interface, typenames, options);
+    }
+
+    void Visit(const AidlStructuredParcelable& parcelable) override {
+      if (!parcelable.IsGeneric()) {
+        GenerateParcelSource(out, parcelable, typenames, options);
+      } else {
+        out << "\n";
+      }
+    }
+
+    void Visit(const AidlUnionDecl& union_decl) override {
+      if (!union_decl.IsGeneric()) {
+        GenerateParcelSource(out, union_decl, typenames, options);
+      } else {
+        out << "\n";
+      }
+    }
+
+    void Visit(const AidlEnumDeclaration& enum_decl) override {
+      if (!enum_decl.GetParentType()) {
+        out << "// This file is intentionally left blank as placeholder for enum declaration.\n";
+      }
+    }
+
+    void Visit(const AidlParcelable& parcelable) override {
+      AIDL_FATAL_IF(parcelable.GetParentType(), parcelable)
+          << "Unstructured parcelable can't be nested.";
+      out << "// This file is intentionally left blank as placeholder for parcel declaration.\n";
+    }
+  } v(out, typenames, options);
+  VisitTopDown(v, defined_type);
+}
+
+bool GenerateCpp(const string& output_file, const Options& options, const AidlTypenames& typenames,
+                 const AidlDefinedType& defined_type, const IoDelegate& io_delegate) {
+  if (!ValidateOutputFilePath(output_file, options, defined_type)) {
+    return false;
+  }
+
+  using GenFn = void (*)(CodeWriter& out, const AidlDefinedType& defined_type,
+                         const AidlTypenames& typenames, const Options& options);
+  // Wrap Generate* function to handle CodeWriter for a file.
+  auto gen = [&](auto file, GenFn fn) {
+    unique_ptr<CodeWriter> writer(io_delegate.GetCodeWriter(file));
+
+    GenerateAutoGenHeader(*writer, options);
+
+    fn(*writer, defined_type, typenames, options);
+    AIDL_FATAL_IF(!writer->Close(), defined_type) << "I/O Error!";
+    return true;
+  };
+
+  return gen(options.OutputHeaderDir() + HeaderFile(defined_type, ClassNames::RAW),
+             &GenerateHeader) &&
+         gen(options.OutputHeaderDir() + HeaderFile(defined_type, ClassNames::CLIENT),
+             &GenerateClientHeader) &&
+         gen(options.OutputHeaderDir() + HeaderFile(defined_type, ClassNames::SERVER),
+             &GenerateServerHeader) &&
+         gen(output_file, &GenerateSource);
+}
+
+}  // namespace cpp
+}  // namespace aidl
+}  // namespace android
diff --git a/generate_cpp.h b/generate_cpp.h
new file mode 100644
index 0000000..acd3d39
--- /dev/null
+++ b/generate_cpp.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+
+#include "aidl_language.h"
+#include "aidl_to_cpp.h"
+#include "aidl_to_cpp_common.h"
+#include "options.h"
+
+namespace android {
+namespace aidl {
+namespace cpp {
+
+bool GenerateCpp(const string& output_file, const Options& options, const AidlTypenames& typenames,
+                 const AidlDefinedType& parsed_doc, const IoDelegate& io_delegate);
+
+}  // namespace cpp
+}  // namespace aidl
+}  // namespace android
diff --git a/generate_cpp_analyzer.cpp b/generate_cpp_analyzer.cpp
new file mode 100644
index 0000000..23c0ae6
--- /dev/null
+++ b/generate_cpp_analyzer.cpp
@@ -0,0 +1,220 @@
+/*
+ * Copyright (C) 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "generate_cpp_analyzer.h"
+
+#include <string>
+#include "aidl.h"
+#include "aidl_language.h"
+#include "aidl_to_common.h"
+#include "aidl_to_cpp.h"
+#include "code_writer.h"
+#include "logging.h"
+
+using std::string;
+using std::unique_ptr;
+
+namespace android {
+namespace aidl {
+namespace cpp {
+namespace {
+
+const char kAndroidStatusVarName[] = "_aidl_ret_status";
+const char kReturnVarName[] = "_aidl_return";
+const char kDataVarName[] = "_aidl_data";
+const char kReplyVarName[] = "_aidl_reply";
+
+void GenerateAnalyzerTransaction(CodeWriter& out, const AidlInterface& interface,
+                                 const AidlMethod& method, const AidlTypenames& typenames,
+                                 const Options& options) {
+  // Reading past the interface descriptor and reply binder status
+  out << "_aidl_ret_status = ::android::OK;\n";
+  out.Write("if (!(%s.enforceInterface(android::String16(\"%s\")))) {\n", kDataVarName,
+            interface.GetDescriptor().c_str());
+  out.Write("  %s = ::android::BAD_TYPE;\n", kAndroidStatusVarName);
+  out << "  std::cout << \"  Failure: Parcel interface does not match.\" << std::endl;\n"
+      << "  break;\n"
+      << "}\n";
+
+  // Declare parameters
+  for (const unique_ptr<AidlArgument>& a : method.GetArguments()) {
+    out.Write("%s %s;\n", CppNameOf(a->GetType(), typenames).c_str(), BuildVarName(*a).c_str());
+  }
+  out << "::android::binder::Status binderStatus;\n";
+  // Declare and read the return value.
+  // Read past the binder status.
+  out.Write("binderStatus.readFromParcel(%s);\n", kReplyVarName);
+  if (method.GetType().GetName() != "void") {
+    out.Write("%s %s;\n", CppNameOf(method.GetType(), typenames).c_str(), kReturnVarName);
+    out.Write("bool returnError = false;\n");
+  }
+
+  // Read Reply
+  if (method.GetType().GetName() != "void") {
+    out.Write("%s = %s.%s(%s);\n", kAndroidStatusVarName, kReplyVarName,
+              ParcelReadMethodOf(method.GetType(), typenames).c_str(),
+              ParcelReadCastOf(method.GetType(), typenames, string("&") + kReturnVarName).c_str());
+    out.Write("if (((%s) != (android::NO_ERROR))) {\n", kAndroidStatusVarName);
+    out.Indent();
+    out.Write(
+        "std::cerr << \"Failure: error in reading return value from Parcel.\" << std::endl;\n");
+    out.Write("returnError = true;\n");
+    out.Dedent();
+    out.Write("}\n");
+  }
+
+  // Reading arguments
+  out << "do { // Single-pass loop to break if argument reading fails\n";
+  out.Indent();
+  for (const auto& a : method.GetArguments()) {
+    out.Write("%s = %s.%s(%s);\n", kAndroidStatusVarName, kDataVarName,
+              ParcelReadMethodOf(a->GetType(), typenames).c_str(),
+              ParcelReadCastOf(a->GetType(), typenames, "&" + BuildVarName(*a)).c_str());
+    out.Write("if (((%s) != (android::NO_ERROR))) {\n", kAndroidStatusVarName);
+    out.Indent();
+    out.Write("std::cerr << \"Failure: error in reading argument %s from Parcel.\" << std::endl;\n",
+              a->GetName().c_str());
+    out.Dedent();
+    out.Write("  break;\n}\n");
+  }
+  out.Dedent();
+  out << "} while(false);\n";
+
+  if (!method.GetArguments().empty() && options.GetMinSdkVersion() >= SDK_VERSION_Tiramisu) {
+    out.Write(
+        "if (!%s.enforceNoDataAvail().isOk()) {\n  %s = android::BAD_VALUE;\n  std::cout << \"  "
+        "Failure: Parcel has too much data.\" << std::endl;\n  break;\n}\n",
+        kDataVarName, kAndroidStatusVarName);
+  }
+
+  // Arguments
+  out.Write("std::cout << \"  arguments: \" << std::endl;\n");
+  for (const auto& a : method.GetArguments()) {
+    out.Write(
+        "std::cout << \"    %s: \" << ::android::internal::ToString(%s) "
+        "<< std::endl;\n",
+        a->GetName().c_str(), BuildVarName(*a).c_str());
+  }
+
+  // Return Value
+  if (method.GetType().GetName() != "void") {
+    out.Write("if (returnError) {\n");
+    out.Indent();
+    out.Write("std::cout << \"  return: <error>\" << std::endl;\n");
+    out.Dedent();
+    out.Write("} else {");
+    out.Indent();
+    out.Write("std::cout << \"  return: \" << ::android::internal::ToString(%s) << std::endl;\n",
+              kReturnVarName);
+    out.Dedent();
+    out.Write("}\n");
+  } else {
+    out.Write("std::cout << \"  return: void\" << std::endl;\n");
+  }
+}
+
+void GenerateAnalyzerSource(CodeWriter& out, const AidlDefinedType& defined_type,
+                            const AidlTypenames& typenames, const Options& options) {
+  auto interface = AidlCast<AidlInterface>(defined_type);
+  string q_name = GetQualifiedName(*interface, ClassNames::INTERFACE);
+
+  string canonicalName = defined_type.GetCanonicalName();
+  string interfaceName = defined_type.GetName();
+
+  // Includes
+  vector<string> include_list{
+      "iostream", "binder/Parcel.h", "android/binder_to_string.h",
+      HeaderFile(*interface, ClassNames::RAW, false),
+      // HeaderFile(*interface, ClassNames::INTERFACE, false),
+  };
+  for (const auto& include : include_list) {
+    out << "#include <" << include << ">\n";
+  }
+
+  out << "namespace {\n";
+  // Function Start
+  out.Write(
+      "android::status_t analyze%s(uint32_t _aidl_code, const android::Parcel& %s, const "
+      "android::Parcel& %s) {\n",
+      q_name.c_str(), kDataVarName, kReplyVarName);
+  out.Indent();
+  out.Write("android::status_t %s;\nswitch(_aidl_code) {\n", kAndroidStatusVarName);
+  out.Indent();
+
+  // Main Switch Statement
+  for (const auto& method : interface->GetMethods()) {
+    out.Write("case ::android::IBinder::FIRST_CALL_TRANSACTION + %d:\n{\n", (method->GetId()));
+    out.Indent();
+    out.Write("std::cout << \"%s.%s()\" << std::endl;\n", interfaceName.c_str(),
+              method->GetName().c_str());
+    GenerateAnalyzerTransaction(out, *interface, *method, typenames, options);
+    out.Dedent();
+    out << "}\n";
+    out << "break;\n";
+  }
+  out << "default:\n{\n  std::cout << \"  Transaction code \" << _aidl_code << \" not known.\" << "
+         "std::endl;\n";
+  out.Write("%s = android::UNKNOWN_TRANSACTION;\n}\n", kAndroidStatusVarName);
+  out.Dedent();
+  out.Write("}\nreturn %s;\n", kAndroidStatusVarName);
+  out << "// To prevent unused variable warnings\n";
+  out.Write("(void)%s; (void)%s; (void)%s;\n", kAndroidStatusVarName, kDataVarName, kReplyVarName);
+  out.Dedent();
+  out << "}\n\n} // namespace\n";
+
+  out << "\n#include <Analyzer.h>\nusing android::aidl::Analyzer;\n";
+  out.Write(
+      "__attribute__((constructor)) static void addAnalyzer() {\n"
+      "  Analyzer::installAnalyzer(std::make_unique<Analyzer>(\"%s\", \"%s\", &analyze%s));\n}\n",
+      canonicalName.c_str(), interfaceName.c_str(), q_name.c_str());
+}
+
+void GenerateAnalyzerPlaceholder(CodeWriter& out, const AidlDefinedType& /*defined_type*/,
+                                 const AidlTypenames& /*typenames*/, const Options& /*options*/) {
+  out << "// This file is intentionally left blank as placeholder for building an analyzer.\n";
+}
+
+}  // namespace
+
+bool GenerateCppAnalyzer(const string& output_file, const Options& options,
+                         const AidlTypenames& typenames, const AidlDefinedType& defined_type,
+                         const IoDelegate& io_delegate) {
+  if (!ValidateOutputFilePath(output_file, options, defined_type)) {
+    return false;
+  }
+
+  using GenFn = void (*)(CodeWriter & out, const AidlDefinedType& defined_type,
+                         const AidlTypenames& typenames, const Options& options);
+  auto gen = [&](auto file, GenFn fn) {
+    unique_ptr<CodeWriter> writer(io_delegate.GetCodeWriter(file));
+
+    GenerateAutoGenHeader(*writer, options);
+
+    fn(*writer, defined_type, typenames, options);
+    AIDL_FATAL_IF(!writer->Close(), defined_type) << "I/O Error!";
+    return true;
+  };
+
+  if (AidlCast<AidlInterface>(defined_type)) {
+    return gen(output_file, &GenerateAnalyzerSource);
+  } else {
+    return gen(output_file, &GenerateAnalyzerPlaceholder);
+  }
+}
+
+}  // namespace cpp
+}  // namespace aidl
+}  // namespace android
diff --git a/generate_cpp_analyzer.h b/generate_cpp_analyzer.h
new file mode 100644
index 0000000..10bc34b
--- /dev/null
+++ b/generate_cpp_analyzer.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+
+#include "aidl_language.h"
+#include "aidl_to_cpp.h"
+#include "aidl_to_cpp_common.h"
+#include "options.h"
+
+namespace android {
+namespace aidl {
+namespace cpp {
+
+bool GenerateCppAnalyzer(const string& output_file, const Options& options,
+                         const AidlTypenames& typenames, const AidlDefinedType& parsed_doc,
+                         const IoDelegate& io_delegate);
+
+}  // namespace cpp
+}  // namespace aidl
+}  // namespace android
diff --git a/generate_cpp_unittest.cpp b/generate_cpp_unittest.cpp
new file mode 100644
index 0000000..833884b
--- /dev/null
+++ b/generate_cpp_unittest.cpp
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <string>
+
+#include <android-base/stringprintf.h>
+#include <gtest/gtest.h>
+
+#include "aidl.h"
+#include "aidl_language.h"
+#include "code_writer.h"
+#include "generate_cpp.h"
+#include "os.h"
+#include "tests/fake_io_delegate.h"
+#include "tests/test_util.h"
+
+using ::android::aidl::test::FakeIoDelegate;
+using ::android::base::StringPrintf;
+using std::string;
+using std::unique_ptr;
+
+namespace android {
+namespace aidl {
+namespace cpp {
+
+class ASTTest : public ::testing::Test {
+ protected:
+  ASTTest(const string& cmdline, const string& file_contents)
+      : options_(Options::From(cmdline)), file_contents_(file_contents) {
+  }
+
+  AidlInterface* ParseSingleInterface() {
+    io_delegate_.SetFileContents(options_.InputFiles().at(0), file_contents_);
+
+    vector<string> imported_files;
+    ImportResolver import_resolver{io_delegate_, options_.InputFiles().at(0), {"."}};
+    AidlError err = ::android::aidl::internals::load_and_validate_aidl(
+        options_.InputFiles().front(), options_, io_delegate_, &typenames_, &imported_files);
+
+    if (err != AidlError::OK) {
+      return nullptr;
+    }
+
+    const auto& defined_types = typenames_.MainDocument().DefinedTypes();
+    EXPECT_EQ(1ul, defined_types.size());
+    EXPECT_NE(nullptr, defined_types.front().get()->AsInterface());
+
+    return defined_types.front().get()->AsInterface();
+  }
+
+  const Options options_;
+  const string file_contents_;
+  FakeIoDelegate io_delegate_;
+  AidlTypenames typenames_;
+};
+
+namespace test_io_handling {
+
+const char kInputPath[] = "a/IFoo.aidl";
+const char kOutputPath[] = "output.cpp";
+const char kHeaderDir[] = "headers";
+const char kInterfaceHeaderRelPath[] = "a/IFoo.h";
+
+const string kCmdline =
+    string("aidl-cpp -I . ") + kInputPath + " " + kHeaderDir + " " + kOutputPath;
+
+}  // namespace test_io_handling
+
+class IoErrorHandlingTest : public ASTTest {
+ public:
+  IoErrorHandlingTest() : ASTTest(test_io_handling::kCmdline, "package a; interface IFoo {}") {}
+};
+
+TEST_F(IoErrorHandlingTest, GenerateCorrectlyAbsentErrors) {
+  // Confirm that this is working correctly without I/O problems.
+  AidlInterface* interface = ParseSingleInterface();
+  ASSERT_NE(interface, nullptr);
+  ASSERT_TRUE(GenerateCpp(options_.OutputFile(), options_, typenames_, *interface, io_delegate_));
+}
+
+TEST_F(IoErrorHandlingTest, HandlesBadHeaderWrite) {
+  using namespace test_io_handling;
+  AidlInterface* interface = ParseSingleInterface();
+  ASSERT_NE(interface, nullptr);
+
+  // Simulate issues closing the interface header.
+  const string header_path =
+      StringPrintf("%s%c%s", kHeaderDir, OS_PATH_SEPARATOR,
+                   kInterfaceHeaderRelPath);
+  io_delegate_.AddBrokenFilePath(header_path);
+  ASSERT_DEATH(GenerateCpp(options_.OutputFile(), options_, typenames_, *interface, io_delegate_),
+               "I/O Error!");
+  // We should never attempt to write the C++ file if we fail writing headers.
+  ASSERT_FALSE(io_delegate_.GetWrittenContents(kOutputPath, nullptr));
+}
+
+TEST_F(IoErrorHandlingTest, HandlesBadCppWrite) {
+  using test_io_handling::kOutputPath;
+  AidlInterface* interface = ParseSingleInterface();
+  ASSERT_NE(interface, nullptr);
+
+  // Simulate issues closing the cpp file.
+  io_delegate_.AddBrokenFilePath(kOutputPath);
+  ASSERT_DEATH(GenerateCpp(options_.OutputFile(), options_, typenames_, *interface, io_delegate_),
+               "I/O Error!");
+}
+
+}  // namespace cpp
+}  // namespace aidl
+}  // namespace android
diff --git a/generate_java.cpp b/generate_java.cpp
new file mode 100644
index 0000000..4b4a215
--- /dev/null
+++ b/generate_java.cpp
@@ -0,0 +1,1085 @@
+/*
+ * Copyright (C) 2016, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "generate_java.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <algorithm>
+#include <map>
+#include <memory>
+#include <optional>
+#include <sstream>
+
+#include <android-base/format.h>
+#include <android-base/stringprintf.h>
+
+#include "aidl_to_common.h"
+#include "aidl_to_java.h"
+#include "code_writer.h"
+#include "logging.h"
+
+using ::android::base::EndsWith;
+using ::android::base::Join;
+using ::android::base::StartsWith;
+using std::string;
+using std::unique_ptr;
+using std::vector;
+
+namespace {
+using android::aidl::java::CodeGeneratorContext;
+using android::aidl::java::ConstantValueDecorator;
+
+inline string GetterName(const AidlVariableDeclaration& variable) {
+  return "get" + variable.GetCapitalizedName();
+}
+inline string SetterName(const AidlVariableDeclaration& variable) {
+  return "set" + variable.GetCapitalizedName();
+}
+
+// clang-format off
+const map<string, string> kContentsDescribers {
+  {"FileDescriptor", R"(if (_v instanceof java.io.FileDescriptor) {
+  return android.os.Parcelable.CONTENTS_FILE_DESCRIPTOR;
+})"},
+  {"Parcelable", R"(if (_v instanceof android.os.Parcelable) {
+  return ((android.os.Parcelable) _v).describeContents();
+})"},
+  {"Map", R"(if (_v instanceof java.util.Map) {
+  return describeContents(((java.util.Map) _v).values());
+})"},
+  {"List", R"(if (_v instanceof java.util.Collection) {
+  int _mask = 0;
+  for (Object o : (java.util.Collection) _v) {
+    _mask |= describeContents(o);
+  }
+  return _mask;
+})"},
+  {"Array", R"(if (_v instanceof Object[]) {
+  int _mask = 0;
+  for (Object o : (Object[]) _v) {
+    _mask |= describeContents(o);
+  }
+  return _mask;
+})"},
+};
+// clang-format on
+
+void GenerateDescribeContentsHelper(CodeWriter& out, const set<string>& describers) {
+  out << "private int describeContents(Object _v) {\n";
+  out.Indent();
+  out << "if (_v == null) return 0;\n";
+  for (const auto& d : describers) {
+    out << kContentsDescribers.at(d) << "\n";
+  }
+  out << "return 0;\n";
+  out.Dedent();
+  out << "}\n";
+}
+
+// Some types contribute to Parcelable.describeContents().
+// e.g. FileDescriptor, Parcelables, List<Parcelables> ...
+bool CanDescribeContents(const AidlTypeSpecifier& type, const AidlTypenames& types,
+                         set<string>* describers) {
+  if (type.IsArray()) {
+    bool canDescribe = false;
+    type.ViewAsArrayBase([&](const AidlTypeSpecifier& base) {
+      canDescribe = CanDescribeContents(base, types, describers);
+    });
+
+    if (canDescribe) {
+      describers->insert("Array");
+      return true;
+    }
+    return false;
+  }
+
+  if (type.GetName() == "List") {
+    if (CanDescribeContents(*type.GetTypeParameters()[0], types, describers)) {
+      describers->insert("List");
+      return true;
+    }
+    return false;
+  }
+
+  if (type.GetName() == "Map") {
+    if (CanDescribeContents(*type.GetTypeParameters()[1], types, describers)) {
+      describers->insert("Map");  // Map describer uses List describer
+      describers->insert("List");
+      return true;
+    }
+    return false;
+  }
+
+  if (type.GetName() == "FileDescriptor") {
+    describers->insert("FileDescriptor");
+    return true;
+  }
+
+  if (type.GetName() == "ParcelFileDescriptor" || type.GetName() == "ParcelableHolder" ||
+      types.GetParcelable(type) != nullptr) {
+    describers->insert("Parcelable");
+    return true;
+  }
+
+  return false;
+}
+void GenerateParcelableDescribeContents(CodeWriter& out, const AidlStructuredParcelable& decl,
+                                        const AidlTypenames& types) {
+  set<string> describers;
+
+  out << "@Override\n";
+  out << "public int describeContents() {\n";
+  out.Indent();
+  out << "int _mask = 0;\n";
+  for (const auto& f : decl.GetFields()) {
+    if (CanDescribeContents(f->GetType(), types, &describers)) {
+      out << "_mask |= describeContents(" << f->GetName() << ");\n";
+    }
+  }
+  out << "return _mask;\n";
+  out.Dedent();
+  out << "}\n";
+  if (!describers.empty()) {
+    GenerateDescribeContentsHelper(out, describers);
+  }
+}
+
+void GenerateParcelableDescribeContents(CodeWriter& out, const AidlUnionDecl& decl,
+                                        const AidlTypenames& types) {
+  set<string> describers;
+
+  out << "@Override\n";
+  out << "public int describeContents() {\n";
+  out.Indent();
+  out << "int _mask = 0;\n";
+  out << "switch (getTag()) {\n";
+  for (const auto& f : decl.GetFields()) {
+    if (CanDescribeContents(f->GetType(), types, &describers)) {
+      out << "case " << f->GetName() << ":\n";
+      out.Indent();
+      out << "_mask |= describeContents(" << GetterName(*f) << "());\n";
+      out << "break;\n";
+      out.Dedent();
+    }
+  }
+  out << "}\n";
+  out << "return _mask;\n";
+  out.Dedent();
+  out << "}\n";
+  if (!describers.empty()) {
+    GenerateDescribeContentsHelper(out, describers);
+  }
+}
+
+void GenerateToString(CodeWriter& out, const AidlStructuredParcelable& parcel,
+                      const AidlTypenames& typenames, const Options& options) {
+  out << "@Override\n";
+  out << "public String toString() {\n";
+  out.Indent();
+  out << "java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(";
+  out << "\", \", \"{\", \"}\");\n";
+  for (const auto& field : parcel.GetFields()) {
+    CodeGeneratorContext ctx{
+        .writer = out,
+        .typenames = typenames,
+        .type = field->GetType(),
+        .var = field->GetName(),
+        .min_sdk_version = options.GetMinSdkVersion(),
+    };
+    out << "_aidl_sj.add(\"" << field->GetName() << ": \" + (";
+    ToStringFor(ctx);
+    out << "));\n";
+  }
+  out << "return \"" << parcel.GetName() << "\" + _aidl_sj.toString()  ;\n";
+  out.Dedent();
+  out << "}\n";
+}
+
+void GenerateToString(CodeWriter& out, const AidlUnionDecl& parcel, const AidlTypenames& typenames,
+                      const Options& options) {
+  out << "@Override\n";
+  out << "public String toString() {\n";
+  out.Indent();
+  out << "switch (_tag) {\n";
+  for (const auto& field : parcel.GetFields()) {
+    CodeGeneratorContext ctx{
+        .writer = out,
+        .typenames = typenames,
+        .type = field->GetType(),
+        .var = GetterName(*field) + "()",
+        .min_sdk_version = options.GetMinSdkVersion(),
+    };
+    out << "case " << field->GetName() << ": return \"" << parcel.GetName() << "."
+        << field->GetName() << "(\" + (";
+    ToStringFor(ctx);
+    out << ") + \")\";\n";
+  }
+  out << "}\n";
+  out << "throw new IllegalStateException(\"unknown field: \" + _tag);\n";
+  out.Dedent();
+  out << "}\n";
+}
+
+void GenerateEqualsAndHashCode(CodeWriter& out, const AidlStructuredParcelable& parcel,
+                      const AidlTypenames&) {
+  out << "@Override\n";
+  out << "public boolean equals(Object other) {\n";
+  out.Indent();
+  out << "if (this == other) return true;\n";
+  out << "if (other == null) return false;\n";
+  out << "if (!(other instanceof " << parcel.GetName() << ")) return false;\n";
+  out << parcel.GetName() << " that = (" << parcel.GetName() << ")other;\n";
+  for (const auto& field : parcel.GetFields()) {
+    out << "if (!java.util.Objects.deepEquals(" << field->GetName() << ", that." << field->GetName()
+        << ")) return false;\n";
+  }
+  out << "return true;\n";
+  out.Dedent();
+  out << "}\n";
+  out << "\n";
+  out << "@Override\n";
+  out << "public int hashCode() {\n";
+  out.Indent();
+  out << "return java.util.Arrays.deepHashCode(java.util.Arrays.asList(";
+  std::vector<std::string> names;
+  for (const auto& field : parcel.GetFields()) {
+    names.push_back(field->GetName());
+  }
+  out << android::base::Join(names, ", ") << ").toArray());\n";
+  out.Dedent();
+  out << "}\n";
+}
+
+void GenerateEqualsAndHashCode(CodeWriter& out, const AidlUnionDecl& decl,
+                                 const AidlTypenames&) {
+  out << "@Override\n";
+  out << "public boolean equals(Object other) {\n";
+  out.Indent();
+  out << "if (this == other) return true;\n";
+  out << "if (other == null) return false;\n";
+  out << "if (!(other instanceof " << decl.GetName() << ")) return false;\n";
+  out << decl.GetName() << " that = (" << decl.GetName() << ")other;\n";
+  out << "if (_tag != that._tag) return false;\n";
+  out << "if (!java.util.Objects.deepEquals(_value, that._value)) return false;\n";
+  out << "return true;\n";
+  out.Dedent();
+  out << "}\n";
+  out << "\n";
+  out << "@Override\n";
+  out << "public int hashCode() {\n";
+  out.Indent();
+  out << "return java.util.Arrays.deepHashCode(java.util.Arrays.asList(_tag, _value).toArray());\n";
+  out.Dedent();
+  out << "}\n";
+  out << "\n";
+}
+
+}  // namespace
+
+namespace android {
+namespace aidl {
+namespace java {
+
+std::string GenerateComments(const AidlCommentable& node) {
+  return FormatCommentsForJava(node.GetComments());
+}
+
+std::string GenerateAnnotations(const AidlNode& node) {
+  std::string result;
+  for (const auto& a : JavaAnnotationsFor(node)) {
+    result += a + "\n";
+  }
+  return result;
+}
+
+std::unique_ptr<android::aidl::java::Class> GenerateParcelableClass(
+    const AidlStructuredParcelable* parcel, const AidlTypenames& typenames,
+    const Options& options) {
+  auto parcel_class = std::make_unique<Class>();
+  parcel_class->comment = GenerateComments(*parcel);
+  parcel_class->modifiers = PUBLIC;
+  parcel_class->what = Class::CLASS;
+  parcel_class->type = parcel->GetCanonicalName();
+  parcel_class->interfaces.push_back("android.os.Parcelable");
+  parcel_class->annotations = JavaAnnotationsFor(*parcel);
+  if (parcel->GetParentType()) {
+    parcel_class->modifiers |= STATIC;
+  }
+
+  if (parcel->IsGeneric()) {
+    parcel_class->type += "<" + base::Join(parcel->GetTypeParameters(), ",") + ">";
+  }
+
+  for (const auto& variable : parcel->GetFields()) {
+    std::ostringstream out;
+    out << GenerateComments(*variable);
+    out << GenerateAnnotations(*variable);
+    out << "public ";
+
+    if (variable->GetType().GetName() == "ParcelableHolder" || parcel->IsJavaOnlyImmutable()) {
+      out << "final ";
+    }
+    out << JavaSignatureOf(variable->GetType()) << " " << variable->GetName();
+    if (!parcel->IsJavaOnlyImmutable() && variable->GetDefaultValue()) {
+      out << " = " << variable->ValueString(ConstantValueDecorator);
+    } else if (variable->GetType().GetName() == "ParcelableHolder") {
+      out << std::boolalpha;
+      out << " = new " << JavaSignatureOf(variable->GetType()) << "(";
+      if (parcel->IsVintfStability()) {
+        out << "android.os.Parcelable.PARCELABLE_STABILITY_VINTF";
+      } else {
+        out << "android.os.Parcelable.PARCELABLE_STABILITY_LOCAL";
+      }
+      out << ")";
+      out << std::noboolalpha;
+    }
+    out << ";\n";
+    parcel_class->elements.push_back(std::make_shared<LiteralClassElement>(out.str()));
+  }
+
+  std::ostringstream out;
+  if (parcel->IsJavaOnlyImmutable()) {
+    auto builder_class = std::make_shared<Class>();
+    builder_class->modifiers = PUBLIC | FINAL | STATIC;
+    builder_class->what = Class::CLASS;
+    builder_class->type = "Builder";
+
+    out.str("");
+    for (const auto& variable : parcel->GetFields()) {
+      out << "private " << JavaSignatureOf(variable->GetType()) << " " << variable->GetName();
+      if (variable->GetDefaultValue()) {
+        out << " = " << variable->ValueString(ConstantValueDecorator);
+      }
+      out << ";\n";
+      out << "public Builder " << SetterName(*variable) << "("
+          << JavaSignatureOf(variable->GetType()) << " " << variable->GetName() << ") {\n"
+          << "  "
+          << "this." << variable->GetName() << " = " << variable->GetName() << ";\n"
+          << "  return this;\n"
+          << "}\n";
+    }
+    out << "public " << parcel->GetCanonicalName() << " build() {\n"
+        << "  return new " << parcel->GetCanonicalName() << "(";
+    std::vector<std::string> variables;
+    std::transform(parcel->GetFields().begin(), parcel->GetFields().end(),
+                   std::back_inserter(variables), [](const auto& f) { return f->GetName(); });
+    out << base::Join(variables, ", ") << ");\n"
+        << "}\n";
+    builder_class->elements.push_back(std::make_shared<LiteralClassElement>(out.str()));
+    parcel_class->elements.push_back(builder_class);
+  }
+  if (parcel->IsVintfStability()) {
+    parcel_class->elements.push_back(std::make_shared<LiteralClassElement>(
+        "@Override\n public final int getStability() { return "
+        "android.os.Parcelable.PARCELABLE_STABILITY_VINTF; }\n"));
+  }
+
+  out.str("");
+  out << "public static final android.os.Parcelable.Creator<" << parcel->GetName() << "> CREATOR = "
+      << "new android.os.Parcelable.Creator<" << parcel->GetName() << ">() {\n";
+  out << "  @Override\n";
+  out << "  public " << parcel->GetName()
+      << " createFromParcel(android.os.Parcel _aidl_source) {\n";
+  if (parcel->IsJavaOnlyImmutable()) {
+    out << "    return internalCreateFromParcel(_aidl_source);\n";
+  } else {
+    out << "    " << parcel->GetName() << " _aidl_out = new " << parcel->GetName() << "();\n";
+    out << "    _aidl_out.readFromParcel(_aidl_source);\n";
+    out << "    return _aidl_out;\n";
+  }
+  out << "  }\n";
+  out << "  @Override\n";
+  out << "  public " << parcel->GetName() << "[] newArray(int _aidl_size) {\n";
+  out << "    return new " << parcel->GetName() << "[_aidl_size];\n";
+  out << "  }\n";
+  out << "};\n";
+  parcel_class->elements.push_back(std::make_shared<LiteralClassElement>(out.str()));
+
+  auto flag_variable = std::make_shared<Variable>("int", "_aidl_flag");
+  auto parcel_variable = std::make_shared<Variable>("android.os.Parcel", "_aidl_parcel");
+
+  auto write_method = std::make_shared<Method>();
+  write_method->modifiers = PUBLIC | OVERRIDE | FINAL;
+  write_method->returnType = "void";
+  write_method->name = "writeToParcel";
+  write_method->parameters.push_back(parcel_variable);
+  write_method->parameters.push_back(flag_variable);
+  write_method->statements = std::make_shared<StatementBlock>();
+
+  out.str("");
+  out << "int _aidl_start_pos = _aidl_parcel.dataPosition();\n"
+      << "_aidl_parcel.writeInt(0);\n";
+  write_method->statements->Add(std::make_shared<LiteralStatement>(out.str()));
+
+  for (const auto& field : parcel->GetFields()) {
+    string code;
+    CodeWriterPtr writer = CodeWriter::ForString(&code);
+    CodeGeneratorContext context{
+        .writer = *(writer.get()),
+        .typenames = typenames,
+        .type = field->GetType(),
+        .parcel = parcel_variable->name,
+        .var = field->GetName(),
+        .min_sdk_version = options.GetMinSdkVersion(),
+        .write_to_parcel_flag = "_aidl_flag",
+    };
+    if (field->IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE)) {
+      context.writer.Write("if (false) {;\n");
+      context.writer.Indent();
+    }
+    WriteToParcelFor(context);
+    if (field->IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE)) {
+      context.writer.Dedent();
+      context.writer.Write("};\n");
+    }
+    writer->Close();
+    write_method->statements->Add(std::make_shared<LiteralStatement>(code));
+  }
+
+  out.str("");
+  out << "int _aidl_end_pos = _aidl_parcel.dataPosition();\n"
+      << "_aidl_parcel.setDataPosition(_aidl_start_pos);\n"
+      << "_aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);\n"
+      << "_aidl_parcel.setDataPosition(_aidl_end_pos);\n";
+
+  write_method->statements->Add(std::make_shared<LiteralStatement>(out.str()));
+
+  parcel_class->elements.push_back(write_method);
+
+  if (parcel->IsJavaOnlyImmutable()) {
+    auto constructor = std::make_shared<Method>();
+    constructor->modifiers = PUBLIC;
+    constructor->name = parcel->GetName();
+    constructor->statements = std::make_shared<StatementBlock>();
+    for (const auto& field : parcel->GetFields()) {
+      constructor->parameters.push_back(
+          std::make_shared<Variable>(JavaSignatureOf(field->GetType()), field->GetName()));
+      out.str("");
+
+      out << "this." << field->GetName() << " = ";
+      if (field->GetType().GetName() == "List") {
+        out << field->GetName() << " == null ? null : java.util.Collections.unmodifiableList("
+            << field->GetName() << ");\n";
+      } else if (field->GetType().GetName() == "Map") {
+        out << field->GetName() << " == null ? null : java.util.Collections.unmodifiableMap("
+            << field->GetName() << ");\n";
+      } else {
+        out << field->GetName() << ";\n";
+      }
+      constructor->statements->Add(std::make_shared<LiteralStatement>(out.str()));
+    }
+    parcel_class->elements.push_back(constructor);
+  }
+
+  // For an immutable parcelable, generate internalCreateFromParcel method.
+  // Otherwise, generate readFromParcel method.
+  auto read_or_create_method = std::make_shared<Method>();
+  if (parcel->IsJavaOnlyImmutable()) {
+    auto constructor = std::make_shared<Method>();
+    read_or_create_method->modifiers = PRIVATE | STATIC;
+    read_or_create_method->returnType = parcel->GetName();
+    read_or_create_method->name = "internalCreateFromParcel";
+    read_or_create_method->parameters.push_back(parcel_variable);
+    read_or_create_method->statements = std::make_shared<StatementBlock>();
+  } else {
+    read_or_create_method->modifiers = PUBLIC | FINAL;
+    read_or_create_method->returnType = "void";
+    read_or_create_method->name = "readFromParcel";
+    read_or_create_method->parameters.push_back(parcel_variable);
+    read_or_create_method->statements = std::make_shared<StatementBlock>();
+  }
+  out.str("");
+  const string builder_variable = "_aidl_parcelable_builder";
+  if (parcel->IsJavaOnlyImmutable()) {
+    out << "Builder " << builder_variable << " = new Builder();\n";
+  }
+  out << "int _aidl_start_pos = _aidl_parcel.dataPosition();\n"
+      << "int _aidl_parcelable_size = _aidl_parcel.readInt();\n"
+      << "try {\n"
+      << "  if (_aidl_parcelable_size < 4) throw new "
+         "android.os.BadParcelableException(\"Parcelable too small\");";
+  if (parcel->IsJavaOnlyImmutable()) {
+    out << " " << builder_variable << ".build()";
+  }
+  out << ";\n";
+
+  read_or_create_method->statements->Add(std::make_shared<LiteralStatement>(out.str()));
+
+  out.str("");
+  out << "  if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return";
+  if (parcel->IsJavaOnlyImmutable()) {
+    out << " " << builder_variable << ".build()";
+  }
+  out << ";\n";
+
+  std::shared_ptr<LiteralStatement> sizeCheck = std::make_shared<LiteralStatement>(out.str());
+  // keep this across different fields in order to create the classloader
+  // at most once.
+  bool is_classloader_created = false;
+  for (const auto& field : parcel->GetFields()) {
+    read_or_create_method->statements->Add(sizeCheck);
+    const auto field_variable_name =
+        (parcel->IsJavaOnlyImmutable() ? "_aidl_temp_" : "") + field->GetName();
+    string code;
+    CodeWriterPtr writer = CodeWriter::ForString(&code);
+    CodeGeneratorContext context{
+        .writer = *(writer.get()),
+        .typenames = typenames,
+        .type = field->GetType(),
+        .parcel = parcel_variable->name,
+        .var = field_variable_name,
+        .min_sdk_version = options.GetMinSdkVersion(),
+        .is_classloader_created = &is_classloader_created,
+    };
+    context.writer.Indent();
+    if (field->IsNew() && ShouldForceDowngradeFor(CommunicationSide::READ)) {
+      context.writer.Write("if (false) {;\n");
+      context.writer.Indent();
+    }
+    if (parcel->IsJavaOnlyImmutable()) {
+      context.writer.Write("%s %s;\n", JavaSignatureOf(field->GetType()).c_str(),
+                           field_variable_name.c_str());
+    }
+    CreateFromParcelFor(context);
+    if (parcel->IsJavaOnlyImmutable()) {
+      context.writer.Write("%s.%s(%s);\n", builder_variable.c_str(), SetterName(*field).c_str(),
+                           field_variable_name.c_str());
+    }
+    if (field->IsNew() && ShouldForceDowngradeFor(CommunicationSide::READ)) {
+      context.writer.Dedent();
+      context.writer.Write("};\n");
+    }
+    writer->Close();
+    read_or_create_method->statements->Add(std::make_shared<LiteralStatement>(code));
+  }
+
+  out.str("");
+  out << "} finally {\n"
+      << "  if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {\n"
+      << "    throw new android.os.BadParcelableException(\"Overflow in the size of "
+         "parcelable\");\n"
+      << "  }\n"
+      << "  _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);\n";
+  if (parcel->IsJavaOnlyImmutable()) {
+    out << "  return " << builder_variable << ".build();\n";
+  }
+  out << "}\n";
+
+  read_or_create_method->statements->Add(std::make_shared<LiteralStatement>(out.str()));
+
+  parcel_class->elements.push_back(read_or_create_method);
+
+  string constants;
+  GenerateConstantDeclarations(*CodeWriter::ForString(&constants), *parcel);
+  parcel_class->elements.push_back(std::make_shared<LiteralClassElement>(constants));
+
+  if (parcel->JavaDerive("toString")) {
+    string to_string;
+    GenerateToString(*CodeWriter::ForString(&to_string), *parcel, typenames, options);
+    parcel_class->elements.push_back(std::make_shared<LiteralClassElement>(to_string));
+  }
+
+  if (parcel->JavaDerive("equals")) {
+    string to_string;
+    GenerateEqualsAndHashCode(*CodeWriter::ForString(&to_string), *parcel, typenames);
+    parcel_class->elements.push_back(std::make_shared<LiteralClassElement>(to_string));
+  }
+
+  string describe_contents;
+  GenerateParcelableDescribeContents(*CodeWriter::ForString(&describe_contents), *parcel,
+                                     typenames);
+  parcel_class->elements.push_back(std::make_shared<LiteralClassElement>(describe_contents));
+
+  // all the nested types
+  string code;
+  auto writer = CodeWriter::ForString(&code);
+  for (const auto& nested : parcel->GetNestedTypes()) {
+    GenerateClass(*writer, *nested, typenames, options);
+  }
+  GenerateParcelHelpers(*writer, *parcel, typenames, options);
+  writer->Close();
+  parcel_class->elements.push_back(std::make_shared<LiteralClassElement>(code));
+
+  return parcel_class;
+}
+
+void GenerateEnumClass(CodeWriter& out, const AidlEnumDeclaration& enum_decl) {
+  const AidlTypeSpecifier& backing_type = enum_decl.GetBackingType();
+  std::string raw_type = JavaSignatureOf(backing_type);
+  std::string boxing_type = JavaBoxingTypeOf(backing_type);
+  out << GenerateComments(enum_decl);
+  out << GenerateAnnotations(enum_decl);
+  out << "public ";
+  if (enum_decl.GetParentType()) {
+    out << "static ";
+  }
+  out << "@interface " << enum_decl.GetName() << " {\n";
+  out.Indent();
+  for (const auto& enumerator : enum_decl.GetEnumerators()) {
+    out << GenerateComments(*enumerator);
+    out << GenerateAnnotations(*enumerator);
+    out << fmt::format("public static final {} {} = {};\n", raw_type, enumerator->GetName(),
+                       enumerator->ValueString(backing_type, ConstantValueDecorator));
+  }
+  if (enum_decl.JavaDerive("toString")) {
+    out << "interface $ {\n";
+    out.Indent();
+    out << "static String toString(" << raw_type << " _aidl_v) {\n";
+    out.Indent();
+    for (const auto& enumerator : enum_decl.GetEnumerators()) {
+      out << "if (_aidl_v == " << enumerator->GetName() << ") return \"" << enumerator->GetName()
+          << "\";\n";
+    }
+    out << "return " << boxing_type << ".toString(_aidl_v);\n";
+    out.Dedent();
+    out << "}\n";
+    out << fmt::format(R"(static String arrayToString(Object _aidl_v) {{
+  if (_aidl_v == null) return "null";
+  Class<?> _aidl_cls = _aidl_v.getClass();
+  if (!_aidl_cls.isArray()) throw new IllegalArgumentException("not an array: " + _aidl_v);
+  Class<?> comp = _aidl_cls.getComponentType();
+  java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "[", "]");
+  if (comp.isArray()) {{
+    for (int _aidl_i = 0; _aidl_i < java.lang.reflect.Array.getLength(_aidl_v); _aidl_i++) {{
+      _aidl_sj.add(arrayToString(java.lang.reflect.Array.get(_aidl_v, _aidl_i)));
+    }}
+  }} else {{
+    if (_aidl_cls != {raw_type}[].class) throw new IllegalArgumentException("wrong type: " + _aidl_cls);
+    for ({raw_type} e : ({raw_type}[]) _aidl_v) {{
+      _aidl_sj.add(toString(e));
+    }}
+  }}
+  return _aidl_sj.toString();
+}}
+)",
+                       fmt::arg("raw_type", raw_type));
+    out.Dedent();
+    out << "}\n";
+  }
+  out.Dedent();
+  out << "}\n";
+}
+
+void GenerateUnionClass(CodeWriter& out, const AidlUnionDecl* decl, const AidlTypenames& typenames,
+                        const Options& options) {
+  const string tag_type = "int";
+  auto tag_type_specifier =
+      typenames.MakeResolvedType(AIDL_LOCATION_HERE, tag_type, /* isArray */ false);
+  const string clazz = decl->GetName();
+
+  out << GenerateComments(*decl);
+  out << GenerateAnnotations(*decl);
+
+  out << "public ";
+  if (decl->GetParentType()) {
+    out << "static ";
+  }
+  out << "final class " + clazz + " implements android.os.Parcelable {\n";
+  out.Indent();
+
+  size_t tag_index = 0;
+  out << "// tags for union fields\n";
+  for (const auto& variable : decl->GetFields()) {
+    auto signature = variable->Signature() + ";";
+    out << "public final static " + tag_type + " " + variable->GetName() + " = " +
+               std::to_string(tag_index++) + ";  // " + signature + "\n";
+  }
+  out << "\n";
+
+  const auto final_opt = decl->IsJavaOnlyImmutable() ? "final " : "";
+  out << "private " << final_opt << tag_type + " _tag;\n";
+  out << "private " << final_opt << "Object _value;\n";
+  out << "\n";
+
+  AIDL_FATAL_IF(decl->GetFields().empty(), *decl) << "Union '" << clazz << "' is empty.";
+  const auto& first_field = decl->GetFields()[0];
+  const auto& first_type = JavaSignatureOf(first_field->GetType());
+  const auto& first_value = first_field->ValueString(ConstantValueDecorator);
+
+  // default ctor() inits with first member's default value
+  out << "public " + clazz + "() {\n";
+  out.Indent();
+  out << first_type + " _value = "
+      << (first_value.empty() ? DefaultJavaValueOf(first_field->GetType()) : first_value) << ";\n";
+  out << "this._tag = " << first_field->GetName() << ";\n";
+  out << "this._value = _value;\n";
+  out.Dedent();
+  out << "}\n\n";
+
+  if (!decl->IsJavaOnlyImmutable()) {
+    // private ctor(Parcel)
+    out << "private " + clazz + "(android.os.Parcel _aidl_parcel) {\n";
+    out << "  readFromParcel(_aidl_parcel);\n";
+    out << "}\n\n";
+  }
+
+  // private ctor(tag, value)
+  out << "private " + clazz + "(" + tag_type + " _tag, Object _value) {\n";
+  out.Indent();
+  out << "this._tag = _tag;\n";
+  out << "this._value = _value;\n";
+  out.Dedent();
+  out << "}\n\n";
+
+  // getTag()
+  out << "public " + tag_type + " " + "getTag() {\n";
+  out.Indent();
+  out << "return _tag;\n";
+  out.Dedent();
+  out << "}\n\n";
+
+  // value ctor, getter, setter(for mutable) for each field
+  for (const auto& variable : decl->GetFields()) {
+    out << "// " + variable->Signature() + ";\n\n";
+
+    auto var_name = variable->GetName();
+    auto var_type = JavaSignatureOf(variable->GetType());
+
+    // value ctor
+    out << GenerateComments(*variable);
+    out << GenerateAnnotations(*variable);
+    out << "public static " + clazz + " " + var_name + "(" + var_type + " _value) {\n";
+    out.Indent();
+    out << "return new " + clazz + "(" + var_name + ", _value);\n";
+    out.Dedent();
+    out << "}\n\n";
+
+    // getter
+    if (variable->GetType().IsGeneric()) {
+      out << "@SuppressWarnings(\"unchecked\")\n";
+    }
+    out << "public " + var_type + " " + GetterName(*variable) + "() {\n";
+    out.Indent();
+    out << "_assertTag(" + var_name + ");\n";
+    out << "return (" + var_type + ") _value;\n";
+    out.Dedent();
+    out << "}\n\n";
+
+    // setter
+    if (!decl->IsJavaOnlyImmutable()) {
+      out << "public void " + SetterName(*variable) + "(" + var_type + " _value) {\n";
+      out.Indent();
+      out << "_set(" + var_name + ", _value);\n";
+      out.Dedent();
+      out << "}\n\n";
+    }
+  }
+
+  if (decl->IsVintfStability()) {
+    out << "@Override\n";
+    out << "public final int getStability() {\n";
+    out << "  return android.os.Parcelable.PARCELABLE_STABILITY_VINTF;\n";
+    out << "}\n\n";
+  }
+
+  out << "public static final android.os.Parcelable.Creator<" << clazz << "> CREATOR = "
+      << "new android.os.Parcelable.Creator<" << clazz << ">() {\n";
+  out << "  @Override\n";
+  out << "  public " << clazz << " createFromParcel(android.os.Parcel _aidl_source) {\n";
+  if (decl->IsJavaOnlyImmutable()) {
+    out << "    return internalCreateFromParcel(_aidl_source);\n";
+  } else {
+    out << "    return new " + clazz + "(_aidl_source);\n";
+  }
+  out << "  }\n";
+  out << "  @Override\n";
+  out << "  public " << clazz << "[] newArray(int _aidl_size) {\n";
+  out << "    return new " << clazz << "[_aidl_size];\n";
+  out << "  }\n";
+  out << "};\n\n";
+
+  auto write_to_parcel = [&](const AidlTypeSpecifier& type, std::string name, std::string parcel) {
+    string code;
+    CodeWriterPtr writer = CodeWriter::ForString(&code);
+    CodeGeneratorContext context{
+        .writer = *(writer.get()),
+        .typenames = typenames,
+        .type = type,
+        .parcel = parcel,
+        .var = name,
+        .min_sdk_version = options.GetMinSdkVersion(),
+        .write_to_parcel_flag = "_aidl_flag",
+    };
+    WriteToParcelFor(context);
+    writer->Close();
+    return code;
+  };
+
+  out << "@Override\n";
+  out << "public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {\n";
+  out.Indent();
+  out << write_to_parcel(*tag_type_specifier, "_tag", "_aidl_parcel");
+  out << "switch (_tag) {\n";
+  for (const auto& variable : decl->GetFields()) {
+    out << "case " + variable->GetName() + ":\n";
+    out.Indent();
+    if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE)) {
+      out << "if (true) throw new IllegalArgumentException(\"union: unknown tag: \" + _tag);\n";
+    }
+
+    out << write_to_parcel(variable->GetType(), GetterName(*variable) + "()", "_aidl_parcel");
+    out << "break;\n";
+    out.Dedent();
+  }
+  out << "}\n";
+  out.Dedent();
+  out << "}\n\n";
+
+  // keep this across different fields in order to create the classloader
+  // at most once.
+  bool is_classloader_created = false;
+  auto read_from_parcel = [&](const AidlTypeSpecifier& type, std::string name, std::string parcel) {
+    string code;
+    CodeWriterPtr writer = CodeWriter::ForString(&code);
+    CodeGeneratorContext context{
+        .writer = *(writer.get()),
+        .typenames = typenames,
+        .type = type,
+        .parcel = parcel,
+        .var = name,
+        .min_sdk_version = options.GetMinSdkVersion(),
+        .is_classloader_created = &is_classloader_created,
+    };
+    CreateFromParcelFor(context);
+    writer->Close();
+    return code;
+  };
+
+  if (decl->IsJavaOnlyImmutable()) {
+    // When it's immutable we don't need readFromParcel, but we can use it from createFromParcel
+    out << "private static " + clazz +
+               " internalCreateFromParcel(android.os.Parcel _aidl_parcel) {\n";
+  } else {
+    // Not override, but as a user-defined parcelable, this method should be public
+    out << "public void readFromParcel(android.os.Parcel _aidl_parcel) {\n";
+  }
+  out.Indent();
+  out << tag_type + " _aidl_tag;\n";
+  out << read_from_parcel(*tag_type_specifier, "_aidl_tag", "_aidl_parcel");
+  out << "switch (_aidl_tag) {\n";
+  for (const auto& variable : decl->GetFields()) {
+    auto var_name = variable->GetName();
+    auto var_type = JavaSignatureOf(variable->GetType());
+    out << "case " + var_name + ": {\n";
+    out.Indent();
+    if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::READ)) {
+      out << "if (true) throw new IllegalArgumentException(\"union: unknown tag: \" + _tag);\n";
+    }
+    out << var_type + " _aidl_value;\n";
+    out << read_from_parcel(variable->GetType(), "_aidl_value", "_aidl_parcel");
+    if (decl->IsJavaOnlyImmutable()) {
+      out << "return new " << clazz << "(_aidl_tag, _aidl_value); }\n";
+    } else {
+      out << "_set(_aidl_tag, _aidl_value);\n";
+      out << "return; }\n";
+    }
+    out.Dedent();
+  }
+  out << "}\n";
+  out << "throw new IllegalArgumentException(\"union: unknown tag: \" + _aidl_tag);\n";
+  out.Dedent();
+  out << "}\n\n";
+
+  GenerateConstantDeclarations(out, *decl);
+
+  GenerateParcelableDescribeContents(out, *decl, typenames);
+  out << "\n";
+  if (decl->JavaDerive("toString")) {
+    GenerateToString(out, *decl, typenames, options);
+  }
+
+  if (decl->JavaDerive("equals")) {
+    GenerateEqualsAndHashCode(out, *decl, typenames);
+  }
+
+  // helper: _assertTag
+  out << "private void _assertTag(" + tag_type + " tag) {\n";
+  out << "  if (getTag() != tag) {\n";
+  out << "    throw new IllegalStateException(\"bad access: \" + _tagString(tag) + \", \" + "
+         "_tagString(getTag()) + \" is available.\");\n";
+  out << "  }\n";
+  out << "}\n\n";
+
+  // helper: _tagString
+  out << "private String _tagString(" + tag_type + " _tag) {\n";
+  out << "  switch (_tag) {\n";
+  for (const auto& variable : decl->GetFields()) {
+    auto var_name = variable->GetName();
+    out << "  case " + var_name + ": return \"" + var_name + "\";\n";
+  }
+  out << "  }\n";
+  out << "  throw new IllegalStateException(\"unknown field: \" + _tag);\n";
+  out << "}\n";
+
+  if (!decl->IsJavaOnlyImmutable()) {
+    out << "\n";
+    out << "private void _set(int _tag, Object _value) {\n";
+    out.Indent();
+    out << "this._tag = _tag;\n";
+    out << "this._value = _value;\n";
+    out.Dedent();
+    out << "}\n";
+  }
+
+  // all the nested types
+  for (const auto& nested : decl->GetNestedTypes()) {
+    GenerateClass(out, *nested, typenames, options);
+  }
+  GenerateParcelHelpers(out, *decl, typenames, options);
+
+  out.Dedent();
+  out << "}\n";
+}
+
+std::string dump_location(const AidlNode& method) {
+  return method.PrintLocation();
+}
+
+std::string GenerateJavaUnsupportedAppUsageParameters(const AidlAnnotation& a) {
+  const std::map<std::string, std::string> params = a.AnnotationParams(ConstantValueDecorator);
+  std::vector<string> parameters_decl;
+  for (const auto& name_and_param : params) {
+    const std::string& param_name = name_and_param.first;
+    const std::string& param_value = name_and_param.second;
+    parameters_decl.push_back(param_name + " = " + param_value);
+  }
+  parameters_decl.push_back("overrideSourcePosition=\"" + dump_location(a) + "\"");
+  return "(" + Join(parameters_decl, ", ") + ")";
+}
+
+std::vector<std::string> GenerateJavaAnnotations(const AidlAnnotatable& a) {
+  std::vector<std::string> result;
+
+  const AidlAnnotation* unsupported_app_usage = a.UnsupportedAppUsage();
+  if (unsupported_app_usage != nullptr) {
+    result.emplace_back("@android.compat.annotation.UnsupportedAppUsage" +
+                        GenerateJavaUnsupportedAppUsageParameters(*unsupported_app_usage));
+  }
+
+  for (const auto& annotation : a.GetAnnotations()) {
+    if (annotation->GetType() == AidlAnnotation::Type::JAVA_PASSTHROUGH) {
+      result.emplace_back(annotation->ParamValue<std::string>("annotation").value());
+    }
+    if (annotation->GetType() == AidlAnnotation::Type::JAVA_SUPPRESS_LINT) {
+      std::vector<std::string> values;
+      for (const auto& [name, value] : annotation->AnnotationParams(ConstantValueDecorator)) {
+        values.emplace_back(name + " = " + value);
+      }
+      result.emplace_back("@android.annotation.SuppressLint(" + Join(values, ", ") + ")");
+    }
+  }
+
+  return result;
+}
+
+std::optional<std::string> JavaPermissionAnnotation(const AidlAnnotatable& a) {
+  if (auto enforce_expr = a.EnforceExpression(); enforce_expr) {
+    return "@android.annotation.EnforcePermission(" +
+           android::aidl::perm::AsJavaAnnotation(*enforce_expr.get()) + ")";
+  } else if (a.IsPermissionNone()) {
+    return "@android.annotation.RequiresNoPermission";
+  }  // TODO: Add annotation for @PermissionManuallyEnforced
+
+  return {};
+}
+
+struct JavaAnnotationsVisitor : AidlVisitor {
+  JavaAnnotationsVisitor(std::vector<std::string>& result) : result(result) {}
+  void Visit(const AidlTypeSpecifier& t) override { result = GenerateJavaAnnotations(t); }
+  void Visit(const AidlInterface& t) override { ForDefinedType(t); }
+  void Visit(const AidlParcelable& t) override { ForDefinedType(t); }
+  void Visit(const AidlStructuredParcelable& t) override { ForDefinedType(t); }
+  void Visit(const AidlUnionDecl& t) override { ForDefinedType(t); }
+  void Visit(const AidlEnumDeclaration& t) override { ForDefinedType(t); }
+  void Visit(const AidlEnumerator& e) override {
+    if (e.IsDeprecated()) {
+      result.push_back("@Deprecated");
+    }
+  }
+  void Visit(const AidlMethod& m) override { ForMember(m); }
+  void Visit(const AidlConstantDeclaration& c) override { ForMember(c); }
+  void Visit(const AidlVariableDeclaration& v) override { ForMember(v); }
+  std::vector<std::string>& result;
+
+  void ForDefinedType(const AidlDefinedType& t) {
+    result = GenerateJavaAnnotations(t);
+    if (t.IsDeprecated()) {
+      result.push_back("@Deprecated");
+    }
+  }
+  template <typename Member>
+  void ForMember(const Member& t) {
+    result = GenerateJavaAnnotations(t.GetType());
+    if (t.IsDeprecated()) {
+      result.push_back("@Deprecated");
+    }
+    if (auto permission_annotation = JavaPermissionAnnotation(t.GetType()); permission_annotation) {
+      result.push_back(*permission_annotation);
+    }
+  }
+};
+
+std::vector<std::string> JavaAnnotationsFor(const AidlNode& a) {
+  std::vector<std::string> result;
+  JavaAnnotationsVisitor visitor{result};
+  a.DispatchVisit(visitor);
+  return result;
+}
+
+void GenerateClass(CodeWriter& out, const AidlDefinedType& defined_type, const AidlTypenames& types,
+                   const Options& options) {
+  if (const AidlStructuredParcelable* parcelable = defined_type.AsStructuredParcelable();
+      parcelable != nullptr) {
+    GenerateParcelableClass(parcelable, types, options)->Write(&out);
+  } else if (const AidlEnumDeclaration* enum_decl = defined_type.AsEnumDeclaration();
+             enum_decl != nullptr) {
+    GenerateEnumClass(out, *enum_decl);
+  } else if (const AidlInterface* interface = defined_type.AsInterface(); interface != nullptr) {
+    GenerateInterfaceClass(interface, types, options)->Write(&out);
+  } else if (const AidlUnionDecl* union_decl = defined_type.AsUnionDeclaration();
+             union_decl != nullptr) {
+    GenerateUnionClass(out, union_decl, types, options);
+  } else {
+    AIDL_FATAL(defined_type) << "Unrecognized type sent for Java generation.";
+  }
+}
+
+// In Java, there's 1:1 mapping between AIDL type and Java type. So we generate a single file for
+// the type.
+void GenerateJava(const std::string& filename, const Options& options, const AidlTypenames& types,
+                  const AidlDefinedType& defined_type, const IoDelegate& io_delegate) {
+  CodeWriterPtr code_writer = io_delegate.GetCodeWriter(filename);
+
+  /* write header */ {
+    auto& out = *code_writer;
+
+    GenerateAutoGenHeader(out, options);
+
+    if (const auto pkg = defined_type.GetPackage(); !pkg.empty()) {
+      out << "package " << pkg << ";\n";
+    }
+  }
+
+  GenerateClass(*code_writer, defined_type, types, options);
+  AIDL_FATAL_IF(!code_writer->Close(), defined_type) << "I/O Error!";
+}
+
+}  // namespace java
+}  // namespace aidl
+}  // namespace android
diff --git a/generate_java.h b/generate_java.h
new file mode 100644
index 0000000..e986f81
--- /dev/null
+++ b/generate_java.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2016, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "aidl_language.h"
+#include "ast_java.h"
+#include "io_delegate.h"
+#include "options.h"
+
+#include <optional>
+#include <string>
+
+namespace android {
+namespace aidl {
+namespace java {
+
+void GenerateJava(const std::string& filename, const Options& options,
+                  const AidlTypenames& typenames, const AidlDefinedType& defined_type,
+                  const IoDelegate& io_delegate);
+
+void GenerateClass(CodeWriter& out, const AidlDefinedType& defined_type, const AidlTypenames& types,
+                   const Options& options);
+
+std::unique_ptr<android::aidl::java::Class> GenerateInterfaceClass(const AidlInterface* iface,
+                                                                   const AidlTypenames& typenames,
+                                                                   const Options& options);
+
+void GenerateConstantDeclarations(CodeWriter& out, const AidlDefinedType& type);
+
+std::string GenerateComments(const AidlCommentable& node);
+
+std::string GenerateAnnotations(const AidlNode& node);
+
+std::vector<std::string> JavaAnnotationsFor(const AidlNode& a);
+
+std::optional<std::string> JavaPermissionAnnotation(const AidlAnnotatable& a);
+
+}  // namespace java
+}  // namespace aidl
+}  // namespace android
diff --git a/generate_java_binder.cpp b/generate_java_binder.cpp
new file mode 100644
index 0000000..70d3146
--- /dev/null
+++ b/generate_java_binder.cpp
@@ -0,0 +1,1437 @@
+/*
+ * Copyright (C) 2016, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl.h"
+#include "aidl_language.h"
+#include "aidl_to_common.h"
+#include "aidl_to_java.h"
+#include "aidl_typenames.h"
+#include "ast_java.h"
+#include "code_writer.h"
+#include "generate_java.h"
+#include "logging.h"
+#include "options.h"
+#include "parser.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <algorithm>
+#include <unordered_set>
+#include <utility>
+#include <vector>
+
+#include <android-base/stringprintf.h>
+
+using android::base::Join;
+using android::base::StringPrintf;
+
+using std::string;
+using std::unique_ptr;
+using std::vector;
+
+namespace android {
+namespace aidl {
+namespace java {
+
+// =================================================
+class VariableFactory {
+ public:
+  using Variable = ::android::aidl::java::Variable;
+
+  explicit VariableFactory(const std::string& base) : base_(base), index_(0) {}
+  std::shared_ptr<Variable> Get(const AidlTypeSpecifier& type) {
+    auto v = std::make_shared<Variable>(JavaSignatureOf(type),
+                                        StringPrintf("%s%d", base_.c_str(), index_));
+    vars_.push_back(v);
+    index_++;
+    return v;
+  }
+
+  std::shared_ptr<Variable> Get(int index) { return vars_[index]; }
+
+ private:
+  std::vector<std::shared_ptr<Variable>> vars_;
+  std::string base_;
+  int index_;
+};
+
+// =================================================
+class StubClass : public Class {
+ public:
+  StubClass(const AidlInterface* interfaceType, const Options& options);
+  ~StubClass() override = default;
+
+  // non-copyable, non-movable
+  StubClass(const StubClass&) = delete;
+  StubClass(StubClass&&) = delete;
+  StubClass& operator=(const StubClass&) = delete;
+  StubClass& operator=(StubClass&&) = delete;
+
+  std::shared_ptr<Variable> transact_code;
+  std::shared_ptr<Variable> transact_data;
+  std::shared_ptr<Variable> transact_reply;
+  std::shared_ptr<Variable> transact_flags;
+  std::vector<std::shared_ptr<IfStatement>> transact_if_statements_meta;
+  std::shared_ptr<SwitchStatement> transact_switch_user;
+  std::shared_ptr<StatementBlock> transact_statements;
+  std::shared_ptr<SwitchStatement> code_to_method_name_switch;
+
+  // Where onTransact cases should be generated as separate methods.
+  bool transact_outline;
+  // Specific methods that should be outlined when transact_outline is true.
+  std::unordered_set<const AidlMethod*> outline_methods;
+  // Number of all methods.
+  size_t all_method_count;
+
+  // Finish generation. This will add a default case to the switch.
+  void Finish();
+
+  std::shared_ptr<Expression> GetTransactDescriptor(const AidlMethod* method);
+
+ private:
+  void MakeConstructors(const AidlInterface* interfaceType);
+  void MakeAsInterface(const AidlInterface* interfaceType);
+
+  std::shared_ptr<Variable> transact_descriptor;
+  const Options& options_;
+};
+
+StubClass::StubClass(const AidlInterface* interfaceType, const Options& options)
+    : Class(), options_(options) {
+  transact_descriptor = nullptr;
+  transact_outline = false;
+  all_method_count = 0;  // Will be set when outlining may be enabled.
+
+  this->comment = "/** Local-side IPC implementation stub class. */";
+  this->modifiers = PUBLIC | ABSTRACT | STATIC;
+  this->what = Class::CLASS;
+  this->type = interfaceType->GetCanonicalName() + ".Stub";
+  this->extends = "android.os.Binder";
+  this->interfaces.push_back(interfaceType->GetCanonicalName());
+
+  MakeConstructors(interfaceType);
+  MakeAsInterface(interfaceType);
+
+  // asBinder
+  auto asBinder = std::make_shared<Method>();
+  asBinder->modifiers = PUBLIC | OVERRIDE;
+  asBinder->returnType = "android.os.IBinder";
+  asBinder->name = "asBinder";
+  asBinder->statements = std::make_shared<StatementBlock>();
+  asBinder->statements->Add(std::make_shared<ReturnStatement>(THIS_VALUE));
+  this->elements.push_back(asBinder);
+
+  if (options_.GenTransactionNames() || options_.GenTraces()) {
+    // getDefaultTransactionName
+    auto getDefaultTransactionName = std::make_shared<Method>();
+    getDefaultTransactionName->comment = "/** @hide */";
+    getDefaultTransactionName->modifiers = PUBLIC | STATIC;
+    getDefaultTransactionName->returnType = "java.lang.String";
+    getDefaultTransactionName->name = "getDefaultTransactionName";
+    auto code = std::make_shared<Variable>("int", "transactionCode");
+    getDefaultTransactionName->parameters.push_back(code);
+    getDefaultTransactionName->statements = std::make_shared<StatementBlock>();
+    this->code_to_method_name_switch = std::make_shared<SwitchStatement>(code);
+    getDefaultTransactionName->statements->Add(this->code_to_method_name_switch);
+    this->elements.push_back(getDefaultTransactionName);
+
+    // getTransactionName
+    auto getTransactionName = std::make_shared<Method>();
+    getTransactionName->comment = "/** @hide */";
+    getTransactionName->modifiers = PUBLIC;
+    getTransactionName->returnType = "java.lang.String";
+    getTransactionName->name = "getTransactionName";
+    auto code2 = std::make_shared<Variable>("int", "transactionCode");
+    getTransactionName->parameters.push_back(code2);
+    getTransactionName->statements = std::make_shared<StatementBlock>();
+    getTransactionName->statements->Add(std::make_shared<ReturnStatement>(
+        std::make_shared<MethodCall>(THIS_VALUE, "getDefaultTransactionName",
+                                     std::vector<std::shared_ptr<Expression>>{code2})));
+    this->elements.push_back(getTransactionName);
+  }
+
+  // onTransact
+  this->transact_code = std::make_shared<Variable>("int", "code");
+  this->transact_data = std::make_shared<Variable>("android.os.Parcel", "data");
+  this->transact_reply = std::make_shared<Variable>("android.os.Parcel", "reply");
+  this->transact_flags = std::make_shared<Variable>("int", "flags");
+  auto onTransact = std::make_shared<Method>();
+  onTransact->modifiers = PUBLIC | OVERRIDE;
+  onTransact->returnType = "boolean";
+  onTransact->name = "onTransact";
+  onTransact->parameters.push_back(this->transact_code);
+  onTransact->parameters.push_back(this->transact_data);
+  onTransact->parameters.push_back(this->transact_reply);
+  onTransact->parameters.push_back(this->transact_flags);
+  onTransact->statements = std::make_shared<StatementBlock>();
+  transact_statements = onTransact->statements;
+  onTransact->exceptions.push_back("android.os.RemoteException");
+  this->elements.push_back(onTransact);
+  this->transact_switch_user = std::make_shared<SwitchStatement>(this->transact_code);
+}
+
+void StubClass::Finish() {
+  auto default_case = std::make_shared<Case>();
+
+  auto superCall = std::make_shared<MethodCall>(
+      SUPER_VALUE, "onTransact",
+      std::vector<std::shared_ptr<Expression>>{this->transact_code, this->transact_data,
+                                               this->transact_reply, this->transact_flags});
+  default_case->statements->Add(std::make_shared<ReturnStatement>(superCall));
+
+  auto case_count = transact_switch_user->cases.size();
+  transact_switch_user->cases.push_back(default_case);
+
+  // Interface token validation is done for user-defined transactions.
+  if (case_count > 0) {
+    auto ifStatement = std::make_shared<IfStatement>();
+    ifStatement->expression = std::make_shared<LiteralExpression>(
+        "code >= android.os.IBinder.FIRST_CALL_TRANSACTION && "
+        "code <= android.os.IBinder.LAST_CALL_TRANSACTION");
+    ifStatement->statements = std::make_shared<StatementBlock>();
+    ifStatement->statements->Add(std::make_shared<MethodCall>(
+        this->transact_data, "enforceInterface",
+        std::vector<std::shared_ptr<Expression>>{this->GetTransactDescriptor(nullptr)}));
+    transact_statements->Add(ifStatement);
+  }
+
+  // Build the if/else chain for the meta methods. There at most 3 different
+  // statements so if/else is more efficient than a switch statement.
+  // Meta transactions are looked up prior to user-defined transactions.
+  AIDL_FATAL_IF(this->transact_if_statements_meta.size() == 0, AIDL_LOCATION_HERE)
+      << "Expecting to have meta methods and found none.";
+  AIDL_FATAL_IF(this->transact_if_statements_meta.size() > 3, AIDL_LOCATION_HERE)
+      << "Expecting to have at most 3 meta methods and found "
+      << this->transact_if_statements_meta.size();
+  auto ifStatement = this->transact_if_statements_meta[0];
+  std::shared_ptr<IfStatement> currentIfStatement = ifStatement;
+  for (size_t i = 1; i < transact_if_statements_meta.size(); i++) {
+    currentIfStatement->elseif = this->transact_if_statements_meta[i];
+    currentIfStatement = currentIfStatement->elseif;
+  }
+
+  transact_statements->Add(ifStatement);
+  transact_statements->Add(this->transact_switch_user);
+
+  // getTransactionName
+  if (options_.GenTransactionNames() || options_.GenTraces()) {
+    // Some transaction codes are common, e.g. INTERFACE_TRANSACTION or DUMP_TRANSACTION.
+    // Common transaction codes will not be resolved to a string by getTransactionName. The method
+    // will return NULL in this case.
+    auto code_switch_default_case = std::make_shared<Case>();
+    code_switch_default_case->statements->Add(std::make_shared<ReturnStatement>(NULL_VALUE));
+    this->code_to_method_name_switch->cases.push_back(code_switch_default_case);
+  }
+
+  // There will be at least one statement for the default, but if we emit a
+  // return true after that default, it will be unreachable.
+  if (case_count > 0) {
+    transact_statements->Add(std::make_shared<ReturnStatement>(TRUE_VALUE));
+  }
+}
+
+// The the expression for the interface's descriptor to be used when
+// generating code for the given method. Null is acceptable for method
+// and stands for synthetic cases.
+std::shared_ptr<Expression> StubClass::GetTransactDescriptor(const AidlMethod* method) {
+  if (transact_outline) {
+    if (method != nullptr) {
+      // When outlining, each outlined method needs its own literal.
+      if (outline_methods.count(method) != 0) {
+        return std::make_shared<LiteralExpression>("DESCRIPTOR");
+      }
+    } else {
+      // Synthetic case. A small number is assumed. Use its own descriptor
+      // if there are only synthetic cases.
+      if (outline_methods.size() == all_method_count) {
+        return std::make_shared<LiteralExpression>("DESCRIPTOR");
+      }
+    }
+  }
+
+  // When not outlining, store the descriptor literal into a local variable, in
+  // an effort to save const-string instructions in each switch case.
+  if (transact_descriptor == nullptr) {
+    transact_descriptor = std::make_shared<Variable>("java.lang.String", "descriptor");
+    transact_statements->Add(std::make_shared<VariableDeclaration>(
+        transact_descriptor, std::make_shared<LiteralExpression>("DESCRIPTOR")));
+  }
+  return transact_descriptor;
+}
+
+void StubClass::MakeConstructors(const AidlInterface* interfaceType) {
+  string ctors_code;
+  CodeWriterPtr writer = CodeWriter::ForString(&ctors_code);
+  CodeWriter& code = *writer;
+
+  if (interfaceType->UsesPermissions()) {
+    code << "private final android.os.PermissionEnforcer mEnforcer;\n";
+    code << "/** Construct the stub using the Enforcer provided. */\n";
+    code << "public Stub(android.os.PermissionEnforcer enforcer)\n";
+  } else {
+    code << "/** Construct the stub at attach it to the interface. */\n";
+    code << "public Stub()\n";
+  }
+  code << "{\n";
+  code.Indent();
+  if (interfaceType->IsVintfStability()) {
+    code << "this.markVintfStability();\n";
+  }
+  code << "this.attachInterface(this, DESCRIPTOR);\n";
+  if (interfaceType->UsesPermissions()) {
+    code << "if (enforcer == null) {\n";
+    code.Indent();
+    code << "throw new IllegalArgumentException(\"enforcer cannot be null\");\n";
+    code.Dedent();
+    code << "}\n";
+    code << "mEnforcer = enforcer;\n";
+  }
+  code.Dedent();
+  code << "}\n";
+
+  // Setup a default constructor for permissions interfaces.
+  if (interfaceType->UsesPermissions()) {
+    code << "@Deprecated\n";
+    code << "/** Default constructor. */\n";
+    code << "public Stub() {\n";
+    code.Indent();
+    code << "this(android.os.PermissionEnforcer.fromContext(\n";
+    code << "   android.app.ActivityThread.currentActivityThread().getSystemContext()));\n";
+    code.Dedent();
+    code << "}\n";
+  }
+
+  code.Close();
+  this->elements.push_back(std::make_shared<LiteralClassElement>(ctors_code));
+}
+
+void StubClass::MakeAsInterface(const AidlInterface* interfaceType) {
+  auto obj = std::make_shared<Variable>("android.os.IBinder", "obj");
+
+  auto m = std::make_shared<Method>();
+  m->comment = "/**\n * Cast an IBinder object into an ";
+  m->comment += interfaceType->GetCanonicalName();
+  m->comment += " interface,\n";
+  m->comment += " * generating a proxy if needed.\n */";
+  m->modifiers = PUBLIC | STATIC;
+  m->returnType = interfaceType->GetCanonicalName();
+  m->name = "asInterface";
+  m->parameters.push_back(obj);
+  m->statements = std::make_shared<StatementBlock>();
+
+  auto ifstatement = std::make_shared<IfStatement>();
+  ifstatement->expression = std::make_shared<Comparison>(obj, "==", NULL_VALUE);
+  ifstatement->statements = std::make_shared<StatementBlock>();
+  ifstatement->statements->Add(std::make_shared<ReturnStatement>(NULL_VALUE));
+  m->statements->Add(ifstatement);
+
+  // IInterface iin = obj.queryLocalInterface(DESCRIPTOR)
+  auto queryLocalInterface = std::make_shared<MethodCall>(obj, "queryLocalInterface");
+  queryLocalInterface->arguments.push_back(std::make_shared<LiteralExpression>("DESCRIPTOR"));
+  auto iin = std::make_shared<Variable>("android.os.IInterface", "iin");
+  auto iinVd = std::make_shared<VariableDeclaration>(iin, queryLocalInterface);
+  m->statements->Add(iinVd);
+
+  // Ensure the instance type of the local object is as expected.
+  // One scenario where this is needed is if another package (with a
+  // different class loader) runs in the same process as the service.
+
+  // if (iin != null && iin instanceof <interfaceType>) return (<interfaceType>)
+  // iin;
+  auto iinNotNull = std::make_shared<Comparison>(iin, "!=", NULL_VALUE);
+  auto instOfCheck = std::make_shared<Comparison>(
+      iin, " instanceof ", std::make_shared<LiteralExpression>(interfaceType->GetCanonicalName()));
+  auto instOfStatement = std::make_shared<IfStatement>();
+  instOfStatement->expression = std::make_shared<Comparison>(iinNotNull, "&&", instOfCheck);
+  instOfStatement->statements = std::make_shared<StatementBlock>();
+  instOfStatement->statements->Add(std::make_shared<ReturnStatement>(
+      std::make_shared<Cast>(interfaceType->GetCanonicalName(), iin)));
+  m->statements->Add(instOfStatement);
+
+  auto ne = std::make_shared<NewExpression>(interfaceType->GetCanonicalName() + ".Stub.Proxy");
+  ne->arguments.push_back(obj);
+  m->statements->Add(std::make_shared<ReturnStatement>(ne));
+
+  this->elements.push_back(m);
+}
+
+// =================================================
+class ProxyClass : public Class {
+ public:
+  ProxyClass(const AidlInterface* interfaceType, const Options& options);
+  ~ProxyClass() override;
+
+  std::shared_ptr<Variable> mRemote;
+};
+
+ProxyClass::ProxyClass(const AidlInterface* interfaceType, const Options& options) : Class() {
+  this->modifiers = PRIVATE | STATIC;
+  this->what = Class::CLASS;
+  this->type = interfaceType->GetCanonicalName() + ".Stub.Proxy";
+  this->interfaces.push_back(interfaceType->GetCanonicalName());
+
+  // IBinder mRemote
+  mRemote = std::make_shared<Variable>("android.os.IBinder", "mRemote");
+  this->elements.push_back(std::make_shared<Field>(PRIVATE, mRemote));
+
+  // Proxy()
+  auto remote = std::make_shared<Variable>("android.os.IBinder", "remote");
+  auto ctor = std::make_shared<Method>();
+  ctor->name = "Proxy";
+  ctor->statements = std::make_shared<StatementBlock>();
+  ctor->parameters.push_back(remote);
+  ctor->statements->Add(std::make_shared<Assignment>(mRemote, remote));
+  this->elements.push_back(ctor);
+
+  if (options.Version() > 0) {
+    std::ostringstream code;
+    code << "private int mCachedVersion = -1;\n";
+    this->elements.emplace_back(std::make_shared<LiteralClassElement>(code.str()));
+  }
+  if (!options.Hash().empty()) {
+    std::ostringstream code;
+    code << "private String mCachedHash = \"-1\";\n";
+    this->elements.emplace_back(std::make_shared<LiteralClassElement>(code.str()));
+  }
+
+  // IBinder asBinder()
+  auto asBinder = std::make_shared<Method>();
+  asBinder->modifiers = PUBLIC | OVERRIDE;
+  asBinder->returnType = "android.os.IBinder";
+  asBinder->name = "asBinder";
+  asBinder->statements = std::make_shared<StatementBlock>();
+  asBinder->statements->Add(std::make_shared<ReturnStatement>(mRemote));
+  this->elements.push_back(asBinder);
+}
+
+ProxyClass::~ProxyClass() {}
+
+// =================================================
+
+static void GenerateWriteToParcel(CodeWriter& out, const AidlTypenames& typenames,
+                                  const AidlTypeSpecifier& type, const std::string& parcel,
+                                  const std::string& var, uint32_t min_sdk_version,
+                                  bool is_return_value) {
+  WriteToParcelFor(CodeGeneratorContext{
+      .writer = out,
+      .typenames = typenames,
+      .type = type,
+      .parcel = parcel,
+      .var = var,
+      .min_sdk_version = min_sdk_version,
+      .write_to_parcel_flag =
+          is_return_value ? "android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE" : "0",
+  });
+}
+
+static void GenerateWriteToParcel(std::shared_ptr<StatementBlock> addTo,
+                                  const AidlTypenames& typenames, const AidlTypeSpecifier& type,
+                                  const std::string& parcel, const std::string& var,
+                                  uint32_t min_sdk_version, bool is_return_value) {
+  string code;
+  GenerateWriteToParcel(*CodeWriter::ForString(&code), typenames, type, parcel, var,
+                        min_sdk_version, is_return_value);
+  addTo->Add(std::make_shared<LiteralStatement>(code));
+}
+
+void GenerateConstantDeclarations(CodeWriter& out, const AidlDefinedType& type) {
+  for (const auto& constant : type.GetConstantDeclarations()) {
+    const AidlTypeSpecifier& type = constant->GetType();
+    out << GenerateComments(*constant);
+    out << GenerateAnnotations(*constant);
+    out << "public static final " << type.Signature() << " " << constant->GetName() << " = "
+        << constant->ValueString(ConstantValueDecorator) << ";\n";
+  }
+}
+
+static std::shared_ptr<Method> GenerateInterfaceMethod(const AidlInterface& iface,
+                                                       const AidlMethod& method) {
+  auto decl = std::make_shared<Method>();
+  decl->comment = GenerateComments(method);
+  decl->modifiers = PUBLIC;
+  decl->returnType = JavaSignatureOf(method.GetType());
+  decl->name = method.GetName();
+  decl->annotations = JavaAnnotationsFor(method);
+  // If the interface has some permission annotation, add it to the method.
+  if (auto iface_annotation = JavaPermissionAnnotation(iface); iface_annotation) {
+    decl->annotations.push_back(*iface_annotation);
+  }
+
+  for (const std::unique_ptr<AidlArgument>& arg : method.GetArguments()) {
+    auto var = std::make_shared<Variable>(JavaSignatureOf(arg->GetType()), arg->GetName());
+    var->annotations = JavaAnnotationsFor(arg->GetType());
+    decl->parameters.push_back(var);
+  }
+
+  decl->exceptions.push_back("android.os.RemoteException");
+
+  return decl;
+}
+
+// Visitor for the permission declared in the @EnforcePermission annotation.
+class PermissionVisitor {
+ public:
+  PermissionVisitor(CodeWriter* code, const AidlMethod& method) : code_(code), method_(method) {}
+
+  ~PermissionVisitor() {
+    code_->Dedent();
+    *code_ << "}\n";
+  }
+
+  string Credentials() const { return "getCallingPid(), getCallingUid()"; }
+
+  void Prologue() {
+    *code_ << "/** Helper method to enforce permissions for " << method_.GetName() << " */\n";
+    *code_ << "protected void " << method_.GetName() << "_enforcePermission() "
+           << "throws SecurityException {\n";
+    code_->Indent();
+  }
+
+  void AddStaticArrayPermissions(const std::vector<std::string>& permissions) {
+    *code_ << "static final String[] PERMISSIONS_" << method_.GetName() << " = {"
+           << Join(permissions, ", ") << "};\n";
+  }
+
+  void operator()(const perm::AllOf& quantifier) {
+    std::vector<std::string> permissions;
+    permissions.reserve(quantifier.operands.size());
+    for (auto const& permission : quantifier.operands) {
+      permissions.push_back(android::aidl::perm::JavaFullName(permission));
+    }
+    AddStaticArrayPermissions(permissions);
+    Prologue();
+    *code_ << "mEnforcer.enforcePermissionAllOf(PERMISSIONS_" << method_.GetName() << ", "
+           << Credentials() << ");\n";
+  }
+
+  void operator()(const perm::AnyOf& quantifier) {
+    std::vector<std::string> permissions;
+    permissions.reserve(quantifier.operands.size());
+    for (auto const& permission : quantifier.operands) {
+      permissions.push_back(android::aidl::perm::JavaFullName(permission));
+    }
+    AddStaticArrayPermissions(permissions);
+    Prologue();
+    *code_ << "mEnforcer.enforcePermissionAnyOf(PERMISSIONS_" << method_.GetName() << ", "
+           << Credentials() << ");\n";
+  }
+
+  void operator()(const std::string& permission) {
+    auto permissionName = android::aidl::perm::JavaFullName(permission);
+    Prologue();
+    *code_ << "mEnforcer.enforcePermission(" << permissionName << ", " << Credentials() << ");\n";
+  }
+
+ private:
+  CodeWriter* code_;
+  const AidlMethod& method_;
+};
+
+static void GeneratePermissionMethod(const AidlInterface& iface, const AidlMethod& method,
+                                     const std::shared_ptr<Class>& addTo) {
+  string code;
+  CodeWriterPtr writer = CodeWriter::ForString(&code);
+
+  if (auto ifacePermExpr = iface.EnforceExpression(); ifacePermExpr) {
+    std::visit(PermissionVisitor(writer.get(), method), *ifacePermExpr.get());
+  } else if (auto methodPermExpr = method.GetType().EnforceExpression(); methodPermExpr) {
+    std::visit(PermissionVisitor(writer.get(), method), *methodPermExpr.get());
+  }
+  writer->Close();
+  addTo->elements.push_back(std::make_shared<LiteralClassElement>(code));
+}
+
+static void GenerateStubCode(const AidlMethod& method, bool oneway,
+                             std::shared_ptr<Variable> transact_data,
+                             std::shared_ptr<Variable> transact_reply,
+                             const AidlTypenames& typenames,
+                             std::shared_ptr<StatementBlock> statement_block,
+                             const Options& options) {
+  // try and finally
+  auto& statements = statement_block;
+
+  auto realCall = std::make_shared<MethodCall>(THIS_VALUE, method.GetName());
+
+  // args
+  VariableFactory stubArgs("_arg");
+  {
+    // keep this across different args in order to create the classloader
+    // at most once.
+    bool is_classloader_created = false;
+
+    if (method.IsNew() && ShouldForceDowngradeFor(CommunicationSide::READ)) {
+      auto if_statement = std::make_shared<IfStatement>();
+      if_statement->expression = std::make_shared<LiteralExpression>("true");
+      if_statement->statements = std::make_shared<StatementBlock>();
+      if_statement->statements->Add(
+          std::make_shared<LiteralExpression>("throw new android.os.RemoteException(\"Method " +
+                                              method.GetName() + " is unimplemented.\")"));
+      statements->Add(if_statement);
+    }
+    for (const std::unique_ptr<AidlArgument>& arg : method.GetArguments()) {
+      std::shared_ptr<Variable> v = stubArgs.Get(arg->GetType());
+
+      statements->Add(std::make_shared<VariableDeclaration>(v));
+
+      string code;
+      CodeWriterPtr writer = CodeWriter::ForString(&code);
+      if (arg->GetDirection() & AidlArgument::IN_DIR) {
+        // "in/inout" parameter should be created from parcel.
+        CodeGeneratorContext context{.writer = *(writer.get()),
+                                     .typenames = typenames,
+                                     .type = arg->GetType(),
+                                     .parcel = transact_data->name,
+                                     .var = v->name,
+                                     .min_sdk_version = options.GetMinSdkVersion(),
+                                     .is_classloader_created = &is_classloader_created};
+        CreateFromParcelFor(context);
+      } else {
+        // "out" parameter should be instantiated before calling the real impl.
+        string java_type = InstantiableJavaSignatureOf(arg->GetType());
+
+        if (arg->GetType().IsDynamicArray()) {
+          // dynamic array should be created with a passed length.
+          string var_length = v->name + "_length";
+          (*writer) << "int " << var_length << " = data.readInt();\n";
+          (*writer) << "if (" << var_length << " < 0) {\n";
+          (*writer) << "  " << v->name << " = null;\n";
+          (*writer) << "} else {\n";
+          (*writer) << "  " << v->name << " = new " << java_type << "[" << var_length << "];\n";
+          (*writer) << "}\n";
+        } else if (arg->GetType().IsFixedSizeArray()) {
+          // fixed-size array can be created with a known size
+          string dimensions;
+          for (auto dim : arg->GetType().GetFixedSizeArrayDimensions()) {
+            dimensions += "[" + std::to_string(dim) + "]";
+          }
+          (*writer) << v->name << " = new " << java_type << dimensions << ";\n";
+        } else {
+          // otherwise, create a new instance with a default constructor
+          (*writer) << v->name << " = new " << java_type << "();\n";
+        }
+      }
+      writer->Close();
+      statements->Add(std::make_shared<LiteralStatement>(code));
+
+      realCall->arguments.push_back(v);
+    }
+  }
+
+  // EOF check
+  if (!method.GetArguments().empty() && options.GetMinSdkVersion() > 32u) {
+    statements->Add(std::make_shared<MethodCall>(transact_data, "enforceNoDataAvail"));
+  }
+
+  // the real call
+  if (method.GetType().GetName() == "void") {
+    statements->Add(realCall);
+
+    if (!oneway) {
+      // report that there were no exceptions
+      auto ex = std::make_shared<MethodCall>(transact_reply, "writeNoException");
+      statements->Add(ex);
+    }
+  } else {
+    auto _result = std::make_shared<Variable>(JavaSignatureOf(method.GetType()), "_result");
+    statements->Add(std::make_shared<VariableDeclaration>(_result, realCall));
+
+    if (!oneway) {
+      // report that there were no exceptions
+      auto ex = std::make_shared<MethodCall>(transact_reply, "writeNoException");
+      statements->Add(ex);
+    }
+
+    // marshall the return value
+    GenerateWriteToParcel(statements, typenames, method.GetType(), transact_reply->name,
+                          _result->name, options.GetMinSdkVersion(), /*is_return_value=*/true);
+  }
+
+  // out parameters
+  int i = 0;
+  for (const std::unique_ptr<AidlArgument>& arg : method.GetArguments()) {
+    std::shared_ptr<Variable> v = stubArgs.Get(i++);
+    if (arg->GetDirection() & AidlArgument::OUT_DIR) {
+      GenerateWriteToParcel(statements, typenames, arg->GetType(), transact_reply->name, v->name,
+                            options.GetMinSdkVersion(), /*is_return_value=*/true);
+    }
+  }
+}
+
+static void GenerateStubCase(const AidlMethod& method, const std::string& transactCodeName,
+                             bool oneway, const std::shared_ptr<StubClass>& stubClass,
+                             const AidlTypenames& typenames, const Options& options) {
+  auto c = std::make_shared<Case>(transactCodeName);
+
+  GenerateStubCode(method, oneway, stubClass->transact_data, stubClass->transact_reply, typenames,
+                   c->statements, options);
+  c->statements->Add(std::make_shared<BreakStatement>());
+
+  stubClass->transact_switch_user->cases.push_back(c);
+}
+
+static void GenerateStubCaseOutline(const AidlMethod& method, const std::string& transactCodeName,
+                                    bool oneway, const std::shared_ptr<StubClass>& stubClass,
+                                    const AidlTypenames& typenames, const Options& options) {
+  std::string outline_name = "onTransact$" + method.GetName() + "$";
+  // Generate an "outlined" method with the actual code.
+  {
+    auto transact_data = std::make_shared<Variable>("android.os.Parcel", "data");
+    auto transact_reply = std::make_shared<Variable>("android.os.Parcel", "reply");
+    auto onTransact_case = std::make_shared<Method>();
+    onTransact_case->modifiers = PRIVATE;
+    onTransact_case->returnType = "boolean";
+    onTransact_case->name = outline_name;
+    onTransact_case->parameters.push_back(transact_data);
+    onTransact_case->parameters.push_back(transact_reply);
+    onTransact_case->statements = std::make_shared<StatementBlock>();
+    onTransact_case->exceptions.push_back("android.os.RemoteException");
+    stubClass->elements.push_back(onTransact_case);
+
+    GenerateStubCode(method, oneway, transact_data, transact_reply, typenames,
+                     onTransact_case->statements, options);
+    onTransact_case->statements->Add(std::make_shared<ReturnStatement>(TRUE_VALUE));
+  }
+
+  // Generate the case dispatch.
+  {
+    auto c = std::make_shared<Case>(transactCodeName);
+
+    auto helper_call =
+        std::make_shared<MethodCall>(THIS_VALUE, outline_name,
+                                     std::vector<std::shared_ptr<Expression>>{
+                                         stubClass->transact_data, stubClass->transact_reply});
+    c->statements->Add(std::make_shared<ReturnStatement>(helper_call));
+
+    stubClass->transact_switch_user->cases.push_back(c);
+  }
+}
+
+template <typename Formatter>
+static std::string ArgList(const AidlMethod& method, Formatter formatter) {
+  vector<string> args;
+  for (const auto& arg : method.GetArguments()) {
+    args.push_back(std::invoke(formatter, *arg));
+  }
+  return Join(args, ", ");
+}
+
+static std::string FormatArgForDecl(const AidlArgument& arg) {
+  return JavaSignatureOf(arg.GetType()) + " " + arg.GetName();
+}
+
+static void GenerateProxyMethod(CodeWriter& out, const AidlInterface& iface,
+                                const AidlMethod& method, const std::string& transactCodeName,
+                                bool oneway, const AidlTypenames& typenames,
+                                const Options& options) {
+  bool is_void = method.GetType().GetName() == "void";
+
+  out << GenerateComments(method);
+  out << "@Override public " << JavaSignatureOf(method.GetType()) << " " << method.GetName() << "("
+      << ArgList(method, FormatArgForDecl) << ") throws android.os.RemoteException\n{\n";
+  out.Indent();
+
+  if (method.IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE)) {
+    out << "if (true) {\n";
+    out << "  throw new android.os.RemoteException(\"Method " + method.GetName() +
+               " is unimplemented.\");\n";
+    out << "}\n";
+  }
+
+  // the parcels
+  if (options.GenRpc()) {
+    out << "android.os.Parcel _data = android.os.Parcel.obtain(asBinder());\n";
+  } else {
+    out << "android.os.Parcel _data = android.os.Parcel.obtain();\n";
+  }
+
+  if (iface.IsSensitiveData()) {
+    out << "_data.markSensitive();\n";
+  }
+
+  if (!oneway) {
+    out << "android.os.Parcel _reply = android.os.Parcel.obtain();\n";
+  }
+
+  // the return value
+  if (!is_void) {
+    out << JavaSignatureOf(method.GetType()) << " _result;\n";
+  }
+
+  out << "try {\n";
+  out.Indent();
+
+  // the interface identifier token: the DESCRIPTOR constant, marshalled as a
+  // string
+  out << "_data.writeInterfaceToken(DESCRIPTOR);\n";
+
+  // the parameters
+  for (const std::unique_ptr<AidlArgument>& arg : method.GetArguments()) {
+    AidlArgument::Direction dir = arg->GetDirection();
+    if (dir == AidlArgument::OUT_DIR && arg->GetType().IsDynamicArray()) {
+      // In Java we pass a pre-allocated array for an 'out' argument. For transaction,
+      // we pass the size of the array so that the remote can allocate the array with the same size.
+      out << "_data.writeInt(" << arg->GetName() << ".length);\n";
+    } else if (dir & AidlArgument::IN_DIR) {
+      GenerateWriteToParcel(out, typenames, arg->GetType(), "_data", arg->GetName(),
+                            options.GetMinSdkVersion(), /*is_return_value=*/false);
+    }
+  }
+
+  std::vector<std::string> flags;
+  if (oneway) flags.push_back("android.os.IBinder.FLAG_ONEWAY");
+  if (iface.IsSensitiveData()) flags.push_back("android.os.IBinder.FLAG_CLEAR_BUF");
+
+  // the transact call
+  out << "boolean _status = mRemote.transact(Stub." << transactCodeName << ", _data, "
+      << (oneway ? "null" : "_reply") << ", " << (flags.empty() ? "0" : Join(flags, " | "))
+      << ");\n";
+
+  // TODO(b/151102494): annotation is applied on the return type
+  if (method.GetType().IsPropagateAllowBlocking() && !oneway) {
+    if (options.GetMinSdkVersion() < JAVA_PROPAGATE_VERSION) {
+      out << "if (android.os.Build.VERSION.SDK_INT >= " + std::to_string(JAVA_PROPAGATE_VERSION) +
+                 ") { _reply.setPropagateAllowBlocking(); }\n";
+    } else {
+      out << "_reply.setPropagateAllowBlocking();\n";
+    }
+  }
+
+  // If the transaction returns false, which means UNKNOWN_TRANSACTION, fall back to the local
+  // method in the default impl, if set before. Otherwise, throw a RuntimeException if the interface
+  // is versioned. We can't throw the exception for unversioned interface because that would be an
+  // app breaking change.
+  if (iface.IsJavaDefault() || options.Version() > 0) {
+    out << "if (!_status) {\n";
+    out.Indent();
+
+    if (iface.IsJavaDefault()) {
+      out << "if (getDefaultImpl() != null) {\n";
+      out.Indent();
+      if (is_void) {
+        out << "getDefaultImpl()." << method.GetName() << "("
+            << ArgList(method, &AidlArgument::GetName) << ");\n";
+        out << "return;\n";
+      } else {
+        out << "return getDefaultImpl()." << method.GetName() << "("
+            << ArgList(method, &AidlArgument::GetName) << ");\n";
+      }
+      out.Dedent();
+      out << "}\n";
+    }
+
+    // TODO(b/274144762): we shouldn't have different behavior for versioned interfaces
+    // also this set to false for all exceptions, not just unimplemented methods.
+    if (options.Version() > 0) {
+      out << "throw new android.os.RemoteException(\"Method " << method.GetName()
+          << " is unimplemented.\");\n";
+    }
+
+    out.Dedent();
+    out << "}\n";
+  }
+
+  if (!oneway) {
+    // keep this across return value and arguments in order to create the
+    // classloader at most once.
+    bool is_classloader_created = false;
+
+    // throw back exceptions.
+    out << "_reply.readException();\n";
+
+    if (!is_void) {
+      CreateFromParcelFor(CodeGeneratorContext{.writer = out,
+                                               .typenames = typenames,
+                                               .type = method.GetType(),
+                                               .parcel = "_reply",
+                                               .var = "_result",
+                                               .min_sdk_version = options.GetMinSdkVersion(),
+                                               .is_classloader_created = &is_classloader_created});
+    }
+
+    // the out/inout parameters
+    for (const std::unique_ptr<AidlArgument>& arg : method.GetArguments()) {
+      if (arg->GetDirection() & AidlArgument::OUT_DIR) {
+        ReadFromParcelFor(CodeGeneratorContext{.writer = out,
+                                               .typenames = typenames,
+                                               .type = arg->GetType(),
+                                               .parcel = "_reply",
+                                               .var = arg->GetName(),
+                                               .min_sdk_version = options.GetMinSdkVersion(),
+                                               .is_classloader_created = &is_classloader_created});
+      }
+    }
+  }
+
+  out.Dedent();
+  out << "}\nfinally {\n";
+  out.Indent();
+
+  // returning and cleanup
+  if (!oneway) {
+    out << "_reply.recycle();\n";
+  }
+  out << "_data.recycle();\n";
+
+  out.Dedent();
+  out << "}\n";  // finally
+
+  if (!is_void) {
+    out << "return _result;\n";
+  }
+
+  out.Dedent();
+  out << "}\n";  // method body
+}
+
+static void GenerateMethods(const AidlInterface& iface, const AidlMethod& method, Class* interface,
+                            std::shared_ptr<StubClass> stubClass,
+                            std::shared_ptr<ProxyClass> proxyClass, int index,
+                            const AidlTypenames& typenames, const Options& options) {
+  const bool oneway = method.IsOneway();
+
+  // == the TRANSACT_ constant =============================================
+  string transactCodeName = "TRANSACTION_";
+  transactCodeName += method.GetName();
+
+  auto transactCode =
+      std::make_shared<Field>(STATIC | FINAL, std::make_shared<Variable>("int", transactCodeName));
+  transactCode->value =
+      StringPrintf("(android.os.IBinder.FIRST_CALL_TRANSACTION + %d)", index);
+  stubClass->elements.push_back(transactCode);
+
+  // getTransactionName
+  if (options.GenTransactionNames() || options.GenTraces()) {
+    auto c = std::make_shared<Case>(transactCodeName);
+    c->statements->Add(std::make_shared<ReturnStatement>(
+        std::make_shared<StringLiteralExpression>(method.GetName())));
+    stubClass->code_to_method_name_switch->cases.push_back(c);
+  }
+
+  // == the declaration in the interface ===================================
+  std::shared_ptr<ClassElement> decl;
+  if (method.IsUserDefined()) {
+    decl = GenerateInterfaceMethod(iface, method);
+  } else {
+    if (method.GetName() == kGetInterfaceVersion && options.Version() > 0) {
+      std::ostringstream code;
+      code << "public int " << kGetInterfaceVersion << "() "
+           << "throws android.os.RemoteException;\n";
+      decl = std::make_shared<LiteralClassElement>(code.str());
+    }
+    if (method.GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+      std::ostringstream code;
+      code << "public String " << kGetInterfaceHash << "() "
+           << "throws android.os.RemoteException;\n";
+      decl = std::make_shared<LiteralClassElement>(code.str());
+    }
+  }
+  interface->elements.push_back(decl);
+
+  // == the stub method ====================================================
+  if (method.IsUserDefined()) {
+    bool outline_stub =
+        stubClass->transact_outline && stubClass->outline_methods.count(&method) != 0;
+    if (outline_stub) {
+      GenerateStubCaseOutline(method, transactCodeName, oneway, stubClass, typenames, options);
+    } else {
+      GenerateStubCase(method, transactCodeName, oneway, stubClass, typenames, options);
+    }
+    if (iface.EnforceExpression() || method.GetType().EnforceExpression()) {
+      GeneratePermissionMethod(iface, method, stubClass);
+    }
+  } else {
+    if (method.GetName() == kGetInterfaceVersion && options.Version() > 0) {
+      auto ifStatement = std::make_shared<IfStatement>();
+      ifStatement->expression = std::make_shared<LiteralExpression>("code == " + transactCodeName);
+      std::ostringstream code;
+      code << "reply.writeNoException();\n"
+           << "reply.writeInt(" << kGetInterfaceVersion << "());\n"
+           << "return true;\n";
+      ifStatement->statements->Add(std::make_shared<LiteralStatement>(code.str()));
+      stubClass->transact_if_statements_meta.push_back(ifStatement);
+    }
+    if (method.GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+      auto ifStatement = std::make_shared<IfStatement>();
+      ifStatement->expression = std::make_shared<LiteralExpression>("code == " + transactCodeName);
+      std::ostringstream code;
+      code << "reply.writeNoException();\n"
+           << "reply.writeString(" << kGetInterfaceHash << "());\n"
+           << "return true;\n";
+      ifStatement->statements->Add(std::make_shared<LiteralStatement>(code.str()));
+      stubClass->transact_if_statements_meta.push_back(ifStatement);
+    }
+  }
+
+  // == the proxy method ===================================================
+  string proxy_code;
+  CodeWriterPtr writer = CodeWriter::ForString(&proxy_code);
+  CodeWriter& code = *writer;
+  if (method.IsUserDefined()) {
+    GenerateProxyMethod(code, iface, method, transactCodeName, oneway, typenames, options);
+  } else {
+    if (method.GetName() == kGetInterfaceVersion && options.Version() > 0) {
+      code << "@Override\n"
+           << "public int " << kGetInterfaceVersion << "()"
+           << " throws "
+           << "android.os.RemoteException {\n"
+           << "  if (mCachedVersion == -1) {\n";
+      if (options.GenRpc()) {
+        code << "    android.os.Parcel data = android.os.Parcel.obtain(asBinder());\n";
+      } else {
+        code << "    android.os.Parcel data = android.os.Parcel.obtain();\n";
+      }
+      code << "    android.os.Parcel reply = android.os.Parcel.obtain();\n"
+           << "    try {\n"
+           << "      data.writeInterfaceToken(DESCRIPTOR);\n"
+           << "      boolean _status = mRemote.transact(Stub." << transactCodeName << ", "
+           << "data, reply, 0);\n";
+      if (iface.IsJavaDefault()) {
+        code << "      if (!_status) {\n"
+             << "        if (getDefaultImpl() != null) {\n"
+             << "          return getDefaultImpl().getInterfaceVersion();\n"
+             << "        }\n"
+             << "      }\n";
+      }
+      code << "      reply.readException();\n"
+           << "      mCachedVersion = reply.readInt();\n"
+           << "    } finally {\n"
+           << "      reply.recycle();\n"
+           << "      data.recycle();\n"
+           << "    }\n"
+           << "  }\n"
+           << "  return mCachedVersion;\n"
+           << "}\n";
+    }
+    if (method.GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+      code << "@Override\n"
+           << "public synchronized String " << kGetInterfaceHash << "()"
+           << " throws "
+           << "android.os.RemoteException {\n"
+           << "  if (\"-1\".equals(mCachedHash)) {\n";
+      if (options.GenRpc()) {
+        code << "    android.os.Parcel data = android.os.Parcel.obtain(asBinder());\n";
+      } else {
+        code << "    android.os.Parcel data = android.os.Parcel.obtain();\n";
+      }
+      code << "    android.os.Parcel reply = android.os.Parcel.obtain();\n"
+           << "    try {\n"
+           << "      data.writeInterfaceToken(DESCRIPTOR);\n"
+           << "      boolean _status = mRemote.transact(Stub." << transactCodeName << ", "
+           << "data, reply, 0);\n";
+      if (iface.IsJavaDefault()) {
+        code << "      if (!_status) {\n"
+             << "        if (getDefaultImpl() != null) {\n"
+             << "          return getDefaultImpl().getInterfaceHash();\n"
+             << "        }\n"
+             << "      }\n";
+      }
+      code << "      reply.readException();\n"
+           << "      mCachedHash = reply.readString();\n"
+           << "    } finally {\n"
+           << "      reply.recycle();\n"
+           << "      data.recycle();\n"
+           << "    }\n"
+           << "  }\n"
+           << "  return mCachedHash;\n"
+           << "}\n";
+    }
+  }
+  code.Close();
+  if (!proxy_code.empty()) {
+    proxyClass->elements.push_back(std::make_shared<LiteralClassElement>(proxy_code));
+  }
+}
+
+static void GenerateInterfaceDescriptors(const Options& options, const AidlInterface* iface,
+                                         Class* interface, std::shared_ptr<StubClass> stub,
+                                         std::shared_ptr<ProxyClass> proxy) {
+  // the interface descriptor transaction handler
+  auto ifStatement = std::make_shared<IfStatement>();
+  ifStatement->expression = std::make_shared<LiteralExpression>("code == INTERFACE_TRANSACTION");
+  ifStatement->statements->Add(std::make_shared<MethodCall>(
+      stub->transact_reply, "writeString",
+      std::vector<std::shared_ptr<Expression>>{stub->GetTransactDescriptor(nullptr)}));
+  ifStatement->statements->Add(std::make_shared<ReturnStatement>(TRUE_VALUE));
+  stub->transact_if_statements_meta.push_back(ifStatement);
+
+  // and the proxy-side method returning the descriptor directly
+  auto getDesc = std::make_shared<Method>();
+  getDesc->modifiers = PUBLIC;
+  getDesc->returnType = "java.lang.String";
+  getDesc->name = "getInterfaceDescriptor";
+  getDesc->statements = std::make_shared<StatementBlock>();
+  getDesc->statements->Add(
+      std::make_shared<ReturnStatement>(std::make_shared<LiteralExpression>("DESCRIPTOR")));
+  proxy->elements.push_back(getDesc);
+
+  // add the DESCRIPTOR field to the interface class
+  Class* classToAddDescriptor = interface;
+  static std::set<std::string> greylist = {
+#include "hiddenapi-greylist"
+  };
+  if (greylist.find(iface->GetCanonicalName()) != greylist.end()) {
+    // For app compatibility, we keep DESCRIPTOR to the stub class for
+    // the interfaces that are in the greylist.
+    classToAddDescriptor = stub.get();
+  }
+  auto descriptor = std::make_shared<Field>(
+      STATIC | FINAL | PUBLIC, std::make_shared<Variable>("java.lang.String", "DESCRIPTOR"));
+  std::string name = iface->GetDescriptor();
+
+  // TODO(b/242862858): avoid differentiating behahavior. This is currently blocked
+  // to fix because of a metalava lint which disallows running code to generate
+  // static fields.
+  if (options.IsStructured()) {
+    // mangle the interface name at build time and demangle it at runtime, to avoid
+    // being renamed by jarjar. See b/153843174
+    std::replace(name.begin(), name.end(), '.', '$');
+    descriptor->value = "\"" + name + "\".replace('$', '.')";
+  } else {
+    descriptor->value = "\"" + name + "\"";
+  }
+  classToAddDescriptor->elements.push_back(descriptor);
+}
+
+// Check whether (some) methods in this interface should be "outlined," that
+// is, have specific onTransact methods for certain cases. Set up StubClass
+// metadata accordingly.
+//
+// Outlining will be enabled if the interface has more than outline_threshold
+// methods. In that case, the methods are sorted by number of arguments
+// (so that more "complex" methods come later), and the first non_outline_count
+// number of methods not outlined (are kept in the onTransact() method).
+//
+// Requirements: non_outline_count <= outline_threshold.
+static void ComputeOutlineMethods(const AidlInterface* iface, const std::shared_ptr<StubClass> stub,
+                                  size_t outline_threshold, size_t non_outline_count) {
+  AIDL_FATAL_IF(non_outline_count > outline_threshold, iface);
+  // We'll outline (create sub methods) if there are more than min_methods
+  // cases.
+  stub->transact_outline = iface->GetMethods().size() > outline_threshold;
+  if (stub->transact_outline) {
+    stub->all_method_count = iface->GetMethods().size();
+    std::vector<const AidlMethod*> methods;
+    methods.reserve(iface->GetMethods().size());
+    for (const auto& ptr : iface->GetMethods()) {
+      methods.push_back(ptr.get());
+    }
+
+    std::stable_sort(
+        methods.begin(),
+        methods.end(),
+        [](const AidlMethod* m1, const AidlMethod* m2) {
+          return m1->GetArguments().size() < m2->GetArguments().size();
+        });
+
+    stub->outline_methods.insert(methods.begin() + non_outline_count,
+                                 methods.end());
+  }
+}
+
+static shared_ptr<ClassElement> GenerateDefaultImplMethod(const AidlMethod& method) {
+  auto default_method = std::make_shared<Method>();
+  default_method->comment = GenerateComments(method);
+  default_method->modifiers = PUBLIC | OVERRIDE;
+  default_method->returnType = JavaSignatureOf(method.GetType());
+  default_method->name = method.GetName();
+  default_method->statements = std::make_shared<StatementBlock>();
+  for (const auto& arg : method.GetArguments()) {
+    default_method->parameters.push_back(
+        std::make_shared<Variable>(JavaSignatureOf(arg->GetType()), arg->GetName()));
+  }
+  default_method->exceptions.push_back("android.os.RemoteException");
+
+  if (method.GetType().GetName() != "void") {
+    const string& defaultValue = DefaultJavaValueOf(method.GetType());
+    default_method->statements->Add(
+        std::make_shared<LiteralStatement>(StringPrintf("return %s;\n", defaultValue.c_str())));
+  }
+  return default_method;
+}
+
+static shared_ptr<Class> GenerateDefaultImplClass(const AidlInterface& iface,
+                                                  const Options& options) {
+  auto default_class = std::make_shared<Class>();
+  default_class->comment = "/** Default implementation for " + iface.GetName() + ". */";
+  default_class->modifiers = PUBLIC | STATIC;
+  default_class->what = Class::CLASS;
+  default_class->type = iface.GetCanonicalName() + ".Default";
+  default_class->interfaces.emplace_back(iface.GetCanonicalName());
+
+  for (const auto& m : iface.GetMethods()) {
+    if (m->IsUserDefined()) {
+      default_class->elements.emplace_back(GenerateDefaultImplMethod(*m));
+    } else {
+      // These are called only when the remote side does not implement these
+      // methods, which is normally impossible, because these methods are
+      // automatically declared in the interface class and not implementing
+      // them on the remote side causes a compilation error. But if the remote
+      // side somehow managed to not implement it, that's an error and we
+      // report the case by returning an invalid value here.
+      if (m->GetName() == kGetInterfaceVersion && options.Version() > 0) {
+        std::ostringstream code;
+        code << "@Override\n"
+             << "public int " << kGetInterfaceVersion << "() {\n"
+             << "  return 0;\n"
+             << "}\n";
+        default_class->elements.emplace_back(std::make_shared<LiteralClassElement>(code.str()));
+      }
+      if (m->GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+        std::ostringstream code;
+        code << "@Override\n"
+             << "public String " << kGetInterfaceHash << "() {\n"
+             << "  return \"\";\n"
+             << "}\n";
+        default_class->elements.emplace_back(std::make_shared<LiteralClassElement>(code.str()));
+      }
+    }
+  }
+
+  default_class->elements.emplace_back(
+      std::make_shared<LiteralClassElement>("@Override\n"
+                                            "public android.os.IBinder asBinder() {\n"
+                                            "  return null;\n"
+                                            "}\n"));
+
+  return default_class;
+}
+
+static shared_ptr<ClassElement> GenerateDelegatorMethod(const AidlMethod& method) {
+  auto delegator_method = std::make_shared<Method>();
+  delegator_method->comment = GenerateComments(method);
+  delegator_method->modifiers = PUBLIC | OVERRIDE;
+  delegator_method->returnType = JavaSignatureOf(method.GetType());
+  delegator_method->name = method.GetName();
+  delegator_method->statements = std::make_shared<StatementBlock>();
+  std::vector<std::string> argNames;
+  for (const auto& arg : method.GetArguments()) {
+    delegator_method->parameters.push_back(
+        std::make_shared<Variable>(JavaSignatureOf(arg->GetType()), arg->GetName()));
+    argNames.push_back(arg->GetName());
+  }
+  delegator_method->exceptions.push_back("android.os.RemoteException");
+
+  std::string return_str;
+  if (method.GetType().GetName() != "void") {
+    return_str = "return ";
+  }
+  delegator_method->statements->Add(
+      std::make_shared<LiteralStatement>(return_str + "mImpl." + method.GetName() + "(" +
+                                         android::base::Join(argNames, ",") + ");\n"));
+  return delegator_method;
+}
+
+static shared_ptr<Class> GenerateDelegatorClass(const AidlInterface& iface,
+                                                const Options& options) {
+  auto delegator_class = std::make_shared<Class>();
+  delegator_class->comment = "/** Delegator implementation for " + iface.GetName() + ". */";
+  delegator_class->modifiers = PUBLIC | STATIC;
+  delegator_class->what = Class::CLASS;
+  delegator_class->type = iface.GetCanonicalName() + ".Delegator";
+  delegator_class->extends = iface.GetCanonicalName() + ".Stub";
+
+  // constructor
+  delegator_class->elements.emplace_back(
+      std::make_shared<LiteralClassElement>("public Delegator(" + iface.GetCanonicalName() +
+                                            " impl) {\n"
+                                            "  this.mImpl = impl;\n"
+                                            "}\n"));
+  // meta methods
+  if (!options.Hash().empty()) {
+    delegator_class->elements.emplace_back(
+        std::make_shared<LiteralClassElement>("@Override\n"
+                                              "public String " +
+                                              kGetInterfaceHash +
+                                              "() throws android.os.RemoteException {\n"
+                                              "  return mImpl." +
+                                              kGetInterfaceHash +
+                                              "();\n"
+                                              "}\n"));
+  }
+  if (options.Version() > 0) {
+    delegator_class->elements.emplace_back(
+        std::make_shared<LiteralClassElement>("@Override\n"
+                                              "public int " +
+                                              kGetInterfaceVersion +
+                                              "() throws android.os.RemoteException {\n"
+                                              "  int implVer = mImpl." +
+                                              kGetInterfaceVersion +
+                                              "();\n"
+                                              "  return VERSION < implVer ? VERSION : implVer;\n"
+                                              "}\n"));
+  }
+
+  // user defined methods
+  for (const auto& m : iface.GetMethods()) {
+    if (m->IsUserDefined()) {
+      delegator_class->elements.emplace_back(GenerateDelegatorMethod(*m));
+    }
+  }
+
+  delegator_class->elements.emplace_back(
+      std::make_shared<LiteralClassElement>(iface.GetCanonicalName() + " mImpl;\n"));
+
+  return delegator_class;
+}
+
+static shared_ptr<ClassElement> GenerateMaxTransactionId(int max_transaction_id) {
+  auto getMaxTransactionId = std::make_shared<Method>();
+  getMaxTransactionId->comment = "/** @hide */";
+  getMaxTransactionId->modifiers = PUBLIC;
+  getMaxTransactionId->returnType = "int";
+  getMaxTransactionId->name = "getMaxTransactionId";
+  getMaxTransactionId->statements = std::make_shared<StatementBlock>();
+  getMaxTransactionId->statements->Add(std::make_shared<ReturnStatement>(
+      std::make_shared<LiteralExpression>(std::to_string(max_transaction_id))));
+  return getMaxTransactionId;
+}
+
+std::unique_ptr<Class> GenerateInterfaceClass(const AidlInterface* iface,
+                                              const AidlTypenames& typenames,
+                                              const Options& options) {
+  // the interface class
+  auto interface = std::make_unique<Class>();
+  interface->comment = GenerateComments(*iface);
+  interface->modifiers = PUBLIC;
+  interface->what = Class::INTERFACE;
+  interface->type = iface->GetCanonicalName();
+  interface->interfaces.push_back("android.os.IInterface");
+  interface->annotations = JavaAnnotationsFor(*iface);
+
+  if (options.Version()) {
+    std::ostringstream code;
+    code << "/**\n"
+         << " * The version of this interface that the caller is built against.\n"
+         << " * This might be different from what {@link #getInterfaceVersion()\n"
+         << " * getInterfaceVersion} returns as that is the version of the interface\n"
+         << " * that the remote object is implementing.\n"
+         << " */\n"
+         << "public static final int VERSION = ";
+    if (options.IsLatestUnfrozenVersion()) {
+      code << "true ? " << options.PreviousVersion() << " : " << options.Version() << ";\n";
+    } else {
+      code << options.Version() << ";\n";
+    }
+
+    interface->elements.emplace_back(std::make_shared<LiteralClassElement>(code.str()));
+  }
+  if (!options.Hash().empty() || options.IsLatestUnfrozenVersion()) {
+    std::ostringstream code;
+    if (options.IsLatestUnfrozenVersion()) {
+      code << "public static final String HASH = \"" << options.PreviousHash() << "\";\n";
+    } else {
+      code << "public static final String HASH = \"" << options.Hash() << "\";\n";
+    }
+
+    interface->elements.emplace_back(std::make_shared<LiteralClassElement>(code.str()));
+  }
+
+  // the default impl class
+  auto default_impl = GenerateDefaultImplClass(*iface, options);
+  interface->elements.emplace_back(default_impl);
+
+  // the delegator class
+  if (iface->IsJavaDelegator()) {
+    auto delegator = GenerateDelegatorClass(*iface, options);
+    interface->elements.emplace_back(delegator);
+  }
+
+  // the stub inner class
+  auto stub = std::make_shared<StubClass>(iface, options);
+  interface->elements.push_back(stub);
+
+  ComputeOutlineMethods(iface, stub, options.onTransact_outline_threshold_,
+                        options.onTransact_non_outline_count_);
+
+  // the proxy inner class
+  auto proxy = std::make_shared<ProxyClass>(iface, options);
+  stub->elements.push_back(proxy);
+
+  // stub and proxy support for getInterfaceDescriptor()
+  GenerateInterfaceDescriptors(options, iface, interface.get(), stub, proxy);
+
+  // all the declared constants of the interface
+  string constants;
+  GenerateConstantDeclarations(*CodeWriter::ForString(&constants), *iface);
+  interface->elements.push_back(std::make_shared<LiteralClassElement>(constants));
+
+  // all the declared methods of the interface
+  int max_transaction_id = 0;
+  for (const auto& item : iface->GetMethods()) {
+    GenerateMethods(*iface, *item, interface.get(), stub, proxy, item->GetId(), typenames, options);
+    max_transaction_id = std::max(max_transaction_id, item->GetId());
+  }
+
+  // getMaxTransactionId
+  if (options.GenTransactionNames() || options.GenTraces()) {
+    stub->elements.push_back(GenerateMaxTransactionId(max_transaction_id));
+  }
+
+  // all the nested types
+  string code;
+  auto writer = CodeWriter::ForString(&code);
+  for (const auto& nested : iface->GetNestedTypes()) {
+    GenerateClass(*writer, *nested, typenames, options);
+  }
+  GenerateParcelHelpers(*writer, *iface, typenames, options);
+  writer->Close();
+  interface->elements.push_back(std::make_shared<LiteralClassElement>(code));
+
+  if (iface->IsJavaDefault()) {
+    // additional static methods for the default impl set/get to the
+    // stub class. Can't add them to the interface as the generated java files
+    // may be compiled with Java < 1.7 where static interface method isn't
+    // supported.
+    // TODO(b/111417145) make this conditional depending on the Java language
+    // version requested
+    const string i_name = iface->GetCanonicalName();
+    stub->elements.emplace_back(std::make_shared<LiteralClassElement>(
+        StringPrintf("public static boolean setDefaultImpl(%s impl) {\n"
+                     "  // Only one user of this interface can use this function\n"
+                     "  // at a time. This is a heuristic to detect if two different\n"
+                     "  // users in the same process use this function.\n"
+                     "  if (Stub.Proxy.sDefaultImpl != null) {\n"
+                     "    throw new IllegalStateException(\"setDefaultImpl() called twice\");\n"
+                     "  }\n"
+                     "  if (impl != null) {\n"
+                     "    Stub.Proxy.sDefaultImpl = impl;\n"
+                     "    return true;\n"
+                     "  }\n"
+                     "  return false;\n"
+                     "}\n",
+                     i_name.c_str())));
+    stub->elements.emplace_back(
+        std::make_shared<LiteralClassElement>(StringPrintf("public static %s getDefaultImpl() {\n"
+                                                           "  return Stub.Proxy.sDefaultImpl;\n"
+                                                           "}\n",
+                                                           i_name.c_str())));
+
+    // the static field is defined in the proxy class, not in the interface class
+    // because all fields in an interface class are by default final.
+    proxy->elements.emplace_back(std::make_shared<LiteralClassElement>(
+        StringPrintf("public static %s sDefaultImpl;\n", i_name.c_str())));
+  }
+
+  stub->Finish();
+
+  return interface;
+}
+
+}  // namespace java
+}  // namespace aidl
+}  // namespace android
diff --git a/generate_ndk.cpp b/generate_ndk.cpp
new file mode 100644
index 0000000..ea4b4b9
--- /dev/null
+++ b/generate_ndk.cpp
@@ -0,0 +1,1523 @@
+/*
+ * Copyright (C) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "generate_ndk.h"
+
+#include "aidl.h"
+#include "aidl_language.h"
+#include "aidl_to_common.h"
+#include "aidl_to_cpp_common.h"
+#include "aidl_to_ndk.h"
+#include "logging.h"
+
+#include <android-base/stringprintf.h>
+
+namespace android {
+namespace aidl {
+namespace ndk {
+
+static constexpr const char* kDescriptor = "descriptor";
+static constexpr const char* kVersion = "version";
+static constexpr const char* kHash = "hash";
+static constexpr const char* kCachedVersion = "_aidl_cached_version";
+static constexpr const char* kCachedHash = "_aidl_cached_hash";
+static constexpr const char* kCachedHashMutex = "_aidl_cached_hash_mutex";
+
+namespace internals {
+// 4 outputs for NDK for each type: Header, BpHeader, BnHeader, Source
+void GenerateHeader(CodeWriter& out, const AidlTypenames& types,
+                    const AidlDefinedType& defined_type, const Options& options);
+void GenerateClientHeader(CodeWriter& out, const AidlTypenames& types,
+                          const AidlDefinedType& defined_type, const Options& options);
+void GenerateServerHeader(CodeWriter& out, const AidlTypenames& types,
+                          const AidlDefinedType& defined_type, const Options& options);
+void GenerateSource(CodeWriter& out, const AidlTypenames& types,
+                    const AidlDefinedType& defined_type, const Options& options);
+
+// Header contains ClassDecl of a root type
+void GenerateInterfaceClassDecl(CodeWriter& out, const AidlTypenames& types,
+                                const AidlInterface& iface, const Options& options);
+void GenerateParcelClassDecl(CodeWriter& out, const AidlTypenames& types,
+                             const AidlStructuredParcelable& parcelable, const Options& options);
+void GenerateParcelClassDecl(CodeWriter& out, const AidlTypenames& types,
+                             const AidlUnionDecl& union_decl, const Options& options);
+void GenerateEnumClassDecl(CodeWriter& out, const AidlTypenames& types,
+                           const AidlEnumDeclaration& enum_decl, const Options& options);
+
+// BpHeader/BnHeader for interface
+void GenerateClientHeader(CodeWriter& out, const AidlTypenames& types,
+                          const AidlInterface& defined_type, const Options& options);
+void GenerateServerHeader(CodeWriter& out, const AidlTypenames& types,
+                          const AidlInterface& defined_type, const Options& options);
+
+// Source for interface
+void GenerateSource(CodeWriter& out, const AidlTypenames& types, const AidlInterface& iface,
+                    const Options& options);
+void GenerateClassSource(CodeWriter& out, const AidlTypenames& types,
+                         const AidlInterface& defined_type, const Options& options);
+void GenerateClientSource(CodeWriter& out, const AidlTypenames& types,
+                          const AidlInterface& defined_type, const Options& options);
+void GenerateServerSource(CodeWriter& out, const AidlTypenames& types,
+                          const AidlInterface& defined_type, const Options& options);
+void GenerateInterfaceSource(CodeWriter& out, const AidlTypenames& types,
+                             const AidlInterface& defined_type, const Options& options);
+
+// Source for structured parcelable
+void GenerateParcelSource(CodeWriter& out, const AidlTypenames& types,
+                          const AidlStructuredParcelable& defined_type, const Options& options);
+
+// Source for union
+void GenerateParcelSource(CodeWriter& out, const AidlTypenames& types,
+                          const AidlUnionDecl& defined_type, const Options& options);
+
+// Compare headers so that <android/..> and <aidl/..> comes after other (probably) std headers.
+struct HeaderComp {
+  static int rank(const string& a) {
+    return base::StartsWith(a, "aidl/") ? 2 : base::StartsWith(a, "android/") ? 1 : 0;
+  }
+  bool operator()(const string& a, const string& b) const {
+    return std::make_tuple(rank(a), a) < std::make_tuple(rank(b), b);
+  }
+};
+}  // namespace internals
+
+using namespace internals;
+using cpp::ClassNames;
+using cpp::GetQualifiedName;
+
+void GenerateNdk(const string& output_file, const Options& options, const AidlTypenames& types,
+                 const AidlDefinedType& defined_type, const IoDelegate& io_delegate) {
+  using GenFn = void (*)(CodeWriter & out, const AidlTypenames& types,
+                         const AidlDefinedType& defined_type, const Options& options);
+  // Wrap Generate* function to handle CodeWriter for a file.
+  auto gen = [&](auto file, GenFn fn) {
+    unique_ptr<CodeWriter> writer(io_delegate.GetCodeWriter(file));
+
+    GenerateAutoGenHeader(*writer, options);
+
+    fn(*writer, types, defined_type, options);
+    AIDL_FATAL_IF(!writer->Close(), defined_type) << "I/O Error!";
+  };
+
+  gen(options.OutputHeaderDir() + NdkHeaderFile(defined_type, ClassNames::RAW), &GenerateHeader);
+  gen(options.OutputHeaderDir() + NdkHeaderFile(defined_type, ClassNames::CLIENT),
+      &GenerateClientHeader);
+  gen(options.OutputHeaderDir() + NdkHeaderFile(defined_type, ClassNames::SERVER),
+      &GenerateServerHeader);
+  gen(output_file, &GenerateSource);
+}
+
+namespace internals {
+
+void EnterNdkNamespace(CodeWriter& out, const AidlDefinedType& defined_type) {
+  out << "namespace aidl {\n";
+  cpp::EnterNamespace(out, defined_type);
+}
+void LeaveNdkNamespace(CodeWriter& out, const AidlDefinedType& defined_type) {
+  cpp::LeaveNamespace(out, defined_type);
+  out << "}  // namespace aidl\n";
+}
+
+static void StatusCheckGoto(CodeWriter& out) {
+  out << "if (_aidl_ret_status != STATUS_OK) goto _aidl_error;\n\n";
+}
+static void StatusCheckBreak(CodeWriter& out) {
+  out << "if (_aidl_ret_status != STATUS_OK) break;\n\n";
+}
+static void StatusCheckReturn(CodeWriter& out) {
+  out << "if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;\n\n";
+}
+
+void GenerateHeaderIncludes(CodeWriter& out, const AidlTypenames& types,
+                            const AidlDefinedType& defined_type, const Options& options);
+
+void GenerateClassDecl(CodeWriter& out, const AidlTypenames& types,
+                       const AidlDefinedType& defined_type, const Options& options);
+
+void GenerateNestedTypeDecls(CodeWriter& out, const AidlTypenames& types,
+                             const AidlDefinedType& defined_type, const Options& options) {
+  auto visit = [&](const auto& nested) { GenerateClassDecl(out, types, nested, options); };
+  AIDL_FATAL_IF(!TopologicalVisit(defined_type.GetNestedTypes(), visit), defined_type)
+      << "Cycle detected.";
+}
+
+void GenerateHeaderDefinitions(CodeWriter& out, const AidlTypenames& types,
+                               const AidlDefinedType& defined_type, const Options& options) {
+  struct Visitor : AidlVisitor {
+    CodeWriter& out;
+    const AidlTypenames& types;
+    const Options& options;
+    Visitor(CodeWriter& out, const AidlTypenames& types, const Options& options)
+        : out(out), types(types), options(options) {}
+
+    void Visit(const AidlEnumDeclaration& enum_decl) override {
+      const auto backing_type = NdkNameOf(types, enum_decl.GetBackingType(), StorageMode::STACK);
+      EnterNdkNamespace(out, enum_decl);
+      out << cpp::GenerateEnumToString(enum_decl, backing_type);
+      LeaveNdkNamespace(out, enum_decl);
+
+      out << "namespace ndk {\n";
+      out << "namespace internal {\n";
+      out << cpp::GenerateEnumValues(enum_decl, {"aidl"});
+      out << "}  // namespace internal\n";
+      out << "}  // namespace ndk\n";
+    }
+
+    void Visit(const AidlStructuredParcelable& parcelable) override {
+      if (parcelable.IsGeneric()) {
+        GenerateParcelSource(out, types, parcelable, options);
+      }
+    }
+
+    void Visit(const AidlUnionDecl& union_decl) override {
+      if (union_decl.IsGeneric()) {
+        GenerateParcelSource(out, types, union_decl, options);
+      }
+    }
+
+  } v(out, types, options);
+  VisitTopDown(v, defined_type);
+}
+
+void GenerateHeader(CodeWriter& out, const AidlTypenames& types,
+                    const AidlDefinedType& defined_type, const Options& options) {
+  out << "#pragma once\n\n";
+  GenerateHeaderIncludes(out, types, defined_type, options);
+  cpp::GenerateForwardDecls(out, defined_type, true);
+  EnterNdkNamespace(out, defined_type);
+  GenerateClassDecl(out, types, defined_type, options);
+  LeaveNdkNamespace(out, defined_type);
+  GenerateHeaderDefinitions(out, types, defined_type, options);
+}
+
+void GenerateClientHeader(CodeWriter& out, const AidlTypenames& types,
+                          const AidlDefinedType& defined_type, const Options& options) {
+  if (auto iface = AidlCast<AidlInterface>(defined_type); iface) {
+    GenerateClientHeader(out, types, *iface, options);
+  } else if (auto parcelable = AidlCast<AidlStructuredParcelable>(defined_type); parcelable) {
+    out << "#error TODO(b/111362593) defined_types do not have bp classes\n";
+  } else if (auto union_decl = AidlCast<AidlUnionDecl>(defined_type); union_decl) {
+    out << "#error TODO(b/111362593) defined_types do not have bp classes\n";
+  } else if (auto enum_decl = AidlCast<AidlEnumDeclaration>(defined_type); enum_decl) {
+    out << "#error TODO(b/111362593) enums do not have bp classes\n";
+  } else {
+    AIDL_FATAL(defined_type) << "Unrecognized type sent for NDK generation.";
+  }
+}
+
+void GenerateServerHeader(CodeWriter& out, const AidlTypenames& types,
+                          const AidlDefinedType& defined_type, const Options& options) {
+  if (auto iface = AidlCast<AidlInterface>(defined_type); iface) {
+    GenerateServerHeader(out, types, *iface, options);
+  } else if (auto parcelable = AidlCast<AidlStructuredParcelable>(defined_type); parcelable) {
+    out << "#error TODO(b/111362593) defined_types do not have bn classes\n";
+  } else if (auto union_decl = AidlCast<AidlUnionDecl>(defined_type); union_decl) {
+    out << "#error TODO(b/111362593) defined_types do not have bn classes\n";
+  } else if (auto enum_decl = AidlCast<AidlEnumDeclaration>(defined_type); enum_decl) {
+    out << "#error TODO(b/111362593) enums do not have bn classes\n";
+  } else {
+    AIDL_FATAL(defined_type) << "Unrecognized type sent for CPP generation.";
+  }
+}
+
+void GenerateSource(CodeWriter& out, const AidlTypenames& types,
+                    const AidlDefinedType& defined_type, const Options& options) {
+  struct Visitor : AidlVisitor {
+    CodeWriter& out;
+    const AidlTypenames& types;
+    const Options& options;
+    Visitor(CodeWriter& out, const AidlTypenames& types, const Options& options)
+        : out(out), types(types), options(options) {}
+
+    void Visit(const AidlInterface& interface) override {
+      GenerateSource(out, types, interface, options);
+    }
+
+    void Visit(const AidlStructuredParcelable& parcelable) override {
+      if (!parcelable.IsGeneric()) {
+        GenerateParcelSource(out, types, parcelable, options);
+      }
+    }
+
+    void Visit(const AidlUnionDecl& union_decl) override {
+      if (!union_decl.IsGeneric()) {
+        GenerateParcelSource(out, types, union_decl, options);
+      }
+    }
+
+    void Visit(const AidlEnumDeclaration& enum_decl) override {
+      if (!enum_decl.GetParentType()) {
+        out << "// This file is intentionally left blank as placeholder for enum declaration.\n";
+      }
+    }
+  } v(out, types, options);
+  VisitTopDown(v, defined_type);
+}
+
+void GenerateHeaderIncludes(CodeWriter& out, const AidlTypenames& types,
+                            const AidlDefinedType& defined_type, const Options& options) {
+  // Collect implementation related headers and referenced defined types by recursivly visiting
+  // nested types
+  struct Visitor : AidlVisitor {
+    const AidlTypenames& types;
+    const Options& options;
+    std::set<std::string, HeaderComp> includes;
+    Visitor(const AidlTypenames& types, const Options& options) : types(types), options(options) {}
+
+    // Collect includes for each type reference
+    void Visit(const AidlTypeSpecifier& type) override {
+      auto defined = type.GetDefinedType();
+      if (!defined) return;
+      includes.insert(NdkHeaderFile(*defined, ClassNames::RAW, false /*use_os_sep*/));
+    }
+
+    // Collect implementation-specific includes for each type definition
+    void Visit(const AidlInterface& interface) override {
+      AddCommonHeaders(interface);
+      includes.insert("android/binder_interface_utils.h");
+      if (options.GenLog()) {
+        includes.insert("functional");
+        includes.insert("chrono");
+        includes.insert("sstream");
+      }
+      // For nested interfaces client/server classes are defined in the same header.
+      // So we need includes for client/server class as well.
+      if (interface.GetParentType()) {
+        includes.insert("android/binder_ibinder.h");
+        if (options.GenTraces()) {
+          includes.insert("android/trace.h");
+        }
+      }
+    }
+
+    void Visit(const AidlStructuredParcelable& parcelable) override {
+      AddCommonHeaders(parcelable);
+      includes.insert("android/binder_interface_utils.h");
+      includes.insert("android/binder_parcelable_utils.h");
+      includes.insert("android/binder_to_string.h");  // used by toString()
+    }
+
+    void Visit(const AidlUnionDecl& union_decl) override {
+      AddCommonHeaders(union_decl);
+      includes.insert("android/binder_interface_utils.h");
+      includes.insert("android/binder_parcelable_utils.h");
+      includes.insert("android/binder_to_string.h");  // used by toString()
+      auto union_headers = cpp::UnionWriter::GetHeaders(union_decl);
+      includes.insert(std::begin(union_headers), std::end(union_headers));
+    }
+
+    void Visit(const AidlEnumDeclaration& enum_decl) override {
+      AddCommonHeaders(enum_decl);
+      includes.insert("array");
+      includes.insert("android/binder_enums.h");
+    }
+
+    void AddCommonHeaders(const AidlDefinedType& defined_type) {
+      includes.insert("cstdint");
+      includes.insert("memory");
+      includes.insert("optional");
+      includes.insert("string");
+      includes.insert("vector");
+      if (defined_type.IsSensitiveData()) {
+        includes.insert("android/binder_parcel_platform.h");
+        includes.insert("android/binder_ibinder_platform.h");
+      }
+    }
+  } v(types, options);
+  VisitTopDown(v, defined_type);
+
+  for (const auto& path : v.includes) {
+    out << "#include <" << path << ">\n";
+  }
+  out << "#ifdef BINDER_STABILITY_SUPPORT\n";
+  out << "#include <android/binder_stability.h>\n";
+  out << "#endif  // BINDER_STABILITY_SUPPORT\n";
+  out << "\n";
+
+  if (v.includes.count("cassert")) {
+    // TODO(b/31559095) bionic on host should define __assert2
+    out << "#ifndef __BIONIC__\n#define __assert2(a,b,c,d) ((void)0)\n#endif\n\n";
+  }
+}
+
+void GenerateClassDecl(CodeWriter& out, const AidlTypenames& types,
+                       const AidlDefinedType& defined_type, const Options& options) {
+  if (auto iface = AidlCast<AidlInterface>(defined_type); iface) {
+    GenerateInterfaceClassDecl(out, types, *iface, options);
+  } else if (auto parcelable = AidlCast<AidlStructuredParcelable>(defined_type); parcelable) {
+    GenerateParcelClassDecl(out, types, *parcelable, options);
+  } else if (auto union_decl = AidlCast<AidlUnionDecl>(defined_type); union_decl) {
+    GenerateParcelClassDecl(out, types, *union_decl, options);
+  } else if (auto enum_decl = AidlCast<AidlEnumDeclaration>(defined_type); enum_decl) {
+    GenerateEnumClassDecl(out, types, *enum_decl, options);
+  } else {
+    AIDL_FATAL(defined_type) << "Unrecognized type sent for NDK generation.";
+  }
+}
+
+static void GenerateSourceIncludes(CodeWriter& out, const AidlTypenames& types,
+                                   const AidlDefinedType& defined_type, const Options& options) {
+  // Once in a .cpp file
+  if (defined_type.GetParentType() != nullptr) {
+    return;
+  }
+
+  const string self_header = NdkHeaderFile(defined_type, ClassNames::RAW, false /*use_os_sep*/);
+  out << "#include \"" << self_header << "\"\n";
+  out << "\n";
+
+  std::set<std::string, HeaderComp> includes = {self_header};
+  includes.insert("android/binder_parcel_utils.h");
+  types.IterateTypes([&](const AidlDefinedType& a_defined_type) {
+    if (a_defined_type.AsInterface() != nullptr) {
+      includes.insert(NdkHeaderFile(a_defined_type, ClassNames::CLIENT, false /*use_os_sep*/));
+      includes.insert(NdkHeaderFile(a_defined_type, ClassNames::SERVER, false /*use_os_sep*/));
+      includes.insert(NdkHeaderFile(a_defined_type, ClassNames::RAW, false /*use_os_sep*/));
+    }
+  });
+
+  struct Visitor : AidlVisitor {
+    bool has_interface = false;
+    void Visit(const AidlInterface&) override { has_interface = true; }
+  } v;
+  VisitTopDown(v, defined_type);
+
+  if (v.has_interface && options.GenLog()) {
+    includes.insert("android/binder_to_string.h");
+  }
+
+  // Emit includes except self_header
+  includes.erase(includes.find(self_header));
+  for (const auto& inc : includes) {
+    out << "#include <" << inc << ">\n";
+  }
+  out << "\n";
+
+  // Emit additional definition for gen_traces
+  if (v.has_interface && options.GenTraces()) {
+    out << "namespace {\n";
+    out << "struct ScopedTrace {\n";
+    out.Indent();
+    out << "inline explicit ScopedTrace(const char* name) { ATrace_beginSection(name); }\n";
+    out << "inline ~ScopedTrace() { ATrace_endSection(); }\n";
+    out.Dedent();
+    out << "};\n";
+    out << "}  // namespace\n";
+    out << "\n";
+  }
+}
+
+static void GenerateConstantDeclarations(CodeWriter& out, const AidlTypenames& types,
+                                         const AidlDefinedType& type) {
+  for (const auto& constant : type.GetConstantDeclarations()) {
+    const AidlTypeSpecifier& type = constant->GetType();
+
+    if (type.Signature() == "String") {
+      out << "static const char*";
+      cpp::GenerateDeprecated(out, *constant);
+      out << " " << constant->GetName() << ";\n";
+    } else if (type.Signature() == "float" || type.Signature() == "double") {
+      out << "static constexpr " << NdkNameOf(types, type, StorageMode::STACK) << " ";
+      out << constant->GetName();
+      cpp::GenerateDeprecated(out, *constant);
+      out << " = " << constant->ValueString(ConstantValueDecorator) << ";\n";
+    } else {
+      out << "enum : " << NdkNameOf(types, type, StorageMode::STACK) << " { ";
+      out << constant->GetName();
+      cpp::GenerateDeprecated(out, *constant);
+      out << " = " << constant->ValueString(ConstantValueDecorator) << " };\n";
+    }
+  }
+}
+
+static void GenerateConstantDefinitions(CodeWriter& out, const AidlDefinedType& interface,
+                                        const std::string& clazz,
+                                        const std::string& tmpl_decl = "") {
+  for (const auto& constant : interface.GetConstantDeclarations()) {
+    const AidlConstantValue& value = constant->GetValue();
+    AIDL_FATAL_IF(value.GetType() == AidlConstantValue::Type::UNARY ||
+                      value.GetType() == AidlConstantValue::Type::BINARY,
+                  value);
+    if (value.GetType() == AidlConstantValue::Type::STRING) {
+      out << tmpl_decl;
+      out << "const char* " << clazz << "::" << constant->GetName() << " = "
+          << constant->ValueString(ConstantValueDecorator) << ";\n";
+    }
+  }
+}
+
+void GenerateSource(CodeWriter& out, const AidlTypenames& types, const AidlInterface& defined_type,
+                    const Options& options) {
+  GenerateSourceIncludes(out, types, defined_type, options);
+  EnterNdkNamespace(out, defined_type);
+  GenerateClassSource(out, types, defined_type, options);
+  GenerateClientSource(out, types, defined_type, options);
+  GenerateServerSource(out, types, defined_type, options);
+  GenerateInterfaceSource(out, types, defined_type, options);
+  LeaveNdkNamespace(out, defined_type);
+}
+
+static std::string MethodId(const AidlMethod& m) {
+  return "(FIRST_CALL_TRANSACTION + " + std::to_string(m.GetId()) + " /*" + m.GetName() + "*/)";
+}
+
+static void GenerateClientMethodDefinition(CodeWriter& out, const AidlTypenames& types,
+                                           const AidlInterface& defined_type,
+                                           const AidlMethod& method, const Options& options) {
+  const std::string q_name = GetQualifiedName(defined_type, ClassNames::CLIENT);
+  const std::string clazz = ClassName(defined_type, ClassNames::CLIENT);
+
+  out << NdkMethodDecl(types, method, q_name) << " {\n";
+  out.Indent();
+  out << "binder_status_t _aidl_ret_status = STATUS_OK;\n";
+  out << "::ndk::ScopedAStatus _aidl_status;\n";
+
+  if (method.GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+    out << "const std::lock_guard<std::mutex> lock(" << kCachedHashMutex << ");\n";
+    out << "if (" << kCachedHash << " != \"-1\") {\n";
+    out.Indent();
+    out << "*_aidl_return = " << kCachedHash << ";\n"
+        << "_aidl_status.set(AStatus_fromStatus(_aidl_ret_status));\n"
+        << "return _aidl_status;\n";
+    out.Dedent();
+    out << "}\n";
+  } else if (method.GetName() == kGetInterfaceVersion && options.Version() > 0) {
+    out << "if (" << kCachedVersion << " != -1) {\n";
+    out.Indent();
+    out << "*_aidl_return = " << kCachedVersion << ";\n"
+        << "_aidl_status.set(AStatus_fromStatus(_aidl_ret_status));\n"
+        << "return _aidl_status;\n";
+    out.Dedent();
+    out << "}\n";
+  }
+  out << "::ndk::ScopedAParcel _aidl_in;\n";
+  out << "::ndk::ScopedAParcel _aidl_out;\n";
+  out << "\n";
+
+  if (options.GenLog()) {
+    out << cpp::GenLogBeforeExecute(q_name, method, false /* isServer */, true /* isNdk */);
+  }
+  if (options.GenTraces()) {
+    out << "ScopedTrace _aidl_trace(\"AIDL::" << to_string(options.TargetLanguage())
+        << "::" << ClassName(defined_type, ClassNames::INTERFACE) << "::" << method.GetName()
+        << "::client\");\n";
+  }
+
+  if (method.IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE) &&
+      method.IsUserDefined()) {
+    out << "if (true) {\n";
+    out << "  _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;\n";
+    out << "  goto _aidl_error;\n";
+    out << "}\n";
+  }
+
+  out << "_aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());\n";
+  if (defined_type.IsSensitiveData()) {
+    out << "AParcel_markSensitive(_aidl_in.get());\n";
+  }
+  StatusCheckGoto(out);
+
+  for (const auto& arg : method.GetArguments()) {
+    const std::string var_name = cpp::BuildVarName(*arg);
+
+    if (arg->IsIn()) {
+      out << "_aidl_ret_status = ";
+      const std::string prefix = (arg->IsOut() ? "*" : "");
+      WriteToParcelFor({out, types, arg->GetType(), "_aidl_in.get()", prefix + var_name});
+      out << ";\n";
+      StatusCheckGoto(out);
+    } else if (arg->IsOut() && arg->GetType().IsDynamicArray()) {
+      out << "_aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *" << var_name
+          << ");\n";
+      StatusCheckGoto(out);
+    }
+  }
+  out << "_aidl_ret_status = AIBinder_transact(\n";
+  out.Indent();
+  out << "asBinder().get(),\n";
+  out << MethodId(method) << ",\n";
+  out << "_aidl_in.getR(),\n";
+  out << "_aidl_out.getR(),\n";
+
+  std::vector<std::string> flags;
+  if (method.IsOneway()) flags.push_back("FLAG_ONEWAY");
+  if (defined_type.IsSensitiveData()) flags.push_back("FLAG_CLEAR_BUF");
+  out << (flags.empty() ? "0" : base::Join(flags, " | ")) << "\n";
+
+  out << "#ifdef BINDER_STABILITY_SUPPORT\n";
+  out << "| FLAG_PRIVATE_LOCAL\n";
+  out << "#endif  // BINDER_STABILITY_SUPPORT\n";
+  out << ");\n";
+  out.Dedent();
+
+  // If the method is not implmented in the server side but the client has
+  // provided the default implementation, call it instead of failing hard.
+  const std::string iface = ClassName(defined_type, ClassNames::INTERFACE);
+  out << "if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ";
+  out << iface << "::getDefaultImpl()) {\n";
+  out.Indent();
+  out << "_aidl_status = " << iface << "::getDefaultImpl()->" << method.GetName() << "(";
+  out << NdkArgList(types, method, FormatArgNameOnly) << ");\n";
+  out << "goto _aidl_status_return;\n";
+  out.Dedent();
+  out << "}\n";
+
+  StatusCheckGoto(out);
+
+  if (!method.IsOneway()) {
+    out << "_aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());\n";
+    StatusCheckGoto(out);
+
+    out << "if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;\n";
+  }
+
+  if (method.GetType().GetName() != "void") {
+    out << "_aidl_ret_status = ";
+    ReadFromParcelFor({out, types, method.GetType(), "_aidl_out.get()", "_aidl_return"});
+    out << ";\n";
+    StatusCheckGoto(out);
+    if (method.GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+      out << kCachedHash << " = *_aidl_return;\n";
+    } else if (method.GetName() == kGetInterfaceVersion && options.Version() > 0) {
+      out << kCachedVersion << " = *_aidl_return;\n";
+    }
+  }
+  for (const AidlArgument* arg : method.GetOutArguments()) {
+    out << "_aidl_ret_status = ";
+    ReadFromParcelFor({out, types, arg->GetType(), "_aidl_out.get()", cpp::BuildVarName(*arg)});
+    out << ";\n";
+    StatusCheckGoto(out);
+  }
+
+  out << "_aidl_error:\n";
+  out << "_aidl_status.set(AStatus_fromStatus(_aidl_ret_status));\n";
+  out << "_aidl_status_return:\n";
+  if (options.GenLog()) {
+    out << cpp::GenLogAfterExecute(q_name, defined_type, method, "_aidl_status", "_aidl_return",
+                                   false /* isServer */, true /* isNdk */);
+  }
+
+  out << "return _aidl_status;\n";
+  out.Dedent();
+  out << "}\n";
+}
+
+static void GenerateServerCaseDefinition(CodeWriter& out, const AidlTypenames& types,
+                                         const AidlInterface& defined_type,
+                                         const AidlMethod& method, const Options& options) {
+  const string q_name = GetQualifiedName(defined_type, ClassNames::SERVER);
+
+  out << "case " << MethodId(method) << ": {\n";
+  out.Indent();
+
+  if (defined_type.EnforceExpression() || method.GetType().EnforceExpression()) {
+    out.Write("#error Permission checks not implemented for the ndk backend\n");
+  }
+
+  if (method.IsNew() && ShouldForceDowngradeFor(CommunicationSide::READ) &&
+      method.IsUserDefined()) {
+    out << "if (true) break;\n";
+  }
+  for (const auto& arg : method.GetArguments()) {
+    out << NdkNameOf(types, arg->GetType(), StorageMode::STACK) << " " << cpp::BuildVarName(*arg)
+        << ";\n";
+  }
+  if (method.GetType().GetName() != "void") {
+    out << NdkNameOf(types, method.GetType(), StorageMode::STACK) << " _aidl_return;\n";
+  }
+  out << "\n";
+  if (options.GenTraces()) {
+    out << "ScopedTrace _aidl_trace(\"AIDL::" << to_string(options.TargetLanguage())
+        << "::" << ClassName(defined_type, ClassNames::INTERFACE) << "::" << method.GetName()
+        << "::server\");\n";
+  }
+
+  for (const auto& arg : method.GetArguments()) {
+    const std::string var_name = cpp::BuildVarName(*arg);
+
+    if (arg->IsIn()) {
+      out << "_aidl_ret_status = ";
+      ReadFromParcelFor({out, types, arg->GetType(), "_aidl_in", "&" + var_name});
+      out << ";\n";
+      StatusCheckBreak(out);
+    } else if (arg->IsOut() && arg->GetType().IsDynamicArray()) {
+      out << "_aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &" << var_name << ");\n";
+      StatusCheckBreak(out);
+    }
+  }
+  if (options.GenLog()) {
+    out << cpp::GenLogBeforeExecute(q_name, method, true /* isServer */, true /* isNdk */);
+  }
+  out << "::ndk::ScopedAStatus _aidl_status = _aidl_impl->" << method.GetName() << "("
+      << NdkArgList(types, method, FormatArgForCall) << ");\n";
+
+  if (options.GenLog()) {
+    out << cpp::GenLogAfterExecute(q_name, defined_type, method, "_aidl_status", "_aidl_return",
+                                   true /* isServer */, true /* isNdk */);
+  }
+  if (method.IsOneway()) {
+    // For a oneway transaction, the kernel will have already returned a result. This is for the
+    // in-process case when a oneway transaction is parceled/unparceled in the same process.
+    out << "_aidl_ret_status = STATUS_OK;\n";
+  } else {
+    out << "_aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());\n";
+    StatusCheckBreak(out);
+
+    out << "if (!AStatus_isOk(_aidl_status.get())) break;\n\n";
+
+    if (method.GetType().GetName() != "void") {
+      out << "_aidl_ret_status = ";
+      WriteToParcelFor({out, types, method.GetType(), "_aidl_out", "_aidl_return"});
+      out << ";\n";
+      StatusCheckBreak(out);
+    }
+    for (const AidlArgument* arg : method.GetOutArguments()) {
+      out << "_aidl_ret_status = ";
+      WriteToParcelFor({out, types, arg->GetType(), "_aidl_out", cpp::BuildVarName(*arg)});
+      out << ";\n";
+      StatusCheckBreak(out);
+    }
+  }
+  out << "break;\n";
+  out.Dedent();
+  out << "}\n";
+}
+
+static string OnTransactFuncName(const AidlInterface& interface) {
+  string name = interface.GetCanonicalName();
+  std::replace(name.begin(), name.end(), '.', '_');
+  return "_aidl_" + name + "_onTransact";
+}
+
+static string GlobalClassVarName(const AidlInterface& interface) {
+  string name = interface.GetCanonicalName();
+  std::replace(name.begin(), name.end(), '.', '_');
+  return "_g_aidl_" + name + "_clazz";
+}
+
+void GenerateClassSource(CodeWriter& out, const AidlTypenames& types,
+                         const AidlInterface& defined_type, const Options& options) {
+  const std::string i_name = GetQualifiedName(defined_type, ClassNames::INTERFACE);
+  const std::string q_name = GetQualifiedName(defined_type, ClassNames::SERVER);
+
+  const string on_transact = OnTransactFuncName(defined_type);
+  bool deprecated = defined_type.IsDeprecated() ||
+                    std::any_of(defined_type.GetMethods().begin(), defined_type.GetMethods().end(),
+                                [](const auto& m) { return m->IsDeprecated(); });
+  if (deprecated) {
+    out << "#pragma clang diagnostic push\n";
+    out << "#pragma clang diagnostic ignored \"-Wdeprecated\"\n";
+  }
+  out << "static binder_status_t " << on_transact
+      << "(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, "
+         "AParcel* _aidl_out) {\n";
+  out.Indent();
+  out << "(void)_aidl_in;\n";
+  out << "(void)_aidl_out;\n";
+  out << "binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;\n";
+  if (!defined_type.GetMethods().empty()) {
+    // we know this cast is valid because this method is only called by the ICInterface
+    // AIBinder_Class object which is associated with this class.
+    out << "std::shared_ptr<" << q_name << "> _aidl_impl = std::static_pointer_cast<" << q_name
+        << ">(::ndk::ICInterface::asInterface(_aidl_binder));\n";
+    out << "switch (_aidl_code) {\n";
+    out.Indent();
+    for (const auto& method : defined_type.GetMethods()) {
+      GenerateServerCaseDefinition(out, types, defined_type, *method, options);
+    }
+    out.Dedent();
+    out << "}\n";
+  } else {
+    out << "(void)_aidl_binder;\n";
+    out << "(void)_aidl_code;\n";
+  }
+  out << "return _aidl_ret_status;\n";
+  out.Dedent();
+  out << "}\n\n";
+
+  out << "static AIBinder_Class* " << GlobalClassVarName(defined_type)
+      << " = ::ndk::ICInterface::defineClass(" << i_name << "::" << kDescriptor << ", "
+      << on_transact << ");\n\n";
+  if (deprecated) {
+    out << "#pragma clang diagnostic pop\n";
+  }
+}
+
+void GenerateClientSource(CodeWriter& out, const AidlTypenames& types,
+                          const AidlInterface& defined_type, const Options& options) {
+  const std::string q_name = GetQualifiedName(defined_type, ClassNames::CLIENT);
+  const std::string clazz = ClassName(defined_type, ClassNames::CLIENT);
+
+  out << q_name << "::" << clazz << "(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}\n";
+  out << q_name << "::~" << clazz << "() {}\n";
+  if (options.GenLog()) {
+    out << "std::function<void(const " << q_name << "::TransactionLog&)> " << q_name
+        << "::logFunc;\n";
+  }
+  out << "\n";
+  for (const auto& method : defined_type.GetMethods()) {
+    GenerateClientMethodDefinition(out, types, defined_type, *method, options);
+  }
+}
+
+void GenerateServerSource(CodeWriter& out, const AidlTypenames& types,
+                          const AidlInterface& defined_type, const Options& options) {
+  const std::string q_name = GetQualifiedName(defined_type, ClassNames::SERVER);
+  const std::string clazz = ClassName(defined_type, ClassNames::SERVER);
+  const std::string iface = ClassName(defined_type, ClassNames::INTERFACE);
+
+  out << "// Source for " << clazz << "\n";
+  out << q_name << "::" << clazz << "() {}\n";
+  out << q_name << "::~" << clazz << "() {}\n";
+  if (options.GenLog()) {
+    out << "std::function<void(const " << q_name << "::TransactionLog&)> " << q_name
+        << "::logFunc;\n";
+  }
+  out << "::ndk::SpAIBinder " << q_name << "::createBinder() {\n";
+  out.Indent();
+  out << "AIBinder* binder = AIBinder_new(" << GlobalClassVarName(defined_type)
+      << ", static_cast<void*>(this));\n";
+
+  out << "#ifdef BINDER_STABILITY_SUPPORT\n";
+  if (defined_type.IsVintfStability()) {
+    out << "AIBinder_markVintfStability(binder);\n";
+  } else {
+    out << "AIBinder_markCompilationUnitStability(binder);\n";
+  }
+  out << "#endif  // BINDER_STABILITY_SUPPORT\n";
+
+  out << "return ::ndk::SpAIBinder(binder);\n";
+  out.Dedent();
+  out << "}\n";
+
+  // Implement the meta methods
+  for (const auto& method : defined_type.GetMethods()) {
+    if (method->IsUserDefined()) {
+      continue;
+    }
+    if (method->GetName() == kGetInterfaceVersion && options.Version() > 0) {
+      out << NdkMethodDecl(types, *method, q_name) << " {\n";
+      out.Indent();
+      out << "*_aidl_return = " << iface << "::" << kVersion << ";\n";
+      out << "return ::ndk::ScopedAStatus(AStatus_newOk());\n";
+      out.Dedent();
+      out << "}\n";
+    }
+    if (method->GetName() == kGetInterfaceHash && (!options.Hash().empty())) {
+      out << NdkMethodDecl(types, *method, q_name) << " {\n";
+      out.Indent();
+      out << "*_aidl_return = " << iface << "::" << kHash << ";\n";
+      out << "return ::ndk::ScopedAStatus(AStatus_newOk());\n";
+      out.Dedent();
+      out << "}\n";
+    }
+  }
+}
+void GenerateInterfaceSource(CodeWriter& out, const AidlTypenames& types,
+                             const AidlInterface& defined_type, const Options& options) {
+  const std::string q_name = GetQualifiedName(defined_type, ClassNames::INTERFACE);
+  const std::string clazz = ClassName(defined_type, ClassNames::INTERFACE);
+  const std::string bp_clazz = ClassName(defined_type, ClassNames::CLIENT);
+
+  out << "// Source for " << clazz << "\n";
+  out << "const char* " << q_name << "::" << kDescriptor << " = \"" << defined_type.GetDescriptor()
+      << "\";\n";
+  out << q_name << "::" << clazz << "() {}\n";
+  out << q_name << "::~" << clazz << "() {}\n";
+  out << "\n";
+  GenerateConstantDefinitions(out, defined_type, q_name);
+  out << "\n";
+
+  out << "std::shared_ptr<" << q_name << "> " << q_name
+      << "::fromBinder(const ::ndk::SpAIBinder& binder) {\n";
+  out.Indent();
+  out << "if (!AIBinder_associateClass(binder.get(), " << GlobalClassVarName(defined_type)
+      << ")) {\n";
+  out.Indent();
+  // since NDK users don't use weak symbol support, we don't check builtin available. We could
+  // optionally check it if __ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__ is defined, but this would
+  // also mean that app developers relying on this behavior would be missing test parity, and if
+  // local transactions aren't supported, due to missing the descriptor API, they will need to
+  // work around it a different way, so it's best to check based on __ANDROID_API__
+  out << "#if __ANDROID_API__ >= 31\n";
+  out << "const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());\n";
+  out << "if (originalClass == nullptr) return nullptr;\n";
+  out << "if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {\n";
+  out.Indent();
+  // parcel transactions in process, e.g. NDK<->Rust (okay..)
+  out << "return ::ndk::SharedRefBase::make<" << GetQualifiedName(defined_type, ClassNames::CLIENT)
+      << ">(binder);\n";
+  out.Dedent();
+  out << "}\n";
+  out << "#endif\n";
+  out << "return nullptr;\n";
+  out.Dedent();
+  out << "}\n";
+  out << "std::shared_ptr<::ndk::ICInterface> interface = "
+         "::ndk::ICInterface::asInterface(binder.get());\n";
+  out << "if (interface) {\n";
+  out.Indent();
+  out << "return std::static_pointer_cast<" << clazz << ">(interface);\n";
+  out.Dedent();
+  out << "}\n";
+  out << "return ::ndk::SharedRefBase::make<" << GetQualifiedName(defined_type, ClassNames::CLIENT)
+      << ">(binder);\n";
+  out.Dedent();
+  out << "}\n\n";
+
+  out << "binder_status_t " << q_name << "::writeToParcel(AParcel* parcel, const std::shared_ptr<"
+      << clazz << ">& instance) {\n";
+  out.Indent();
+  out << "return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : "
+         "nullptr);\n";
+  out.Dedent();
+  out << "}\n";
+
+  out << "binder_status_t " << q_name << "::readFromParcel(const AParcel* parcel, std::shared_ptr<"
+      << clazz << ">* instance) {\n";
+  out.Indent();
+  out << "::ndk::SpAIBinder binder;\n";
+  out << "binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());\n";
+  out << "if (status != STATUS_OK) return status;\n";
+  out << "*instance = " << clazz << "::fromBinder(binder);\n";
+  out << "return STATUS_OK;\n";
+  out.Dedent();
+  out << "}\n";
+
+  // defintion for static member setDefaultImpl
+  out << "bool " << q_name << "::setDefaultImpl(const std::shared_ptr<" << clazz << ">& impl) {\n";
+  out.Indent();
+  out << "// Only one user of this interface can use this function\n";
+  out << "// at a time. This is a heuristic to detect if two different\n";
+  out << "// users in the same process use this function.\n";
+  out << "assert(!" << clazz << "::default_impl);\n";
+  out << "if (impl) {\n";
+  out.Indent();
+  out << clazz << "::default_impl = impl;\n";
+  out << "return true;\n";
+  out.Dedent();
+  out << "}\n";
+  out << "return false;\n";
+  out.Dedent();
+  out << "}\n";
+
+  // definition for static member getDefaultImpl
+  out << "const std::shared_ptr<" << q_name << ">& " << q_name << "::getDefaultImpl() {\n";
+  out.Indent();
+  out << "return " << clazz << "::default_impl;\n";
+  out.Dedent();
+  out << "}\n";
+
+  // definition for the static field default_impl
+  out << "std::shared_ptr<" << q_name << "> " << q_name << "::default_impl = nullptr;\n";
+
+  // default implementation for the <Name>Default class members
+  const std::string defaultClazz = q_name + "Default";
+  for (const auto& method : defined_type.GetMethods()) {
+    if (method->IsUserDefined()) {
+      out << "::ndk::ScopedAStatus " << defaultClazz << "::" << method->GetName() << "("
+          << NdkArgList(types, *method, FormatArgNameUnused) << ") {\n";
+      out.Indent();
+      out << "::ndk::ScopedAStatus _aidl_status;\n";
+      out << "_aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));\n";
+      out << "return _aidl_status;\n";
+      out.Dedent();
+      out << "}\n";
+    } else {
+      if (method->GetName() == kGetInterfaceVersion && options.Version() > 0) {
+        out << "::ndk::ScopedAStatus " << defaultClazz << "::" << method->GetName() << "("
+            << "int32_t* _aidl_return) {\n";
+        out.Indent();
+        out << "*_aidl_return = 0;\n";
+        out << "return ::ndk::ScopedAStatus(AStatus_newOk());\n";
+        out.Dedent();
+        out << "}\n";
+      }
+      if (method->GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+        out << "::ndk::ScopedAStatus " << defaultClazz << "::" << method->GetName() << "("
+            << "std::string* _aidl_return) {\n";
+        out.Indent();
+        out << "*_aidl_return = \"\";\n";
+        out << "return ::ndk::ScopedAStatus(AStatus_newOk());\n";
+        out.Dedent();
+        out << "}\n";
+      }
+    }
+  }
+
+  out << "::ndk::SpAIBinder " << defaultClazz << "::asBinder() {\n";
+  out.Indent();
+  out << "return ::ndk::SpAIBinder();\n";
+  out.Dedent();
+  out << "}\n";
+
+  out << "bool " << defaultClazz << "::isRemote() {\n";
+  out.Indent();
+  out << "return false;\n";
+  out.Dedent();
+  out << "}\n";
+}
+
+void GenerateClientClassDecl(CodeWriter& out, const AidlTypenames& types,
+                             const AidlInterface& defined_type, const Options& options) {
+  const std::string clazz = ClassName(defined_type, ClassNames::CLIENT);
+
+  out << "class";
+  cpp::GenerateDeprecated(out, defined_type);
+  out << " " << clazz << " : public ::ndk::BpCInterface<"
+      << ClassName(defined_type, ClassNames::INTERFACE) << "> {\n";
+  out << "public:\n";
+  out.Indent();
+  out << "explicit " << clazz << "(const ::ndk::SpAIBinder& binder);\n";
+  out << "virtual ~" << clazz << "();\n";
+  out << "\n";
+  for (const auto& method : defined_type.GetMethods()) {
+    out << NdkMethodDecl(types, *method) << " override";
+    cpp::GenerateDeprecated(out, *method);
+    out << ";\n";
+  }
+
+  if (options.Version() > 0) {
+    out << "int32_t " << kCachedVersion << " = -1;\n";
+  }
+
+  if (!options.Hash().empty()) {
+    out << "std::string " << kCachedHash << " = \"-1\";\n";
+    out << "std::mutex " << kCachedHashMutex << ";\n";
+  }
+  if (options.GenLog()) {
+    out << cpp::kTransactionLogStruct;
+    out << "static std::function<void(const TransactionLog&)> logFunc;\n";
+  }
+  out.Dedent();
+  out << "};\n";
+}
+
+void GenerateClientHeader(CodeWriter& out, const AidlTypenames& types,
+                          const AidlInterface& defined_type, const Options& options) {
+  out << "#pragma once\n\n";
+  out << "#include \"" << NdkHeaderFile(defined_type, ClassNames::RAW, false /*use_os_sep*/)
+      << "\"\n";
+  out << "\n";
+  out << "#include <android/binder_ibinder.h>\n";
+  if (options.GenLog()) {
+    out << "#include <functional>\n";
+    out << "#include <chrono>\n";
+    out << "#include <sstream>\n";
+  }
+  if (options.GenTraces()) {
+    out << "#include <android/trace.h>\n";
+  }
+  out << "\n";
+  EnterNdkNamespace(out, defined_type);
+  GenerateClientClassDecl(out, types, defined_type, options);
+  LeaveNdkNamespace(out, defined_type);
+}
+
+void GenerateDelegatorClassDecl(CodeWriter& out, const AidlTypenames& types,
+                                const AidlInterface& defined_type, const Options& options) {
+  const std::string clazz = ClassName(defined_type, ClassNames::DELEGATOR_IMPL);
+  const std::string iface = ClassName(defined_type, ClassNames::INTERFACE);
+  const std::string bn_name = ClassName(defined_type, ClassNames::SERVER);
+  const std::string kDelegateImplVarName = "_impl";
+  const std::string kStatusType = "::ndk::ScopedAStatus";
+
+  out << "class";
+  cpp::GenerateDeprecated(out, defined_type);
+  out << " " << clazz << " : public " << bn_name << " {\n";
+  out << "public:\n";
+  out.Indent();
+  out << "explicit " << clazz << "(const std::shared_ptr<" << iface << "> &impl)"
+      << " : " << kDelegateImplVarName << "(impl) {\n";
+  if (options.Version() > 0) {
+    // TODO(b/222347502) If we need to support mismatched versions of delegator and
+    // impl, this check will be removed. The NDK backend can't override the
+    // getInterface* meta methods because they are marked "final". Removing
+    // "final" changes the ABI and breaks prebuilts.
+    out << "   int32_t _impl_ver = 0;\n";
+    out << "   if (!impl->" << kGetInterfaceVersion << "(&_impl_ver).isOk()) {;\n";
+    out << "      __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, \"Delegator failed to get "
+           "version of the implementation.\");\n";
+    out << "   }\n";
+    out << "   if (_impl_ver != " << iface << "::" << kVersion << ") {\n";
+    out << "      __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, \"Mismatched versions of "
+           "delegator and implementation is not allowed.\");\n";
+    out << "   }\n";
+  }
+  out << "}\n\n";
+  for (const auto& method : defined_type.GetMethods()) {
+    if (method->IsUserDefined()) {
+      out << kStatusType << " " << method->GetName() << "("
+          << NdkArgList(types, *method, FormatArgForDecl) << ") override";
+      cpp::GenerateDeprecated(out, *method);
+      out << " {\n"
+          << "  return " << kDelegateImplVarName << "->" << method->GetName() << "("
+          << NdkArgList(types, *method, FormatArgNameOnly) << ");\n";
+      out << "}\n";
+    }
+  }
+  out.Dedent();
+  out << "protected:\n";
+  out.Indent();
+  out.Dedent();
+  out << "private:\n";
+  out.Indent();
+  out << "std::shared_ptr<" << iface << "> " << kDelegateImplVarName << ";\n";
+  out.Dedent();
+  out << "};\n\n";
+}
+
+void GenerateServerClassDecl(CodeWriter& out, const AidlTypenames& types,
+                             const AidlInterface& defined_type, const Options& options) {
+  const std::string clazz = ClassName(defined_type, ClassNames::SERVER);
+  const std::string iface = ClassName(defined_type, ClassNames::INTERFACE);
+
+  out << "class";
+  cpp::GenerateDeprecated(out, defined_type);
+  out << " " << clazz << " : public ::ndk::BnCInterface<" << iface << "> {\n";
+  out << "public:\n";
+  out.Indent();
+  out << clazz << "();\n";
+  out << "virtual ~" << clazz << "();\n";
+
+  // Declare the meta methods
+  for (const auto& method : defined_type.GetMethods()) {
+    if (method->IsUserDefined()) {
+      continue;
+    }
+    if (method->GetName() == kGetInterfaceVersion && options.Version() > 0) {
+      out << NdkMethodDecl(types, *method) << " final;\n";
+    } else if (method->GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+      out << NdkMethodDecl(types, *method) << " final;\n";
+    } else {
+      AIDL_FATAL(defined_type) << "Meta method '" << method->GetName() << "' is unimplemented.";
+    }
+  }
+  if (options.GenLog()) {
+    out << cpp::kTransactionLogStruct;
+    out << "static std::function<void(const TransactionLog&)> logFunc;\n";
+  }
+  out.Dedent();
+  out << "protected:\n";
+  out.Indent();
+  out << "::ndk::SpAIBinder createBinder() override;\n";
+  out.Dedent();
+  out << "private:\n";
+  out.Indent();
+  out.Dedent();
+  out << "};\n";
+}
+
+void GenerateServerHeader(CodeWriter& out, const AidlTypenames& types,
+                          const AidlInterface& defined_type, const Options& options) {
+  out << "#pragma once\n\n";
+  out << "#include \"" << NdkHeaderFile(defined_type, ClassNames::RAW, false /*use_os_sep*/)
+      << "\"\n";
+  out << "\n";
+  out << "#include <android/binder_ibinder.h>\n";
+  // Needed for *Delegator classes while delegator version is required to be
+  // the same as the implementation version
+  // TODO(b/222347502) If we ever need to support mismatched versions of delegator and
+  // impl, this include can be removed.
+  out << "#include <cassert>\n\n";
+  // TODO(b/31559095) bionic on host should define __assert2
+  out << "#ifndef __BIONIC__\n#ifndef __assert2\n#define __assert2(a,b,c,d) "
+         "((void)0)\n#endif\n#endif\n";
+  out << "\n";
+  EnterNdkNamespace(out, defined_type);
+  GenerateServerClassDecl(out, types, defined_type, options);
+  GenerateDelegatorClassDecl(out, types, defined_type, options);
+  LeaveNdkNamespace(out, defined_type);
+}
+
+void GenerateInterfaceClassDecl(CodeWriter& out, const AidlTypenames& types,
+                                const AidlInterface& defined_type, const Options& options) {
+  const std::string clazz = ClassName(defined_type, ClassNames::INTERFACE);
+  out << "class " << ClassName(defined_type, ClassNames::DELEGATOR_IMPL) << ";\n\n";
+  out << "class";
+  cpp::GenerateDeprecated(out, defined_type);
+  out << " " << clazz << " : public ::ndk::ICInterface {\n";
+  out << "public:\n";
+  out.Indent();
+  out << "typedef " << ClassName(defined_type, ClassNames::DELEGATOR_IMPL)
+      << " DefaultDelegator;\n";
+  out << "static const char* " << kDescriptor << ";\n";
+  out << clazz << "();\n";
+  out << "virtual ~" << clazz << "();\n";
+  out << "\n";
+  GenerateNestedTypeDecls(out, types, defined_type, options);
+  GenerateConstantDeclarations(out, types, defined_type);
+  if (options.Version() > 0) {
+    if (options.IsLatestUnfrozenVersion()) {
+      out << "static inline const int32_t " << kVersion << " = true ? "
+          << std::to_string(options.PreviousVersion()) << " : " << std::to_string(options.Version())
+          << ";\n";
+    } else {
+      out << "static inline const int32_t " << kVersion << " = "
+          << std::to_string(options.Version()) << ";\n";
+    }
+  }
+  if (!options.Hash().empty()) {
+    if (options.IsLatestUnfrozenVersion()) {
+      out << "static inline const std::string " << kHash << " = true ? \"" << options.PreviousHash()
+          << "\" : \"" << options.Hash() << "\";\n";
+    } else {
+      out << "static inline const std::string " << kHash << " = \"" << options.Hash() << "\";\n";
+    }
+  }
+  for (const auto& method : defined_type.GetMethods()) {
+    if (!method->IsUserDefined()) {
+      continue;
+    }
+    out << "static constexpr uint32_t TRANSACTION_" << method->GetName() << " = "
+        << "FIRST_CALL_TRANSACTION + " << std::to_string(method->GetId()) << ";\n";
+  }
+  out << "\n";
+  out << "static std::shared_ptr<" << clazz << "> fromBinder(const ::ndk::SpAIBinder& binder);\n";
+  out << "static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<" << clazz
+      << ">& instance);";
+  out << "\n";
+  out << "static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<" << clazz
+      << ">* instance);";
+  out << "\n";
+  out << "static bool setDefaultImpl(const std::shared_ptr<" << clazz << ">& impl);";
+  out << "\n";
+  out << "static const std::shared_ptr<" << clazz << ">& getDefaultImpl();";
+  out << "\n";
+  for (const auto& method : defined_type.GetMethods()) {
+    out << "virtual " << NdkMethodDecl(types, *method);
+    cpp::GenerateDeprecated(out, *method);
+    out << " = 0;\n";
+  }
+  out.Dedent();
+  out << "private:\n";
+  out.Indent();
+  out << "static std::shared_ptr<" << clazz << "> default_impl;\n";
+  out.Dedent();
+  out << "};\n";
+
+  const std::string defaultClazz = clazz + "Default";
+  out << "class";
+  cpp::GenerateDeprecated(out, defined_type);
+  out << " " << defaultClazz << " : public " << clazz << " {\n";
+  out << "public:\n";
+  out.Indent();
+  for (const auto& method : defined_type.GetMethods()) {
+    if (method->IsUserDefined()) {
+      out << NdkMethodDecl(types, *method) << " override";
+      cpp::GenerateDeprecated(out, *method);
+      out << ";\n";
+    } else if (method->GetName() == kGetInterfaceVersion && options.Version() > 0) {
+      out << NdkMethodDecl(types, *method) << " override;\n";
+    } else if (method->GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+      out << NdkMethodDecl(types, *method) << " override;\n";
+    }
+  }
+  out << "::ndk::SpAIBinder asBinder() override;\n";
+  out << "bool isRemote() override;\n";
+  out.Dedent();
+  out << "};\n";
+
+  // When an interface is nested, every class should be defined together here
+  // because we don't have separate headers for them.
+  // (e.g. IFoo, IFooDefault, BpFoo, BnFoo, IFooDelegator)
+  if (defined_type.GetParentType()) {
+    GenerateClientClassDecl(out, types, defined_type, options);
+    GenerateServerClassDecl(out, types, defined_type, options);
+  }
+}
+
+void GenerateParcelClassDecl(CodeWriter& out, const AidlTypenames& types,
+                             const AidlStructuredParcelable& defined_type, const Options& options) {
+  const std::string clazz = ClassName(defined_type, ClassNames::RAW);
+
+  cpp::ClangDiagnosticIgnoreDeprecated guard(out, cpp::HasDeprecatedField(defined_type));
+  out << cpp::TemplateDecl(defined_type);
+  out << "class";
+  cpp::GenerateDeprecated(out, defined_type);
+  out << " " << clazz << " {\n";
+  out << "public:\n";
+  out.Indent();
+  if (defined_type.IsFixedSize()) {
+    out << "typedef std::true_type fixed_size;\n";
+  } else {
+    out << "typedef std::false_type fixed_size;\n";
+  }
+  out << "static const char* descriptor;\n";
+  out << "\n";
+  GenerateNestedTypeDecls(out, types, defined_type, options);
+  for (const auto& variable : defined_type.GetFields()) {
+    const auto& type = variable->GetType();
+    std::string cpp_type = NdkNameOf(types, type, StorageMode::STACK);
+    out << cpp_type;
+    cpp::GenerateDeprecated(out, *variable);
+    out << " " << variable->GetName();
+    if (defined_type.IsFixedSize()) {
+      int alignment = cpp::AlignmentOf(type, types);
+      if (alignment > 0) {
+        out << " __attribute__((aligned (" << std::to_string(alignment) << ")))";
+      }
+    }
+    if (variable->GetDefaultValue()) {
+      out << " = " << variable->ValueString(ConstantValueDecorator);
+    } else {
+      // Some types needs to be explicitly initialized even when no default value is set.
+      // - ParcelableHolder should be initialized with stability.
+      // - enum should be zero initialized, otherwise the value will be indeterminate
+      // - fixed-size arrays should be initialized, otherwise the value will be indeterminate
+      if (type.GetName() == "ParcelableHolder") {
+        if (defined_type.IsVintfStability()) {
+          out << "{::ndk::STABILITY_VINTF}";
+        } else {
+          out << "{::ndk::STABILITY_LOCAL}";
+        }
+      } else if (types.GetEnumDeclaration(type) && !type.IsArray()) {
+        out << " = " << cpp_type << "(0)";
+      } else if (type.IsFixedSizeArray() && !type.IsNullable()) {
+        out << " = {{}}";
+      }
+    }
+    out << ";\n";
+  }
+  out << "\n";
+  out << "binder_status_t readFromParcel(const AParcel* parcel);\n";
+  out << "binder_status_t writeToParcel(AParcel* parcel) const;\n";
+  out << "\n";
+
+  cpp::GenerateParcelableComparisonOperators(out, defined_type);
+
+  out << "static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::"
+      << (defined_type.IsVintfStability() ? "STABILITY_VINTF" : "STABILITY_LOCAL") << ";\n";
+
+  GenerateConstantDeclarations(out, types, defined_type);
+  cpp::GenerateToString(out, defined_type);
+
+  out.Dedent();
+  out << "};\n";
+}
+
+void GenerateParcelSource(CodeWriter& out, const AidlTypenames& types,
+                          const AidlStructuredParcelable& defined_type, const Options& options) {
+  std::string clazz = GetQualifiedName(defined_type);
+  if (defined_type.IsGeneric()) {
+    std::vector<std::string> template_params;
+    for (const auto& parameter : defined_type.GetTypeParameters()) {
+      template_params.push_back(parameter);
+    }
+    clazz += base::StringPrintf("<%s>", base::Join(template_params, ", ").c_str());
+  }
+
+  GenerateSourceIncludes(out, types, defined_type, options);
+  EnterNdkNamespace(out, defined_type);
+  out << cpp::TemplateDecl(defined_type);
+  out << "const char* " << clazz << "::" << kDescriptor << " = \""
+      << defined_type.GetCanonicalName() << "\";\n";
+  out << "\n";
+
+  GenerateConstantDefinitions(out, defined_type, clazz, cpp::TemplateDecl(defined_type));
+
+  {
+    cpp::ClangDiagnosticIgnoreDeprecated guard(out, cpp::HasDeprecatedField(defined_type));
+    out << cpp::TemplateDecl(defined_type);
+    out << "binder_status_t " << clazz << "::readFromParcel(const AParcel* _aidl_parcel) {\n";
+    out.Indent();
+    out << "binder_status_t _aidl_ret_status = STATUS_OK;\n";
+    out << "int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);\n";
+    out << "int32_t _aidl_parcelable_size = 0;\n";
+    out << "_aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);\n";
+    StatusCheckReturn(out);
+    out << "if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;\n";
+    out << "if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;\n";
+    for (const auto& variable : defined_type.GetFields()) {
+      if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::READ)) {
+        out << "if (false) {\n";
+        out.Indent();
+      }
+
+      out << "if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= "
+             "_aidl_parcelable_size) "
+             "{\n"
+          << "  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);\n"
+          << "  return _aidl_ret_status;\n"
+          << "}\n";
+      out << "_aidl_ret_status = ";
+      ReadFromParcelFor(
+          {out, types, variable->GetType(), "_aidl_parcel", "&" + variable->GetName()});
+      out << ";\n";
+      StatusCheckReturn(out);
+      if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::READ)) {
+        out.Dedent();
+        out << "}\n";
+      }
+    }
+    out << "AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);\n"
+        << "return _aidl_ret_status;\n";
+    out.Dedent();
+    out << "}\n";
+
+    out << cpp::TemplateDecl(defined_type);
+    out << "binder_status_t " << clazz << "::writeToParcel(AParcel* _aidl_parcel) const {\n";
+    out.Indent();
+    out << "binder_status_t _aidl_ret_status;\n";
+
+    out << "size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);\n";
+    out << "_aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);\n";
+    StatusCheckReturn(out);
+
+    for (const auto& variable : defined_type.GetFields()) {
+      if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE)) {
+        out << "if (false) {\n";
+        out.Indent();
+      }
+      out << "_aidl_ret_status = ";
+      WriteToParcelFor({out, types, variable->GetType(), "_aidl_parcel", variable->GetName()});
+      out << ";\n";
+      StatusCheckReturn(out);
+      if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE)) {
+        out.Dedent();
+        out << "}\n";
+      }
+    }
+    out << "size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);\n";
+    out << "AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);\n";
+    out << "AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);\n";
+    out << "AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);\n";
+
+    out << "return _aidl_ret_status;\n";
+    out.Dedent();
+    out << "}\n";
+  }
+  out << "\n";
+  LeaveNdkNamespace(out, defined_type);
+}
+
+void GenerateParcelClassDecl(CodeWriter& out, const AidlTypenames& types,
+                             const AidlUnionDecl& defined_type, const Options& options) {
+  const std::string clazz = ClassName(defined_type, ClassNames::RAW);
+
+  cpp::ClangDiagnosticIgnoreDeprecated guard(out, cpp::HasDeprecatedField(defined_type));
+  cpp::UnionWriter uw{defined_type, types,
+                      [&](const AidlTypeSpecifier& type, const AidlTypenames& types) {
+                        return NdkNameOf(types, type, StorageMode::STACK);
+                      },
+                      &ConstantValueDecorator};
+
+  out << cpp::TemplateDecl(defined_type);
+  out << "class";
+  cpp::GenerateDeprecated(out, defined_type);
+  out << " " << clazz << " {\n";
+  out << "public:\n";
+  out.Indent();
+  if (defined_type.IsFixedSize()) {
+    out << "typedef std::true_type fixed_size;\n";
+  } else {
+    out << "typedef std::false_type fixed_size;\n";
+  }
+  out << "static const char* descriptor;\n";
+  out << "\n";
+  GenerateNestedTypeDecls(out, types, defined_type, options);
+  uw.PublicFields(out);
+
+  out << "binder_status_t readFromParcel(const AParcel* _parcel);\n";
+  out << "binder_status_t writeToParcel(AParcel* _parcel) const;\n";
+  out << "\n";
+
+  cpp::GenerateParcelableComparisonOperators(out, defined_type);
+
+  out << "static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::"
+      << (defined_type.IsVintfStability() ? "STABILITY_VINTF" : "STABILITY_LOCAL") << ";\n";
+  GenerateConstantDeclarations(out, types, defined_type);
+  cpp::GenerateToString(out, defined_type);
+  out.Dedent();
+  out << "private:\n";
+  out.Indent();
+  uw.PrivateFields(out);
+  out.Dedent();
+  out << "};\n";
+}
+
+void GenerateParcelSource(CodeWriter& out, const AidlTypenames& types,
+                          const AidlUnionDecl& defined_type, const Options& options) {
+  std::string clazz = GetQualifiedName(defined_type);
+  if (defined_type.IsGeneric()) {
+    std::vector<std::string> template_params;
+    for (const auto& parameter : defined_type.GetTypeParameters()) {
+      template_params.push_back(parameter);
+    }
+    clazz += base::StringPrintf("<%s>", base::Join(template_params, ", ").c_str());
+  }
+
+  cpp::UnionWriter uw{defined_type, types,
+                      [&](const AidlTypeSpecifier& type, const AidlTypenames& types) {
+                        return NdkNameOf(types, type, StorageMode::STACK);
+                      },
+                      &ConstantValueDecorator};
+  cpp::ParcelWriterContext ctx{
+      .status_type = "binder_status_t",
+      .status_ok = "STATUS_OK",
+      .status_bad = "STATUS_BAD_VALUE",
+      .read_func =
+          [&](CodeWriter& out, const std::string& var, const AidlTypeSpecifier& type) {
+            ReadFromParcelFor({out, types, type, "_parcel", "&" + var});
+          },
+      .write_func =
+          [&](CodeWriter& out, const std::string& value, const AidlTypeSpecifier& type) {
+            WriteToParcelFor({out, types, type, "_parcel", value});
+          },
+  };
+
+  GenerateSourceIncludes(out, types, defined_type, options);
+  EnterNdkNamespace(out, defined_type);
+  out << cpp::TemplateDecl(defined_type);
+  out << "const char* " << clazz << "::" << kDescriptor << " = \""
+      << defined_type.GetCanonicalName() << "\";\n";
+  out << "\n";
+
+  GenerateConstantDefinitions(out, defined_type, clazz, cpp::TemplateDecl(defined_type));
+
+  {
+    cpp::ClangDiagnosticIgnoreDeprecated guard(out, cpp::HasDeprecatedField(defined_type));
+    out << cpp::TemplateDecl(defined_type);
+    out << "binder_status_t " << clazz << "::readFromParcel(const AParcel* _parcel) {\n";
+    out.Indent();
+    uw.ReadFromParcel(out, ctx);
+    out.Dedent();
+    out << "}\n";
+
+    out << cpp::TemplateDecl(defined_type);
+    out << "binder_status_t " << clazz << "::writeToParcel(AParcel* _parcel) const {\n";
+    out.Indent();
+    uw.WriteToParcel(out, ctx);
+    out.Dedent();
+    out << "}\n";
+  }
+
+  out << "\n";
+  LeaveNdkNamespace(out, defined_type);
+}
+
+void GenerateEnumClassDecl(CodeWriter& out, const AidlTypenames& types,
+                           const AidlEnumDeclaration& enum_decl, const Options&) {
+  cpp::GenerateEnumClassDecl(out, enum_decl,
+                             NdkNameOf(types, enum_decl.GetBackingType(), StorageMode::STACK),
+                             ConstantValueDecorator);
+  out << "\n";
+}
+
+}  // namespace internals
+}  // namespace ndk
+}  // namespace aidl
+}  // namespace android
diff --git a/generate_ndk.h b/generate_ndk.h
new file mode 100644
index 0000000..d9bc910
--- /dev/null
+++ b/generate_ndk.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+
+#include "aidl_language.h"
+#include "options.h"
+
+namespace android {
+namespace aidl {
+namespace ndk {
+
+void GenerateNdk(const string& output_file, const Options& options, const AidlTypenames& types,
+                 const AidlDefinedType& defined_type, const IoDelegate& io_delegate);
+
+}  // namespace ndk
+}  // namespace aidl
+}  // namespace android
diff --git a/generate_rust.cpp b/generate_rust.cpp
new file mode 100644
index 0000000..815da71
--- /dev/null
+++ b/generate_rust.cpp
@@ -0,0 +1,1333 @@
+/*
+ * Copyright (C) 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "generate_rust.h"
+
+#include <android-base/stringprintf.h>
+#include <android-base/strings.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <map>
+#include <memory>
+#include <sstream>
+
+#include "aidl_to_common.h"
+#include "aidl_to_cpp_common.h"
+#include "aidl_to_rust.h"
+#include "code_writer.h"
+#include "comments.h"
+#include "logging.h"
+
+using android::base::Join;
+using android::base::Split;
+using std::ostringstream;
+using std::shared_ptr;
+using std::string;
+using std::unique_ptr;
+using std::vector;
+
+namespace android {
+namespace aidl {
+namespace rust {
+
+static constexpr const char kArgumentPrefix[] = "_arg_";
+static constexpr const char kGetInterfaceVersion[] = "getInterfaceVersion";
+static constexpr const char kGetInterfaceHash[] = "getInterfaceHash";
+
+struct MangledAliasVisitor : AidlVisitor {
+  CodeWriter& out;
+  MangledAliasVisitor(CodeWriter& out) : out(out) {}
+  void Visit(const AidlStructuredParcelable& type) override { VisitType(type); }
+  void Visit(const AidlInterface& type) override { VisitType(type); }
+  void Visit(const AidlEnumDeclaration& type) override { VisitType(type); }
+  void Visit(const AidlUnionDecl& type) override { VisitType(type); }
+  template <typename T>
+  void VisitType(const T& type) {
+    out << " pub use " << Qname(type) << " as " << Mangled(type) << ";\n";
+  }
+  // Return a mangled name for a type (including AIDL package)
+  template <typename T>
+  string Mangled(const T& type) const {
+    ostringstream alias;
+    for (const auto& component : Split(type.GetCanonicalName(), ".")) {
+      alias << "_" << component.size() << "_" << component;
+    }
+    return alias.str();
+  }
+  template <typename T>
+  string Typename(const T& type) const {
+    if constexpr (std::is_same_v<T, AidlInterface>) {
+      return ClassName(type, cpp::ClassNames::INTERFACE);
+    } else {
+      return type.GetName();
+    }
+  }
+  // Return a fully qualified name for a type in the current file (excluding AIDL package)
+  template <typename T>
+  string Qname(const T& type) const {
+    return Module(type) + "::r#" + Typename(type);
+  }
+  // Return a module name for a type (relative to the file)
+  template <typename T>
+  string Module(const T& type) const {
+    if (type.GetParentType()) {
+      return Module(*type.GetParentType()) + "::r#" + type.GetName();
+    } else {
+      return "super";
+    }
+  }
+};
+
+void GenerateMangledAliases(CodeWriter& out, const AidlDefinedType& type) {
+  MangledAliasVisitor v(out);
+  out << "pub(crate) mod mangled {\n";
+  VisitTopDown(v, type);
+  out << "}\n";
+}
+
+string BuildArg(const AidlArgument& arg, const AidlTypenames& typenames, Lifetime lifetime) {
+  // We pass in parameters that are not primitives by const reference.
+  // Arrays get passed in as slices, which is handled in RustNameOf.
+  auto arg_mode = ArgumentStorageMode(arg, typenames);
+  auto arg_type = RustNameOf(arg.GetType(), typenames, arg_mode, lifetime);
+  return kArgumentPrefix + arg.GetName() + ": " + arg_type;
+}
+
+enum class MethodKind {
+  // This is a normal non-async method.
+  NORMAL,
+  // This is an async method. Identical to NORMAL except that async is added
+  // in front of `fn`.
+  ASYNC,
+  // This is an async function, but using a boxed future instead of the async
+  // keyword.
+  BOXED_FUTURE,
+  // This could have been a non-async method, but it returns a Future so that
+  // it would not be breaking to make the function do async stuff in the future.
+  READY_FUTURE,
+};
+
+string BuildMethod(const AidlMethod& method, const AidlTypenames& typenames,
+                   const MethodKind kind = MethodKind::NORMAL) {
+  // We need to mark the arguments with a lifetime only when returning a future that
+  // actually captures the arguments.
+  Lifetime lifetime;
+  switch (kind) {
+    case MethodKind::NORMAL:
+    case MethodKind::ASYNC:
+    case MethodKind::READY_FUTURE:
+      lifetime = Lifetime::NONE;
+      break;
+    case MethodKind::BOXED_FUTURE:
+      lifetime = Lifetime::A;
+      break;
+  }
+
+  auto method_type = RustNameOf(method.GetType(), typenames, StorageMode::VALUE, lifetime);
+  auto return_type = string{"binder::Result<"} + method_type + ">";
+  auto fn_prefix = string{""};
+
+  switch (kind) {
+    case MethodKind::NORMAL:
+      // Don't wrap the return type in anything.
+      break;
+    case MethodKind::ASYNC:
+      fn_prefix = "async ";
+      break;
+    case MethodKind::BOXED_FUTURE:
+      return_type = "binder::BoxFuture<'a, " + return_type + ">";
+      break;
+    case MethodKind::READY_FUTURE:
+      return_type = "std::future::Ready<" + return_type + ">";
+      break;
+  }
+
+  string parameters = "&" + RustLifetimeName(lifetime) + "self";
+  string lifetime_str = RustLifetimeGeneric(lifetime);
+
+  for (const std::unique_ptr<AidlArgument>& arg : method.GetArguments()) {
+    parameters += ", ";
+    parameters += BuildArg(*arg, typenames, lifetime);
+  }
+
+  return fn_prefix + "fn r#" + method.GetName() + lifetime_str + "(" + parameters + ") -> " +
+         return_type;
+}
+
+void GenerateClientMethodHelpers(CodeWriter& out, const AidlInterface& iface,
+                                 const AidlMethod& method, const AidlTypenames& typenames,
+                                 const Options& options, const std::string& default_trait_name) {
+  string parameters = "&self";
+  for (const std::unique_ptr<AidlArgument>& arg : method.GetArguments()) {
+    parameters += ", ";
+    parameters += BuildArg(*arg, typenames, Lifetime::NONE);
+  }
+
+  // Generate build_parcel helper.
+  out << "fn build_parcel_" + method.GetName() + "(" + parameters +
+             ") -> binder::Result<binder::binder_impl::Parcel> {\n";
+  out.Indent();
+
+  out << "let mut aidl_data = self.binder.prepare_transact()?;\n";
+
+  if (iface.IsSensitiveData()) {
+    out << "aidl_data.mark_sensitive();\n";
+  }
+
+  // Arguments
+  for (const std::unique_ptr<AidlArgument>& arg : method.GetArguments()) {
+    auto arg_name = kArgumentPrefix + arg->GetName();
+    if (arg->IsIn()) {
+      // If the argument is already a reference, don't reference it again
+      // (unless we turned it into an Option<&T>)
+      auto ref_mode = ArgumentReferenceMode(*arg, typenames);
+      if (IsReference(ref_mode)) {
+        out << "aidl_data.write(" << arg_name << ")?;\n";
+      } else {
+        out << "aidl_data.write(&" << arg_name << ")?;\n";
+      }
+    } else if (arg->GetType().IsDynamicArray()) {
+      // For out-only arrays, send the array size
+      if (arg->GetType().IsNullable()) {
+        out << "aidl_data.write_slice_size(" << arg_name << ".as_deref())?;\n";
+      } else {
+        out << "aidl_data.write_slice_size(Some(" << arg_name << "))?;\n";
+      }
+    }
+  }
+
+  out << "Ok(aidl_data)\n";
+  out.Dedent();
+  out << "}\n";
+
+  // Generate read_response helper.
+  auto return_type = RustNameOf(method.GetType(), typenames, StorageMode::VALUE, Lifetime::NONE);
+  out << "fn read_response_" + method.GetName() + "(" + parameters +
+             ", _aidl_reply: std::result::Result<binder::binder_impl::Parcel, "
+             "binder::StatusCode>) -> binder::Result<" +
+             return_type + "> {\n";
+  out.Indent();
+
+  // Check for UNKNOWN_TRANSACTION and call the default impl
+  if (method.IsUserDefined()) {
+    string default_args;
+    for (const std::unique_ptr<AidlArgument>& arg : method.GetArguments()) {
+      if (!default_args.empty()) {
+        default_args += ", ";
+      }
+      default_args += kArgumentPrefix;
+      default_args += arg->GetName();
+    }
+    out << "if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {\n";
+    out << "  if let Some(_aidl_default_impl) = <Self as " << default_trait_name
+        << ">::getDefaultImpl() {\n";
+    out << "    return _aidl_default_impl.r#" << method.GetName() << "(" << default_args << ");\n";
+    out << "  }\n";
+    out << "}\n";
+  }
+
+  // Return all other errors
+  out << "let _aidl_reply = _aidl_reply?;\n";
+
+  string return_val = "()";
+  if (!method.IsOneway()) {
+    // Check for errors
+    out << "let _aidl_status: binder::Status = _aidl_reply.read()?;\n";
+    out << "if !_aidl_status.is_ok() { return Err(_aidl_status); }\n";
+
+    // Return reply value
+    if (method.GetType().GetName() != "void") {
+      auto return_type =
+          RustNameOf(method.GetType(), typenames, StorageMode::VALUE, Lifetime::NONE);
+      out << "let _aidl_return: " << return_type << " = _aidl_reply.read()?;\n";
+      return_val = "_aidl_return";
+
+      if (!method.IsUserDefined()) {
+        if (method.GetName() == kGetInterfaceVersion && options.Version() > 0) {
+          out << "self.cached_version.store(_aidl_return, std::sync::atomic::Ordering::Relaxed);\n";
+        }
+        if (method.GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+          out << "*self.cached_hash.lock().unwrap() = Some(_aidl_return.clone());\n";
+        }
+      }
+    }
+
+    for (const AidlArgument* arg : method.GetOutArguments()) {
+      out << "_aidl_reply.read_onto(" << kArgumentPrefix << arg->GetName() << ")?;\n";
+    }
+  }
+
+  // Return the result
+  out << "Ok(" << return_val << ")\n";
+
+  out.Dedent();
+  out << "}\n";
+}
+
+void GenerateClientMethod(CodeWriter& out, const AidlInterface& iface, const AidlMethod& method,
+                          const AidlTypenames& typenames, const Options& options,
+                          const MethodKind kind) {
+  // Generate the method
+  out << BuildMethod(method, typenames, kind) << " {\n";
+  out.Indent();
+
+  if (!method.IsUserDefined()) {
+    if (method.GetName() == kGetInterfaceVersion && options.Version() > 0) {
+      // Check if the version is in the cache
+      out << "let _aidl_version = "
+             "self.cached_version.load(std::sync::atomic::Ordering::Relaxed);\n";
+      switch (kind) {
+        case MethodKind::NORMAL:
+        case MethodKind::ASYNC:
+          out << "if _aidl_version != -1 { return Ok(_aidl_version); }\n";
+          break;
+        case MethodKind::BOXED_FUTURE:
+          out << "if _aidl_version != -1 { return Box::pin(std::future::ready(Ok(_aidl_version))); "
+                 "}\n";
+          break;
+        case MethodKind::READY_FUTURE:
+          out << "if _aidl_version != -1 { return std::future::ready(Ok(_aidl_version)); }\n";
+          break;
+      }
+    }
+
+    if (method.GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+      out << "{\n";
+      out << "  let _aidl_hash_lock = self.cached_hash.lock().unwrap();\n";
+      out << "  if let Some(ref _aidl_hash) = *_aidl_hash_lock {\n";
+      switch (kind) {
+        case MethodKind::NORMAL:
+        case MethodKind::ASYNC:
+          out << "    return Ok(_aidl_hash.clone());\n";
+          break;
+        case MethodKind::BOXED_FUTURE:
+          out << "    return Box::pin(std::future::ready(Ok(_aidl_hash.clone())));\n";
+          break;
+        case MethodKind::READY_FUTURE:
+          out << "    return std::future::ready(Ok(_aidl_hash.clone()));\n";
+          break;
+      }
+      out << "  }\n";
+      out << "}\n";
+    }
+  }
+
+  string build_parcel_args;
+  for (const std::unique_ptr<AidlArgument>& arg : method.GetArguments()) {
+    if (!build_parcel_args.empty()) {
+      build_parcel_args += ", ";
+    }
+    build_parcel_args += kArgumentPrefix;
+    build_parcel_args += arg->GetName();
+  }
+
+  string read_response_args =
+      build_parcel_args.empty() ? "_aidl_reply" : build_parcel_args + ", _aidl_reply";
+
+  vector<string> flags;
+  if (method.IsOneway()) flags.push_back("binder::binder_impl::FLAG_ONEWAY");
+  if (iface.IsSensitiveData()) flags.push_back("binder::binder_impl::FLAG_CLEAR_BUF");
+  flags.push_back("binder::binder_impl::FLAG_PRIVATE_LOCAL");
+
+  string transact_flags = flags.empty() ? "0" : Join(flags, " | ");
+
+  switch (kind) {
+    case MethodKind::NORMAL:
+    case MethodKind::ASYNC:
+      if (method.IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE) &&
+          method.IsUserDefined()) {
+        out << "if (true) {\n";
+        out << " return Err(binder::Status::from(binder::StatusCode::UNKNOWN_TRANSACTION));\n";
+        out << "} else {\n";
+        out.Indent();
+      }
+      // Prepare transaction.
+      out << "let _aidl_data = self.build_parcel_" + method.GetName() + "(" + build_parcel_args +
+                 ")?;\n";
+      // Submit transaction.
+      out << "let _aidl_reply = self.binder.submit_transact(transactions::r#" << method.GetName()
+          << ", _aidl_data, " << transact_flags << ");\n";
+      // Deserialize response.
+      out << "self.read_response_" + method.GetName() + "(" + read_response_args + ")\n";
+      break;
+    case MethodKind::READY_FUTURE:
+      if (method.IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE) &&
+          method.IsUserDefined()) {
+        out << "if (true) {\n";
+        out << " return "
+               "std::future::ready(Err(binder::Status::from(binder::StatusCode::UNKNOWN_"
+               "TRANSACTION)));\n";
+        out << "} else {\n";
+        out.Indent();
+      }
+      // Prepare transaction.
+      out << "let _aidl_data = match self.build_parcel_" + method.GetName() + "(" +
+                 build_parcel_args + ") {\n";
+      out.Indent();
+      out << "Ok(_aidl_data) => _aidl_data,\n";
+      out << "Err(err) => return std::future::ready(Err(err)),\n";
+      out.Dedent();
+      out << "};\n";
+      // Submit transaction.
+      out << "let _aidl_reply = self.binder.submit_transact(transactions::r#" << method.GetName()
+          << ", _aidl_data, " << transact_flags << ");\n";
+      // Deserialize response.
+      out << "std::future::ready(self.read_response_" + method.GetName() + "(" +
+                 read_response_args + "))\n";
+      break;
+    case MethodKind::BOXED_FUTURE:
+      if (method.IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE) &&
+          method.IsUserDefined()) {
+        out << "if (true) {\n";
+        out << " return "
+               "Box::pin(std::future::ready(Err(binder::Status::from(binder::StatusCode::UNKNOWN_"
+               "TRANSACTION))));\n";
+        out << "} else {\n";
+        out.Indent();
+      }
+      // Prepare transaction.
+      out << "let _aidl_data = match self.build_parcel_" + method.GetName() + "(" +
+                 build_parcel_args + ") {\n";
+      out.Indent();
+      out << "Ok(_aidl_data) => _aidl_data,\n";
+      out << "Err(err) => return Box::pin(std::future::ready(Err(err))),\n";
+      out.Dedent();
+      out << "};\n";
+      // Submit transaction.
+      out << "let binder = self.binder.clone();\n";
+      out << "P::spawn(\n";
+      out.Indent();
+      out << "move || binder.submit_transact(transactions::r#" << method.GetName()
+          << ", _aidl_data, " << transact_flags << "),\n";
+      out << "move |_aidl_reply| async move {\n";
+      out.Indent();
+      // Deserialize response.
+      out << "self.read_response_" + method.GetName() + "(" + read_response_args + ")\n";
+      out.Dedent();
+      out << "}\n";
+      out.Dedent();
+      out << ")\n";
+      break;
+  }
+
+  if (method.IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE) &&
+      method.IsUserDefined()) {
+    out.Dedent();
+    out << "}\n";
+  }
+  out.Dedent();
+  out << "}\n";
+}
+
+void GenerateServerTransaction(CodeWriter& out, const AidlInterface& interface,
+                               const AidlMethod& method, const AidlTypenames& typenames) {
+  out << "transactions::r#" << method.GetName() << " => {\n";
+  out.Indent();
+  if (method.IsUserDefined() && method.IsNew() &&
+      ShouldForceDowngradeFor(CommunicationSide::READ)) {
+    out << "if (true) {\n";
+    out << "  Err(binder::StatusCode::UNKNOWN_TRANSACTION)\n";
+    out << "} else {\n";
+    out.Indent();
+  }
+
+  if (interface.EnforceExpression() || method.GetType().EnforceExpression()) {
+    out << "compile_error!(\"Permission checks not support for the Rust backend\");\n";
+  }
+
+  string args;
+  for (const auto& arg : method.GetArguments()) {
+    string arg_name = kArgumentPrefix + arg->GetName();
+    StorageMode arg_mode;
+    if (arg->IsIn()) {
+      arg_mode = StorageMode::VALUE;
+    } else {
+      // We need a value we can call Default::default() on
+      arg_mode = StorageMode::DEFAULT_VALUE;
+    }
+    auto arg_type = RustNameOf(arg->GetType(), typenames, arg_mode, Lifetime::NONE);
+
+    string arg_mut = arg->IsOut() ? "mut " : "";
+    string arg_init = arg->IsIn() ? "_aidl_data.read()?" : "Default::default()";
+    out << "let " << arg_mut << arg_name << ": " << arg_type << " = " << arg_init << ";\n";
+    if (!arg->IsIn() && arg->GetType().IsDynamicArray()) {
+      // _aidl_data.resize_[nullable_]out_vec(&mut _arg_foo)?;
+      auto resize_name = arg->GetType().IsNullable() ? "resize_nullable_out_vec" : "resize_out_vec";
+      out << "_aidl_data." << resize_name << "(&mut " << arg_name << ")?;\n";
+    }
+
+    auto ref_mode = ArgumentReferenceMode(*arg, typenames);
+    if (!args.empty()) {
+      args += ", ";
+    }
+    args += TakeReference(ref_mode, arg_name);
+  }
+  out << "let _aidl_return = _aidl_service.r#" << method.GetName() << "(" << args << ");\n";
+
+  if (!method.IsOneway()) {
+    out << "match &_aidl_return {\n";
+    out.Indent();
+    out << "Ok(_aidl_return) => {\n";
+    out.Indent();
+    out << "_aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;\n";
+    if (method.GetType().GetName() != "void") {
+      out << "_aidl_reply.write(_aidl_return)?;\n";
+    }
+
+    // Serialize out arguments
+    for (const AidlArgument* arg : method.GetOutArguments()) {
+      string arg_name = kArgumentPrefix + arg->GetName();
+
+      auto& arg_type = arg->GetType();
+      if (!arg->IsIn() && arg_type.IsArray() && arg_type.GetName() == "ParcelFileDescriptor") {
+        // We represent arrays of ParcelFileDescriptor as
+        // Vec<Option<ParcelFileDescriptor>> when they're out-arguments,
+        // but we need all of them to be initialized to Some; if there's
+        // any None, return UNEXPECTED_NULL (this is what libbinder_ndk does)
+        out << "if " << arg_name << ".iter().any(Option::is_none) { "
+            << "return Err(binder::StatusCode::UNEXPECTED_NULL); }\n";
+      } else if (!arg->IsIn() && TypeNeedsOption(arg_type, typenames)) {
+        // Unwrap out-only arguments that we wrapped in Option<T>
+        out << "let " << arg_name << " = " << arg_name
+            << ".ok_or(binder::StatusCode::UNEXPECTED_NULL)?;\n";
+      }
+
+      out << "_aidl_reply.write(&" << arg_name << ")?;\n";
+    }
+    out.Dedent();
+    out << "}\n";
+    out << "Err(_aidl_status) => _aidl_reply.write(_aidl_status)?\n";
+    out.Dedent();
+    out << "}\n";
+  }
+  out << "Ok(())\n";
+  if (method.IsUserDefined() && method.IsNew() &&
+      ShouldForceDowngradeFor(CommunicationSide::READ)) {
+    out.Dedent();
+    out << "}\n";
+  }
+  out.Dedent();
+  out << "}\n";
+}
+
+void GenerateServerItems(CodeWriter& out, const AidlInterface* iface,
+                         const AidlTypenames& typenames) {
+  auto trait_name = ClassName(*iface, cpp::ClassNames::INTERFACE);
+  auto server_name = ClassName(*iface, cpp::ClassNames::SERVER);
+
+  // Forward all IFoo functions from Binder to the inner object
+  out << "impl " << trait_name << " for binder::binder_impl::Binder<" << server_name << "> {\n";
+  out.Indent();
+  for (const auto& method : iface->GetMethods()) {
+    string args;
+    for (const std::unique_ptr<AidlArgument>& arg : method->GetArguments()) {
+      if (!args.empty()) {
+        args += ", ";
+      }
+      args += kArgumentPrefix;
+      args += arg->GetName();
+    }
+    out << BuildMethod(*method, typenames) << " { "
+        << "self.0.r#" << method->GetName() << "(" << args << ") }\n";
+  }
+  out.Dedent();
+  out << "}\n";
+
+  out << "fn on_transact("
+         "_aidl_service: &dyn "
+      << trait_name
+      << ", "
+         "_aidl_code: binder::binder_impl::TransactionCode, "
+         "_aidl_data: &binder::binder_impl::BorrowedParcel<'_>, "
+         "_aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), "
+         "binder::StatusCode> "
+         "{\n";
+  out.Indent();
+  out << "match _aidl_code {\n";
+  out.Indent();
+  for (const auto& method : iface->GetMethods()) {
+    GenerateServerTransaction(out, *iface, *method, typenames);
+  }
+  out << "_ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)\n";
+  out.Dedent();
+  out << "}\n";
+  out.Dedent();
+  out << "}\n";
+}
+
+void GenerateDeprecated(CodeWriter& out, const AidlCommentable& type) {
+  if (auto deprecated = FindDeprecated(type.GetComments()); deprecated.has_value()) {
+    if (deprecated->note.empty()) {
+      out << "#[deprecated]\n";
+    } else {
+      out << "#[deprecated = " << QuotedEscape(deprecated->note) << "]\n";
+    }
+  }
+}
+
+template <typename TypeWithConstants>
+void GenerateConstantDeclarations(CodeWriter& out, const TypeWithConstants& type,
+                                  const AidlTypenames& typenames) {
+  for (const auto& constant : type.GetConstantDeclarations()) {
+    const AidlTypeSpecifier& type = constant->GetType();
+    const AidlConstantValue& value = constant->GetValue();
+
+    string const_type;
+    if (type.Signature() == "String") {
+      const_type = "&str";
+    } else if (type.Signature() == "byte" || type.Signature() == "int" ||
+               type.Signature() == "long" || type.Signature() == "float" ||
+               type.Signature() == "double") {
+      const_type = RustNameOf(type, typenames, StorageMode::VALUE, Lifetime::NONE);
+    } else {
+      AIDL_FATAL(value) << "Unrecognized constant type: " << type.Signature();
+    }
+
+    GenerateDeprecated(out, *constant);
+    out << "pub const r#" << constant->GetName() << ": " << const_type << " = "
+        << constant->ValueString(ConstantValueDecoratorRef) << ";\n";
+  }
+}
+
+void GenerateRustInterface(CodeWriter* code_writer, const AidlInterface* iface,
+                           const AidlTypenames& typenames, const Options& options) {
+  *code_writer << "#![allow(non_upper_case_globals)]\n";
+  *code_writer << "#![allow(non_snake_case)]\n";
+  // Import IBinderInternal for transact()
+  *code_writer << "#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;\n";
+
+  auto trait_name = ClassName(*iface, cpp::ClassNames::INTERFACE);
+  auto trait_name_async = trait_name + "Async";
+  auto trait_name_async_server = trait_name + "AsyncServer";
+  auto client_name = ClassName(*iface, cpp::ClassNames::CLIENT);
+  auto server_name = ClassName(*iface, cpp::ClassNames::SERVER);
+  *code_writer << "use binder::declare_binder_interface;\n";
+  *code_writer << "declare_binder_interface! {\n";
+  code_writer->Indent();
+  *code_writer << trait_name << "[\"" << iface->GetDescriptor() << "\"] {\n";
+  code_writer->Indent();
+  *code_writer << "native: " << server_name << "(on_transact),\n";
+  *code_writer << "proxy: " << client_name << " {\n";
+  code_writer->Indent();
+  if (options.Version() > 0) {
+    string comma = options.Hash().empty() ? "" : ",";
+    *code_writer << "cached_version: "
+                    "std::sync::atomic::AtomicI32 = "
+                    "std::sync::atomic::AtomicI32::new(-1)"
+                 << comma << "\n";
+  }
+  if (!options.Hash().empty()) {
+    *code_writer << "cached_hash: "
+                    "std::sync::Mutex<Option<String>> = "
+                    "std::sync::Mutex::new(None)\n";
+  }
+  code_writer->Dedent();
+  *code_writer << "},\n";
+  *code_writer << "async: " << trait_name_async << ",\n";
+  if (iface->IsVintfStability()) {
+    *code_writer << "stability: binder::binder_impl::Stability::Vintf,\n";
+  }
+  code_writer->Dedent();
+  *code_writer << "}\n";
+  code_writer->Dedent();
+  *code_writer << "}\n";
+
+  // Emit the trait.
+  GenerateDeprecated(*code_writer, *iface);
+  *code_writer << "pub trait " << trait_name << ": binder::Interface + Send {\n";
+  code_writer->Indent();
+  *code_writer << "fn get_descriptor() -> &'static str where Self: Sized { \""
+               << iface->GetDescriptor() << "\" }\n";
+
+  for (const auto& method : iface->GetMethods()) {
+    // Generate the method
+    GenerateDeprecated(*code_writer, *method);
+    if (method->IsUserDefined()) {
+      *code_writer << BuildMethod(*method, typenames) << ";\n";
+    } else {
+      // Generate default implementations for meta methods
+      *code_writer << BuildMethod(*method, typenames) << " {\n";
+      code_writer->Indent();
+      if (method->GetName() == kGetInterfaceVersion && options.Version() > 0) {
+        *code_writer << "Ok(VERSION)\n";
+      } else if (method->GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+        *code_writer << "Ok(HASH.into())\n";
+      }
+      code_writer->Dedent();
+      *code_writer << "}\n";
+    }
+  }
+
+  // Emit the default implementation code inside the trait
+  auto default_trait_name = ClassName(*iface, cpp::ClassNames::DEFAULT_IMPL);
+  auto default_ref_name = default_trait_name + "Ref";
+  *code_writer << "fn getDefaultImpl()"
+               << " -> " << default_ref_name << " where Self: Sized {\n";
+  *code_writer << "  DEFAULT_IMPL.lock().unwrap().clone()\n";
+  *code_writer << "}\n";
+  *code_writer << "fn setDefaultImpl(d: " << default_ref_name << ")"
+               << " -> " << default_ref_name << " where Self: Sized {\n";
+  *code_writer << "  std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)\n";
+  *code_writer << "}\n";
+  code_writer->Dedent();
+  *code_writer << "}\n";
+
+  // Emit the async trait.
+  GenerateDeprecated(*code_writer, *iface);
+  *code_writer << "pub trait " << trait_name_async << "<P>: binder::Interface + Send {\n";
+  code_writer->Indent();
+  *code_writer << "fn get_descriptor() -> &'static str where Self: Sized { \""
+               << iface->GetDescriptor() << "\" }\n";
+
+  for (const auto& method : iface->GetMethods()) {
+    // Generate the method
+    GenerateDeprecated(*code_writer, *method);
+
+    MethodKind kind = method->IsOneway() ? MethodKind::READY_FUTURE : MethodKind::BOXED_FUTURE;
+
+    if (method->IsUserDefined()) {
+      *code_writer << BuildMethod(*method, typenames, kind) << ";\n";
+    } else {
+      // Generate default implementations for meta methods
+      *code_writer << BuildMethod(*method, typenames, kind) << " {\n";
+      code_writer->Indent();
+      if (method->GetName() == kGetInterfaceVersion && options.Version() > 0) {
+        *code_writer << "Box::pin(async move { Ok(VERSION) })\n";
+      } else if (method->GetName() == kGetInterfaceHash && !options.Hash().empty()) {
+        *code_writer << "Box::pin(async move { Ok(HASH.into()) })\n";
+      }
+      code_writer->Dedent();
+      *code_writer << "}\n";
+    }
+  }
+  code_writer->Dedent();
+  *code_writer << "}\n";
+
+  // Emit the async server trait.
+  GenerateDeprecated(*code_writer, *iface);
+  *code_writer << "#[::async_trait::async_trait]\n";
+  *code_writer << "pub trait " << trait_name_async_server << ": binder::Interface + Send {\n";
+  code_writer->Indent();
+  *code_writer << "fn get_descriptor() -> &'static str where Self: Sized { \""
+               << iface->GetDescriptor() << "\" }\n";
+
+  for (const auto& method : iface->GetMethods()) {
+    // Generate the method
+    if (method->IsUserDefined()) {
+      GenerateDeprecated(*code_writer, *method);
+      *code_writer << BuildMethod(*method, typenames, MethodKind::ASYNC) << ";\n";
+    }
+  }
+  code_writer->Dedent();
+  *code_writer << "}\n";
+
+  // Emit a new_async_binder method for binding an async server.
+  *code_writer << "impl " << server_name << " {\n";
+  code_writer->Indent();
+  *code_writer << "/// Create a new async binder service.\n";
+  *code_writer << "pub fn new_async_binder<T, R>(inner: T, rt: R, features: "
+                  "binder::BinderFeatures) -> binder::Strong<dyn "
+               << trait_name << ">\n";
+  *code_writer << "where\n";
+  code_writer->Indent();
+  *code_writer << "T: " << trait_name_async_server
+               << " + binder::Interface + Send + Sync + 'static,\n";
+  *code_writer << "R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,\n";
+  code_writer->Dedent();
+  *code_writer << "{\n";
+  code_writer->Indent();
+  // Define a wrapper struct that implements the non-async trait by calling block_on.
+  *code_writer << "struct Wrapper<T, R> {\n";
+  code_writer->Indent();
+  *code_writer << "_inner: T,\n";
+  *code_writer << "_rt: R,\n";
+  code_writer->Dedent();
+  *code_writer << "}\n";
+  *code_writer << "impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: "
+                  "Send + Sync {\n";
+  code_writer->Indent();
+  *code_writer << "fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }\n";
+  *code_writer
+      << "fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> "
+         "std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }\n";
+  code_writer->Dedent();
+  *code_writer << "}\n";
+  *code_writer << "impl<T, R> " << trait_name << " for Wrapper<T, R>\n";
+  *code_writer << "where\n";
+  code_writer->Indent();
+  *code_writer << "T: " << trait_name_async_server << " + Send + Sync + 'static,\n";
+  *code_writer << "R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,\n";
+  code_writer->Dedent();
+  *code_writer << "{\n";
+  code_writer->Indent();
+  for (const auto& method : iface->GetMethods()) {
+    // Generate the method
+    if (method->IsUserDefined()) {
+      string args = "";
+      for (const std::unique_ptr<AidlArgument>& arg : method->GetArguments()) {
+        if (!args.empty()) {
+          args += ", ";
+        }
+        args += kArgumentPrefix;
+        args += arg->GetName();
+      }
+
+      *code_writer << BuildMethod(*method, typenames) << " {\n";
+      code_writer->Indent();
+      *code_writer << "self._rt.block_on(self._inner.r#" << method->GetName() << "(" << args
+                   << "))\n";
+      code_writer->Dedent();
+      *code_writer << "}\n";
+    }
+  }
+  code_writer->Dedent();
+  *code_writer << "}\n";
+
+  *code_writer << "let wrapped = Wrapper { _inner: inner, _rt: rt };\n";
+  *code_writer << "Self::new_binder(wrapped, features)\n";
+
+  code_writer->Dedent();
+  *code_writer << "}\n";
+  code_writer->Dedent();
+  *code_writer << "}\n";
+
+  // Emit the default trait
+  *code_writer << "pub trait " << default_trait_name << ": Send + Sync {\n";
+  code_writer->Indent();
+  for (const auto& method : iface->GetMethods()) {
+    if (!method->IsUserDefined()) {
+      continue;
+    }
+
+    // Generate the default method
+    *code_writer << BuildMethod(*method, typenames) << " {\n";
+    code_writer->Indent();
+    *code_writer << "Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())\n";
+    code_writer->Dedent();
+    *code_writer << "}\n";
+  }
+  code_writer->Dedent();
+  *code_writer << "}\n";
+
+  // Generate the transaction code constants
+  // The constants get their own sub-module to avoid conflicts
+  *code_writer << "pub mod transactions {\n";
+  code_writer->Indent();
+  for (const auto& method : iface->GetMethods()) {
+    // Generate the transaction code constant
+    *code_writer << "pub const r#" << method->GetName()
+                 << ": binder::binder_impl::TransactionCode = "
+                    "binder::binder_impl::FIRST_CALL_TRANSACTION + " +
+                        std::to_string(method->GetId()) + ";\n";
+  }
+  code_writer->Dedent();
+  *code_writer << "}\n";
+
+  // Emit the default implementation code outside the trait
+  *code_writer << "pub type " << default_ref_name << " = Option<std::sync::Arc<dyn "
+               << default_trait_name << ">>;\n";
+  *code_writer << "use lazy_static::lazy_static;\n";
+  *code_writer << "lazy_static! {\n";
+  *code_writer << "  static ref DEFAULT_IMPL: std::sync::Mutex<" << default_ref_name
+               << "> = std::sync::Mutex::new(None);\n";
+  *code_writer << "}\n";
+
+  // Emit the interface constants
+  GenerateConstantDeclarations(*code_writer, *iface, typenames);
+
+  // Emit VERSION and HASH
+  // These need to be top-level item constants instead of associated consts
+  // because the latter are incompatible with trait objects, see
+  // https://doc.rust-lang.org/reference/items/traits.html#object-safety
+  if (options.Version() > 0) {
+    if (options.IsLatestUnfrozenVersion()) {
+      *code_writer << "pub const VERSION: i32 = if true {"
+                   << std::to_string(options.PreviousVersion()) << "} else {"
+                   << std::to_string(options.Version()) << "};\n";
+    } else {
+      *code_writer << "pub const VERSION: i32 = " << std::to_string(options.Version()) << ";\n";
+    }
+  }
+  if (!options.Hash().empty() || options.IsLatestUnfrozenVersion()) {
+    if (options.IsLatestUnfrozenVersion()) {
+      *code_writer << "pub const HASH: &str = if true {\"" << options.PreviousHash()
+                   << "\"} else {\"" << options.Hash() << "\"};\n";
+    } else {
+      *code_writer << "pub const HASH: &str = \"" << options.Hash() << "\";\n";
+    }
+  }
+
+  // Generate the client-side method helpers
+  //
+  // The methods in this block are not marked pub, so they are not accessible from outside the
+  // AIDL generated code.
+  *code_writer << "impl " << client_name << " {\n";
+  code_writer->Indent();
+  for (const auto& method : iface->GetMethods()) {
+    GenerateClientMethodHelpers(*code_writer, *iface, *method, typenames, options, trait_name);
+  }
+  code_writer->Dedent();
+  *code_writer << "}\n";
+
+  // Generate the client-side methods
+  *code_writer << "impl " << trait_name << " for " << client_name << " {\n";
+  code_writer->Indent();
+  for (const auto& method : iface->GetMethods()) {
+    GenerateClientMethod(*code_writer, *iface, *method, typenames, options, MethodKind::NORMAL);
+  }
+  code_writer->Dedent();
+  *code_writer << "}\n";
+
+  // Generate the async client-side methods
+  *code_writer << "impl<P: binder::BinderAsyncPool> " << trait_name_async << "<P> for "
+               << client_name << " {\n";
+  code_writer->Indent();
+  for (const auto& method : iface->GetMethods()) {
+    MethodKind kind = method->IsOneway() ? MethodKind::READY_FUTURE : MethodKind::BOXED_FUTURE;
+    GenerateClientMethod(*code_writer, *iface, *method, typenames, options, kind);
+  }
+  code_writer->Dedent();
+  *code_writer << "}\n";
+
+  // Generate the server-side methods
+  GenerateServerItems(*code_writer, iface, typenames);
+}
+
+void RemoveUsed(std::set<std::string>* params, const AidlTypeSpecifier& type) {
+  if (!type.IsResolved()) {
+    params->erase(type.GetName());
+  }
+  if (type.IsGeneric()) {
+    for (const auto& param : type.GetTypeParameters()) {
+      RemoveUsed(params, *param);
+    }
+  }
+}
+
+std::set<std::string> FreeParams(const AidlStructuredParcelable* parcel) {
+  if (!parcel->IsGeneric()) {
+    return std::set<std::string>();
+  }
+  auto typeParams = parcel->GetTypeParameters();
+  std::set<std::string> unusedParams(typeParams.begin(), typeParams.end());
+  for (const auto& variable : parcel->GetFields()) {
+    RemoveUsed(&unusedParams, variable->GetType());
+  }
+  return unusedParams;
+}
+
+void WriteParams(CodeWriter& out, const AidlParameterizable<std::string>* parcel,
+                 std::string extra) {
+  if (parcel->IsGeneric()) {
+    out << "<";
+    for (const auto& param : parcel->GetTypeParameters()) {
+      out << param << extra << ",";
+    }
+    out << ">";
+  }
+}
+
+void WriteParams(CodeWriter& out, const AidlParameterizable<std::string>* parcel) {
+  WriteParams(out, parcel, "");
+}
+
+void GenerateParcelBody(CodeWriter& out, const AidlStructuredParcelable* parcel,
+                        const AidlTypenames& typenames) {
+  GenerateDeprecated(out, *parcel);
+  out << "pub struct r#" << parcel->GetName();
+  WriteParams(out, parcel);
+  out << " {\n";
+  out.Indent();
+  for (const auto& variable : parcel->GetFields()) {
+    GenerateDeprecated(out, *variable);
+    auto field_type =
+        RustNameOf(variable->GetType(), typenames, StorageMode::PARCELABLE_FIELD, Lifetime::NONE);
+    out << "pub r#" << variable->GetName() << ": " << field_type << ",\n";
+  }
+  for (const auto& unused_param : FreeParams(parcel)) {
+    out << "_phantom_" << unused_param << ": std::marker::PhantomData<" << unused_param << ">,\n";
+  }
+  out.Dedent();
+  out << "}\n";
+}
+
+void GenerateParcelDefault(CodeWriter& out, const AidlStructuredParcelable* parcel) {
+  out << "impl";
+  WriteParams(out, parcel, ": Default");
+  out << " Default for r#" << parcel->GetName();
+  WriteParams(out, parcel);
+  out << " {\n";
+  out.Indent();
+  out << "fn default() -> Self {\n";
+  out.Indent();
+  out << "Self {\n";
+  out.Indent();
+  for (const auto& variable : parcel->GetFields()) {
+    out << "r#" << variable->GetName() << ": ";
+    if (variable->GetDefaultValue()) {
+      out << variable->ValueString(ConstantValueDecorator);
+    } else {
+      // Some types don't implement "Default".
+      // - ParcelableHolder
+      // - Arrays
+      if (variable->GetType().GetName() == "ParcelableHolder") {
+        out << "binder::ParcelableHolder::new(";
+        if (parcel->IsVintfStability()) {
+          out << "binder::binder_impl::Stability::Vintf";
+        } else {
+          out << "binder::binder_impl::Stability::Local";
+        }
+        out << ")";
+      } else if (variable->GetType().IsFixedSizeArray() && !variable->GetType().IsNullable()) {
+        out << ArrayDefaultValue(variable->GetType());
+      } else {
+        out << "Default::default()";
+      }
+    }
+    out << ",\n";
+  }
+  for (const auto& unused_param : FreeParams(parcel)) {
+    out << "r#_phantom_" << unused_param << ": Default::default(),\n";
+  }
+  out.Dedent();
+  out << "}\n";
+  out.Dedent();
+  out << "}\n";
+  out.Dedent();
+  out << "}\n";
+}
+
+void GenerateParcelSerializeBody(CodeWriter& out, const AidlStructuredParcelable* parcel,
+                                 const AidlTypenames& typenames) {
+  out << "parcel.sized_write(|subparcel| {\n";
+  out.Indent();
+  for (const auto& variable : parcel->GetFields()) {
+    if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE)) {
+      out << "if (false) {\n";
+      out.Indent();
+    }
+    if (TypeNeedsOption(variable->GetType(), typenames)) {
+      out << "let __field_ref = self.r#" << variable->GetName()
+          << ".as_ref().ok_or(binder::StatusCode::UNEXPECTED_NULL)?;\n";
+      out << "subparcel.write(__field_ref)?;\n";
+    } else {
+      out << "subparcel.write(&self.r#" << variable->GetName() << ")?;\n";
+    }
+    if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE)) {
+      out.Dedent();
+      out << "}\n";
+    }
+  }
+  out << "Ok(())\n";
+  out.Dedent();
+  out << "})\n";
+}
+
+void GenerateParcelDeserializeBody(CodeWriter& out, const AidlStructuredParcelable* parcel,
+                                   const AidlTypenames& typenames) {
+  out << "parcel.sized_read(|subparcel| {\n";
+  out.Indent();
+
+  for (const auto& variable : parcel->GetFields()) {
+    if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::READ)) {
+      out << "if (false) {\n";
+      out.Indent();
+    }
+    out << "if subparcel.has_more_data() {\n";
+    out.Indent();
+    if (TypeNeedsOption(variable->GetType(), typenames)) {
+      out << "self.r#" << variable->GetName() << " = Some(subparcel.read()?);\n";
+    } else {
+      out << "self.r#" << variable->GetName() << " = subparcel.read()?;\n";
+    }
+    out.Dedent();
+    if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::READ)) {
+      out.Dedent();
+      out << "}\n";
+    }
+    out << "}\n";
+  }
+  out << "Ok(())\n";
+  out.Dedent();
+  out << "})\n";
+}
+
+void GenerateParcelBody(CodeWriter& out, const AidlUnionDecl* parcel,
+                        const AidlTypenames& typenames) {
+  GenerateDeprecated(out, *parcel);
+  out << "pub enum r#" << parcel->GetName() << " {\n";
+  out.Indent();
+  for (const auto& variable : parcel->GetFields()) {
+    GenerateDeprecated(out, *variable);
+    auto field_type =
+        RustNameOf(variable->GetType(), typenames, StorageMode::PARCELABLE_FIELD, Lifetime::NONE);
+    out << variable->GetCapitalizedName() << "(" << field_type << "),\n";
+  }
+  out.Dedent();
+  out << "}\n";
+}
+
+void GenerateParcelDefault(CodeWriter& out, const AidlUnionDecl* parcel) {
+  out << "impl";
+  WriteParams(out, parcel, ": Default");
+  out << " Default for r#" << parcel->GetName();
+  WriteParams(out, parcel);
+  out << " {\n";
+  out.Indent();
+  out << "fn default() -> Self {\n";
+  out.Indent();
+
+  AIDL_FATAL_IF(parcel->GetFields().empty(), *parcel)
+      << "Union '" << parcel->GetName() << "' is empty.";
+  const auto& first_field = parcel->GetFields()[0];
+  const auto& first_value = first_field->ValueString(ConstantValueDecorator);
+
+  out << "Self::";
+  if (first_field->GetDefaultValue()) {
+    out << first_field->GetCapitalizedName() << "(" << first_value << ")\n";
+  } else {
+    out << first_field->GetCapitalizedName() << "(Default::default())\n";
+  }
+
+  out.Dedent();
+  out << "}\n";
+  out.Dedent();
+  out << "}\n";
+}
+
+void GenerateParcelSerializeBody(CodeWriter& out, const AidlUnionDecl* parcel,
+                                 const AidlTypenames& typenames) {
+  out << "match self {\n";
+  out.Indent();
+  int tag = 0;
+  for (const auto& variable : parcel->GetFields()) {
+    out << "Self::" << variable->GetCapitalizedName() << "(v) => {\n";
+    out.Indent();
+    if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE)) {
+      out << "if (true) {\n";
+      out << "  Err(binder::StatusCode::BAD_VALUE)\n";
+      out << "} else {\n";
+      out.Indent();
+    }
+    out << "parcel.write(&" << std::to_string(tag++) << "i32)?;\n";
+    if (TypeNeedsOption(variable->GetType(), typenames)) {
+      out << "let __field_ref = v.as_ref().ok_or(binder::StatusCode::UNEXPECTED_NULL)?;\n";
+      out << "parcel.write(__field_ref)\n";
+    } else {
+      out << "parcel.write(v)\n";
+    }
+    if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::WRITE)) {
+      out.Dedent();
+      out << "}\n";
+    }
+    out.Dedent();
+    out << "}\n";
+  }
+  out.Dedent();
+  out << "}\n";
+}
+
+void GenerateParcelDeserializeBody(CodeWriter& out, const AidlUnionDecl* parcel,
+                                   const AidlTypenames& typenames) {
+  out << "let tag: i32 = parcel.read()?;\n";
+  out << "match tag {\n";
+  out.Indent();
+  int tag = 0;
+  for (const auto& variable : parcel->GetFields()) {
+    auto field_type =
+        RustNameOf(variable->GetType(), typenames, StorageMode::PARCELABLE_FIELD, Lifetime::NONE);
+
+    out << std::to_string(tag++) << " => {\n";
+    out.Indent();
+    if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::READ)) {
+      out << "if (true) {\n";
+      out << "  Err(binder::StatusCode::BAD_VALUE)\n";
+      out << "} else {\n";
+      out.Indent();
+    }
+    out << "let value: " << field_type << " = ";
+    if (TypeNeedsOption(variable->GetType(), typenames)) {
+      out << "Some(parcel.read()?);\n";
+    } else {
+      out << "parcel.read()?;\n";
+    }
+    out << "*self = Self::" << variable->GetCapitalizedName() << "(value);\n";
+    out << "Ok(())\n";
+    if (variable->IsNew() && ShouldForceDowngradeFor(CommunicationSide::READ)) {
+      out.Dedent();
+      out << "}\n";
+    }
+    out.Dedent();
+    out << "}\n";
+  }
+  out << "_ => {\n";
+  out << "  Err(binder::StatusCode::BAD_VALUE)\n";
+  out << "}\n";
+  out.Dedent();
+  out << "}\n";
+}
+
+template <typename ParcelableType>
+void GenerateParcelableTrait(CodeWriter& out, const ParcelableType* parcel,
+                             const AidlTypenames& typenames) {
+  out << "impl";
+  WriteParams(out, parcel);
+  out << " binder::Parcelable for r#" << parcel->GetName();
+  WriteParams(out, parcel);
+  out << " {\n";
+  out.Indent();
+
+  out << "fn write_to_parcel(&self, "
+         "parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), "
+         "binder::StatusCode> "
+         "{\n";
+  out.Indent();
+  GenerateParcelSerializeBody(out, parcel, typenames);
+  out.Dedent();
+  out << "}\n";
+
+  out << "fn read_from_parcel(&mut self, "
+         "parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), "
+         "binder::StatusCode> {\n";
+  out.Indent();
+  GenerateParcelDeserializeBody(out, parcel, typenames);
+  out.Dedent();
+  out << "}\n";
+
+  out.Dedent();
+  out << "}\n";
+
+  // Emit the outer (de)serialization traits
+  out << "binder::impl_serialize_for_parcelable!(r#" << parcel->GetName();
+  WriteParams(out, parcel);
+  out << ");\n";
+  out << "binder::impl_deserialize_for_parcelable!(r#" << parcel->GetName();
+  WriteParams(out, parcel);
+  out << ");\n";
+}
+
+template <typename ParcelableType>
+void GenerateMetadataTrait(CodeWriter& out, const ParcelableType* parcel) {
+  out << "impl";
+  WriteParams(out, parcel);
+  out << " binder::binder_impl::ParcelableMetadata for r#" << parcel->GetName();
+  WriteParams(out, parcel);
+  out << " {\n";
+  out.Indent();
+
+  out << "fn get_descriptor() -> &'static str { \"" << parcel->GetCanonicalName() << "\" }\n";
+
+  if (parcel->IsVintfStability()) {
+    out << "fn get_stability(&self) -> binder::binder_impl::Stability { "
+           "binder::binder_impl::Stability::Vintf }\n";
+  }
+
+  out.Dedent();
+  out << "}\n";
+}
+
+template <typename ParcelableType>
+void GenerateRustParcel(CodeWriter* code_writer, const ParcelableType* parcel,
+                        const AidlTypenames& typenames) {
+  vector<string> derives = parcel->RustDerive();
+
+  // Debug is always derived because all Rust AIDL types implement it
+  // ParcelFileDescriptor doesn't support any of the others because
+  // it's a newtype over std::fs::File which only implements Debug
+  derives.insert(derives.begin(), "Debug");
+
+  *code_writer << "#[derive(" << Join(derives, ", ") << ")]\n";
+  GenerateParcelBody(*code_writer, parcel, typenames);
+  GenerateConstantDeclarations(*code_writer, *parcel, typenames);
+  GenerateParcelDefault(*code_writer, parcel);
+  GenerateParcelableTrait(*code_writer, parcel, typenames);
+  GenerateMetadataTrait(*code_writer, parcel);
+}
+
+void GenerateRustEnumDeclaration(CodeWriter* code_writer, const AidlEnumDeclaration* enum_decl,
+                                 const AidlTypenames& typenames) {
+  const auto& aidl_backing_type = enum_decl->GetBackingType();
+  auto backing_type = RustNameOf(aidl_backing_type, typenames, StorageMode::VALUE, Lifetime::NONE);
+
+  *code_writer << "#![allow(non_upper_case_globals)]\n";
+  *code_writer << "use binder::declare_binder_enum;\n";
+  *code_writer << "declare_binder_enum! {\n";
+  code_writer->Indent();
+
+  GenerateDeprecated(*code_writer, *enum_decl);
+  *code_writer << "r#" << enum_decl->GetName() << " : [" << backing_type << "; "
+               << std::to_string(enum_decl->GetEnumerators().size()) << "] {\n";
+  code_writer->Indent();
+  for (const auto& enumerator : enum_decl->GetEnumerators()) {
+    auto value = enumerator->GetValue()->ValueString(aidl_backing_type, ConstantValueDecorator);
+    GenerateDeprecated(*code_writer, *enumerator);
+    *code_writer << "r#" << enumerator->GetName() << " = " << value << ",\n";
+  }
+  code_writer->Dedent();
+  *code_writer << "}\n";
+
+  code_writer->Dedent();
+  *code_writer << "}\n";
+}
+
+void GenerateClass(CodeWriter* code_writer, const AidlDefinedType& defined_type,
+                   const AidlTypenames& types, const Options& options) {
+  if (const AidlStructuredParcelable* parcelable = defined_type.AsStructuredParcelable();
+      parcelable != nullptr) {
+    GenerateRustParcel(code_writer, parcelable, types);
+  } else if (const AidlEnumDeclaration* enum_decl = defined_type.AsEnumDeclaration();
+             enum_decl != nullptr) {
+    GenerateRustEnumDeclaration(code_writer, enum_decl, types);
+  } else if (const AidlInterface* interface = defined_type.AsInterface(); interface != nullptr) {
+    GenerateRustInterface(code_writer, interface, types, options);
+  } else if (const AidlUnionDecl* union_decl = defined_type.AsUnionDeclaration();
+             union_decl != nullptr) {
+    GenerateRustParcel(code_writer, union_decl, types);
+  } else {
+    AIDL_FATAL(defined_type) << "Unrecognized type sent for Rust generation.";
+  }
+
+  for (const auto& nested : defined_type.GetNestedTypes()) {
+    (*code_writer) << "pub mod r#" << nested->GetName() << " {\n";
+    code_writer->Indent();
+    GenerateClass(code_writer, *nested, types, options);
+    code_writer->Dedent();
+    (*code_writer) << "}\n";
+  }
+}
+
+void GenerateRust(const string& filename, const Options& options, const AidlTypenames& types,
+                  const AidlDefinedType& defined_type, const IoDelegate& io_delegate) {
+  CodeWriterPtr code_writer = io_delegate.GetCodeWriter(filename);
+
+  GenerateAutoGenHeader(*code_writer, options);
+
+  // Forbid the use of unsafe in auto-generated code.
+  // Unsafe code should only be allowed in libbinder_rs.
+  *code_writer << "#![forbid(unsafe_code)]\n";
+  // Disable rustfmt on auto-generated files, including the golden outputs
+  *code_writer << "#![cfg_attr(rustfmt, rustfmt_skip)]\n";
+  GenerateClass(code_writer.get(), defined_type, types, options);
+  GenerateMangledAliases(*code_writer, defined_type);
+
+  AIDL_FATAL_IF(!code_writer->Close(), defined_type) << "I/O Error!";
+}
+
+}  // namespace rust
+}  // namespace aidl
+}  // namespace android
diff --git a/generate_rust.h b/generate_rust.h
new file mode 100644
index 0000000..9de8e56
--- /dev/null
+++ b/generate_rust.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "aidl_language.h"
+#include "io_delegate.h"
+#include "options.h"
+
+#include <string>
+
+namespace android {
+namespace aidl {
+namespace rust {
+
+void GenerateRust(const string& filename, const Options& options, const AidlTypenames& types,
+                  const AidlDefinedType& defined_type, const IoDelegate& io_delegate);
+
+}  // namespace rust
+}  // namespace aidl
+}  // namespace android
diff --git a/hiddenapi-greylist b/hiddenapi-greylist
new file mode 100644
index 0000000..282e9c9
--- /dev/null
+++ b/hiddenapi-greylist
@@ -0,0 +1,539 @@
+"android.accessibilityservice.IAccessibilityServiceClient",
+"android.accessibilityservice.IAccessibilityServiceConnection",
+"android.accounts.IAccountAuthenticator",
+"android.accounts.IAccountAuthenticatorResponse",
+"android.accounts.IAccountManager",
+"android.accounts.IAccountManagerResponse",
+"android.app.admin.IDeviceAdminService",
+"android.app.admin.IDevicePolicyManager",
+"android.app.backup.IBackupManager",
+"android.app.backup.IBackupManagerMonitor",
+"android.app.backup.IBackupObserver",
+"android.app.backup.IFullBackupRestoreObserver",
+"android.app.backup.IRestoreObserver",
+"android.app.backup.IRestoreSession",
+"android.app.backup.ISelectBackupTransportCallback",
+"android.app.IActivityController",
+"android.app.IActivityManager",
+"android.app.IActivityPendingResult",
+"android.app.IAlarmCompleteListener",
+"android.app.IAlarmListener",
+"android.app.IAlarmManager",
+"android.app.IApplicationThread",
+"android.app.IAppTask",
+"android.app.IAssistDataReceiver",
+"android.app.IBackupAgent",
+"android.app.IEphemeralResolver",
+"android.app.IInputForwarder",
+"android.app.IInstantAppResolver",
+"android.app.IInstrumentationWatcher",
+"android.app.INotificationManager",
+"android.app.IProcessObserver",
+"android.app.ISearchManager",
+"android.app.ISearchManagerCallback",
+"android.app.IServiceConnection",
+"android.app.IStopUserCallback",
+"android.app.ITaskStackListener",
+"android.app.ITransientNotification",
+"android.app.IUiAutomationConnection",
+"android.app.IUidObserver",
+"android.app.IUiModeManager",
+"android.app.IUserSwitchObserver",
+"android.app.IWallpaperManager",
+"android.app.IWallpaperManagerCallback",
+"android.app.job.IJobCallback",
+"android.app.job.IJobScheduler",
+"android.app.job.IJobService",
+"android.app.slice.ISliceListener",
+"android.app.slice.ISliceManager",
+"android.app.trust.IStrongAuthTracker",
+"android.app.trust.ITrustListener",
+"android.app.trust.ITrustManager",
+"android.app.usage.ICacheQuotaService",
+"android.app.usage.IStorageStatsManager",
+"android.app.usage.IUsageStatsManager",
+"android.bluetooth.IBluetooth",
+"android.bluetooth.IBluetoothA2dp",
+"android.bluetooth.IBluetoothA2dpSink",
+"android.bluetooth.IBluetoothAvrcpController",
+"android.bluetooth.IBluetoothAvrcpTarget",
+"android.bluetooth.IBluetoothCallback",
+"android.bluetooth.IBluetoothGatt",
+"android.bluetooth.IBluetoothGattCallback",
+"android.bluetooth.IBluetoothGattServerCallback",
+"android.bluetooth.IBluetoothHeadset",
+"android.bluetooth.IBluetoothHeadsetClient",
+"android.bluetooth.IBluetoothHeadsetPhone",
+"android.bluetooth.IBluetoothHealth",
+"android.bluetooth.IBluetoothHealthCallback",
+"android.bluetooth.IBluetoothHearingAid",
+"android.bluetooth.IBluetoothHidDevice",
+"android.bluetooth.IBluetoothHidDeviceCallback",
+"android.bluetooth.IBluetoothHidHost",
+"android.bluetooth.IBluetoothManager",
+"android.bluetooth.IBluetoothManagerCallback",
+"android.bluetooth.IBluetoothMap",
+"android.bluetooth.IBluetoothMapClient",
+"android.bluetooth.IBluetoothPan",
+"android.bluetooth.IBluetoothPbap",
+"android.bluetooth.IBluetoothPbapClient",
+"android.bluetooth.IBluetoothProfileServiceConnection",
+"android.bluetooth.IBluetoothSap",
+"android.bluetooth.IBluetoothSocketManager",
+"android.bluetooth.IBluetoothStateChangeCallback",
+"android.bluetooth.le.IAdvertisingSetCallback",
+"android.bluetooth.le.IPeriodicAdvertisingCallback",
+"android.bluetooth.le.IScannerCallback",
+"android.companion.ICompanionDeviceDiscoveryService",
+"android.companion.ICompanionDeviceDiscoveryServiceCallback",
+"android.companion.ICompanionDeviceManager",
+"android.companion.IFindDeviceCallback",
+"android.content.IClipboard",
+"android.content.IContentService",
+"android.content.IIntentReceiver",
+"android.content.IIntentSender",
+"android.content.IOnPrimaryClipChangedListener",
+"android.content.IRestrictionsManager",
+"android.content.ISyncAdapter",
+"android.content.ISyncAdapterUnsyncableAccountCallback",
+"android.content.ISyncContext",
+"android.content.ISyncServiceAdapter",
+"android.content.ISyncStatusObserver",
+"android.content.om.IOverlayManager",
+"android.content.pm.dex.IArtManager",
+"android.content.pm.dex.ISnapshotRuntimeProfileCallback",
+"android.content.pm.ICrossProfileApps",
+"android.content.pm.IDexModuleRegisterCallback",
+"android.content.pm.ILauncherApps",
+"android.content.pm.IOnAppsChangedListener",
+"android.content.pm.IOnPermissionsChangeListener",
+"android.content.pm.IOtaDexopt",
+"android.content.pm.IPackageDataObserver",
+"android.content.pm.IPackageDeleteObserver",
+"android.content.pm.IPackageDeleteObserver2",
+"android.content.pm.IPackageInstaller",
+"android.content.pm.IPackageInstallerCallback",
+"android.content.pm.IPackageInstallerSession",
+"android.content.pm.IPackageInstallObserver2",
+"android.content.pm.IPackageManager",
+"android.content.pm.IPackageManagerNative",
+"android.content.pm.IPackageMoveObserver",
+"android.content.pm.IPackageStatsObserver",
+"android.content.pm.IPinItemRequest",
+"android.content.pm.IShortcutService",
+"android.content.pm.permission.IRuntimePermissionPresenter",
+"android.database.IContentObserver",
+"android.hardware.biometrics.IBiometricPromptReceiver",
+"android.hardware.camera2.ICameraDeviceCallbacks",
+"android.hardware.camera2.ICameraDeviceUser",
+"android.hardware.display.IDisplayManager",
+"android.hardware.display.IDisplayManagerCallback",
+"android.hardware.display.IVirtualDisplayCallback",
+"android.hardware.fingerprint.IFingerprintClientActiveCallback",
+"android.hardware.fingerprint.IFingerprintService",
+"android.hardware.fingerprint.IFingerprintServiceLockoutResetCallback",
+"android.hardware.fingerprint.IFingerprintServiceReceiver",
+"android.hardware.hdmi.IHdmiControlCallback",
+"android.hardware.hdmi.IHdmiControlService",
+"android.hardware.hdmi.IHdmiDeviceEventListener",
+"android.hardware.hdmi.IHdmiHotplugEventListener",
+"android.hardware.hdmi.IHdmiInputChangeListener",
+"android.hardware.hdmi.IHdmiMhlVendorCommandListener",
+"android.hardware.hdmi.IHdmiRecordListener",
+"android.hardware.hdmi.IHdmiSystemAudioModeChangeListener",
+"android.hardware.hdmi.IHdmiVendorCommandListener",
+"android.hardware.ICamera",
+"android.hardware.ICameraClient",
+"android.hardware.ICameraService",
+"android.hardware.ICameraServiceListener",
+"android.hardware.ICameraServiceProxy",
+"android.hardware.IConsumerIrService",
+"android.hardware.input.IInputDevicesChangedListener",
+"android.hardware.input.IInputManager",
+"android.hardware.input.ITabletModeChangedListener",
+"android.hardware.ISerialManager",
+"android.hardware.location.IActivityRecognitionHardware",
+"android.hardware.location.IActivityRecognitionHardwareClient",
+"android.hardware.location.IActivityRecognitionHardwareSink",
+"android.hardware.location.IActivityRecognitionHardwareWatcher",
+"android.hardware.location.IContextHubCallback",
+"android.hardware.location.IContextHubClient",
+"android.hardware.location.IContextHubClientCallback",
+"android.hardware.location.IContextHubService",
+"android.hardware.location.IContextHubTransactionCallback",
+"android.hardware.location.IGeofenceHardware",
+"android.hardware.location.IGeofenceHardwareCallback",
+"android.hardware.location.IGeofenceHardwareMonitorCallback",
+"android.hardware.radio.IAnnouncementListener",
+"android.hardware.radio.ICloseHandle",
+"android.hardware.radio.IRadioService",
+"android.hardware.radio.ITuner",
+"android.hardware.radio.ITunerCallback",
+"android.hardware.soundtrigger.IRecognitionStatusCallback",
+"android.hardware.usb.IUsbManager",
+"android.location.IBatchedLocationCallback",
+"android.location.ICountryDetector",
+"android.location.ICountryListener",
+"android.location.IFusedGeofenceHardware",
+"android.location.IGeocodeProvider",
+"android.location.IGeofenceProvider",
+"android.location.IGnssMeasurementsListener",
+"android.location.IGnssNavigationMessageListener",
+"android.location.IGnssStatusListener",
+"android.location.IGnssStatusProvider",
+"android.location.IGpsGeofenceHardware",
+"android.location.ILocationListener",
+"android.location.ILocationManager",
+"android.location.INetInitiatedListener",
+"android.media.audiopolicy.IAudioPolicyCallback",
+"android.media.IAudioFocusDispatcher",
+"android.media.IAudioRoutesObserver",
+"android.media.IAudioServerStateDispatcher",
+"android.media.IAudioService",
+"android.media.IMediaHTTPConnection",
+"android.media.IMediaHTTPService",
+"android.media.IMediaResourceMonitor",
+"android.media.IMediaRouterClient",
+"android.media.IMediaRouterService",
+"android.media.IMediaScannerListener",
+"android.media.IMediaScannerService",
+"android.media.IPlaybackConfigDispatcher",
+"android.media.IPlayer",
+"android.media.IRecordingConfigDispatcher",
+"android.media.IRemoteDisplayCallback",
+"android.media.IRemoteDisplayProvider",
+"android.media.IRemoteVolumeController",
+"android.media.IRemoteVolumeObserver",
+"android.media.IRingtonePlayer",
+"android.media.ISessionTokensListener",
+"android.media.IVolumeController",
+"android.media.midi.IBluetoothMidiService",
+"android.media.midi.IMidiDeviceListener",
+"android.media.midi.IMidiDeviceOpenCallback",
+"android.media.midi.IMidiDeviceServer",
+"android.media.midi.IMidiManager",
+"android.media.projection.IMediaProjection",
+"android.media.projection.IMediaProjectionCallback",
+"android.media.projection.IMediaProjectionManager",
+"android.media.projection.IMediaProjectionWatcherCallback",
+"android.media.session.IActiveSessionsListener",
+"android.media.session.ICallback",
+"android.media.session.IOnMediaKeyListener",
+"android.media.session.IOnVolumeKeyLongPressListener",
+"android.media.session.ISession",
+"android.media.session.ISessionCallback",
+"android.media.session.ISessionController",
+"android.media.session.ISessionControllerCallback",
+"android.media.session.ISessionManager",
+"android.media.soundtrigger.ISoundTriggerDetectionService",
+"android.media.soundtrigger.ISoundTriggerDetectionServiceClient",
+"android.media.tv.ITvInputClient",
+"android.media.tv.ITvInputHardware",
+"android.media.tv.ITvInputHardwareCallback",
+"android.media.tv.ITvInputManager",
+"android.media.tv.ITvInputManagerCallback",
+"android.media.tv.ITvInputService",
+"android.media.tv.ITvInputServiceCallback",
+"android.media.tv.ITvInputSession",
+"android.media.tv.ITvInputSessionCallback",
+"android.media.tv.ITvRemoteProvider",
+"android.media.tv.ITvRemoteServiceInput",
+"android.net.ICaptivePortal",
+"android.net.IConnectivityManager",
+"android.net.IEthernetManager",
+"android.net.IEthernetServiceListener",
+"android.net.IIpConnectivityMetrics",
+"android.net.IIpSecService",
+"android.net.INetd",
+"android.net.INetdEventCallback",
+"android.net.INetworkManagementEventObserver",
+"android.net.INetworkPolicyListener",
+"android.net.INetworkPolicyManager",
+"android.net.INetworkRecommendationProvider",
+"android.net.INetworkScoreCache",
+"android.net.INetworkScoreService",
+"android.net.INetworkStatsService",
+"android.net.INetworkStatsSession",
+"android.net.ITetheringStatsProvider",
+"android.net.nsd.INsdManager",
+"android.net.sip.ISipService",
+"android.net.sip.ISipSession",
+"android.net.sip.ISipSessionListener",
+"android.net.wifi.aware.IWifiAwareDiscoverySessionCallback",
+"android.net.wifi.aware.IWifiAwareEventCallback",
+"android.net.wifi.aware.IWifiAwareMacAddressProvider",
+"android.net.wifi.aware.IWifiAwareManager",
+"android.net.wifi.hotspot2.IProvisioningCallback",
+"android.net.wifi.ISoftApCallback",
+"android.net.wifi.IWifiManager",
+"android.net.wifi.IWifiScanner",
+"android.net.wifi.p2p.IWifiP2pManager",
+"android.net.wifi.rtt.IRttCallback",
+"android.net.wifi.rtt.IWifiRttManager",
+"android.nfc.IAppCallback",
+"android.nfc.INfcAdapter",
+"android.nfc.INfcAdapterExtras",
+"android.nfc.INfcCardEmulation",
+"android.nfc.INfcDta",
+"android.nfc.INfcFCardEmulation",
+"android.nfc.INfcTag",
+"android.nfc.INfcUnlockHandler",
+"android.nfc.ITagRemovedCallback",
+"android.os.IBatteryPropertiesListener",
+"android.os.IBatteryPropertiesRegistrar",
+"android.os.ICancellationSignal",
+"android.os.IDeviceIdentifiersPolicyService",
+"android.os.IDeviceIdleController",
+"android.os.IHardwarePropertiesManager",
+"android.os.IIncidentManager",
+"android.os.IIncidentReportStatusListener",
+"android.os.IInstalld",
+"android.os.IMaintenanceActivityListener",
+"android.os.IMessenger",
+"android.os.INetworkActivityListener",
+"android.os.INetworkManagementService",
+"android.os.IPermissionController",
+"android.os.IPowerManager",
+"android.os.IProcessInfoService",
+"android.os.IProgressListener",
+"android.os.IRecoverySystem",
+"android.os.IRecoverySystemProgressListener",
+"android.os.IRemoteCallback",
+"android.os.ISchedulingPolicyService",
+"android.os.IStatsCompanionService",
+"android.os.IStatsManager",
+"android.os.IStoraged",
+"android.os.ISystemUpdateManager",
+"android.os.IThermalEventListener",
+"android.os.IThermalService",
+"android.os.IUpdateEngine",
+"android.os.IUpdateEngineCallback",
+"android.os.IUpdateLock",
+"android.os.IUserManager",
+"android.os.IVibratorService",
+"android.os.IVold",
+"android.os.IVoldListener",
+"android.os.IVoldTaskListener",
+"android.os.storage.IObbActionListener",
+"android.os.storage.IStorageEventListener",
+"android.os.storage.IStorageManager",
+"android.os.storage.IStorageShutdownObserver",
+"android.print.ILayoutResultCallback",
+"android.print.IPrintDocumentAdapter",
+"android.print.IPrintDocumentAdapterObserver",
+"android.print.IPrinterDiscoveryObserver",
+"android.print.IPrintJobStateChangeListener",
+"android.print.IPrintManager",
+"android.print.IPrintServicesChangeListener",
+"android.print.IPrintSpooler",
+"android.print.IPrintSpoolerCallbacks",
+"android.print.IPrintSpoolerClient",
+"android.print.IWriteResultCallback",
+"android.printservice.IPrintService",
+"android.printservice.IPrintServiceClient",
+"android.printservice.recommendation.IRecommendationsChangeListener",
+"android.printservice.recommendation.IRecommendationService",
+"android.printservice.recommendation.IRecommendationServiceCallbacks",
+"android.se.omapi.ISecureElementChannel",
+"android.se.omapi.ISecureElementListener",
+"android.se.omapi.ISecureElementReader",
+"android.se.omapi.ISecureElementService",
+"android.se.omapi.ISecureElementSession",
+"android.security.IConfirmationPromptCallback",
+"android.security.IKeyChainAliasCallback",
+"android.security.IKeyChainService",
+"android.security.IKeystoreService",
+"android.security.keymaster.IKeyAttestationApplicationIdProvider",
+"android.service.autofill.IAutofillFieldClassificationService",
+"android.service.autofill.IAutoFillService",
+"android.service.autofill.IFillCallback",
+"android.service.autofill.ISaveCallback",
+"android.service.carrier.ICarrierMessagingCallback",
+"android.service.carrier.ICarrierMessagingService",
+"android.service.carrier.ICarrierService",
+"android.service.chooser.IChooserTargetResult",
+"android.service.chooser.IChooserTargetService",
+"android.service.dreams.IDreamManager",
+"android.service.dreams.IDreamService",
+"android.service.euicc.IDeleteSubscriptionCallback",
+"android.service.euicc.IDownloadSubscriptionCallback",
+"android.service.euicc.IEraseSubscriptionsCallback",
+"android.service.euicc.IEuiccService",
+"android.service.euicc.IGetDefaultDownloadableSubscriptionListCallback",
+"android.service.euicc.IGetDownloadableSubscriptionMetadataCallback",
+"android.service.euicc.IGetEidCallback",
+"android.service.euicc.IGetEuiccInfoCallback",
+"android.service.euicc.IGetEuiccProfileInfoListCallback",
+"android.service.euicc.IGetOtaStatusCallback",
+"android.service.euicc.IOtaStatusChangedCallback",
+"android.service.euicc.IRetainSubscriptionsForFactoryResetCallback",
+"android.service.euicc.ISwitchToSubscriptionCallback",
+"android.service.euicc.IUpdateSubscriptionNicknameCallback",
+"android.service.media.IMediaBrowserService",
+"android.service.media.IMediaBrowserServiceCallbacks",
+"android.service.notification.IConditionListener",
+"android.service.notification.IConditionProvider",
+"android.service.notification.INotificationListener",
+"android.service.notification.IStatusBarNotificationHolder",
+"android.service.oemlock.IOemLockService",
+"android.service.persistentdata.IPersistentDataBlockService",
+"android.service.quicksettings.IQSService",
+"android.service.quicksettings.IQSTileService",
+"android.service.resolver.IResolverRankerResult",
+"android.service.resolver.IResolverRankerService",
+"android.service.settings.suggestions.ISuggestionService",
+"android.service.textclassifier.ITextClassificationCallback",
+"android.service.textclassifier.ITextClassifierService",
+"android.service.textclassifier.ITextLinksCallback",
+"android.service.textclassifier.ITextSelectionCallback",
+"android.service.trust.ITrustAgentService",
+"android.service.trust.ITrustAgentServiceCallback",
+"android.service.voice.IVoiceInteractionService",
+"android.service.voice.IVoiceInteractionSession",
+"android.service.voice.IVoiceInteractionSessionService",
+"android.service.vr.IPersistentVrStateCallbacks",
+"android.service.vr.IVrListener",
+"android.service.vr.IVrManager",
+"android.service.vr.IVrStateCallbacks",
+"android.service.wallpaper.IWallpaperConnection",
+"android.service.wallpaper.IWallpaperEngine",
+"android.service.wallpaper.IWallpaperService",
+"android.speech.IRecognitionListener",
+"android.speech.IRecognitionService",
+"android.speech.tts.ITextToSpeechCallback",
+"android.speech.tts.ITextToSpeechService",
+"android.telephony.data.IDataService",
+"android.telephony.data.IDataServiceCallback",
+"android.telephony.INetworkService",
+"android.telephony.INetworkServiceCallback",
+"android.telephony.mbms.IDownloadProgressListener",
+"android.telephony.mbms.IDownloadStatusListener",
+"android.telephony.mbms.IMbmsDownloadSessionCallback",
+"android.telephony.mbms.IMbmsStreamingSessionCallback",
+"android.telephony.mbms.IStreamingServiceCallback",
+"android.telephony.mbms.vendor.IMbmsDownloadService",
+"android.telephony.mbms.vendor.IMbmsStreamingService",
+"android.view.accessibility.IAccessibilityInteractionConnection",
+"android.view.accessibility.IAccessibilityInteractionConnectionCallback",
+"android.view.accessibility.IAccessibilityManager",
+"android.view.accessibility.IAccessibilityManagerClient",
+"android.view.autofill.IAutoFillManager",
+"android.view.autofill.IAutoFillManagerClient",
+"android.view.autofill.IAutofillWindowPresenter",
+"android.view.IApplicationToken",
+"android.view.IAppTransitionAnimationSpecsFuture",
+"android.view.IDockedStackListener",
+"android.view.IGraphicsStats",
+"android.view.IGraphicsStatsCallback",
+"android.view.IInputFilter",
+"android.view.IInputFilterHost",
+"android.view.IOnKeyguardExitResult",
+"android.view.IPinnedStackController",
+"android.view.IPinnedStackListener",
+"android.view.IRecentsAnimationController",
+"android.view.IRecentsAnimationRunner",
+"android.view.IRemoteAnimationFinishedCallback",
+"android.view.IRemoteAnimationRunner",
+"android.view.IRotationWatcher",
+"android.view.IWallpaperVisibilityListener",
+"android.view.IWindow",
+"android.view.IWindowFocusObserver",
+"android.view.IWindowId",
+"android.view.IWindowManager",
+"android.view.IWindowSession",
+"android.view.IWindowSessionCallback",
+"android.webkit.IWebViewUpdateService",
+"com.android.ims.ImsConfigListener",
+"com.android.ims.internal.IImsCallSession",
+"com.android.ims.internal.IImsCallSessionListener",
+"com.android.ims.internal.IImsConfig",
+"com.android.ims.internal.IImsEcbm",
+"com.android.ims.internal.IImsEcbmListener",
+"com.android.ims.internal.IImsExternalCallStateListener",
+"com.android.ims.internal.IImsFeatureStatusCallback",
+"com.android.ims.internal.IImsMMTelFeature",
+"com.android.ims.internal.IImsMultiEndpoint",
+"com.android.ims.internal.IImsRcsFeature",
+"com.android.ims.internal.IImsRegistrationListener",
+"com.android.ims.internal.IImsService",
+"com.android.ims.internal.IImsServiceController",
+"com.android.ims.internal.IImsServiceFeatureCallback",
+"com.android.ims.internal.IImsStreamMediaSession",
+"com.android.ims.internal.IImsUt",
+"com.android.ims.internal.IImsUtListener",
+"com.android.ims.internal.IImsVideoCallCallback",
+"com.android.ims.internal.IImsVideoCallProvider",
+"com.android.ims.internal.uce.options.IOptionsListener",
+"com.android.ims.internal.uce.options.IOptionsService",
+"com.android.ims.internal.uce.presence.IPresenceListener",
+"com.android.ims.internal.uce.presence.IPresenceService",
+"com.android.ims.internal.uce.uceservice.IUceListener",
+"com.android.ims.internal.uce.uceservice.IUceService",
+"com.android.internal.app.IAppOpsActiveCallback",
+"com.android.internal.app.IAppOpsCallback",
+"com.android.internal.app.IAppOpsService",
+"com.android.internal.app.IBatteryStats",
+"com.android.internal.app.IMediaContainerService",
+"com.android.internal.app.ISoundTriggerService",
+"com.android.internal.app.IVoiceInteractionManagerService",
+"com.android.internal.app.IVoiceInteractionSessionListener",
+"com.android.internal.app.IVoiceInteractionSessionShowCallback",
+"com.android.internal.app.IVoiceInteractor",
+"com.android.internal.app.IVoiceInteractorCallback",
+"com.android.internal.app.IVoiceInteractorRequest",
+"com.android.internal.appwidget.IAppWidgetHost",
+"com.android.internal.appwidget.IAppWidgetService",
+"com.android.internal.backup.IBackupTransport",
+"com.android.internal.backup.IObbBackupService",
+"com.android.internal.location.ILocationProvider",
+"com.android.internal.net.INetworkWatchlistManager",
+"com.android.internal.os.IDropBoxManagerService",
+"com.android.internal.os.IParcelFileDescriptorFactory",
+"com.android.internal.os.IResultReceiver",
+"com.android.internal.os.IShellCallback",
+"com.android.internal.policy.IKeyguardDismissCallback",
+"com.android.internal.policy.IKeyguardDrawnCallback",
+"com.android.internal.policy.IKeyguardExitCallback",
+"com.android.internal.policy.IKeyguardService",
+"com.android.internal.policy.IKeyguardStateCallback",
+"com.android.internal.policy.IShortcutService",
+"com.android.internal.statusbar.IStatusBar",
+"com.android.internal.statusbar.IStatusBarService",
+"com.android.internal.telecom.ICallScreeningAdapter",
+"com.android.internal.telecom.ICallScreeningService",
+"com.android.internal.telecom.IConnectionService",
+"com.android.internal.telecom.IConnectionServiceAdapter",
+"com.android.internal.telecom.IInCallAdapter",
+"com.android.internal.telecom.IInCallService",
+"com.android.internal.telecom.ITelecomService",
+"com.android.internal.telecom.IVideoCallback",
+"com.android.internal.telecom.IVideoProvider",
+"com.android.internal.telecom.RemoteServiceCallback",
+"com.android.internal.telephony.IApnSourceService",
+"com.android.internal.telephony.ICarrierConfigLoader",
+"com.android.internal.telephony.IMms",
+"com.android.internal.telephony.IOnSubscriptionsChangedListener",
+"com.android.internal.telephony.IPhoneStateListener",
+"com.android.internal.telephony.IPhoneSubInfo",
+"com.android.internal.telephony.ISms",
+"com.android.internal.telephony.ISub",
+"com.android.internal.telephony.ITelephonyRegistry",
+"com.android.internal.telephony.IWapPushManager",
+"com.android.internal.textservice.ISpellCheckerService",
+"com.android.internal.textservice.ISpellCheckerServiceCallback",
+"com.android.internal.textservice.ISpellCheckerSession",
+"com.android.internal.textservice.ISpellCheckerSessionListener",
+"com.android.internal.textservice.ITextServicesManager",
+"com.android.internal.textservice.ITextServicesSessionListener",
+"com.android.internal.view.IDragAndDropPermissions",
+"com.android.internal.view.IInputContext",
+"com.android.internal.view.IInputContextCallback",
+"com.android.internal.view.IInputMethod",
+"com.android.internal.view.IInputMethodClient",
+"com.android.internal.view.IInputMethodManager",
+"com.android.internal.view.IInputMethodSession",
+"com.android.internal.view.IInputSessionCallback",
+"com.android.internal.widget.ICheckCredentialProgressCallback",
+"com.android.internal.widget.ILockSettings",
+"com.android.internal.widget.IRemoteViewsFactory",
+"com.android.internal.telephony.ITelephony"
diff --git a/import_resolver.cpp b/import_resolver.cpp
new file mode 100644
index 0000000..c1c8593
--- /dev/null
+++ b/import_resolver.cpp
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "import_resolver.h"
+#include "aidl_language.h"
+#include "logging.h"
+
+#include <algorithm>
+
+#include <android-base/file.h>
+#include <android-base/strings.h>
+#include <unistd.h>
+
+#ifdef _WIN32
+#include <io.h>
+#endif
+
+#include "os.h"
+
+using std::set;
+using std::string;
+using std::vector;
+
+namespace android {
+namespace aidl {
+
+ImportResolver::ImportResolver(const IoDelegate& io_delegate, const string& input_file_name,
+                               const set<string>& import_paths)
+    : io_delegate_(io_delegate), input_file_name_(input_file_name) {
+  for (string path : import_paths) {
+    if (path.empty()) {
+      path = ".";
+    }
+    if (path[path.size() - 1] != OS_PATH_SEPARATOR) {
+      path += OS_PATH_SEPARATOR;
+    }
+    import_paths_.emplace(std::move(path));
+  }
+}
+
+string ImportResolver::FindImportFile(const string& canonical_name) const {
+  auto parts = base::Split(canonical_name, ".");
+  while (!parts.empty()) {
+    string relative_path = base::Join(parts, OS_PATH_SEPARATOR) + ".aidl";
+    auto candidates = ScanImportPaths(relative_path);
+    if (candidates.size() == 0) {
+      // remove the last part & keep searching
+      parts.pop_back();
+      continue;
+    }
+    if (candidates.size() == 1) {
+      // found! ("legacy" logic: may still be ambiguous path if we try other relative paths)
+      return *candidates.begin();
+    }
+    if (candidates.size() > 1) {
+      AIDL_ERROR(input_file_name_) << "Duplicate files found for " << canonical_name << " from:\n"
+                                   << base::Join(candidates, "\n");
+      return "";
+    }
+  }
+  AIDL_ERROR(input_file_name_) << "Couldn't find import for class " << canonical_name
+                               << ". Searched here:\n - " << base::Join(import_paths_, "\n - ");
+  return "";
+}
+
+set<string> ImportResolver::ScanImportPaths(const string& relative_path) const {
+  // Look for that relative path at each of our import roots.
+  set<string> found;
+  for (const auto& path : import_paths_) {
+    if (io_delegate_.FileIsReadable(path + relative_path)) {
+      found.emplace(path + relative_path);
+    }
+  }
+  return found;
+}
+
+}  // namespace aidl
+}  // namespace android
diff --git a/import_resolver.h b/import_resolver.h
new file mode 100644
index 0000000..a9f38fd
--- /dev/null
+++ b/import_resolver.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <set>
+#include <string>
+
+#include "io_delegate.h"
+
+namespace android {
+namespace aidl {
+
+class ImportResolver {
+ public:
+  ImportResolver(const IoDelegate& io_delegate, const std::string& input_file_name,
+                 const std::set<std::string>& import_paths);
+  virtual ~ImportResolver() = default;
+
+  // non-copyable, non-movable
+  ImportResolver(const ImportResolver&) = delete;
+  ImportResolver(ImportResolver&&) = delete;
+  ImportResolver& operator=(const ImportResolver&) = delete;
+  ImportResolver& operator=(ImportResolver&&) = delete;
+
+  // Resolve the canonical name for a class to a file that exists
+  // in one of the import paths given to the ImportResolver.
+  std::string FindImportFile(const std::string& canonical_name) const;
+
+ private:
+  std::set<std::string> ScanImportPaths(const std::string& relative_path) const;
+
+  const IoDelegate& io_delegate_;
+  const std::string& input_file_name_;
+  std::set<std::string> import_paths_;
+};
+
+}  // namespace aidl
+}  // namespace android
diff --git a/io_delegate.cpp b/io_delegate.cpp
new file mode 100644
index 0000000..b903f1f
--- /dev/null
+++ b/io_delegate.cpp
@@ -0,0 +1,285 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "io_delegate.h"
+
+#include <cstring>
+#include <fstream>
+#include <type_traits>
+#include <vector>
+
+#ifdef _WIN32
+#include <direct.h>
+#include <windows.h>
+#undef ERROR
+#else
+#include <dirent.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+#endif
+
+#include <android-base/strings.h>
+
+#include "logging.h"
+#include "os.h"
+
+using std::string;
+using std::unique_ptr;
+using std::vector;
+
+using android::base::Error;
+using android::base::Result;
+using android::base::Split;
+using android::base::StartsWith;
+
+namespace android {
+namespace aidl {
+
+bool IoDelegate::GetAbsolutePath(const string& path, string* absolute_path) {
+#ifdef _WIN32
+
+  char buf[4096];
+  DWORD path_len = GetFullPathName(path.c_str(), sizeof(buf), buf, nullptr);
+  if (path_len <= 0 || path_len >= sizeof(buf)) {
+    AIDL_ERROR(path) << "Failed to GetFullPathName";
+    return false;
+  }
+  *absolute_path = buf;
+
+  return true;
+
+#else
+
+  if (path.empty()) {
+    AIDL_ERROR(path) << "Giving up on finding an absolute path to represent the empty string.";
+    return false;
+  }
+  if (path[0] == OS_PATH_SEPARATOR) {
+    *absolute_path = path;
+    return true;
+  }
+
+  char buf[4096];
+  if (getcwd(buf, sizeof(buf)) == nullptr) {
+    AIDL_ERROR(path) << "Path of current working directory does not fit in " << sizeof(buf)
+                     << " bytes";
+    return false;
+  }
+
+  *absolute_path = buf;
+  *absolute_path += OS_PATH_SEPARATOR;
+  *absolute_path += path;
+  return true;
+#endif
+}
+
+unique_ptr<string> IoDelegate::GetFileContents(
+    const string& filename,
+    const string& content_suffix) const {
+  unique_ptr<string> contents;
+  std::ifstream in(filename, std::ios::in | std::ios::binary);
+  if (!in) {
+    return contents;
+  }
+  contents.reset(new string);
+  in.seekg(0, std::ios::end);
+  ssize_t file_size = in.tellg();
+  contents->resize(file_size + content_suffix.length());
+  in.seekg(0, std::ios::beg);
+  // Read the file contents into the beginning of the string
+  in.read(&(*contents)[0], file_size);
+  // Drop the suffix in at the end.
+  contents->replace(file_size, content_suffix.length(), content_suffix);
+  in.close();
+
+  return contents;
+}
+
+bool IoDelegate::FileIsReadable(const string& path) const {
+#ifdef _WIN32
+  // check that the file exists and is not write-only
+  return (0 == _access(path.c_str(), 0)) &&  // mode 0=exist
+         (0 == _access(path.c_str(), 4));    // mode 4=readable
+#else
+  return (0 == access(path.c_str(), R_OK));
+#endif
+}
+
+static bool CreateNestedDirs(const string& caller_base_dir, const vector<string>& nested_subdirs) {
+  string base_dir = caller_base_dir;
+  if (base_dir.empty()) {
+    base_dir = ".";
+  }
+  for (const string& subdir : nested_subdirs) {
+    if (base_dir[base_dir.size() - 1] != OS_PATH_SEPARATOR) {
+      base_dir += OS_PATH_SEPARATOR;
+    }
+    base_dir += subdir;
+    bool success;
+#ifdef _WIN32
+    success = _mkdir(base_dir.c_str()) == 0;
+#else
+    success = mkdir(base_dir.c_str(),
+                    S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) == 0;
+#endif
+    // On darwin when you try to mkdir("/", ...) we get EISDIR.
+    if (!success && (errno != EEXIST && errno != EISDIR)) {
+      AIDL_ERROR(caller_base_dir) << "Error while creating " << base_dir << ": " << strerror(errno);
+      return false;
+    }
+  }
+  return true;
+}
+
+bool IoDelegate::CreateDirForPath(const string& path) const {
+  if (path.empty()) {
+    return true;
+  }
+
+  string absolute_path;
+  if (!GetAbsolutePath(path, &absolute_path)) {
+    return false;
+  }
+
+  auto directories = Split(absolute_path, string{OS_PATH_SEPARATOR});
+
+  // The "base" directory is just the root of the file system.  On Windows,
+  // this will look like "C:\" but on Unix style file systems we get an empty
+  // string after splitting "/foo" with "/"
+  string base = directories[0];
+  if (base.empty()) {
+    base = "/";
+  }
+  directories.erase(directories.begin());
+
+  // Remove the actual file in question, we're just creating the directory path.
+  bool is_file = path.back() != OS_PATH_SEPARATOR;
+  if (is_file) {
+    directories.pop_back();
+  }
+
+  return CreateNestedDirs(base, directories);
+}
+
+unique_ptr<CodeWriter> IoDelegate::GetCodeWriter(
+    const string& file_path) const {
+  if (CreateDirForPath(file_path)) {
+    return CodeWriter::ForFile(file_path);
+  } else {
+    return nullptr;
+  }
+}
+
+#ifdef _WIN32
+
+static Result<void> add_list_files(const string& dirname, vector<string>* result) {
+  AIDL_FATAL_IF(result == nullptr, dirname);
+
+  WIN32_FIND_DATA find_data;
+  // Look up the first file.
+  // See https://stackoverflow.com/a/14841564/112950 for why we use remove_pointer_t
+  // here.
+  // Note: we need to use a wildcard expression like `\*` to ensure we traverse
+  // the directory. Otherwise Find{First,Next}File will only return the directory
+  // itself and stop.
+  const string path(dirname + "\\*");
+  std::unique_ptr<std::remove_pointer_t<HANDLE>, decltype(&FindClose)> search_handle(
+      FindFirstFile(path.c_str(), &find_data), FindClose);
+
+  if (search_handle.get() == INVALID_HANDLE_VALUE) {
+    return Error() << "Failed to read directory '" << dirname << "': " << GetLastError();
+  }
+
+  bool has_more_files = true;
+  do {
+    const bool skip = !strcmp(find_data.cFileName, ".") || !strcmp(find_data.cFileName, "..");
+
+    if (!skip) {
+      if (find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+        if (auto ret = add_list_files(dirname + OS_PATH_SEPARATOR + find_data.cFileName, result);
+            !ret.ok()) {
+          return ret;
+        }
+      } else {
+        result->emplace_back(dirname + OS_PATH_SEPARATOR + find_data.cFileName);
+      }
+    }
+
+    has_more_files = FindNextFile(search_handle.get(), &find_data);
+    if (!has_more_files) {
+      const DWORD err = GetLastError();
+      if (err != ERROR_NO_MORE_FILES) {
+        return Error() << "Failed to read directory entry in '" << dirname << "': " << err;
+      }
+    }
+  } while (has_more_files);
+
+  return Result<void>();
+}
+#else
+static Result<void> add_list_files(const string& dirname, vector<string>* result) {
+  AIDL_FATAL_IF(result == nullptr, dirname);
+  std::unique_ptr<DIR, decltype(&closedir)> dir(opendir(dirname.c_str()), closedir);
+
+  if (dir == nullptr) {
+    return Error() << "Failed to read directory '" << dirname << "': " << strerror(errno);
+  }
+
+  while (true) {
+    errno = 0;
+    struct dirent* ent = readdir(dir.get());
+    if (ent == nullptr) {
+      if (errno != 0) {
+        return Error() << "Failed to read directory entry in '" << dirname
+                       << "': " << strerror(errno);
+      }
+      break;
+    }
+
+    if (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, "..")) {
+      continue;
+    }
+    if (ent->d_type == DT_REG) {
+      result->emplace_back(dirname + OS_PATH_SEPARATOR + ent->d_name);
+    } else if (ent->d_type == DT_DIR) {
+      if (auto ret = add_list_files(dirname + OS_PATH_SEPARATOR + ent->d_name, result); !ret.ok()) {
+        return ret;
+      }
+    }
+  }
+
+  return Result<void>();
+}
+#endif
+
+Result<vector<string>> IoDelegate::ListFiles(const string& dir) const {
+  vector<string> result;
+  if (auto ret = add_list_files(dir, &result); !ret.ok()) {
+    return ret.error();
+  }
+  return result;
+}
+
+string IoDelegate::CleanPath(const string& path) {
+  if (base::StartsWith(path, string{'.', OS_PATH_SEPARATOR})) {
+    return path.substr(2);
+  }
+  return path;
+}
+
+}  // namespace android
+}  // namespace aidl
diff --git a/io_delegate.h b/io_delegate.h
new file mode 100644
index 0000000..a92a9b9
--- /dev/null
+++ b/io_delegate.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <android-base/result.h>
+
+#include "code_writer.h"
+
+namespace android {
+namespace aidl {
+
+class IoDelegate {
+ public:
+  IoDelegate() = default;
+  virtual ~IoDelegate() = default;
+
+  IoDelegate(const IoDelegate&) = delete;
+  IoDelegate(IoDelegate&&) = delete;
+  IoDelegate& operator=(const IoDelegate&) = delete;
+  IoDelegate& operator=(IoDelegate&&) = delete;
+
+  // Stores an absolute version of |path| to |*absolute_path|,
+  // possibly prefixing it with the current working directory.
+  // Returns false and does not set |*absolute_path| on error.
+  static bool GetAbsolutePath(const std::string& path,
+                              std::string* absolute_path);
+
+  // Remove leading "./" from |path|.
+  static std::string CleanPath(const std::string& path);
+
+  // Returns a unique_ptr to the contents of |filename|.
+  // Will append the optional |content_suffix| to the returned contents.
+  virtual std::unique_ptr<std::string> GetFileContents(
+      const std::string& filename,
+      const std::string& content_suffix = "") const;
+
+  virtual bool FileIsReadable(const std::string& path) const;
+
+  virtual std::unique_ptr<CodeWriter> GetCodeWriter(
+      const std::string& file_path) const;
+
+  virtual android::base::Result<std::vector<std::string>> ListFiles(const std::string& dir) const;
+
+ private:
+  // Create the directory when path is a dir or the parent directory when
+  // path is a file. Path is a dir if it ends with the path separator.
+  bool CreateDirForPath(const std::string& path) const;
+};  // class IoDelegate
+
+}  // namespace aidl
+}  // namespace android
diff --git a/io_delegate_unittest.cpp b/io_delegate_unittest.cpp
new file mode 100644
index 0000000..d952b83
--- /dev/null
+++ b/io_delegate_unittest.cpp
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2016, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "io_delegate.h"
+
+#include <string>
+
+#include <gtest/gtest.h>
+
+using std::string;
+using testing::internal::CaptureStderr;
+using testing::internal::GetCapturedStderr;
+
+namespace android {
+namespace aidl {
+
+TEST(IoDelegateTest, CannotGetAbsolutePathFromEmptyString) {
+  string expected_error =
+      "ERROR: : Giving up on finding an absolute path to represent the empty string.\n";
+  CaptureStderr();
+  string absolute_path;
+  EXPECT_FALSE(IoDelegate::GetAbsolutePath("", &absolute_path));
+  EXPECT_TRUE(absolute_path.empty());
+  EXPECT_EQ(expected_error, GetCapturedStderr());
+}
+
+TEST(IoDelegateTest, CurrentlyInfersLinuxAbsolutePath) {
+  string absolute_path;
+  EXPECT_TRUE(IoDelegate::GetAbsolutePath("foo", &absolute_path));
+  ASSERT_FALSE(absolute_path.empty());
+  // Should find our desired file at the end of |absolute_path|
+  // But we don't know the prefix, since it's the current working directory
+  EXPECT_TRUE(absolute_path.rfind("/foo") == absolute_path.length() - 4);
+  // Whatever our current working directory, the path is absolute.
+  EXPECT_EQ(absolute_path[0], '/');
+}
+
+}  // namespace aidl
+}  // namespace android
diff --git a/location.cpp b/location.cpp
new file mode 100644
index 0000000..4b8a278
--- /dev/null
+++ b/location.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "location.h"
+
+AidlLocation::AidlLocation(const std::string& file, Point begin, Point end, Source source)
+    : file_(file), begin_(begin), end_(end), source_(source) {}
+
+std::ostream& operator<<(std::ostream& os, const AidlLocation& l) {
+  os << l.file_;
+  if (l.LocationKnown()) {
+    os << ":" << l.begin_.line << "." << l.begin_.column << "-";
+    if (l.begin_.line != l.end_.line) {
+      os << l.end_.line << ".";
+    }
+    os << l.end_.column;
+  }
+  return os;
+}
diff --git a/location.h b/location.h
new file mode 100644
index 0000000..9ccad24
--- /dev/null
+++ b/location.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <iostream>
+#include <string>
+
+class AidlLocation {
+ public:
+  struct Point {
+    int line;
+    int column;
+  };
+
+  enum class Source {
+    // From internal aidl source code
+    INTERNAL = 0,
+    // From a parsed file
+    EXTERNAL = 1
+  };
+
+  AidlLocation(const std::string& file, Point begin, Point end, Source source);
+  AidlLocation(const std::string& file, Source source)
+      : AidlLocation(file, {0, 0}, {0, 0}, source) {}
+
+  bool IsInternal() const { return source_ == Source::INTERNAL; }
+
+  // The first line of a file is line 1.
+  bool LocationKnown() const { return begin_.line != 0; }
+
+  std::string GetFile() const { return file_; }
+
+  friend std::ostream& operator<<(std::ostream& os, const AidlLocation& l);
+  friend class AidlNode;
+
+ private:
+  // INTENTIONALLY HIDDEN: only operator<< should access details here.
+  // Otherwise, locations should only ever be copied around to construct new
+  // objects.
+  const std::string file_;
+  Point begin_;
+  Point end_;
+  Source source_;
+};
+
+#define AIDL_LOCATION_HERE \
+  (AidlLocation{__FILE__, {__LINE__, 0}, {__LINE__, 0}, AidlLocation::Source::INTERNAL})
+
+std::ostream& operator<<(std::ostream& os, const AidlLocation& l);
\ No newline at end of file
diff --git a/logging.cpp b/logging.cpp
new file mode 100644
index 0000000..3c75565
--- /dev/null
+++ b/logging.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "logging.h"
+
+#include "aidl_language.h"
+
+bool AidlErrorLog::sHadError = false;
+
+AidlErrorLog::AidlErrorLog(Severity severity, const AidlLocation& location,
+                           const std::string& suffix /* = "" */)
+    : os_(&std::cerr), severity_(severity), location_(location), suffix_(suffix) {
+  sHadError |= severity_ >= ERROR;
+  if (severity_ != NO_OP) {
+    (*os_) << (severity_ == WARNING ? "WARNING: " : "ERROR: ");
+    (*os_) << location << ": ";
+  }
+}
+
+AidlErrorLog::AidlErrorLog(Severity severity, const AidlNode& node)
+    : AidlErrorLog(severity, node.location_) {}
+
+AidlErrorLog::AidlErrorLog(Severity severity, const std::string& filename)
+    : AidlErrorLog(severity, AidlLocation(filename, AidlLocation::Source::EXTERNAL)) {}
+
+AidlErrorLog::~AidlErrorLog() {
+  if (severity_ == NO_OP) return;
+  (*os_) << suffix_ << std::endl;
+  if (severity_ == FATAL) abort();
+  if (location_.IsInternal()) {
+    (*os_) << "Logging an internal location should not happen. Offending location: " << location_
+           << std::endl;
+    abort();
+  }
+}
diff --git a/logging.h b/logging.h
new file mode 100644
index 0000000..f2150c2
--- /dev/null
+++ b/logging.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <iostream>
+#include <string>
+
+#include "location.h"
+
+class AidlNode;
+
+// Generic point for printing any error in the AIDL compiler.
+class AidlErrorLog {
+ public:
+  enum Severity { NO_OP, WARNING, ERROR, FATAL };
+
+  AidlErrorLog(Severity severity, const AidlLocation& location, const std::string& suffix = "");
+  AidlErrorLog(Severity severity, const std::string& filename);
+  AidlErrorLog(Severity severity, const AidlNode& node);
+  AidlErrorLog(Severity severity, const AidlNode* node) : AidlErrorLog(severity, *node) {}
+
+  template <typename T>
+  AidlErrorLog(Severity severity, const std::unique_ptr<T>& node) : AidlErrorLog(severity, *node) {}
+  ~AidlErrorLog();
+
+  // AidlErrorLog is a single use object. No need to copy
+  AidlErrorLog(const AidlErrorLog&) = delete;
+  AidlErrorLog& operator=(const AidlErrorLog&) = delete;
+
+  // btw, making it movable so that functions can return it.
+  AidlErrorLog(AidlErrorLog&&) = default;
+  AidlErrorLog& operator=(AidlErrorLog&&) = delete;
+
+  template <typename T>
+  AidlErrorLog& operator<<(T&& arg) {
+    if (severity_ != NO_OP) {
+      (*os_) << std::forward<T>(arg);
+    }
+    return *this;
+  }
+
+  static void clearError() { sHadError = false; }
+  static bool hadError() { return sHadError; }
+
+ private:
+  std::ostream* os_;
+  Severity severity_;
+  const AidlLocation location_;
+  const std::string suffix_;
+  static bool sHadError;
+};
+
+// A class used to make it obvious to clang that code is going to abort. This
+// informs static analyses of the aborting behavior of `AIDL_FATAL`, and
+// helps generate slightly faster/smaller code.
+class AidlAbortOnDestruction {
+ public:
+  __attribute__((noreturn)) ~AidlAbortOnDestruction() { abort(); }
+};
+
+#define AIDL_ERROR(CONTEXT) ::AidlErrorLog(AidlErrorLog::ERROR, (CONTEXT))
+#define AIDL_FATAL(CONTEXT) \
+  (::AidlAbortOnDestruction(), ::AidlErrorLog(AidlErrorLog::FATAL, (CONTEXT)))
+#define AIDL_FATAL_IF(CONDITION, CONTEXT) \
+  if (CONDITION) AIDL_FATAL(CONTEXT) << "Bad internal state: " << #CONDITION << ": "
diff --git a/main.cpp b/main.cpp
new file mode 100644
index 0000000..c0078ba
--- /dev/null
+++ b/main.cpp
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl.h"
+#include "io_delegate.h"
+#include "logging.h"
+#include "options.h"
+
+#include <iostream>
+
+using android::aidl::Options;
+
+#ifdef AIDL_CPP_BUILD
+constexpr Options::Language kDefaultLang = Options::Language::CPP;
+#else
+constexpr Options::Language kDefaultLang = Options::Language::JAVA;
+#endif
+
+int main(int argc, char* argv[]) {
+  Options options(argc, argv, kDefaultLang);
+
+  // Only minimal functionality should go here, so that as much of possible of
+  // the aidl compiler is mocked with the single function `aidl_entry`
+
+  android::aidl::IoDelegate io_delegate;
+  int ret = aidl_entry(options, io_delegate);
+
+  return ret;
+}
diff --git a/metadata/Android.bp b/metadata/Android.bp
new file mode 100644
index 0000000..064ed5d
--- /dev/null
+++ b/metadata/Android.bp
@@ -0,0 +1,61 @@
+// build time C++ available list of all AIDL interfaces in the tree
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "system_tools_aidl_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["system_tools_aidl_license"],
+}
+
+cc_test_library {
+    name: "libaidlmetadata",
+    host_supported: true,
+    srcs: [":aidl_metadata_in_cpp"],
+    export_include_dirs: ["include"],
+
+    cflags: ["-O0"],
+}
+
+cc_library_headers {
+    name: "libaidlmetadata_headers",
+    product_available: true,
+    recovery_available: true,
+    host_supported: true,
+    export_include_dirs: ["include"],
+}
+
+// private impl below
+
+cc_binary {
+    name: "aidl_metadata_parser",
+    host_supported: true,
+    srcs: ["parser.cpp"],
+    shared_libs: ["libjsoncpp"],
+    visibility: [":__subpackages__"],
+}
+
+cc_genrule {
+    name: "aidl_metadata_in_cpp",
+    host_supported: true,
+    cmd: "$(location aidl_metadata_parser) $(in) > $(genDir)/metadata.cpp",
+    srcs: [
+        ":aidl_metadata_json",
+    ],
+    tools: ["aidl_metadata_parser"],
+    visibility: [":__subpackages__"],
+    out: ["metadata.cpp"],
+}
+
+cc_test_host {
+    name: "libaidlmetadata_test",
+    static_libs: [
+        "libaidlmetadata",
+        "libgmock",
+    ],
+    srcs: ["test.cpp"],
+    test_options: {
+        unit_test: true,
+    },
+    test_suites: ["general-tests"],
+}
diff --git a/metadata/include/aidl/metadata.h b/metadata/include/aidl/metadata.h
new file mode 100644
index 0000000..09c60ba
--- /dev/null
+++ b/metadata/include/aidl/metadata.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <string>
+#include <vector>
+
+namespace android {
+
+struct AidlInterfaceMetadata {
+  // name of module defining package
+  std::string name;
+
+  // stability of interface (e.g. "vintf")
+  std::string stability;
+
+  // list of types e.g. android.hardware.foo.IFoo
+  std::vector<std::string> types;
+
+  // list of all hashes
+  std::vector<std::string> hashes;
+
+  // true if the interface is different from the last frozen version
+  bool has_development;
+
+  // list of all frozen versions
+  std::vector<size_t> versions;
+
+  static std::vector<AidlInterfaceMetadata> all();
+};
+
+}  // namespace android
diff --git a/metadata/parser.cpp b/metadata/parser.cpp
new file mode 100644
index 0000000..646a77b
--- /dev/null
+++ b/metadata/parser.cpp
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <fstream>
+#include <iostream>
+
+#include <json/json.h>
+
+int main(int argc, char** argv) {
+  if (argc != 2) {
+    std::cerr << "Usage: aidl_metadata_parser *.json" << std::endl;
+    return EXIT_FAILURE;
+  }
+  const std::string path = argv[1];
+
+  Json::Value root;
+  Json::CharReaderBuilder builder;
+
+  std::ifstream stream(path);
+  std::string errorMessage;
+  if (!Json::parseFromStream(builder, stream, &root, &errorMessage)) {
+    std::cerr << "Failed to read interface metadata file: " << path << std::endl
+              << errorMessage << std::endl;
+    return EXIT_FAILURE;
+  }
+
+  std::cout << "#include <aidl/metadata.h>" << std::endl;
+  std::cout << "namespace android {" << std::endl;
+  std::cout << "std::vector<AidlInterfaceMetadata> AidlInterfaceMetadata::all() {" << std::endl;
+  std::cout << "return std::vector<AidlInterfaceMetadata>{" << std::endl;
+  for (const Json::Value& entry : root) {
+    std::cout << "AidlInterfaceMetadata{" << std::endl;
+    // AIDL interface characters guaranteed to be accepted in C++ string
+    std::cout << "std::string(\"" << entry["name"].asString() << "\")," << std::endl;
+    std::cout << "std::string(\"" << entry["stability"].asString() << "\")," << std::endl;
+    std::cout << "std::vector<std::string>{" << std::endl;
+    for (const Json::Value& intf : entry["types"]) {
+      std::cout << "std::string(\"" << intf.asString() << "\")," << std::endl;
+    }
+    std::cout << "}," << std::endl;
+    std::cout << "std::vector<std::string>{" << std::endl;
+    for (const Json::Value& intf : entry["hashes"]) {
+      std::cout << "std::string(\"" << intf.asString() << "\")," << std::endl;
+    }
+    std::cout << "}," << std::endl;
+    std::cout << entry["has_development"].asString() << "," << std::endl;
+    std::cout << "std::vector<size_t>{" << std::endl;
+    for (const Json::Value& intf : entry["versions"]) {
+      std::cout << intf.asString() << "," << std::endl;
+    }
+    std::cout << "}," << std::endl;
+    std::cout << "}," << std::endl;
+  }
+  std::cout << "};" << std::endl;
+  std::cout << "}" << std::endl;
+  std::cout << "}  // namespace android" << std::endl;
+  return EXIT_SUCCESS;
+}
diff --git a/metadata/test.cpp b/metadata/test.cpp
new file mode 100644
index 0000000..7d7d331
--- /dev/null
+++ b/metadata/test.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/metadata.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <optional>
+
+using ::android::AidlInterfaceMetadata;
+using ::testing::ElementsAre;
+
+static std::optional<AidlInterfaceMetadata> metadataForModule(const std::string& name) {
+  for (const AidlInterfaceMetadata& info : AidlInterfaceMetadata::all()) {
+    if (name == info.name) return info;
+  }
+  return std::nullopt;
+}
+
+TEST(AidlMetadata, HasTestInstances) {
+  const auto& info = metadataForModule("test-piece-1");
+  ASSERT_NE(info, std::nullopt);
+  EXPECT_EQ(info->stability, "");
+  EXPECT_THAT(info->types,
+              ElementsAre("some_package.IFoo", "some_package.Thing",
+                          "some_package.sub_package.IFoo", "some_package.sub_package.SubThing"));
+  EXPECT_THAT(info->hashes, ElementsAre("13e24b2fac6a979971819fba2ab0d6d7c4182122",
+                                        "dc2a9292847e43b4360bb183f7491f0e9895eaa9",
+                                        "54f935920ab0934c242145cf00f9852ae3f5a63e",
+                                        "be5dd6bf9c9000ee053621f118b7d6a7cfd1e79e"));
+  EXPECT_THAT(info->versions, ElementsAre(1, 2, 3, 4));
+  EXPECT_EQ(info->has_development, false);
+}
+
+TEST(AidlMetadata, HasTestInstancesNoDevelopment) {
+  const auto& info = metadataForModule("test-piece-2");
+  ASSERT_NE(info, std::nullopt);
+  EXPECT_EQ(info->stability, "");
+  EXPECT_THAT(info->types, ElementsAre("INoPackage", "some_package.IBar"));
+  EXPECT_THAT(info->hashes, ElementsAre("c544902ab8a1d2e72ae9396032ba113e9b9698c4",
+                                        "fcd36db451cdbeeb049833fd7f499a987acf3930"));
+  EXPECT_THAT(info->versions, ElementsAre(1));
+  EXPECT_EQ(info->has_development, false);
+}
diff --git a/options.cpp b/options.cpp
new file mode 100644
index 0000000..782854c
--- /dev/null
+++ b/options.cpp
@@ -0,0 +1,744 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "options.h"
+
+#include <android-base/logging.h>
+#include <android-base/parseint.h>
+#include <android-base/result.h>
+#include <android-base/strings.h>
+#include <getopt.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <algorithm>
+#include <iostream>
+#include <sstream>
+#include <string>
+
+#include "aidl_language.h"
+#include "logging.h"
+#include "os.h"
+
+using android::base::Join;
+using android::base::Result;
+using android::base::Split;
+using android::base::StringReplace;
+using android::base::Trim;
+using std::endl;
+using std::string;
+
+#ifndef PLATFORM_SDK_VERSION
+#define PLATFORM_SDK_VERSION "<UNKNOWN>"
+#endif
+
+namespace android {
+namespace aidl {
+
+string Options::GetUsage() const {
+  std::ostringstream sstr;
+  sstr << "AIDL Compiler: built for platform SDK version " << PLATFORM_SDK_VERSION << endl;
+  sstr << "usage:" << endl
+       << myname_ << " --lang={java|cpp|ndk|rust} [OPTION]... INPUT..." << endl
+       << "   Generate Java, C++ or Rust files for AIDL file(s)." << endl
+       << endl
+       << myname_ << " --preprocess OUTPUT INPUT..." << endl
+       << "   Create an AIDL file having declarations of AIDL file(s)." << endl
+       << endl
+       << myname_ << " --dumpapi --out=DIR INPUT..." << endl
+       << "   Dump API signature of AIDL file(s) to DIR." << endl
+       << endl
+       << myname_ << " --checkapi[={compatible|equal}] OLD_DIR NEW_DIR" << endl
+       << "   Check whether NEW_DIR API dump is {compatible|equal} extension " << endl
+       << "   of the API dump OLD_DIR. Default: compatible" << endl
+       << endl
+       << myname_ << " --apimapping OUTPUT INPUT..." << endl
+       << "   Generate a mapping of declared aidl method signatures to" << endl
+       << "   the original line number. e.g.: " << endl
+       << "       If line 39 of foo/bar/IFoo.aidl contains:"
+       << "         void doFoo(int bar, String baz);" << endl
+       << "       Then the result would be:" << endl
+       << "         foo.bar.Baz|doFoo|int,String,|void" << endl
+       << "         foo/bar/IFoo.aidl:39" << endl
+       << endl;
+
+  // Legacy option formats
+  if (language_ == Options::Language::JAVA) {
+    sstr << myname_ << " [OPTION]... INPUT [OUTPUT]" << endl
+         << "   Generate a Java file for an AIDL file." << endl
+         << endl;
+  } else if (language_ == Options::Language::CPP) {
+    sstr << myname_ << " [OPTION]... INPUT HEADER_DIR OUTPUT" << endl
+         << "   Generate C++ headers and source for an AIDL file." << endl
+         << endl;
+  } else if (language_ == Options::Language::RUST) {
+    sstr << myname_ << " [OPTION]... INPUT [OUTPUT]" << endl
+         << "   Generate Rust file for an AIDL file." << endl
+         << endl;
+  }
+
+  sstr << "OPTION:" << endl
+       << "  -I DIR, --include=DIR" << endl
+       << "          Use DIR as a search path for import statements of dependencies." << endl
+       << "  -N DIR, --next_include=DIR" << endl
+       << "          Use DIR as a search path for local import statements." << endl
+       << "  -p FILE, --preprocessed=FILE" << endl
+       << "          Include FILE which is created by --preprocess." << endl
+       << "  -d FILE, --dep=FILE" << endl
+       << "          Generate dependency file as FILE. Don't use this when" << endl
+       << "          there are multiple input files. Use -a then." << endl
+       << "  -o DIR, --out=DIR" << endl
+       << "          Use DIR as the base output directory for generated files." << endl
+       << "  -h DIR, --header_out=DIR" << endl
+       << "          Generate C++ headers under DIR." << endl
+       << "  --previous_api_dir=DIR" << endl
+       << "          The aidl_api directory of the previous version of this interface." << endl
+       << "  -a" << endl
+       << "          Generate dependency file next to the output file with the" << endl
+       << "          name based on the input file." << endl
+       << "  -b" << endl
+       << "          Trigger fail when trying to compile a parcelable declaration." << endl
+       << "  --ninja" << endl
+       << "          Generate dependency file in a format ninja understands." << endl
+       << "  --rpc" << endl
+       << "          (for Java) whether to generate support for RPC transactions." << endl
+       << "  --structured" << endl
+       << "          Whether this interface is defined exclusively in AIDL." << endl
+       << "          It is therefore a candidate for stabilization." << endl
+       << "  --stability=<level>" << endl
+       << "          The stability requirement of this interface." << endl
+       << "  --min_sdk_version=<version>" << endl
+       << "          Minimum SDK version that the generated code should support." << endl
+       << "          Defaults to " << DEFAULT_SDK_VERSION_JAVA << " for --lang=java, " << endl
+       << "            " << DEFAULT_SDK_VERSION_CPP << " for --lang=cpp, " << endl
+       << "            " << DEFAULT_SDK_VERSION_NDK << " for --lang=ndk, " << endl
+       << "            " << DEFAULT_SDK_VERSION_RUST << " for --lang=rust, " << endl
+       << "  --omit_invocation" << endl
+       << "          Do not print full commandline in output. This is required " << endl
+       << "          for certain build systems." << endl
+       << "  -t, --trace" << endl
+       << "          Include tracing code for systrace. Note that if either" << endl
+       << "          the client or service code is not auto-generated by this" << endl
+       << "          tool, that part will not be traced." << endl
+       << "  --transaction_names" << endl
+       << "          Generate transaction names." << endl
+       << "  -v VER, --version=VER" << endl
+       << "          Set the version of the interface and parcelable to VER." << endl
+       << "          VER must be an interger greater than 0." << endl
+       << "  --hash=HASH" << endl
+       << "          Set the interface hash to HASH." << endl
+       << "  --previous_hash=HASH" << endl
+       << "          Set the interface previous version's hash to HASH." << endl
+       << "  --log" << endl
+       << "          Information about the transaction, e.g., method name, argument" << endl
+       << "          values, execution time, etc., is provided via callback." << endl
+       << "  -Werror" << endl
+       << "          Turn warnings into errors." << endl
+       << "  -Wno-error=<warning>" << endl
+       << "          Turn the specified warning into a warning even if -Werror is specified."
+       << endl
+       << "  -W<warning>" << endl
+       << "          Enable the specified warning." << endl
+       << "  -Wno-<warning>" << endl
+       << "          Disable the specified warning." << endl
+       << "  -w" << endl
+       << "          Disable all diagnostics. -w wins -Weverything" << endl
+       << "  -Weverything" << endl
+       << "          Enable all diagnostics." << endl
+       << "  --help" << endl
+       << "          Show this help." << endl
+       << endl
+       << "INPUT:" << endl
+       << "  An AIDL file." << endl
+       << endl
+       << "OUTPUT:" << endl
+       << "  Path to the generated Java or C++ source file. This is ignored when" << endl
+       << "  -o or --out is specified or the number of the input files are" << endl
+       << "  more than one." << endl
+       << "  For Java, if omitted, Java source file is generated at the same" << endl
+       << "  place as the input AIDL file," << endl
+       << endl
+       << "HEADER_DIR:" << endl
+       << "  Path to where C++ headers are generated." << endl;
+  return sstr.str();
+}
+
+string to_string(Options::Language language) {
+  switch (language) {
+    case Options::Language::CPP:
+      return "cpp";
+    case Options::Language::JAVA:
+      return "java";
+    case Options::Language::NDK:
+      return "ndk";
+    case Options::Language::RUST:
+      return "rust";
+    case Options::Language::CPP_ANALYZER:
+      return "cpp-analyzer";
+    case Options::Language::UNSPECIFIED:
+      return "unspecified";
+    default:
+      AIDL_FATAL(AIDL_LOCATION_HERE)
+          << "Unexpected Options::Language enumerator: " << static_cast<size_t>(language);
+  }
+}
+
+bool Options::StabilityFromString(const std::string& stability, Stability* out_stability) {
+  if (stability == "vintf") {
+    *out_stability = Stability::VINTF;
+    return true;
+  }
+  return false;
+}
+
+static const std::map<std::string, uint32_t> codeNameToVersion = {
+    {"S", 31},
+    {"Tiramisu", SDK_VERSION_Tiramisu},
+    {"UpsideDownCake", SDK_VERSION_UpsideDownCake},
+    {"VanillaIceCream", SDK_VERSION_current},
+    // this is an alias for the latest in-development platform version
+    {"current", SDK_VERSION_current},
+    // this is an alias for use of all APIs, including those not in any API surface
+    {"platform_apis", 10001},
+};
+
+Result<uint32_t> MinSdkVersionFromString(const std::string& str) {
+  uint32_t num;
+  if (!android::base::ParseUint(str, &num, 10000u /* max */)) {
+    if (auto found = codeNameToVersion.find(str); found != codeNameToVersion.end()) {
+      return found->second;
+    }
+    return Errorf("Invalid SDK version: {}", str);
+  }
+  return num;
+}
+
+static uint32_t DefaultMinSdkVersionForLang(const Options::Language lang) {
+  switch (lang) {
+    case Options::Language::CPP:
+      return DEFAULT_SDK_VERSION_CPP;
+    case Options::Language::JAVA:
+      return DEFAULT_SDK_VERSION_JAVA;
+    case Options::Language::NDK:
+      return DEFAULT_SDK_VERSION_NDK;
+    case Options::Language::RUST:
+      return DEFAULT_SDK_VERSION_RUST;
+    case Options::Language::CPP_ANALYZER:
+      return DEFAULT_SDK_VERSION_CPP;
+    case Options::Language::UNSPECIFIED:
+      return DEFAULT_SDK_VERSION_JAVA;  // The safest option
+    default:
+      AIDL_FATAL(AIDL_LOCATION_HERE)
+          << "Unexpected Options::Language enumerator: " << static_cast<size_t>(lang);
+  }
+}
+
+Options Options::From(const string& cmdline) {
+  vector<string> args = Split(cmdline, " ");
+  return From(args);
+}
+
+Options Options::From(const vector<string>& args) {
+  Options::Language lang = Options::Language::JAVA;
+  int argc = args.size();
+  if (argc >= 1 && args.at(0) == "aidl-cpp") {
+    lang = Options::Language::CPP;
+  }
+  const char* argv[argc + 1];
+  for (int i = 0; i < argc; i++) {
+    argv[i] = args.at(i).c_str();
+  }
+  argv[argc] = nullptr;
+
+  return Options(argc, argv, lang);
+}
+
+static std::string ComputeRawArgs(int argc, const char* const raw_argv[]) {
+  std::vector<std::string> args;
+  for (int i = 0; i < argc; i++) {
+    // First pass. This is mostly for devs to understand where files come from, and
+    // there may be more complicated rules, but we can at least do better than the
+    // typical paste that would break args with spaces in them.
+    args.push_back(StringReplace(raw_argv[i], " ", "\\ ", true));
+  }
+
+  return Join(args, " ");
+}
+
+static std::string ToCanonicalDirectory(const std::string& optarg) {
+  std::string dir = Trim(optarg);
+  if (!dir.empty() && dir.back() != OS_PATH_SEPARATOR) {
+    dir.push_back(OS_PATH_SEPARATOR);
+  }
+  return dir;
+}
+
+Options Options::PlusImportDir(const std::string& import_dir) const {
+  Options copy(*this);
+  copy.import_dirs_.insert(ToCanonicalDirectory(import_dir));
+  return copy;
+}
+
+Options::Options(int argc, const char* const raw_argv[], Options::Language default_lang)
+    : myname_(argc >= 1 ? raw_argv[0] : "aidl"),
+      raw_args_(ComputeRawArgs(argc, raw_argv)),
+      language_(default_lang) {
+  std::vector<const char*> argv = warning_options_.Parse(argc, raw_argv, error_message_);
+  if (!Ok()) return;
+  argc = argv.size();
+
+  bool lang_option_found = false;
+  optind = 0;
+  while (true) {
+    static struct option long_options[] = {
+        {"lang", required_argument, 0, 'l'},
+        {"preprocess", no_argument, 0, 's'},
+        {"dumpapi", no_argument, 0, 'u'},
+        {"no_license", no_argument, 0, 'x'},
+        {"checkapi", optional_argument, 0, 'A'},
+        {"apimapping", required_argument, 0, 'i'},
+        {"include", required_argument, 0, 'I'},
+        {"next_include", required_argument, 0, 'N'},
+        {"preprocessed", required_argument, 0, 'p'},
+        {"dep", required_argument, 0, 'd'},
+        {"out", required_argument, 0, 'o'},
+        {"header_out", required_argument, 0, 'h'},
+        {"ninja", no_argument, 0, 'n'},
+        {"rpc", no_argument, 0, 'r'},
+        {"stability", required_argument, 0, 'Y'},
+        {"omit_invocation", no_argument, 0, 'O'},
+        {"min_sdk_version", required_argument, 0, 'm'},
+        {"structured", no_argument, 0, 'S'},
+        {"trace", no_argument, 0, 't'},
+        {"transaction_names", no_argument, 0, 'c'},
+        {"previous_api_dir", required_argument, 0, 'f'},
+        {"version", required_argument, 0, 'v'},
+        {"log", no_argument, 0, 'L'},
+        {"hash", required_argument, 0, 'H'},
+        {"previous_hash", required_argument, 0, 'P'},
+        {"help", no_argument, 0, 'e'},
+        {0, 0, 0, 0},
+    };
+    const int c = getopt_long(argc, const_cast<char* const*>(argv.data()),
+                              "I:N:p:d:o:h:abtv:i:", long_options, nullptr);
+    if (c == -1) {
+      // no more options
+      break;
+    }
+    switch (c) {
+      case 'l':
+        if (language_ == Options::Language::CPP) {
+          // aidl-cpp can't set language. aidl-cpp exists only for backwards
+          // compatibility.
+          error_message_ << "aidl-cpp does not support --lang." << endl;
+          return;
+        } else {
+          lang_option_found = true;
+          string lang = Trim(optarg);
+          if (lang == "java") {
+            language_ = Options::Language::JAVA;
+            task_ = Options::Task::COMPILE;
+          } else if (lang == "cpp") {
+            language_ = Options::Language::CPP;
+            task_ = Options::Task::COMPILE;
+          } else if (lang == "ndk") {
+            language_ = Options::Language::NDK;
+            task_ = Options::Task::COMPILE;
+          } else if (lang == "rust") {
+            language_ = Options::Language::RUST;
+            task_ = Options::Task::COMPILE;
+          } else if (lang == "cpp-analyzer") {
+            language_ = Options::Language::CPP_ANALYZER;
+            task_ = Options::Task::COMPILE;
+          } else {
+            error_message_ << "Unsupported language: '" << lang << "'" << endl;
+            return;
+          }
+        }
+        break;
+      case 's':
+        task_ = Options::Task::PREPROCESS;
+        break;
+      case 'u':
+        task_ = Options::Task::DUMP_API;
+        break;
+      case 'x':
+        dump_no_license_ = true;
+        break;
+      case 'A':
+        task_ = Options::Task::CHECK_API;
+        // to ensure that all parcelables in the api dumpes are structured
+        structured_ = true;
+        if (optarg) {
+          if (strcmp(optarg, "compatible") == 0)
+            check_api_level_ = CheckApiLevel::COMPATIBLE;
+          else if (strcmp(optarg, "equal") == 0)
+            check_api_level_ = CheckApiLevel::EQUAL;
+          else {
+            error_message_ << "Unsupported --checkapi level: '" << optarg << "'" << endl;
+            return;
+          }
+        }
+        break;
+      case 'I': {
+        // imports for dependencies
+        import_dirs_.emplace(ToCanonicalDirectory(optarg));
+        previous_import_dirs_.emplace(ToCanonicalDirectory(optarg));
+        break;
+      }
+      case 'p':
+        preprocessed_files_.emplace_back(Trim(optarg));
+        break;
+      case 'd':
+        dependency_file_ = Trim(optarg);
+        break;
+      case 'o':
+        output_dir_ = ToCanonicalDirectory(optarg);
+        break;
+      case 'N':
+        import_dirs_.emplace(ToCanonicalDirectory(optarg));
+        break;
+      case 'f':
+        previous_api_dir_ = ToCanonicalDirectory(optarg);
+        previous_import_dirs_.emplace(ToCanonicalDirectory(optarg));
+        break;
+      case 'O':
+        raw_args_ = "cmd not shown due to `--omit_invocation`";
+        break;
+      case 'h':
+        output_header_dir_ = ToCanonicalDirectory(optarg);
+        break;
+      case 'n':
+        dependency_file_ninja_ = true;
+        break;
+      case 'S':
+        structured_ = true;
+        break;
+      case 'Y': {
+        const string stability_str = Trim(optarg);
+        if (!StabilityFromString(stability_str, &stability_)) {
+          error_message_ << "Unrecognized stability level: '" << stability_str
+                         << "'. Must be vintf." << endl;
+          return;
+        }
+        break;
+      }
+      case 'm':
+        if (auto ret = MinSdkVersionFromString(Trim(optarg)); ret.ok()) {
+          min_sdk_version_ = *ret;
+        } else {
+          error_message_ << ret.error();
+          return;
+        }
+        break;
+      case 'r':
+        gen_rpc_ = true;
+        break;
+      case 't':
+        gen_traces_ = true;
+        break;
+      case 'a':
+        auto_dep_file_ = true;
+        break;
+      case 'b':
+        fail_on_parcelable_ = true;
+        break;
+      case 'c':
+        gen_transaction_names_ = true;
+        break;
+      case 'v': {
+        const string ver_str = Trim(optarg);
+        int ver = atoi(ver_str.c_str());
+        if (ver > 0) {
+          version_ = ver;
+        } else {
+          error_message_ << "Invalid version number: '" << ver_str << "'. "
+                         << "Version must be a positive natural number." << endl;
+          return;
+        }
+        break;
+      }
+      case 'H':
+        hash_ = Trim(optarg);
+        break;
+      case 'P':
+        previous_hash_ = Trim(optarg);
+        break;
+      case 'L':
+        gen_log_ = true;
+        break;
+      case 'e':
+        std::cerr << GetUsage();
+        task_ = Task::HELP;
+        CHECK(Ok());
+        return;
+      case 'i':
+        output_file_ = Trim(optarg);
+        task_ = Task::DUMP_MAPPINGS;
+        break;
+      default:
+        error_message_ << GetUsage();
+        CHECK(!Ok());
+        return;
+    }
+  }  // while
+
+  // Positional arguments
+  if (!lang_option_found && task_ == Options::Task::COMPILE) {
+    // the legacy arguments format
+    if (argc - optind <= 0) {
+      error_message_ << "No input file" << endl;
+      return;
+    }
+    if (language_ == Options::Language::JAVA || language_ == Options::Language::RUST) {
+      input_files_.emplace_back(argv[optind++]);
+      if (argc - optind >= 1) {
+        output_file_ = argv[optind++];
+      } else if (output_dir_.empty()) {
+        // when output is omitted and -o option isn't set, the output is by
+        // default set to the input file path with .aidl is replaced to .java.
+        // If -o option is set, the output path is calculated by
+        // GetOutputFilePath which returns "<output_dir>/<package/name>/
+        // <typename>.java"
+        output_file_ = input_files_.front();
+        if (android::base::EndsWith(output_file_, ".aidl")) {
+          output_file_ = output_file_.substr(0, output_file_.length() - strlen(".aidl"));
+        }
+        output_file_ += (language_ == Options::Language::JAVA) ? ".java" : ".rs";
+      }
+    } else if (IsCppOutput()) {
+      input_files_.emplace_back(argv[optind++]);
+      if (argc - optind < 2) {
+        error_message_ << "No HEADER_DIR or OUTPUT." << endl;
+        return;
+      }
+      output_header_dir_ = ToCanonicalDirectory(argv[optind++]);
+      output_file_ = argv[optind++];
+    }
+    if (argc - optind > 0) {
+      error_message_ << "Too many arguments: ";
+      for (int i = optind; i < argc; i++) {
+        error_message_ << " " << argv[i];
+      }
+      error_message_ << endl;
+    }
+  } else {
+    // the new arguments format
+    if (task_ == Options::Task::COMPILE || task_ == Options::Task::DUMP_API ||
+        task_ == Options::Task::DUMP_MAPPINGS) {
+      if (argc - optind < 1) {
+        error_message_ << "No input file." << endl;
+        return;
+      }
+    } else {
+      if (argc - optind < 2) {
+        error_message_ << "Insufficient arguments. At least 2 required, but "
+                       << "got " << (argc - optind) << "." << endl;
+        return;
+      }
+      if (task_ != Options::Task::CHECK_API) {
+        output_file_ = argv[optind++];
+      }
+    }
+    while (optind < argc) {
+      input_files_.emplace_back(argv[optind++]);
+    }
+  }
+
+  // filter out invalid combinations
+  if (lang_option_found) {
+    if (IsCppOutput() && task_ == Options::Task::COMPILE) {
+      if (output_dir_.empty()) {
+        error_message_ << "Output directory is not set. Set with --out." << endl;
+        return;
+      }
+      if (output_header_dir_.empty()) {
+        error_message_ << "Header output directory is not set. Set with "
+                       << "--header_out." << endl;
+        return;
+      }
+    }
+    if (language_ == Options::Language::JAVA && task_ == Options::Task::COMPILE) {
+      if (output_dir_.empty()) {
+        error_message_ << "Output directory is not set. Set with --out." << endl;
+        return;
+      }
+      if (!output_header_dir_.empty()) {
+        error_message_ << "Header output directory is set, which does not make "
+                       << "sense for Java." << endl;
+        return;
+      }
+    }
+    if (language_ == Options::Language::RUST && task_ == Options::Task::COMPILE) {
+      if (output_dir_.empty()) {
+        error_message_ << "Output directory is not set. Set with --out." << endl;
+        return;
+      }
+      if (!output_header_dir_.empty()) {
+        error_message_ << "Header output directory is set, which does not make "
+                       << "sense for Rust." << endl;
+        return;
+      }
+    }
+  }
+  if (!previous_api_dir_.empty()) {
+    if (previous_hash_.empty()) {
+      error_message_ << "--previous_hash must be set if --previous_api_dir is set" << endl;
+      return;
+    }
+  } else {
+    if (!previous_hash_.empty()) {
+      error_message_ << "--previous_hash must not be set if --previous_api_dir is not set" << endl;
+      return;
+    }
+  }
+
+  if (task_ == Options::Task::COMPILE) {
+    for (const string& input : input_files_) {
+      if (!android::base::EndsWith(input, ".aidl")) {
+        error_message_ << "Expected .aidl file for input but got '" << input << "'" << endl;
+        return;
+      }
+    }
+    if (!output_file_.empty() && input_files_.size() > 1) {
+      error_message_ << "Multiple AIDL files can't be compiled to a single "
+                     << "output file '" << output_file_ << "'. "
+                     << "Use --out=DIR instead for output files." << endl;
+      return;
+    }
+    if (!dependency_file_.empty() && input_files_.size() > 1) {
+      error_message_ << "-d or --dep doesn't work when compiling multiple AIDL "
+                     << "files. Use '-a' to generate dependency file next to "
+                     << "the output file with the name based on the input "
+                     << "file." << endl;
+      return;
+    }
+    if (gen_log_ && (language_ != Options::Language::CPP && language_ != Options::Language::NDK)) {
+      error_message_ << "--log is currently supported for either --lang=cpp or --lang=ndk" << endl;
+      return;
+    }
+  }
+  if (task_ == Options::Task::PREPROCESS) {
+    if (version_ > 0) {
+      error_message_ << "--version should not be used with '--preprocess'." << endl;
+      return;
+    }
+  }
+  if (task_ == Options::Task::CHECK_API) {
+    if (input_files_.size() != 2) {
+      error_message_ << "--checkapi requires two inputs for comparing, "
+                     << "but got " << input_files_.size() << "." << endl;
+      return;
+    }
+  }
+  if (task_ == Options::Task::DUMP_API) {
+    if (output_dir_.empty()) {
+      error_message_ << "--dumpapi requires output directory. Use --out." << endl;
+      return;
+    }
+  }
+  if (task_ != Options::Task::COMPILE) {
+    if (min_sdk_version_ != 0) {
+      error_message_ << "--min_sdk_version is available only for compilation." << endl;
+      return;
+    }
+    // For other tasks, use "current"
+    min_sdk_version_ = MinSdkVersionFromString("current").value();
+  }
+
+  uint32_t default_ver = DefaultMinSdkVersionForLang(language_);
+  if (min_sdk_version_ == 0) {  // --min_sdk_version flag not specified
+    min_sdk_version_ = default_ver;
+  } else if (min_sdk_version_ < default_ver) {
+    error_message_ << "Min SDK version should at least be " << default_ver << "." << endl;
+    return;
+  }
+
+  uint32_t rpc_version = MinSdkVersionFromString("Tiramisu").value();
+  // note: we would like to always generate (Java) code to support RPC out of
+  // the box, but doing so causes an unclear error for people trying to use RPC
+  // - now we require them to add the gen_rpc build rule and get this clear message.
+  if (gen_rpc_ && min_sdk_version_ < rpc_version) {
+    error_message_ << "RPC code requires minimum SDK version of at least " << rpc_version << endl;
+    return;
+  }
+
+  if (min_sdk_version_ >= rpc_version) gen_rpc_ = true;
+
+  AIDL_FATAL_IF(!output_dir_.empty() && output_dir_.back() != OS_PATH_SEPARATOR, output_dir_);
+  AIDL_FATAL_IF(!output_header_dir_.empty() && output_header_dir_.back() != OS_PATH_SEPARATOR,
+                output_header_dir_);
+}
+
+std::vector<const char*> WarningOptions::Parse(int argc, const char* const raw_argv[],
+                                               ErrorMessage& error_message) {
+  std::vector<const char*> remains;
+  for (int i = 0; i < argc; i++) {
+    auto arg = raw_argv[i];
+    if (strcmp(arg, "-Weverything") == 0) {
+      enable_all_ = true;
+    } else if (strcmp(arg, "-Werror") == 0) {
+      as_errors_ = true;
+    } else if (strcmp(arg, "-w") == 0) {
+      disable_all_ = true;
+    } else if (base::StartsWith(arg, "-Wno-error=")) {
+      no_errors_.insert(arg + strlen("-Wno-error="));
+    } else if (base::StartsWith(arg, "-Wno-")) {
+      disabled_.insert(arg + strlen("-Wno-"));
+    } else if (base::StartsWith(arg, "-W")) {
+      enabled_.insert(arg + strlen("-W"));
+    } else {
+      remains.push_back(arg);
+    }
+  }
+
+  for (const auto& names : {no_errors_, disabled_, enabled_}) {
+    for (const auto& name : names) {
+      if (kAllDiagnostics.count(name) == 0) {
+        error_message << "unknown warning: " << name << "\n";
+        return {};
+      }
+    }
+  }
+
+  return remains;
+}
+
+DiagnosticMapping WarningOptions::GetDiagnosticMapping() const {
+  DiagnosticMapping mapping;
+  for (const auto& [_, d] : kAllDiagnostics) {
+    bool enabled = d.default_enabled;
+    if (enable_all_ || enabled_.find(d.name) != enabled_.end()) {
+      enabled = true;
+    }
+    if (disable_all_ || disabled_.find(d.name) != disabled_.end()) {
+      enabled = false;
+    }
+
+    DiagnosticSeverity severity = DiagnosticSeverity::DISABLED;
+    if (enabled) {
+      severity = DiagnosticSeverity::WARNING;
+      if (as_errors_ && no_errors_.find(d.name) == no_errors_.end()) {
+        severity = DiagnosticSeverity::ERROR;
+      }
+    }
+    mapping.Severity(d.id, severity);
+  }
+  return mapping;
+}
+
+}  // namespace aidl
+}  // namespace android
diff --git a/options.h b/options.h
new file mode 100644
index 0000000..c3fb79a
--- /dev/null
+++ b/options.h
@@ -0,0 +1,276 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <set>
+#include <string>
+#include <vector>
+
+#include <android-base/result.h>
+#include <android-base/strings.h>
+
+#include "diagnostics.h"
+#include "logging.h"
+
+namespace android {
+namespace aidl {
+
+using std::set;
+using std::string;
+using std::vector;
+
+// The oldest SDK version that is supported for each backend. For non-Java backends, these are the
+// platform SDK version where the support for the backend was added. For Java backend, this is 1.
+// TODO(b/205065703) switch back to DEFAULT_SDK_VERSION_JAVA = 23
+constexpr uint32_t DEFAULT_SDK_VERSION_JAVA = 1;
+constexpr uint32_t DEFAULT_SDK_VERSION_CPP = 23;
+constexpr uint32_t DEFAULT_SDK_VERSION_NDK = 29;
+constexpr uint32_t DEFAULT_SDK_VERSION_RUST = 31;
+
+constexpr uint32_t SDK_VERSION_current = 10000;
+constexpr uint32_t SDK_VERSION_Tiramisu = 33;
+constexpr uint32_t SDK_VERSION_UpsideDownCake = 34;
+
+constexpr uint32_t JAVA_PROPAGATE_VERSION = SDK_VERSION_Tiramisu;
+
+// A simple wrapper around ostringstream. This is just to make Options class
+// copiable by the implicit copy constructor. If ostingstream is not wrapped,
+// the implcit copy constructor is not generated because ostringstream isn't
+// copiable. This class makes the field copiable by having a copy constructor
+// that does not copy the underlying stream.
+class ErrorMessage {
+ public:
+  ErrorMessage() = default;
+  ErrorMessage(const ErrorMessage&) {}
+  std::ostringstream stream_;
+
+  template <typename T>
+  ErrorMessage& operator<<(T& t) {
+    stream_ << t;
+    return *this;
+  }
+
+  template <typename T>
+  ErrorMessage& operator<<(const T& t) {
+    stream_ << t;
+    return *this;
+  }
+
+  // for "<< endl"
+  ErrorMessage& operator<<(std::ostream& (*f)(std::ostream&)) {
+    f(stream_);
+    return *this;
+  }
+};
+
+// Handles warning-related options (e.g. -W, -w, ...)
+class WarningOptions {
+ public:
+  std::vector<const char*> Parse(int argc, const char* const argv[], ErrorMessage& error_message);
+  DiagnosticMapping GetDiagnosticMapping() const;
+
+ private:
+  bool as_errors_ = false;           // -Werror
+  bool enable_all_ = false;          // -Weverything
+  bool disable_all_ = false;         // -w
+  std::set<std::string> enabled_;    // -Wfoo
+  std::set<std::string> disabled_;   // -Wno-foo
+  std::set<std::string> no_errors_;  // -Wno-error=foo
+};
+
+// Options for AIDL
+//
+// These are passed all throughout the compiler, but they should not affect the
+// code which is generated. In order to avoid ODR issues, and also in order to
+// make sure the language is orthogonal and portable, we should only generate
+// different things based on the file contents themselves.
+class Options final {
+ public:
+  enum class Language { UNSPECIFIED, JAVA, CPP, NDK, RUST, CPP_ANALYZER };
+
+  enum class Task { HELP, COMPILE, PREPROCESS, DUMP_API, CHECK_API, DUMP_MAPPINGS };
+
+  enum class CheckApiLevel { COMPATIBLE, EQUAL };
+
+  enum class Stability { UNSPECIFIED, VINTF };
+  bool StabilityFromString(const std::string& stability, Stability* out_stability);
+
+  Options(int argc, const char* const argv[], Language default_lang = Language::UNSPECIFIED);
+
+  Options PlusImportDir(const std::string& import_dir) const;
+
+  Options AsPreviousVersion() const {
+    Options copy(*this);
+    copy.as_previous_version_ = true;
+    return copy;
+  }
+
+  Options WithoutVersion() const {
+    Options copy(*this);
+    copy.version_ = 0;
+    copy.hash_ = "";
+    return copy;
+  }
+
+  Options WithNoWarnings() const {
+    Options copy(*this);
+    copy.warning_options_ = WarningOptions();
+    return copy;
+  }
+
+  static Options From(const string& cmdline);
+
+  static Options From(const vector<string>& args);
+
+  // to print in output files
+  std::string RawArgs() const { return raw_args_; }
+
+  // Contain no references to unstructured data types (such as a parcelable that is
+  // implemented in Java). These interfaces aren't inherently stable but they have the
+  // capacity to be stabilized.
+  bool IsStructured() const { return structured_; }
+
+  Stability GetStability() const { return stability_; }
+
+  uint32_t GetMinSdkVersion() const { return min_sdk_version_; }
+
+  Language TargetLanguage() const { return language_; }
+  bool IsCppOutput() const {
+    return language_ == Language::CPP || language_ == Language::NDK ||
+           language_ == Language::CPP_ANALYZER;
+  }
+
+  Task GetTask() const { return task_; }
+
+  CheckApiLevel GetCheckApiLevel() const { return check_api_level_; }
+
+  const set<string>& ImportDirs() const {
+    if (as_previous_version_) {
+      return previous_import_dirs_;
+    } else {
+      return import_dirs_;
+    }
+  }
+
+  const vector<string>& PreprocessedFiles() const { return preprocessed_files_; }
+
+  string DependencyFile() const {
+    return dependency_file_;
+  }
+
+  bool AutoDepFile() const { return auto_dep_file_; }
+
+  bool GenRpc() const { return gen_rpc_; }
+
+  bool GenTraces() const { return gen_traces_; }
+
+  bool GenTransactionNames() const { return gen_transaction_names_; }
+
+  bool DependencyFileNinja() const { return dependency_file_ninja_; }
+
+  const string& PreviousApiDir() const { return previous_api_dir_; }
+
+  const vector<string>& InputFiles() const { return input_files_; }
+
+  // Path to the output file. This is used only when there is only one
+  // output file for the invocation. When there are multiple outputs
+  // (e.g. compile multiple AIDL files), output files are created under
+  // OutputDir().
+  const string& OutputFile() const { return output_file_; }
+
+  // Path to the directory where output file(s) will be generated under.
+  const string& OutputDir() const { return output_dir_; }
+
+  // Path to the directory where header file(s) will be generated under.
+  // Only used when TargetLanguage() == Language::CPP
+  const string& OutputHeaderDir() const { return output_header_dir_; }
+
+  bool FailOnParcelable() const { return fail_on_parcelable_; }
+
+  int Version() const { return version_; }
+
+  int PreviousVersion() const {
+    AIDL_FATAL_IF(version_ <= 1, "This should only be called on versions greater than 1");
+    return version_ - 1;
+  }
+
+  bool IsLatestUnfrozenVersion() const { return !PreviousApiDir().empty(); }
+
+  string Hash() const { return hash_; }
+
+  string PreviousHash() const { return previous_hash_; }
+
+  bool GenLog() const { return gen_log_; }
+
+  bool DumpNoLicense() const { return dump_no_license_; }
+
+  bool Ok() const { return error_message_.stream_.str().empty(); }
+
+  string GetErrorMessage() const { return error_message_.stream_.str(); }
+
+  string GetUsage() const;
+
+  bool GenApiMapping() const { return task_ == Task::DUMP_MAPPINGS; }
+
+  DiagnosticMapping GetDiagnosticMapping() const { return warning_options_.GetDiagnosticMapping(); }
+
+  // The following are for testability, but cannot be influenced on the command line.
+  // Threshold of interface methods to enable outlining of onTransact cases.
+  size_t onTransact_outline_threshold_{275u};
+  // Number of cases to _not_ outline, if outlining is enabled.
+  size_t onTransact_non_outline_count_{275u};
+
+ private:
+  Options() = default;
+
+  const string myname_;
+  std::string raw_args_;
+  Language language_ = Language::UNSPECIFIED;
+  Task task_ = Task::COMPILE;
+  CheckApiLevel check_api_level_ = CheckApiLevel::COMPATIBLE;
+  set<string> import_dirs_;
+  set<string> previous_import_dirs_;
+  bool as_previous_version_ = false;
+  vector<string> preprocessed_files_;
+  string dependency_file_;
+  bool gen_rpc_ = false;
+  bool gen_traces_ = false;
+  bool gen_transaction_names_ = false;
+  bool dependency_file_ninja_ = false;
+  string previous_api_dir_;
+  bool structured_ = false;
+  Stability stability_ = Stability::UNSPECIFIED;
+  uint32_t min_sdk_version_ = 0;  // invalid version
+  string output_dir_;
+  string output_header_dir_;
+  bool fail_on_parcelable_ = false;
+  bool auto_dep_file_ = false;
+  vector<string> input_files_;
+  string output_file_;
+  int version_ = 0;
+  string hash_ = "";
+  string previous_hash_ = "";
+  bool gen_log_ = false;
+  bool dump_no_license_ = false;
+  ErrorMessage error_message_;
+  WarningOptions warning_options_;
+};
+
+std::string to_string(Options::Language language);
+android::base::Result<uint32_t> MinSdkVersionFromString(const std::string& str);
+
+}  // namespace aidl
+}  // namespace android
diff --git a/options_unittest.cpp b/options_unittest.cpp
new file mode 100644
index 0000000..5636288
--- /dev/null
+++ b/options_unittest.cpp
@@ -0,0 +1,527 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "options.h"
+
+#include <iostream>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "diagnostics.h"
+
+using android::aidl::DiagnosticID;
+using android::aidl::DiagnosticSeverity;
+using std::cerr;
+using std::endl;
+using std::string;
+using std::unique_ptr;
+using std::vector;
+using testing::internal::CaptureStderr;
+using testing::internal::GetCapturedStderr;
+
+namespace android {
+namespace aidl {
+namespace {
+
+const char kPreprocessCommandOutputFile[] = "output_file_name";
+const char kPreprocessCommandInput1[] = "input1.aidl";
+const char kPreprocessCommandInput2[] = "input2.aidl";
+const char kPreprocessCommandInput3[] = "input3.aidl";
+const char* kPreprocessCommand[] = {
+    "aidl", "--preprocess",
+    kPreprocessCommandOutputFile,
+    kPreprocessCommandInput1,
+    kPreprocessCommandInput2,
+    kPreprocessCommandInput3,
+    nullptr,
+};
+
+const char kCompileCommandInput[] = "directory/ITool.aidl";
+const char kCompileCommandIncludePath[] = "-Iinclude_path";
+const char* kCompileJavaCommand[] = {
+    "aidl",
+    "-b",
+    kCompileCommandIncludePath,
+    kCompileCommandInput,
+    nullptr,
+};
+const char kCompileCommandJavaOutput[] = "directory/ITool.java";
+
+const char kCompileDepFileNinja[] = "--ninja";
+const char* kCompileJavaCommandNinja[] = {
+    "aidl",
+    "-b",
+    kCompileDepFileNinja,
+    kCompileCommandIncludePath,
+    kCompileCommandInput,
+    nullptr,
+};
+
+const char kCompileDepFile[] = "-doutput.deps";
+const char kCompileCommandHeaderDir[] = "output/dir/";
+const char kCompileCommandCppOutput[] = "some/file.cpp";
+const char* kCompileCppCommand[] = {
+    "aidl-cpp",
+    kCompileCommandIncludePath,
+    kCompileDepFile,
+    kCompileCommandInput,
+    kCompileCommandHeaderDir,
+    kCompileCommandCppOutput,
+    nullptr,
+};
+const char* kCompileCppCommandNinja[] = {
+    "aidl-cpp",
+    kCompileCommandIncludePath,
+    kCompileDepFile,
+    kCompileDepFileNinja,
+    kCompileCommandInput,
+    kCompileCommandHeaderDir,
+    kCompileCommandCppOutput,
+    nullptr,
+};
+
+unique_ptr<Options> GetOptions(const char* command[],
+                               Options::Language default_lang = Options::Language::JAVA) {
+  int argc = 0;
+  const char** command_part = command;
+  for (; *command_part; ++argc, ++command_part) {}
+  unique_ptr<Options> ret(new Options(argc, command, default_lang));
+  if (!ret->Ok()) {
+    cerr << ret->GetErrorMessage();
+    cerr << "Failed to parse command line:";
+    for (int i = 0; i < argc; ++i) {
+      cerr << " " << command[i];
+      cerr << endl;
+    }
+  }
+  EXPECT_NE(ret, nullptr) << "Failed to parse options!";
+  return ret;
+}
+
+}  // namespace
+
+TEST(OptionsTests, ParsesPreprocess) {
+  unique_ptr<Options> options = GetOptions(kPreprocessCommand);
+  EXPECT_EQ(Options::Task::PREPROCESS, options->GetTask());
+  EXPECT_EQ(false, options->FailOnParcelable());
+  EXPECT_EQ(0u, options->ImportDirs().size());
+  EXPECT_EQ(0u, options->PreprocessedFiles().size());
+  EXPECT_EQ(string{kPreprocessCommandOutputFile}, options->OutputFile());
+  EXPECT_EQ(false, options->AutoDepFile());
+  const vector<string> expected_input{kPreprocessCommandInput1,
+                                      kPreprocessCommandInput2,
+                                      kPreprocessCommandInput3};
+  EXPECT_EQ(expected_input, options->InputFiles());
+}
+
+TEST(OptionsTests, ParsesCompileJava) {
+  unique_ptr<Options> options = GetOptions(kCompileJavaCommand);
+  EXPECT_EQ(Options::Task::COMPILE, options->GetTask());
+  EXPECT_EQ(Options::Language::JAVA, options->TargetLanguage());
+  EXPECT_EQ(true, options->FailOnParcelable());
+  EXPECT_EQ(1u, options->ImportDirs().size());
+  EXPECT_EQ(0u, options->PreprocessedFiles().size());
+  EXPECT_EQ(string{kCompileCommandInput}, options->InputFiles().front());
+  EXPECT_EQ(string{kCompileCommandJavaOutput}, options->OutputFile());
+  EXPECT_EQ(false, options->AutoDepFile());
+  EXPECT_EQ(false, options->DependencyFileNinja());
+}
+
+TEST(OptionsTests, ParsesCompileJavaNinja) {
+  unique_ptr<Options> options = GetOptions(kCompileJavaCommandNinja);
+  EXPECT_EQ(Options::Task::COMPILE, options->GetTask());
+  EXPECT_EQ(Options::Language::JAVA, options->TargetLanguage());
+  EXPECT_EQ(true, options->FailOnParcelable());
+  EXPECT_EQ(1u, options->ImportDirs().size());
+  EXPECT_EQ(0u, options->PreprocessedFiles().size());
+  EXPECT_EQ(string{kCompileCommandInput}, options->InputFiles().front());
+  EXPECT_EQ(string{kCompileCommandJavaOutput}, options->OutputFile());
+  EXPECT_EQ(false, options->AutoDepFile());
+  EXPECT_EQ(true, options->DependencyFileNinja());
+}
+
+TEST(OptionsTests, ParsesCompileCpp) {
+  unique_ptr<Options> options = GetOptions(kCompileCppCommand, Options::Language::CPP);
+  ASSERT_EQ(1u, options->ImportDirs().size());
+  EXPECT_EQ(string{kCompileCommandIncludePath}.substr(2) + "/", *options->ImportDirs().begin());
+  EXPECT_EQ(string{kCompileDepFile}.substr(2), options->DependencyFile());
+  EXPECT_EQ(false, options->DependencyFileNinja());
+  EXPECT_EQ(kCompileCommandInput, options->InputFiles().front());
+  EXPECT_EQ(kCompileCommandHeaderDir, options->OutputHeaderDir());
+  EXPECT_EQ(kCompileCommandCppOutput, options->OutputFile());
+}
+
+TEST(OptionsTests, ParsesCompileCppNinja) {
+  unique_ptr<Options> options = GetOptions(kCompileCppCommandNinja, Options::Language::CPP);
+  ASSERT_EQ(1u, options->ImportDirs().size());
+  EXPECT_EQ(string{kCompileCommandIncludePath}.substr(2) + "/", *options->ImportDirs().begin());
+  EXPECT_EQ(string{kCompileDepFile}.substr(2), options->DependencyFile());
+  EXPECT_EQ(true, options->DependencyFileNinja());
+  EXPECT_EQ(kCompileCommandInput, options->InputFiles().front());
+  EXPECT_EQ(kCompileCommandHeaderDir, options->OutputHeaderDir());
+  EXPECT_EQ(kCompileCommandCppOutput, options->OutputFile());
+}
+
+TEST(OptionsTests, ParsesCompileJavaMultiInput) {
+  const char* argv[] = {
+      "aidl",
+      "--lang=java",
+      kCompileCommandIncludePath,
+      "-o src_out",
+      "directory/input1.aidl",
+      "directory/input2.aidl",
+      "directory/input3.aidl",
+      nullptr,
+  };
+  unique_ptr<Options> options = GetOptions(argv);
+  EXPECT_EQ(Options::Task::COMPILE, options->GetTask());
+  EXPECT_EQ(Options::Language::JAVA, options->TargetLanguage());
+  EXPECT_EQ(false, options->FailOnParcelable());
+  EXPECT_EQ(1u, options->ImportDirs().size());
+  EXPECT_EQ(0u, options->PreprocessedFiles().size());
+  const vector<string> expected_input{"directory/input1.aidl", "directory/input2.aidl",
+                                      "directory/input3.aidl"};
+  EXPECT_EQ(expected_input, options->InputFiles());
+  EXPECT_EQ(string{""}, options->OutputFile());
+  EXPECT_EQ(false, options->AutoDepFile());
+  EXPECT_EQ(false, options->DependencyFileNinja());
+  EXPECT_EQ(string{""}, options->OutputHeaderDir());
+  EXPECT_EQ(string{"src_out/"}, options->OutputDir());
+}
+
+TEST(OptionsTests, ParsesCompileRust) {
+  const char* argv[] = {
+      "aidl",       "--lang=rust",        kCompileCommandIncludePath,
+      "-o src_out", kCompileCommandInput, nullptr,
+  };
+  unique_ptr<Options> options = GetOptions(argv);
+  EXPECT_EQ(Options::Task::COMPILE, options->GetTask());
+  EXPECT_EQ(Options::Language::RUST, options->TargetLanguage());
+  EXPECT_EQ(false, options->FailOnParcelable());
+  EXPECT_EQ(1u, options->ImportDirs().size());
+  EXPECT_EQ(0u, options->PreprocessedFiles().size());
+  EXPECT_EQ(string{kCompileCommandInput}, options->InputFiles().front());
+  EXPECT_EQ(string{""}, options->OutputFile());
+  EXPECT_EQ(string{""}, options->OutputHeaderDir());
+  EXPECT_EQ(string{"src_out/"}, options->OutputDir());
+  EXPECT_EQ(false, options->AutoDepFile());
+  EXPECT_EQ(false, options->DependencyFileNinja());
+}
+
+TEST(OptionsTests, ParsesCompileJavaInvalid_OutRequired) {
+  // -o option is required
+  string expected_error = "Output directory is not set. Set with --out.";
+  CaptureStderr();
+  const char* arg_with_no_out_dir[] = {
+      "aidl",
+      "--lang=java",
+      kCompileCommandIncludePath,
+      "directory/input1.aidl",
+      "directory/input2.aidl",
+      "directory/input3.aidl",
+      nullptr,
+  };
+  EXPECT_EQ(false, GetOptions(arg_with_no_out_dir)->Ok());
+  EXPECT_THAT(GetCapturedStderr(), testing::HasSubstr(expected_error));
+}
+
+TEST(OptionsTests, ParsesCompileJavaInvalid_RejectHeaderOut) {
+  string expected_error = "Header output directory is set, which does not make sense for Java.";
+  CaptureStderr();
+  // -h options is not for Java
+  const char* arg_with_header_dir[] = {
+      "aidl",          "--lang=java",           kCompileCommandIncludePath, "-o src_out",
+      "-h header_out", "directory/input1.aidl", "directory/input2.aidl",    "directory/input3.aidl",
+      nullptr,
+  };
+  EXPECT_EQ(false, GetOptions(arg_with_header_dir)->Ok());
+  EXPECT_THAT(GetCapturedStderr(), testing::HasSubstr(expected_error));
+}
+
+TEST(OptionsTests, ParsesCompileCppMultiInput) {
+  const char* argv[] = {
+      "aidl",
+      "--lang=cpp",
+      kCompileCommandIncludePath,
+      "-h header_out",
+      "-o src_out",
+      "directory/input1.aidl",
+      "directory/input2.aidl",
+      "directory/input3.aidl",
+      nullptr,
+  };
+  unique_ptr<Options> options = GetOptions(argv);
+  EXPECT_EQ(Options::Task::COMPILE, options->GetTask());
+  EXPECT_EQ(Options::Language::CPP, options->TargetLanguage());
+  EXPECT_EQ(false, options->FailOnParcelable());
+  EXPECT_EQ(1u, options->ImportDirs().size());
+  EXPECT_EQ(0u, options->PreprocessedFiles().size());
+  const vector<string> expected_input{"directory/input1.aidl", "directory/input2.aidl",
+                                      "directory/input3.aidl"};
+  EXPECT_EQ(expected_input, options->InputFiles());
+  EXPECT_EQ(string{""}, options->OutputFile());
+  EXPECT_EQ(false, options->AutoDepFile());
+  EXPECT_EQ(false, options->DependencyFileNinja());
+  EXPECT_EQ(string{"header_out/"}, options->OutputHeaderDir());
+  EXPECT_EQ(string{"src_out/"}, options->OutputDir());
+}
+
+TEST(OptionsTests, ParsesCompileCppInvalid_OutRequired) {
+  // -o option is required
+  string expected_error = "Output directory is not set. Set with --out.";
+  CaptureStderr();
+  const char* arg_with_no_out_dir[] = {
+      "aidl",
+      "--lang=cpp",
+      kCompileCommandIncludePath,
+      "directory/input1.aidl",
+      "directory/input2.aidl",
+      "directory/input3.aidl",
+      nullptr,
+  };
+  EXPECT_EQ(false, GetOptions(arg_with_no_out_dir)->Ok());
+  EXPECT_THAT(GetCapturedStderr(), testing::HasSubstr(expected_error));
+}
+
+TEST(OptionsTests, ParsesCompileCppInvalid_HeaderOutRequired) {
+  // -h options is required as well
+  string expected_error = "Header output directory is not set. Set with --header_out";
+  CaptureStderr();
+  const char* arg_with_no_header_dir[] = {
+      "aidl",
+      "--lang=cpp",
+      kCompileCommandIncludePath,
+      "-o src_out",
+      "directory/input1.aidl",
+      "directory/input2.aidl",
+      "directory/input3.aidl",
+      nullptr,
+  };
+  EXPECT_EQ(false, GetOptions(arg_with_no_header_dir)->Ok());
+  EXPECT_THAT(GetCapturedStderr(), testing::HasSubstr(expected_error));
+}
+
+TEST(OptionsTests, ParsesCompileRustInvalid_OutRequired) {
+  // -o option is required
+  string expected_error = "Output directory is not set. Set with --out";
+  CaptureStderr();
+  const char* arg_with_no_out_dir[] = {
+      "aidl",
+      "--lang=rust",
+      kCompileCommandIncludePath,
+      "directory/input1.aidl",
+      "directory/input2.aidl",
+      "directory/input3.aidl",
+      nullptr,
+  };
+  EXPECT_EQ(false, GetOptions(arg_with_no_out_dir)->Ok());
+  EXPECT_THAT(GetCapturedStderr(), testing::HasSubstr(expected_error));
+}
+
+TEST(OptionsTests, ParsesCompileRustInvalid_RejectHeaderOut) {
+  string expected_error = "Header output directory is set, which does not make sense for Rust.";
+  CaptureStderr();
+  // -h options is not for Rust
+  const char* arg_with_header_dir[] = {
+      "aidl",          "--lang=rust",           kCompileCommandIncludePath, "-o src_out",
+      "-h header_out", "directory/input1.aidl", "directory/input2.aidl",    "directory/input3.aidl",
+      nullptr,
+  };
+  EXPECT_EQ(false, GetOptions(arg_with_header_dir)->Ok());
+  EXPECT_THAT(GetCapturedStderr(), testing::HasSubstr(expected_error));
+}
+
+TEST(OptionsTests, ParsesWarningEnableAll) {
+  const char* args[] = {
+      "aidl", "--lang=java", "-Weverything", "--out=out", "input.aidl", nullptr,
+  };
+  auto options = GetOptions(args);
+  EXPECT_TRUE(options->Ok());
+  auto mapping = options->GetDiagnosticMapping();
+  EXPECT_EQ(DiagnosticSeverity::WARNING, mapping.Severity(DiagnosticID::interface_name));
+}
+
+TEST(OptionsTests, ParsesWarningEnableSpecificWarning) {
+  const char* args[] = {
+      "aidl", "--lang=java", "-Winterface-name", "--out=out", "input.aidl", nullptr,
+  };
+  auto options = GetOptions(args);
+  EXPECT_TRUE(options->Ok());
+  auto mapping = options->GetDiagnosticMapping();
+  EXPECT_EQ(DiagnosticSeverity::WARNING, mapping.Severity(DiagnosticID::interface_name));
+}
+
+TEST(OptionsTests, ParsesWarningDisableSpecificWarning) {
+  const char* args[] = {
+      "aidl",      "--lang=java", "-Weverything", "-Wno-interface-name",
+      "--out=out", "input.aidl",  nullptr,
+  };
+  auto options = GetOptions(args);
+  EXPECT_TRUE(options->Ok());
+  auto mapping = options->GetDiagnosticMapping();
+  EXPECT_EQ(DiagnosticSeverity::DISABLED, mapping.Severity(DiagnosticID::interface_name));
+}
+
+TEST(OptionsTests, ParsesWarningAsErrors) {
+  const char* args[] = {
+      "aidl", "--lang=java", "-Werror", "-Weverything", "--out=out", "input.aidl", nullptr,
+  };
+  auto options = GetOptions(args);
+  EXPECT_TRUE(options->Ok());
+  auto mapping = options->GetDiagnosticMapping();
+  EXPECT_EQ(DiagnosticSeverity::ERROR, mapping.Severity(DiagnosticID::interface_name));
+}
+
+TEST(OptionsTests, RejectsUnknownWarning) {
+  const char* args[] = {
+      "aidl", "--lang=java", "-Wfoobar", "--out=out", "input.aidl", nullptr,
+  };
+  CaptureStderr();
+  auto options = GetOptions(args);
+  EXPECT_FALSE(options->Ok());
+  EXPECT_THAT(GetCapturedStderr(), testing::HasSubstr("unknown warning: foobar"));
+}
+
+TEST(OptionsTests, CheckApi) {
+  const char* args[] = {
+      "aidl", "--checkapi", "old", "new", nullptr,
+  };
+  CaptureStderr();
+  auto options = GetOptions(args);
+  EXPECT_TRUE(options->Ok());
+  EXPECT_EQ("", GetCapturedStderr());
+  EXPECT_EQ(Options::Task::CHECK_API, options->GetTask());
+  EXPECT_EQ(Options::CheckApiLevel::COMPATIBLE, options->GetCheckApiLevel());
+}
+
+TEST(OptionsTests, CheckApiWithCompatible) {
+  const char* args[] = {
+      "aidl", "--checkapi=compatible", "old", "new", nullptr,
+  };
+  CaptureStderr();
+  auto options = GetOptions(args);
+  EXPECT_TRUE(options->Ok());
+  EXPECT_EQ("", GetCapturedStderr());
+  EXPECT_EQ(Options::Task::CHECK_API, options->GetTask());
+  EXPECT_EQ(Options::CheckApiLevel::COMPATIBLE, options->GetCheckApiLevel());
+}
+
+TEST(OptionsTests, CheckApiWithEqual) {
+  const char* args[] = {
+      "aidl", "--checkapi=equal", "old", "new", nullptr,
+  };
+  CaptureStderr();
+  auto options = GetOptions(args);
+  EXPECT_TRUE(options->Ok());
+  EXPECT_EQ("", GetCapturedStderr());
+  EXPECT_EQ(Options::Task::CHECK_API, options->GetTask());
+  EXPECT_EQ(Options::CheckApiLevel::EQUAL, options->GetCheckApiLevel());
+}
+
+TEST(OptionsTests, CheckApiWithUnknown) {
+  const char* args[] = {
+      "aidl", "--checkapi=unknown", "old", "new", nullptr,
+  };
+  CaptureStderr();
+  auto options = GetOptions(args);
+  EXPECT_FALSE(options->Ok());
+  EXPECT_THAT(GetCapturedStderr(), testing::HasSubstr("Unsupported --checkapi level: 'unknown'"));
+}
+
+TEST(OptionsTest, AcceptValidMinSdkVersion) {
+  const char* args[] = {
+      "aidl", "--lang=java", "--min_sdk_version=30", "--out=out", "input.aidl", nullptr,
+  };
+  auto options = GetOptions(args);
+  EXPECT_TRUE(options->Ok());
+  EXPECT_EQ(30u, options->GetMinSdkVersion());
+}
+
+TEST(OptionsTests, AcceptTCodeNameAsMinSdkVersion) {
+  const char* args[] = {
+      "aidl", "--lang=java", "--min_sdk_version=Tiramisu", "--out=out", "input.aidl", nullptr,
+  };
+  auto options = GetOptions(args);
+  EXPECT_TRUE(options->Ok());
+  EXPECT_EQ(33u, options->GetMinSdkVersion());
+}
+
+TEST(OptionsTests, AcceptUCodeNameAsMinSdkVersion) {
+  const char* args[] = {
+      "aidl", "--lang=java", "--min_sdk_version=UpsideDownCake", "--out=out", "input.aidl", nullptr,
+  };
+  auto options = GetOptions(args);
+  EXPECT_TRUE(options->Ok());
+  EXPECT_EQ(34u, options->GetMinSdkVersion());
+}
+
+TEST(OptionsTests, AcceptVCodeNameAsMinSdkVersion) {
+  const char* args[] = {
+      "aidl",      "--lang=java", "--min_sdk_version=VanillaIceCream",
+      "--out=out", "input.aidl",  nullptr,
+  };
+  auto options = GetOptions(args);
+  EXPECT_TRUE(options->Ok());
+  EXPECT_EQ(10000u, options->GetMinSdkVersion());  // TODO: finalize to version
+}
+
+TEST(OptionsTest, DefaultMinSdkVersion) {
+  const char* args[] = {
+      "aidl", "--lang=java", "--out=out", "input.aidl", nullptr,
+  };
+  auto options = GetOptions(args);
+  EXPECT_TRUE(options->Ok());
+  EXPECT_EQ(DEFAULT_SDK_VERSION_JAVA, options->GetMinSdkVersion());
+}
+
+TEST(OptionsTest, RejectInvalidMinSdkVersion) {
+  const char* args[] = {
+      "aidl", "--lang=java", "--min_sdk_version=NOT_A_VERSION", "--out=out", "input.aidl", nullptr,
+  };
+  CaptureStderr();
+  auto options = GetOptions(args);
+  EXPECT_FALSE(options->Ok());
+  EXPECT_THAT(GetCapturedStderr(), testing::HasSubstr("Invalid SDK version: NOT_A_VERSION"));
+}
+
+TEST(OptionsTest, RejectOldMinSdkVersion) {
+  const char* args[] = {
+      "aidl",       "--lang=cpp", "--min_sdk_version=22", "--out=out", "--header_out=out",
+      "input.aidl", nullptr,
+  };
+  CaptureStderr();
+  auto options = GetOptions(args);
+  EXPECT_FALSE(options->Ok());
+  EXPECT_THAT(GetCapturedStderr(), testing::HasSubstr("Min SDK version should at least be 23"));
+}
+
+TEST(OptionsTest, RejectRpcOnOldSdkVersion) {
+  const char* args[] = {
+      "aidl", "--lang=java", "--rpc", "--min_sdk_version=23", "--out=out", "input.aidl", nullptr,
+  };
+  CaptureStderr();
+  auto options = GetOptions(args);
+  EXPECT_FALSE(options->Ok());
+  EXPECT_THAT(GetCapturedStderr(),
+              testing::HasSubstr("RPC code requires minimum SDK version of at least"));
+}
+
+}  // namespace aidl
+}  // namespace android
diff --git a/os.h b/os.h
new file mode 100644
index 0000000..e3d33ef
--- /dev/null
+++ b/os.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#if defined(_WIN32)
+#define OS_PATH_SEPARATOR '\\'
+#else
+#define OS_PATH_SEPARATOR '/'
+#endif
diff --git a/parser.cpp b/parser.cpp
new file mode 100644
index 0000000..edb110b
--- /dev/null
+++ b/parser.cpp
@@ -0,0 +1,345 @@
+/*
+ * Copyright (C) 2019, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "parser.h"
+
+#include <queue>
+
+#include "aidl_language_y.h"
+#include "logging.h"
+
+void yylex_init(void**);
+void yylex_destroy(void*);
+void yyset_in(FILE* f, void*);
+int yyparse(Parser*);
+YY_BUFFER_STATE yy_scan_buffer(char*, size_t, void*);
+void yy_delete_buffer(YY_BUFFER_STATE, void*);
+
+// For each union, generate nested "Tag" enum type so that "Tag" can be used as a valid type.
+//    union Foo { int a; int b; } => union Foo { ... enum Tag { a, b }}
+struct UnionTagGenerater : AidlVisitor {
+  void Visit(const AidlUnionDecl& decl) override {
+    std::vector<std::unique_ptr<AidlEnumerator>> enumerators;
+    for (const auto& field : decl.GetFields()) {
+      enumerators.push_back(std::make_unique<AidlEnumerator>(AIDL_LOCATION_HERE, field->GetName(),
+                                                             nullptr, field->GetComments()));
+    }
+    auto tag_enum = std::make_unique<AidlEnumDeclaration>(AIDL_LOCATION_HERE, "Tag", &enumerators,
+                                                          decl.GetPackage(), Comments{});
+    // Tag for @FixedSize union is limited to "byte" type so that it can be passed via FMQ with
+    // with lower overhead.
+    std::shared_ptr<AidlConstantValue> backing_type{
+        AidlConstantValue::String(AIDL_LOCATION_HERE, decl.IsFixedSize() ? "\"byte\"" : "\"int\"")};
+    std::vector<std::unique_ptr<AidlAnnotation>> annotations;
+    annotations.push_back(
+        AidlAnnotation::Parse(AIDL_LOCATION_HERE, "Backing", {{"type", backing_type}}, Comments{}));
+    tag_enum->Annotate(std::move(annotations));
+    const_cast<AidlUnionDecl&>(decl).AddType(std::move(tag_enum));
+  }
+};
+
+const AidlDocument* Parser::Parse(const std::string& filename,
+                                  const android::aidl::IoDelegate& io_delegate,
+                                  AidlTypenames& typenames, bool is_preprocessed) {
+  auto clean_path = android::aidl::IoDelegate::CleanPath(filename);
+  // reuse pre-parsed document from typenames
+  for (auto& doc : typenames.AllDocuments()) {
+    if (doc->GetLocation().GetFile() == clean_path) {
+      return doc.get();
+    }
+  }
+  // Make sure we can read the file first, before trashing previous state.
+  unique_ptr<string> raw_buffer = io_delegate.GetFileContents(clean_path);
+  if (raw_buffer == nullptr) {
+    AIDL_ERROR(clean_path) << "Error while opening file for parsing";
+    return nullptr;
+  }
+
+  // We're going to scan this buffer in place, and yacc demands we put two
+  // nulls at the end.
+  raw_buffer->append(2u, '\0');
+
+  Parser parser(clean_path, *raw_buffer, is_preprocessed);
+
+  if (yy::parser(&parser).parse() != 0 || parser.HasError()) {
+    return nullptr;
+  }
+
+  // Preprocess parsed document before adding to typenames.
+  UnionTagGenerater v;
+  VisitTopDown(v, *parser.document_);
+
+  // transfer ownership to AidlTypenames and return the raw pointer
+  const AidlDocument* result = parser.document_.get();
+  if (!typenames.AddDocument(std::move(parser.document_))) {
+    return nullptr;
+  }
+  return result;
+}
+
+void Parser::SetTypeParameters(AidlTypeSpecifier* type,
+                               std::vector<std::unique_ptr<AidlTypeSpecifier>>* type_args) {
+  if (type->IsArray()) {
+    AIDL_ERROR(type) << "Must specify type parameters (<>) before array ([]).";
+    AddError();
+  }
+  if (!type->SetTypeParameters(type_args)) {
+    AIDL_ERROR(type) << "Can only specify one set of type parameters.";
+    AddError();
+    delete type_args;
+  }
+}
+
+void Parser::CheckValidTypeName(const AidlToken& token, const AidlLocation& loc) {
+  if (!is_preprocessed_ && token.GetText().find('.') != std::string::npos) {
+    AIDL_ERROR(loc) << "Type name can't be qualified. Use `package`.";
+    AddError();
+  }
+}
+
+void Parser::SetPackage(const std::string& package) {
+  if (is_preprocessed_) {
+    AIDL_ERROR(package) << "Preprocessed file can't declare package.";
+    AddError();
+  }
+  package_ = package;
+}
+
+bool CheckNoRecursiveDefinition(const AidlNode& node) {
+  struct Visitor : AidlVisitor {
+    enum {
+      NOT_STARTED = 0,
+      STARTED = 1,
+      FINISHED = 2,
+    };
+    std::map<const AidlParcelable*, int> visited;
+    std::vector<std::string> path;
+    bool found_cycle = false;
+
+    void Visit(const AidlStructuredParcelable& t) override { FindCycle(&t); }
+    void Visit(const AidlUnionDecl& t) override { FindCycle(&t); }
+    void Visit(const AidlParcelable& t) override { FindCycle(&t); }
+
+    bool FindCycle(const AidlParcelable* p) {
+      // no need to search further
+      if (found_cycle) {
+        return true;
+      }
+      // we just found a cycle
+      if (visited[p] == STARTED) {
+        path.push_back(p->GetName());
+        AIDL_ERROR(p) << p->GetName()
+                      << " is a recursive parcelable: " << android::base::Join(path, "->");
+        return (found_cycle = true);
+      }
+      // we arrived here with a different route.
+      if (visited[p] == FINISHED) {
+        return false;
+      }
+      // start DFS
+      visited[p] = STARTED;
+      path.push_back(p->GetName());
+      for (const auto& f : p->GetFields()) {
+        const auto& ref = f->GetType();
+        if (!ref.IsArray() && !ref.IsHeapNullable()) {
+          const auto& type = ref.GetDefinedType();
+          if (type && type->AsParcelable()) {
+            if (FindCycle(type->AsParcelable())) {
+              return true;
+            }
+          }
+        }
+      }
+      path.pop_back();
+      visited[p] = FINISHED;
+      return false;
+    }
+  } v;
+  VisitTopDown(v, node);
+  return !v.found_cycle;
+}
+
+// Each Visit*() method can use Scope() to get its scope(AidlDefinedType)
+class ScopedVisitor : public AidlVisitor {
+ protected:
+  const AidlDefinedType* Scope() const {
+    AIDL_FATAL_IF(scope_.empty(), AIDL_LOCATION_HERE) << "Scope is empty";
+    return scope_.back();
+  }
+  void PushScope(const AidlDefinedType* scope) { scope_.push_back(scope); }
+  void PopScope() { scope_.pop_back(); }
+  // Keep user defined type as a defining scope
+  void VisitScopedTopDown(const AidlNode& node) {
+    std::function<void(const AidlNode&)> top_down = [&](const AidlNode& a) {
+      a.DispatchVisit(*this);
+      auto defined_type = AidlCast<AidlDefinedType>(a);
+      if (defined_type) PushScope(defined_type);
+      a.TraverseChildren(top_down);
+      if (defined_type) PopScope();
+    };
+    top_down(node);
+  }
+
+ private:
+  std::vector<const AidlDefinedType*> scope_ = {};
+};
+
+class TypeReferenceResolver : public ScopedVisitor {
+ public:
+  TypeReferenceResolver(TypeResolver& resolver) : resolver_(resolver) {}
+
+  void Visit(const AidlTypeSpecifier& t) override {
+    // We're visiting the same node again. This can happen when two constant references
+    // point to an ancestor of this node.
+    if (t.IsResolved()) {
+      return;
+    }
+    AidlTypeSpecifier& type = const_cast<AidlTypeSpecifier&>(t);
+    if (!resolver_(Scope(), &type)) {
+      AIDL_ERROR(type) << "Failed to resolve '" << type.GetUnresolvedName() << "'";
+      success_ = false;
+      return;
+    }
+
+    // In case a new document is imported for the type reference, enqueue it for type resolution.
+    auto resolved = t.GetDefinedType();
+    if (resolved) {
+      queue_.push(&resolved->GetDocument());
+    }
+  }
+
+  bool Resolve(const AidlDocument& document) {
+    queue_.push(&document);
+    while (!queue_.empty()) {
+      auto doc = queue_.front();
+      queue_.pop();
+      // Skip the doc if it's visited already.
+      if (!visited_.insert(doc).second) {
+        continue;
+      }
+      VisitScopedTopDown(*doc);
+    }
+    return success_;
+  }
+
+ private:
+  TypeResolver& resolver_;
+  bool success_ = true;
+  std::queue<const AidlDocument*> queue_ = {};
+  std::set<const AidlDocument*> visited_ = {};
+};
+
+class ConstantReferenceResolver : public ScopedVisitor {
+ public:
+  ConstantReferenceResolver() = default;
+
+  void Visit(const AidlConstantReference& v) override {
+    if (IsCircularReference(&v)) {
+      success_ = false;
+      return;
+    }
+
+    const AidlConstantValue* resolved = v.Resolve(Scope());
+    if (!resolved) {
+      AIDL_ERROR(v) << "Unknown reference '" << v.Literal() << "'";
+      success_ = false;
+      return;
+    }
+
+    // On error, skip recursive visiting to avoid redundant messages
+    if (!success_) {
+      return;
+    }
+    // resolve recursive references
+    PushConstRef(&v);
+    VisitScopedTopDown(*resolved);
+    PopConstRef();
+  }
+
+  bool Resolve(const AidlDocument& document) {
+    VisitScopedTopDown(document);
+    return success_;
+  }
+
+ private:
+  void PushConstRef(const AidlConstantReference* ref) {
+    stack_.push_back(ref);
+    if (ref->GetRefType()) {
+      PushScope(ref->GetRefType()->GetDefinedType());
+    }
+  }
+
+  void PopConstRef() {
+    if (stack_.back()->GetRefType()) {
+      PopScope();
+    }
+    stack_.pop_back();
+  }
+
+  bool IsCircularReference(const AidlConstantReference* ref) {
+    auto it =
+        std::find_if(stack_.begin(), stack_.end(), [&](const auto& elem) { return elem == ref; });
+    if (it == stack_.end()) {
+      return false;
+    }
+    std::vector<std::string> path;
+    while (it != stack_.end()) {
+      path.push_back((*it)->Literal());
+      ++it;
+    }
+    path.push_back(ref->Literal());
+    AIDL_ERROR(ref) << "Found a circular reference: " << android::base::Join(path, " -> ");
+    return true;
+  }
+
+  bool success_ = true;
+  std::vector<const AidlConstantReference*> stack_ = {};
+};
+
+// Resolve references(types/constants) in the "main" document.
+bool ResolveReferences(const AidlDocument& document, TypeResolver& type_resolver) {
+  // Types are resolved first before resolving constant references so that every referenced document
+  // gets imported.
+  if (!TypeReferenceResolver(type_resolver).Resolve(document)) {
+    return false;
+  }
+  if (!ConstantReferenceResolver().Resolve(document)) {
+    return false;
+  }
+  if (!CheckNoRecursiveDefinition(document)) {
+    return false;
+  }
+  return true;
+}
+
+Parser::Parser(const std::string& filename, std::string& raw_buffer, bool is_preprocessed)
+    : filename_(filename), is_preprocessed_(is_preprocessed) {
+  yylex_init(&scanner_);
+  buffer_ = yy_scan_buffer(&raw_buffer[0], raw_buffer.length(), scanner_);
+}
+
+Parser::~Parser() {
+  yy_delete_buffer(buffer_, scanner_);
+  yylex_destroy(scanner_);
+}
+
+void Parser::MakeDocument(const AidlLocation& location, const Comments& comments,
+                          std::vector<std::string> imports,
+                          std::vector<std::unique_ptr<AidlDefinedType>> defined_types) {
+  AIDL_FATAL_IF(document_.get(), location);
+  document_ = std::make_unique<AidlDocument>(location, comments, std::move(imports),
+                                             std::move(defined_types), is_preprocessed_);
+}
diff --git a/parser.h b/parser.h
new file mode 100644
index 0000000..074d6d5
--- /dev/null
+++ b/parser.h
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2019, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "aidl_language.h"
+#include "aidl_typenames.h"
+#include "comments.h"
+#include "io_delegate.h"
+#include "logging.h"
+#include "options.h"
+
+#include <memory>
+#include <string>
+#include <vector>
+
+struct yy_buffer_state;
+typedef yy_buffer_state* YY_BUFFER_STATE;
+
+class AidlToken {
+ public:
+  AidlToken(const std::string& text, android::aidl::Comments comments)
+      : text_(text), comments_(std::move(comments)) {}
+  ~AidlToken() = default;
+
+  AidlToken(const AidlToken&) = delete;
+  AidlToken(AidlToken&&) = delete;
+  AidlToken& operator=(const AidlToken&) = delete;
+  AidlToken& operator=(AidlToken&&) = delete;
+
+  const std::string& GetText() const { return text_; }
+  const android::aidl::Comments& GetComments() const { return comments_; }
+
+  template <typename T>
+  void Append(T&& text) {
+    text_ += std::forward<T>(text);
+  }
+
+ private:
+  std::string text_;
+  android::aidl::Comments comments_;
+};
+
+using TypeResolver = std::function<bool(const AidlDefinedType*, AidlTypeSpecifier*)>;
+bool ResolveReferences(const AidlDocument& document, TypeResolver& resolver);
+
+class Parser {
+ public:
+  // non-copyable, non-assignable
+  Parser(const Parser&) = delete;
+  Parser& operator=(const Parser&) = delete;
+
+  ~Parser();
+
+  // Parse contents of file |filename|. Should only be called once.
+  static const AidlDocument* Parse(const std::string& filename,
+                                   const android::aidl::IoDelegate& io_delegate,
+                                   AidlTypenames& typenames, bool is_preprocessed = false);
+
+  void AddError() { error_++; }
+  bool HasError() const { return error_ != 0; }
+
+  const std::string& FileName() const { return filename_; }
+  void* Scanner() const { return scanner_; }
+
+  // This restricts the grammar to something more reasonable. One alternative
+  // would be to support multiple sets of type specifiers in our AST, but then a
+  // lot of later code would have to deal with this more complicated type. So,
+  // in order to keep the AST simpler, restricting the grammar here.
+  //
+  // Takes ownership of type_args, modifies type.
+  void SetTypeParameters(AidlTypeSpecifier* type,
+                         std::vector<std::unique_ptr<AidlTypeSpecifier>>* type_args);
+
+  // fully-qualified type names are allowed only in preprocessed files
+  void CheckValidTypeName(const AidlToken& token, const AidlLocation& loc);
+
+  void SetPackage(const std::string& package);
+  const std::string& Package() const { return package_; }
+
+  void MakeDocument(const AidlLocation& location, const Comments& comments,
+                    std::vector<std::string> imports,
+                    std::vector<std::unique_ptr<AidlDefinedType>> defined_types);
+
+ private:
+  explicit Parser(const std::string& filename, std::string& raw_buffer, bool is_preprocessed);
+
+  std::string filename_;
+  bool is_preprocessed_;
+  std::string package_;
+  void* scanner_ = nullptr;
+  YY_BUFFER_STATE buffer_;
+  int error_ = 0;
+
+  std::unique_ptr<AidlDocument> document_;
+};
diff --git a/permission.cpp b/permission.cpp
new file mode 100644
index 0000000..9f730da
--- /dev/null
+++ b/permission.cpp
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "permission.h"
+#include <memory>
+#include <string>
+#include <variant>
+#include <vector>
+
+#include <android-base/strings.h>
+
+namespace android {
+namespace aidl {
+namespace perm {
+
+std::string AsJavaAnnotation(const Expression& expr) {
+  if (const auto& s = std::get_if<std::string>(&expr); s) {
+    return JavaFullName(*s);
+  }
+  if (const auto& all = std::get_if<AllOf>(&expr); all) {
+    return all->JavaAnnotation();
+  }
+  if (const auto& any = std::get_if<AnyOf>(&expr); any) {
+    return any->JavaAnnotation();
+  }
+  return "";
+}
+
+std::string JavaFullName(const std::string& permission) {
+  if (permission.find('.') == std::string::npos) {
+    return "android.Manifest.permission." + permission;
+  }
+  return permission;
+}
+
+}  // namespace perm
+}  // namespace aidl
+}  // namespace android
diff --git a/permission.h b/permission.h
new file mode 100644
index 0000000..590a00c
--- /dev/null
+++ b/permission.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+#include <variant>
+#include <vector>
+
+#include <android-base/strings.h>
+
+namespace android {
+namespace aidl {
+namespace perm {
+
+struct AnyOf;
+struct AllOf;
+
+typedef std::variant<std::string, AnyOf, AllOf> Expression;
+std::string AsJavaAnnotation(const Expression& expr);
+std::string JavaFullName(const std::string& permission);
+
+struct AnyOf {
+  std::vector<std::string> operands;
+
+  std::string JavaAnnotation() const {
+    std::string ret("anyOf = {");
+    for (size_t i = 0; i < operands.size(); i++) {
+      ret += android::aidl::perm::JavaFullName(operands[i]);
+      if (i != operands.size() - 1) {
+        ret += ", ";
+      }
+    }
+    return ret + "}";
+  }
+};
+
+struct AllOf {
+  std::vector<std::string> operands;
+
+  std::string JavaAnnotation() const {
+    std::string ret("allOf = {");
+    for (size_t i = 0; i < operands.size(); i++) {
+      ret += android::aidl::perm::JavaFullName(operands[i]);
+      if (i != operands.size() - 1) {
+        ret += ", ";
+      }
+    }
+    return ret + "}";
+  }
+};
+
+
+
+}  // namespace perm
+}  // namespace aidl
+}  // namespace android
diff --git a/preprocess.cpp b/preprocess.cpp
new file mode 100644
index 0000000..d4aa05c
--- /dev/null
+++ b/preprocess.cpp
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "preprocess.h"
+
+#include <android-base/strings.h>
+
+#include "aidl.h"
+
+using android::base::Join;
+
+namespace android {
+namespace aidl {
+
+namespace {
+// PreprocessVisitor emits
+// - types including comments(hide/deprecated) and annotations
+// - constant delcarations for interface/parcelable/unions
+// - enumerators for enums
+struct PreprocessVisitor : AidlVisitor {
+  CodeWriter& out;
+  PreprocessVisitor(CodeWriter& out) : out(out) {}
+
+  void DumpType(const AidlDefinedType& dt, const string& type) {
+    DumpComments(dt);
+    DumpAnnotations(dt);
+    // Top-level definition emits canonical name while nested type emits "name" only.
+    if (dt.GetParentType()) {
+      out << type << " " << dt.GetName();
+    } else {
+      out << type << " " << dt.GetCanonicalName();
+    }
+    if (auto generic_type = dt.AsParameterizable(); generic_type && generic_type->IsGeneric()) {
+      out << "<" << Join(generic_type->GetTypeParameters(), ", ") << ">";
+    }
+  }
+  void DumpMembers(const AidlDefinedType& dt) {
+    out << " {\n";
+    out.Indent();
+    for (const auto& constdecl : dt.GetConstantDeclarations()) {
+      constdecl->DispatchVisit(*this);
+    }
+    for (const auto& nested : dt.GetNestedTypes()) {
+      nested->DispatchVisit(*this);
+    }
+    out.Dedent();
+    out << "}\n";
+  }
+  void DumpComments(const AidlCommentable& c) {
+    const auto hidden = c.IsHidden();
+    const auto deprecated = FindDeprecated(c.GetComments());
+    if (hidden || deprecated) {
+      out << "/**\n";
+      if (hidden) {
+        out << " * @hide\n";
+      }
+      if (deprecated) {
+        out << " * @deprecated " << deprecated->note << "\n";
+      }
+      out << " */\n";
+    }
+  }
+  void DumpAnnotations(const AidlAnnotatable& a) {
+    auto annotations = a.ToString();
+    if (!annotations.empty()) {
+      out << annotations << "\n";
+    }
+  }
+  void DumpConstantValue(const AidlTypeSpecifier& type, const AidlConstantValue& c) {
+    out << c.ValueString(type, AidlConstantValueDecorator);
+  }
+  void Visit(const AidlInterface& t) override {
+    DumpType(t, "interface");
+    DumpMembers(t);
+  }
+  void Visit(const AidlParcelable& t) override {
+    DumpType(t, "parcelable");
+    if (const auto& cpp_header = t.GetCppHeader(); !cpp_header.empty()) {
+      out << " cpp_header " << cpp_header;
+    }
+    if (const auto& ndk_header = t.GetNdkHeader(); !ndk_header.empty()) {
+      out << " ndk_header " << ndk_header;
+    }
+    if (const auto& rust_type = t.GetRustType(); !rust_type.empty()) {
+      out << " rust_type " << rust_type;
+    }
+    out << ";\n";
+  }
+  void Visit(const AidlStructuredParcelable& t) override {
+    DumpType(t, "parcelable");
+    DumpMembers(t);
+  }
+  void Visit(const AidlUnionDecl& t) override {
+    DumpType(t, "union");
+    DumpMembers(t);
+  }
+  void Visit(const AidlEnumDeclaration& t) override {
+    DumpType(t, "enum");
+    out << " {\n";
+    out.Indent();
+    for (const auto& e : t.GetEnumerators()) {
+      out << e->GetName() << " = ";
+      DumpConstantValue(t.GetBackingType(), *e->GetValue());
+      out << ",\n";
+    }
+    out.Dedent();
+    out << "}\n";
+  }
+  void Visit(const AidlConstantDeclaration& c) override {
+    DumpComments(c);
+    out << "const ";
+    Visit(c.GetType());
+    out << " " << c.GetName() << " = ";
+    DumpConstantValue(c.GetType(), c.GetValue());
+    out << ";\n";
+  }
+  void Visit(const AidlTypeSpecifier& t) override { out << t.ToString(); }
+};
+
+}  // namespace
+
+bool Preprocess(const Options& options, const IoDelegate& io_delegate) {
+  unique_ptr<CodeWriter> writer = io_delegate.GetCodeWriter(options.OutputFile());
+  PreprocessVisitor visitor(*writer);
+
+  for (const auto& file : options.InputFiles()) {
+    AidlTypenames typenames;
+    auto result =
+        internals::load_and_validate_aidl(file, options, io_delegate, &typenames, nullptr);
+    if (result == AidlError::OK) {
+      const auto& doc = typenames.MainDocument();
+      for (const auto& t : doc.DefinedTypes()) {
+        t->DispatchVisit(visitor);
+      }
+    } else {
+      return false;
+    }
+  }
+
+  return writer->Close();
+}
+
+}  // namespace aidl
+}  // namespace android
diff --git a/preprocess.h b/preprocess.h
new file mode 100644
index 0000000..d734a68
--- /dev/null
+++ b/preprocess.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "aidl_language.h"
+#include "code_writer.h"
+
+namespace android {
+namespace aidl {
+
+bool Preprocess(const Options& options, const IoDelegate& io_delegate);
+
+}  // namespace aidl
+}  // namespace android
diff --git a/run_integration_tests.sh b/run_integration_tests.sh
new file mode 100755
index 0000000..a423a3e
--- /dev/null
+++ b/run_integration_tests.sh
@@ -0,0 +1,49 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2020 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -ex
+
+# TODO(b/156942077): when this test was converted to atest, we lost the ability
+# to see test results on stdout, and we can't print out the gtest results on
+# stderr because it breaks python test parsing. So, this file is added to help
+# run integration tests.
+
+$ANDROID_BUILD_TOP/build/soong/soong_ui.bash --make-mode \
+    MODULES-IN-system-tools-aidl
+
+adb root
+adb wait-for-device
+adb sync data
+adb push \
+    ${ANDROID_PRODUCT_OUT}/testcases/aidl_test_java_service/*/aidl_test_java_service.jar \
+    /data/framework/aidl_test_java_service.jar
+adb push \
+    ${ANDROID_PRODUCT_OUT}/testcases/aidl_test_java_client/*/aidl_test_java_client.jar \
+    /data/framework/aidl_test_java_client.jar
+adb push \
+    ${ANDROID_PRODUCT_OUT}/testcases/aidl_test_java_service_sdk29/*/aidl_test_java_service_sdk29.jar \
+    /data/framework/aidl_test_java_service_sdk29.jar
+adb push \
+    ${ANDROID_PRODUCT_OUT}/testcases/aidl_test_java_client_sdk29/*/aidl_test_java_client_sdk29.jar \
+    /data/framework/aidl_test_java_client_sdk29.jar
+adb push \
+    ${ANDROID_PRODUCT_OUT}/testcases/aidl_test_java_service_sdk1/*/aidl_test_java_service_sdk1.jar \
+    /data/framework/aidl_test_java_service_sdk1.jar
+adb push \
+    ${ANDROID_PRODUCT_OUT}/testcases/aidl_test_java_client_sdk1/*/aidl_test_java_client_sdk1.jar \
+    /data/framework/aidl_test_java_client_sdk1.jar
+
+${ANDROID_BUILD_TOP}/system/tools/aidl/tests/aidl_integration_test.py
diff --git a/rustfmt.toml b/rustfmt.toml
new file mode 120000
index 0000000..475ba8f
--- /dev/null
+++ b/rustfmt.toml
@@ -0,0 +1 @@
+../../../build/soong/scripts/rustfmt.toml
\ No newline at end of file
diff --git a/scripts/example_dep_build_failure_output.txt b/scripts/example_dep_build_failure_output.txt
new file mode 100644
index 0000000..50aa397
--- /dev/null
+++ b/scripts/example_dep_build_failure_output.txt
@@ -0,0 +1,88 @@
+============================================
+PLATFORM_VERSION_CODENAME=UpsideDownCake
+PLATFORM_VERSION=UpsideDownCake
+TARGET_PRODUCT=aosp_cf_x86_64_phone
+TARGET_BUILD_VARIANT=userdebug
+TARGET_ARCH=x86_64
+TARGET_ARCH_VARIANT=silvermont
+TARGET_2ND_ARCH=x86
+TARGET_2ND_ARCH_VARIANT=silvermont
+HOST_OS=linux
+HOST_OS_EXTRA=Linux-5.18.16-1rodete1-amd64-x86_64-Debian-GNU/Linux-rodete
+HOST_CROSS_OS=windows
+BUILD_ID=AOSP.MASTER
+OUT_DIR=out
+============================================
+[100% 1/1] analyzing Android.bp files and generating ninja file at out/soong/build.ninja
+FAILED: out/soong/build.ninja
+cd "$(dirname "out/host/linux-x86/bin/soong_build")" && BUILDER="$PWD/$(basename "out/host/linux-x86/bin/soong_build")" && cd / && env -i  "$BUILDER"     --top "$TOP"     --soong_out "out/soong"     --out "out"     -o out/soong/build.ninja --globListDir build --globFile out/soong/globs-build.ninja -t -l out/.module_paths/Android.bp.list --available_env out/soong/soong.environment.available --used_env out/soong/soong.environment.used.build Android.bp
+error: hardware/interfaces/automotive/audiocontrol/aidl/Android.bp:12:1: module "android.hardware.automotive.audiocontrol-V2-java" variant "android_common" (created by module "android.hardware.automotive.audiocontrol-V2-java-generator" (created by module "android.hardware.automotive.audiocontrol_interface")): depends on multiple versions of the same aidl_interface: android.media.audio.common.types-V1-java-source, android.media.audio.common.types-V2-java-source
+error: hardware/interfaces/automotive/audiocontrol/aidl/Android.bp:12:1: module "android.hardware.automotive.audiocontrol-V2-java" variant "android_common" (created by module "android.hardware.automotive.audiocontrol-V2-java-generator" (created by module "android.hardware.automotive.audiocontrol_interface")): Dependency path: 
+           via tag java.dependencyTag: { name:staticlib runtimeLinked:false toolchain:false}
+    -> android.hardware.audio.common-V1-java{os:android,arch:common,apex:}
+           via tag java.dependencyTag: { name:staticlib runtimeLinked:false toolchain:false}
+    -> android.media.audio.common.types-V1-java{os:android,arch:common,apex:}
+           via tag android.sourceOrOutputDependencyTag: { moduleName:android.media.audio.common.types-V1-java-source tag:}
+    -> android.media.audio.common.types-V1-java-source{}
+error: hardware/interfaces/automotive/audiocontrol/aidl/Android.bp:12:1: module "android.hardware.automotive.audiocontrol-V2-java" variant "android_common" (created by module "android.hardware.automotive.audiocontrol-V2-java-generator" (created by module "android.hardware.automotive.audiocontrol_interface")): Dependency path: 
+           via tag java.dependencyTag: { name:staticlib runtimeLinked:false toolchain:false}
+    -> android.media.audio.common.types-V2-java{os:android,arch:common,apex:}
+           via tag android.sourceOrOutputDependencyTag: { moduleName:android.media.audio.common.types-V2-java-source tag:}
+    -> android.media.audio.common.types-V2-java-source{}
+error: hardware/interfaces/automotive/audiocontrol/aidl/Android.bp:12:1: module "android.hardware.automotive.audiocontrol-V1-java" variant "android_common" (created by module "android.hardware.automotive.audiocontrol-V1-java-generator" (created by module "android.hardware.automotive.audiocontrol_interface")): depends on multiple versions of the same aidl_interface: android.media.audio.common.types-V1-java-source, android.media.audio.common.types-V2-java-source
+error: hardware/interfaces/automotive/audiocontrol/aidl/Android.bp:12:1: module "android.hardware.automotive.audiocontrol-V1-java" variant "android_common" (created by module "android.hardware.automotive.audiocontrol-V1-java-generator" (created by module "android.hardware.automotive.audiocontrol_interface")): Dependency path: 
+           via tag java.dependencyTag: { name:staticlib runtimeLinked:false toolchain:false}
+    -> android.hardware.audio.common-V1-java{os:android,arch:common,apex:}
+           via tag java.dependencyTag: { name:staticlib runtimeLinked:false toolchain:false}
+    -> android.media.audio.common.types-V1-java{os:android,arch:common,apex:}
+           via tag android.sourceOrOutputDependencyTag: { moduleName:android.media.audio.common.types-V1-java-source tag:}
+    -> android.media.audio.common.types-V1-java-source{}
+error: hardware/interfaces/automotive/audiocontrol/aidl/Android.bp:12:1: module "android.hardware.automotive.audiocontrol-V1-java" variant "android_common" (created by module "android.hardware.automotive.audiocontrol-V1-java-generator" (created by module "android.hardware.automotive.audiocontrol_interface")): Dependency path: 
+           via tag java.dependencyTag: { name:staticlib runtimeLinked:false toolchain:false}
+    -> android.media.audio.common.types-V2-java{os:android,arch:common,apex:}
+           via tag android.sourceOrOutputDependencyTag: { moduleName:android.media.audio.common.types-V2-java-source tag:}
+    -> android.media.audio.common.types-V2-java-source{}
+error: hardware/interfaces/audio/aidl/Android.bp:90:1: module "android.hardware.audio.core-V1-java" variant "android_common" (created by module "android.hardware.audio.core-V1-java-generator" (created by module "android.hardware.audio.core_interface")): depends on multiple versions of the same aidl_interface: android.media.audio.common.types-V1-java-source, android.media.audio.common.types-V2-java-source
+error: hardware/interfaces/audio/aidl/Android.bp:90:1: module "android.hardware.audio.core-V1-java" variant "android_common" (created by module "android.hardware.audio.core-V1-java-generator" (created by module "android.hardware.audio.core_interface")): Dependency path: 
+           via tag java.dependencyTag: { name:staticlib runtimeLinked:false toolchain:false}
+    -> android.hardware.audio.common-V1-java{os:android,arch:common,apex:}
+           via tag java.dependencyTag: { name:staticlib runtimeLinked:false toolchain:false}
+    -> android.media.audio.common.types-V1-java{os:android,arch:common,apex:}
+           via tag android.sourceOrOutputDependencyTag: { moduleName:android.media.audio.common.types-V1-java-source tag:}
+    -> android.media.audio.common.types-V1-java-source{}
+error: hardware/interfaces/audio/aidl/Android.bp:90:1: module "android.hardware.audio.core-V1-java" variant "android_common" (created by module "android.hardware.audio.core-V1-java-generator" (created by module "android.hardware.audio.core_interface")): Dependency path: 
+           via tag java.dependencyTag: { name:staticlib runtimeLinked:false toolchain:false}
+    -> android.media.audio.common.types-V2-java{os:android,arch:common,apex:}
+           via tag android.sourceOrOutputDependencyTag: { moduleName:android.media.audio.common.types-V2-java-source tag:}
+    -> android.media.audio.common.types-V2-java-source{}
+error: hardware/interfaces/automotive/audiocontrol/aidl/Android.bp:12:1: module "android.hardware.automotive.audiocontrol-V3-java" variant "android_common" (created by module "android.hardware.automotive.audiocontrol-V3-java-generator" (created by module "android.hardware.automotive.audiocontrol_interface")): depends on multiple versions of the same aidl_interface: android.media.audio.common.types-V1-java-source, android.media.audio.common.types-V2-java-source
+error: hardware/interfaces/automotive/audiocontrol/aidl/Android.bp:12:1: module "android.hardware.automotive.audiocontrol-V3-java" variant "android_common" (created by module "android.hardware.automotive.audiocontrol-V3-java-generator" (created by module "android.hardware.automotive.audiocontrol_interface")): Dependency path: 
+           via tag java.dependencyTag: { name:staticlib runtimeLinked:false toolchain:false}
+    -> android.hardware.audio.common-V1-java{os:android,arch:common,apex:}
+           via tag java.dependencyTag: { name:staticlib runtimeLinked:false toolchain:false}
+    -> android.media.audio.common.types-V1-java{os:android,arch:common,apex:}
+           via tag android.sourceOrOutputDependencyTag: { moduleName:android.media.audio.common.types-V1-java-source tag:}
+    -> android.media.audio.common.types-V1-java-source{}
+error: hardware/interfaces/automotive/audiocontrol/aidl/Android.bp:12:1: module "android.hardware.automotive.audiocontrol-V3-java" variant "android_common" (created by module "android.hardware.automotive.audiocontrol-V3-java-generator" (created by module "android.hardware.automotive.audiocontrol_interface")): Dependency path: 
+           via tag java.dependencyTag: { name:staticlib runtimeLinked:false toolchain:false}
+    -> android.media.audio.common.types-V2-java{os:android,arch:common,apex:}
+           via tag android.sourceOrOutputDependencyTag: { moduleName:android.media.audio.common.types-V2-java-source tag:}
+    -> android.media.audio.common.types-V2-java-source{}
+error: hardware/interfaces/audio/aidl/Android.bp:147:1: module "android.hardware.audio.effect-V1-java" variant "android_common" (created by module "android.hardware.audio.effect-V1-java-generator" (created by module "android.hardware.audio.effect_interface")): depends on multiple versions of the same aidl_interface: android.media.audio.common.types-V1-java-source, android.media.audio.common.types-V2-java-source
+error: hardware/interfaces/audio/aidl/Android.bp:147:1: module "android.hardware.audio.effect-V1-java" variant "android_common" (created by module "android.hardware.audio.effect-V1-java-generator" (created by module "android.hardware.audio.effect_interface")): Dependency path: 
+           via tag java.dependencyTag: { name:staticlib runtimeLinked:false toolchain:false}
+    -> android.hardware.audio.common-V1-java{os:android,arch:common,apex:}
+           via tag java.dependencyTag: { name:staticlib runtimeLinked:false toolchain:false}
+    -> android.media.audio.common.types-V1-java{os:android,arch:common,apex:}
+           via tag android.sourceOrOutputDependencyTag: { moduleName:android.media.audio.common.types-V1-java-source tag:}
+    -> android.media.audio.common.types-V1-java-source{}
+error: hardware/interfaces/audio/aidl/Android.bp:147:1: module "android.hardware.audio.effect-V1-java" variant "android_common" (created by module "android.hardware.audio.effect-V1-java-generator" (created by module "android.hardware.audio.effect_interface")): Dependency path: 
+           via tag java.dependencyTag: { name:staticlib runtimeLinked:false toolchain:false}
+    -> android.media.audio.common.types-V2-java{os:android,arch:common,apex:}
+           via tag android.sourceOrOutputDependencyTag: { moduleName:android.media.audio.common.types-V2-java-source tag:}
+    -> android.media.audio.common.types-V2-java-source{}
+ninja: build stopped: subcommand failed.
+21:43:11 soong bootstrap failed with: exit status 1
+
+#### failed to build some targets (46 seconds) ####
+
diff --git a/scripts/redundancy_check/Android.bp b/scripts/redundancy_check/Android.bp
new file mode 100644
index 0000000..0ad95ea
--- /dev/null
+++ b/scripts/redundancy_check/Android.bp
@@ -0,0 +1,35 @@
+
+package {
+    default_applicable_licenses: ["system_tools_aidl_license"],
+}
+
+// Example usage:
+//
+//   m aidl_redundancy_check
+//   aidl_redundancy_check \
+//     --installed-files-json $OUT/installed-files.json \
+//     --aidl-metadata-json $ANDROID_BUILD_TOP/out/soong/.intermediates/system/tools/aidl/build/aidl_metadata_json/aidl_metadata.json
+rust_binary_host {
+    name: "aidl_redundancy_check",
+    srcs: ["srcs/main.rs"],
+    rustlibs: [
+        "libanyhow",
+        "libregex",
+        "libserde",
+        "libserde_json",
+        "libclap",
+    ],
+}
+
+rust_test_host {
+    name: "aidl_redundancy_check.test",
+    srcs: ["srcs/main.rs"],
+    rustlibs: [
+        "libanyhow",
+        "libregex",
+        "libserde",
+        "libserde_json",
+        "libclap",
+    ],
+    test_suites: ["general-tests"],
+}
diff --git a/scripts/redundancy_check/srcs/main.rs b/scripts/redundancy_check/srcs/main.rs
new file mode 100644
index 0000000..7e43a71
--- /dev/null
+++ b/scripts/redundancy_check/srcs/main.rs
@@ -0,0 +1,175 @@
+/*
+ * Copyright (C) 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//! Reports redundant AIDL libraries included in a partition.
+
+use anyhow::{Context, Result};
+use clap::Parser;
+use std::collections::BTreeMap;
+use std::fs::File;
+use std::io::BufReader;
+use std::path::{Path, PathBuf};
+
+#[derive(Parser, Debug)]
+#[structopt()]
+struct Opt {
+    /// JSON file with list of files installed in a partition, e.g. "$OUT/installed-files.json".
+    #[clap(long)]
+    installed_files_json: PathBuf,
+
+    /// JSON file with metadata for AIDL interfaces. Optional, but fewer checks are performed when
+    /// unset.
+    #[clap(long)]
+    aidl_metadata_json: Option<PathBuf>,
+}
+
+/// "aidl_metadata.json" entry.
+#[derive(Debug, serde::Deserialize)]
+struct AidlInterfaceMetadata {
+    /// Name of module defining package.
+    name: String,
+}
+
+/// "installed-files.json" entry.
+#[derive(Debug, serde::Deserialize)]
+struct InstalledFile {
+    /// Full file path.
+    #[serde(rename = "Name")]
+    name: String,
+    /// File size.
+    #[serde(rename = "Size")]
+    size: u64,
+}
+
+#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
+enum LibDir {
+    Lib,
+    Lib64,
+}
+
+/// An instance of an AIDL interface lib.
+#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)]
+struct AidlInstance {
+    installed_path: String,
+    size: u64,
+    name: String,
+    variant: String, // e.g. "ndk" or "cpp"
+    version: usize,
+    lib_dir: LibDir,
+}
+
+/// Deserializes a JSON file at `path` into an object of type `T`.
+fn read_json_file<T: serde::de::DeserializeOwned>(path: &Path) -> Result<T> {
+    let file = File::open(path).with_context(|| format!("failed to open: {}", path.display()))?;
+    serde_json::from_reader(BufReader::new(file))
+        .with_context(|| format!("failed to read: {}", path.display()))
+}
+
+/// Extracts AIDL lib info an `InstalledFile`, mainly by parsing the file path. Returns `None` if
+/// it doesn't look like an AIDL lib.
+fn extract_aidl_instance(installed_file: &InstalledFile) -> Option<AidlInstance> {
+    // example: android.hardware.security.keymint-V2-ndk.so
+    let lib_regex = regex::Regex::new(r".*/(lib|lib64)/([^-]*)-V(\d+)-([^.]+)\.")
+        .expect("failed to parse regex");
+    let captures = lib_regex.captures(&installed_file.name)?;
+    let (dir, name, version, variant) = (&captures[1], &captures[2], &captures[3], &captures[4]);
+    Some(AidlInstance {
+        installed_path: installed_file.name.clone(),
+        size: installed_file.size,
+        name: name.to_string(),
+        variant: variant.to_string(),
+        version: version.parse().unwrap(),
+        lib_dir: if dir == "lib64" { LibDir::Lib64 } else { LibDir::Lib },
+    })
+}
+
+fn main() -> Result<()> {
+    let args = Opt::parse();
+
+    // Read the metadata file if available.
+    let metadata_list: Option<Vec<AidlInterfaceMetadata>> = match &args.aidl_metadata_json {
+        Some(aidl_metadata_json) => read_json_file(aidl_metadata_json)?,
+        None => None,
+    };
+    let is_valid_aidl_lib = |name: &str| match &metadata_list {
+        Some(x) => x.iter().any(|metadata| metadata.name == name),
+        None => true,
+    };
+
+    // Read the "installed-files.json" and create a list of AidlInstance.
+    let installed_files: Vec<InstalledFile> = read_json_file(&args.installed_files_json)?;
+    let instances: Vec<AidlInstance> = installed_files
+        .iter()
+        .filter_map(extract_aidl_instance)
+        .filter(|instance| {
+            if !is_valid_aidl_lib(&instance.name) {
+                eprintln!(
+                    "WARNING: {} looks like an AIDL lib, but has no metadata",
+                    &instance.installed_path
+                );
+                return false;
+            }
+            true
+        })
+        .collect();
+
+    // Group redundant AIDL lib instances together.
+    let groups: BTreeMap<(String, LibDir), Vec<&AidlInstance>> =
+        instances.iter().fold(BTreeMap::new(), |mut acc, x| {
+            let key = (x.name.clone(), x.lib_dir);
+            acc.entry(key).or_default().push(x);
+            acc
+        });
+    let mut total_wasted_bytes = 0;
+    for (group_key, mut instances) in groups {
+        if instances.len() > 1 {
+            instances.sort();
+            // Prefer the highest version, break ties favoring ndk.
+            let preferred_instance = instances
+                .iter()
+                .max_by_key(|x| (x.version, i32::from(x.variant == "ndk")))
+                .unwrap();
+            let wasted_bytes: u64 =
+                instances.iter().filter(|x| *x != preferred_instance).map(|x| x.size).sum();
+            println!("Found redundant AIDL instances for {:?}", group_key);
+            for instance in instances.iter() {
+                println!(
+                    "\t{}\t({:.2} KiB){}",
+                    instance.installed_path,
+                    instance.size as f64 / 1024.0,
+                    if instance == preferred_instance { " <- preferred" } else { "" }
+                );
+            }
+            total_wasted_bytes += wasted_bytes;
+            println!("\t(potential savings: {:.2} KiB)", wasted_bytes as f64 / 1024.0);
+            println!();
+        }
+    }
+    println!("total potential savings: {:.2} KiB", total_wasted_bytes as f64 / 1024.0);
+
+    Ok(())
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use clap::CommandFactory;
+
+    #[test]
+    fn verify_opt() {
+        Opt::command().debug_assert();
+    }
+}
diff --git a/scripts/vis_aidl_ver_errors.py b/scripts/vis_aidl_ver_errors.py
new file mode 100755
index 0000000..71c3160
--- /dev/null
+++ b/scripts/vis_aidl_ver_errors.py
@@ -0,0 +1,56 @@
+#!/usr/bin/env python3
+
+# note - needs
+# sudo apt-get install python3-networkx python3-matplotlib
+import matplotlib.pyplot as plt
+import networkx as nx
+
+import re
+import fileinput
+
+# okay - not actually using this now
+# groups : 1 -> module name, 2 -> ultimate deps
+RE_highlevel = re.compile("error: [^ ]* module \"([^\"]*)\" variant \"[^\"]*\" .*? depends on multiple versions of the same aidl_interface: (.*)\n")
+
+# groups : 1 -> module name
+RE_dependencyStart = re.compile("error: [^ ]* module \"([^\"]*)\" variant \"[^\"]*\" .*? Dependency path.*\n")
+
+# groups : 1 -> module name
+RE_dependencyCont = re.compile(" *-> ([^{]*){.*\n")
+
+RE_ignore= re.compile(" *via tag.*{.*}.*\n")
+
+# [(module, module)]
+graph = []
+
+last = None
+
+for i in fileinput.input():
+    # could validate consistency of this graph based on this
+    if RE_highlevel.fullmatch(i): continue
+
+    m = RE_dependencyStart.fullmatch(i)
+    if m:
+        last = m.groups()[0]
+        continue
+
+    m = RE_dependencyCont.fullmatch(i)
+    if m:
+        curr = m.groups()[0]
+        graph += [(last, curr)]
+        last = curr
+        continue
+
+    if RE_ignore.fullmatch(i): continue
+
+    print("UNRECOGNIZED LINE", i.strip())
+
+#for a,b in graph:
+#    print(a,b)
+
+G = nx.MultiDiGraph()
+G.add_edges_from(graph)
+plt.figure(figsize=(10,10))
+nx.draw(G, connectionstyle='arc3,rad=0.01', with_labels=True)
+plt.show()
+
diff --git a/tests/aidl_integration_test.py b/tests/aidl_integration_test.py
new file mode 100755
index 0000000..6355f84
--- /dev/null
+++ b/tests/aidl_integration_test.py
@@ -0,0 +1,364 @@
+#!/usr/bin/env python3
+
+from itertools import product
+from time import sleep
+
+import pipes
+import re
+import subprocess
+import sys
+import textwrap
+import unittest
+
+BITNESS_32 = ("", "32")
+BITNESS_64 = ("64", "64")
+
+APP_PROCESS_FOR_PRETTY_BITNESS = 'app_process%s'
+CPP_TEST_SERVICE_FOR_BITNESS = ' /data/nativetest%s/aidl_test_service/aidl_test_service%s'
+CPP_TEST_CLIENT_FOR_BITNESS = ' /data/nativetest%s/aidl_test_client/aidl_test_client%s'
+CPP_TEST_V1_CLIENT_FOR_BITNESS = ' /data/nativetest%s/aidl_test_v1_client/aidl_test_v1_client%s'
+NDK_TEST_SERVICE_FOR_BITNESS = ' /data/nativetest%s/aidl_test_service_ndk/aidl_test_service_ndk%s'
+NDK_TEST_CLIENT_FOR_BITNESS = ' /data/nativetest%s/aidl_test_client_ndk/aidl_test_client_ndk%s'
+RUST_TEST_CLIENT_FOR_BITNESS = ' /data/nativetest%s/aidl_test_rust_client/aidl_test_rust_client%s'
+RUST_TEST_SERVICE_FOR_BITNESS = ' /data/nativetest%s/aidl_test_rust_service/aidl_test_rust_service%s'
+RUST_TEST_SERVICE_ASYNC_FOR_BITNESS = ' /data/nativetest%s/aidl_test_rust_service_async/aidl_test_rust_service_async%s'
+
+# From AidlTestsJava.java
+INSTRUMENTATION_SUCCESS_PATTERN = r'TEST SUCCESS\n$'
+
+class ShellResultFail(Exception):
+    """Raised on test failures."""
+    def __init__(self, err):
+        stderr = textwrap.indent(err.stderr, "    ")
+        stdout = textwrap.indent(err.stdout, "    ")
+
+        super().__init__(f"STDOUT:\n{stdout}\nSTDERR:\n{stderr}\nRESULT:{err.exit_status}")
+
+def pretty_bitness(bitness):
+    """Returns a human readable version of bitness, corresponding to BITNESS_* variable"""
+    return bitness[-1]
+
+class ShellResult(object):
+    """Represents the result of running a shell command."""
+
+    def __init__(self, exit_status, stdout, stderr):
+        """Construct an instance.
+
+        Args:
+            exit_status: integer exit code of shell command
+            stdout: string stdout of shell command
+            stderr: string stderr of shell command
+        """
+        self.stdout = stdout
+        self.stderr = stderr
+        self.exit_status = exit_status
+
+    def printable_string(self):
+        """Get a string we could print to the logs and understand."""
+        output = []
+        output.append('stdout:')
+        for line in self.stdout.splitlines():
+            output.append('  > %s' % line)
+        output.append('stderr:')
+        for line in self.stderr.splitlines():
+            output.append('  > %s' % line)
+        return '\n'.join(output)
+
+
+class AdbHost(object):
+    """Represents a device connected via ADB."""
+
+    def run(self, command, background=False, ignore_status=False):
+        """Run a command on the device via adb shell.
+
+        Args:
+            command: string containing a shell command to run.
+            background: True iff we should run this command in the background.
+            ignore_status: True iff we should ignore the command's exit code.
+
+        Returns:
+            instance of ShellResult.
+
+        Raises:
+            subprocess.CalledProcessError on command exit != 0.
+        """
+        if background:
+            command = '( %s ) </dev/null >/dev/null 2>&1 &' % command
+        return self.adb('shell %s' % pipes.quote(command),
+                        ignore_status=ignore_status)
+
+    def adb(self, command, ignore_status=False):
+        """Run an ADB command (e.g. `adb sync`).
+
+        Args:
+            command: string containing command to run
+            ignore_status: True iff we should ignore the command's exit code.
+
+        Returns:
+            instance of ShellResult.
+
+        Raises:
+            subprocess.CalledProcessError on command exit != 0.
+        """
+        command = 'adb %s' % command
+        p = subprocess.Popen(command, shell=True, close_fds=True,
+                             stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+                             universal_newlines=True)
+        stdout, stderr = p.communicate()
+        if not ignore_status and p.returncode:
+            raise subprocess.CalledProcessError(p.returncode, command)
+        return ShellResult(p.returncode, stdout, stderr)
+
+class NativeServer:
+    def cleanup(self):
+        self.host.run('killall %s' % self.binary, ignore_status=True)
+    def run(self):
+        return self.host.run(self.binary, background=True)
+
+class NativeClient:
+    def cleanup(self):
+        self.host.run('killall %s' % self.binary, ignore_status=True)
+    def run(self):
+        result = self.host.run(self.binary + ' --gtest_color=yes', ignore_status=True)
+        print(result.printable_string())
+        if result.exit_status:
+            raise ShellResultFail(result)
+
+class CppServer(NativeServer):
+    def __init__(self, host, bitness):
+        self.name = "%s_bit_cpp_server" % pretty_bitness(bitness)
+        self.host = host
+        self.binary = CPP_TEST_SERVICE_FOR_BITNESS % bitness
+
+class CppClient(NativeClient):
+    def __init__(self, host, bitness):
+        self.name = "%s_bit_cpp_client" % pretty_bitness(bitness)
+        self.host = host
+        self.binary = CPP_TEST_CLIENT_FOR_BITNESS % bitness
+
+class CppV1Client(NativeClient):
+    def __init__(self, host, bitness):
+        self.name = "%s_bit_cpp_v1_client" % pretty_bitness(bitness)
+        self.host = host
+        self.binary = CPP_TEST_V1_CLIENT_FOR_BITNESS % bitness
+
+class NdkServer(NativeServer):
+    def __init__(self, host, bitness):
+        self.name = "%s_bit_ndk_server" % pretty_bitness(bitness)
+        self.host = host
+        self.binary = NDK_TEST_SERVICE_FOR_BITNESS % bitness
+
+class NdkClient(NativeClient):
+    def __init__(self, host, bitness):
+        self.name = "%s_bit_ndk_client" % pretty_bitness(bitness)
+        self.host = host
+        self.binary = NDK_TEST_CLIENT_FOR_BITNESS % bitness
+
+class JavaServer:
+    def __init__(self, host, bitness):
+        self.name = "java_server_%s" % pretty_bitness(bitness)
+        self.host = host
+        self.bitness = bitness
+    def cleanup(self):
+        self.host.run('killall ' + APP_PROCESS_FOR_PRETTY_BITNESS % pretty_bitness(self.bitness),
+                      ignore_status=True)
+    def run(self):
+        return self.host.run('CLASSPATH=/data/framework/aidl_test_java_service.jar '
+                             + APP_PROCESS_FOR_PRETTY_BITNESS % pretty_bitness(self.bitness) +
+                             ' /data/framework android.aidl.service.TestServiceServer',
+                             background=True)
+
+class JavaClient:
+    def __init__(self, host, bitness):
+        self.name = "java_client_%s" % pretty_bitness(bitness)
+        self.host = host
+        self.bitness = bitness
+    def cleanup(self):
+        self.host.run('killall ' + APP_PROCESS_FOR_PRETTY_BITNESS % pretty_bitness(self.bitness),
+                      ignore_status=True)
+    def run(self):
+        result = self.host.run('CLASSPATH=/data/framework/aidl_test_java_client.jar '
+                               + APP_PROCESS_FOR_PRETTY_BITNESS % pretty_bitness(self.bitness) +
+                               ' /data/framework android.aidl.tests.AidlJavaTests')
+        print(result.printable_string())
+        if re.search(INSTRUMENTATION_SUCCESS_PATTERN, result.stdout) is None:
+            raise ShellResultFail(result)
+
+class JavaVersionTestClient:
+    def __init__(self, host, bitness, ver):
+        self.name = "java_client_sdk%d_%s" % (ver, pretty_bitness(bitness))
+        self.host = host
+        self.bitness = bitness
+        self.ver = ver
+    def cleanup(self):
+        self.host.run('killall ' + APP_PROCESS_FOR_PRETTY_BITNESS % pretty_bitness(self.bitness),
+                      ignore_status=True)
+    def run(self):
+        result = self.host.run('CLASSPATH=/data/framework/aidl_test_java_client_sdk%d.jar ' % self.ver
+                               + APP_PROCESS_FOR_PRETTY_BITNESS % pretty_bitness(self.bitness) +
+                               ' /data/framework android.aidl.sdkversion.tests.AidlJavaVersionTests')
+        print(result.printable_string())
+        if re.search(INSTRUMENTATION_SUCCESS_PATTERN, result.stdout) is None:
+            raise ShellResultFail(result)
+
+class JavaVersionTestServer:
+    def __init__(self, host, bitness, ver):
+        self.name = "java_server_sdk%s_%s" % (ver, pretty_bitness(bitness))
+        self.host = host
+        self.bitness = bitness
+        self.ver = ver
+    def cleanup(self):
+        self.host.run('killall ' + APP_PROCESS_FOR_PRETTY_BITNESS % pretty_bitness(self.bitness),
+                      ignore_status=True)
+    def run(self):
+        return self.host.run('CLASSPATH=/data/framework/aidl_test_java_service_sdk%d.jar ' % self.ver
+                             + APP_PROCESS_FOR_PRETTY_BITNESS % pretty_bitness(self.bitness) +
+                             ' /data/framework android.aidl.sdkversion.service.AidlJavaVersionTestService',
+                             background=True)
+
+class JavaPermissionClient:
+    def __init__(self, host, bitness):
+        self.name = "java_client_permission_%s" % pretty_bitness(bitness)
+        self.host = host
+        self.bitness = bitness
+    def cleanup(self):
+        self.host.run('killall ' + APP_PROCESS_FOR_PRETTY_BITNESS % pretty_bitness(self.bitness),
+                      ignore_status=True)
+    def run(self):
+        result = self.host.run('CLASSPATH=/data/framework/aidl_test_java_client_permission.jar '
+                               + APP_PROCESS_FOR_PRETTY_BITNESS % pretty_bitness(self.bitness) +
+                               ' /data/framework android.aidl.permission.tests.PermissionTests')
+        print(result.printable_string())
+        if re.search(INSTRUMENTATION_SUCCESS_PATTERN, result.stdout) is None:
+            raise ShellResultFail(result)
+
+class JavaPermissionServer:
+    def __init__(self, host, bitness):
+        self.name = "java_server_permission_%s" % pretty_bitness(bitness)
+        self.host = host
+        self.bitness = bitness
+    def cleanup(self):
+        self.host.run('killall ' + APP_PROCESS_FOR_PRETTY_BITNESS % pretty_bitness(self.bitness),
+                      ignore_status=True)
+    def run(self):
+        return self.host.run('CLASSPATH=/data/framework/aidl_test_java_service_permission.jar '
+                             + APP_PROCESS_FOR_PRETTY_BITNESS % pretty_bitness(self.bitness) +
+                             ' /data/framework android.aidl.permission.service.PermissionTestService',
+                             background=True)
+
+def getprop(host, prop):
+    return host.run('getprop "%s"' % prop).stdout.strip()
+
+class RustClient:
+    def __init__(self, host, bitness):
+        self.name = "%s_bit_rust_client" % pretty_bitness(bitness)
+        self.host = host
+        self.binary = RUST_TEST_CLIENT_FOR_BITNESS % bitness
+    def cleanup(self):
+        self.host.run('killall %s' % self.binary, ignore_status=True)
+    def run(self):
+        result = self.host.run(self.binary, ignore_status=True)
+        print(result.printable_string())
+        if result.exit_status:
+            raise ShellResultFail(result)
+
+class RustServer:
+    def __init__(self, host, bitness):
+        self.name = "%s_bit_rust_server" % pretty_bitness(bitness)
+        self.host = host
+        self.binary = RUST_TEST_SERVICE_FOR_BITNESS % bitness
+    def cleanup(self):
+        self.host.run('killall %s' % self.binary, ignore_status=True)
+    def run(self):
+        return self.host.run(self.binary, background=True)
+
+class RustAsyncServer:
+    def __init__(self, host, bitness):
+        self.name = "%s_bit_rust_server_async" % pretty_bitness(bitness)
+        self.host = host
+        self.binary = RUST_TEST_SERVICE_ASYNC_FOR_BITNESS % bitness
+    def cleanup(self):
+        self.host.run('killall %s' % self.binary, ignore_status=True)
+    def run(self):
+        return self.host.run(self.binary, background=True)
+
+def supported_bitnesses(host):
+    bitnesses = []
+    if getprop(host, "ro.product.cpu.abilist32") != "":
+        bitnesses += [BITNESS_32]
+    if getprop(host, "ro.product.cpu.abilist64") != "":
+        bitnesses += [BITNESS_64]
+    return bitnesses
+
+# tests added dynamically below
+class TestAidl(unittest.TestCase):
+    pass
+
+def make_test(client, server):
+    def test(self):
+        try:
+            # Server is unregistered first so that we give more time
+            # for servicemanager to clear the old notification.
+            # Otherwise, it may race that the client gets ahold
+            # of the service.
+            server.cleanup()
+            client.cleanup()
+            sleep(0.2)
+
+            server.run()
+            client.run()
+        finally:
+            client.cleanup()
+            server.cleanup()
+    return test
+
+def add_test(client, server):
+    test_name = 'test_%s_to_%s' % (client.name, server.name)
+    test = make_test(client, server)
+    setattr(TestAidl, test_name, test)
+
+if __name__ == '__main__':
+    host = AdbHost()
+    bitnesses = supported_bitnesses(host)
+    if len(bitnesses) == 0:
+        print("No clients installed")
+        exit(1)
+
+    clients = []
+    servers = []
+
+    for bitness in bitnesses:
+        clients += [NdkClient(host, bitness)]
+        servers += [NdkServer(host, bitness)]
+
+        clients += [CppClient(host, bitness)]
+        clients += [CppV1Client(host, bitness)]
+        servers += [CppServer(host, bitness)]
+
+        clients += [JavaClient(host, bitness)]
+        servers += [JavaServer(host, bitness)]
+
+        clients += [RustClient(host, bitness)]
+        servers += [RustServer(host, bitness)]
+        servers += [RustAsyncServer(host, bitness)]
+
+    for client in clients:
+        for server in servers:
+            add_test(client, server)
+
+    # boolean: >= 29
+    # typed:   >= 23
+    versions = [1, 29]
+    for c_version, c_bitness, s_version, s_bitness in product(versions, bitnesses, repeat=2):
+        client = JavaVersionTestClient(host, c_bitness, c_version)
+        server = JavaVersionTestServer(host, s_bitness, s_version)
+        add_test(client, server)
+
+    # TODO(b/218914259): Interfaces with permission are only supported for the
+    # Java backend. Once C++ and/or Rust are supported, move the test back into
+    # JavaClient and JavaServer.
+    for bitness in bitnesses:
+        add_test(JavaPermissionClient(host, bitness), JavaPermissionServer(host, bitness))
+
+    suite = unittest.TestLoader().loadTestsFromTestCase(TestAidl)
+    sys.exit(not unittest.TextTestRunner(verbosity=2).run(suite).wasSuccessful())
diff --git a/tests/aidl_integration_test.xml b/tests/aidl_integration_test.xml
new file mode 100644
index 0000000..1d148cb
--- /dev/null
+++ b/tests/aidl_integration_test.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2020 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Runs AIDL on-device integration tests.">
+    <option name="test-suite-tag" value="apct" />
+    <option name="test-suite-tag" value="apct-native" />
+
+    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
+
+    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+      <!-- We would like to abort, but currently there is not a simple way to specify installation of both bitnesses of targets. -->
+      <option name="abort-on-push-failure" value="false"/>
+
+      <option name="push" value="aidl_test_client32->/data/nativetest/aidl_test_client/aidl_test_client32" />
+      <option name="push" value="aidl_test_client64->/data/nativetest64/aidl_test_client/aidl_test_client64" />
+
+      <option name="push" value="aidl_test_v1_client32->/data/nativetest/aidl_test_v1_client/aidl_test_v1_client32" />
+      <option name="push" value="aidl_test_v1_client64->/data/nativetest64/aidl_test_v1_client/aidl_test_v1_client64" />
+
+      <option name="push" value="aidl_test_client_ndk32->/data/nativetest/aidl_test_client_ndk/aidl_test_client_ndk32" />
+      <option name="push" value="aidl_test_client_ndk64->/data/nativetest64/aidl_test_client_ndk/aidl_test_client_ndk64" />
+
+      <option name="push" value="aidl_test_service32->/data/nativetest/aidl_test_service/aidl_test_service32" />
+      <option name="push" value="aidl_test_service64->/data/nativetest64/aidl_test_service/aidl_test_service64" />
+
+      <option name="push" value="aidl_test_service_ndk32->/data/nativetest/aidl_test_service_ndk/aidl_test_service_ndk32" />
+      <option name="push" value="aidl_test_service_ndk64->/data/nativetest64/aidl_test_service_ndk/aidl_test_service_ndk64" />
+
+      <option name="push" value="aidl_test_rust_client32->/data/nativetest/aidl_test_rust_client/aidl_test_rust_client32" />
+      <option name="push" value="aidl_test_rust_client64->/data/nativetest64/aidl_test_rust_client/aidl_test_rust_client64" />
+
+      <option name="push" value="aidl_test_rust_service32->/data/nativetest/aidl_test_rust_service/aidl_test_rust_service32" />
+      <option name="push" value="aidl_test_rust_service64->/data/nativetest64/aidl_test_rust_service/aidl_test_rust_service64" />
+
+      <option name="push" value="aidl_test_rust_service_async32->/data/nativetest/aidl_test_rust_service_async/aidl_test_rust_service_async32" />
+      <option name="push" value="aidl_test_rust_service_async64->/data/nativetest64/aidl_test_rust_service_async/aidl_test_rust_service_async64" />
+
+      <option name="push" value="aidl_test_java_client.jar->/data/framework/aidl_test_java_client.jar" />
+      <option name="push" value="aidl_test_java_service.jar->/data/framework/aidl_test_java_service.jar" />
+
+      <option name="push" value="aidl_test_java_client_sdk29.jar->/data/framework/aidl_test_java_client_sdk29.jar" />
+      <option name="push" value="aidl_test_java_service_sdk29.jar->/data/framework/aidl_test_java_service_sdk29.jar" />
+
+      <option name="push" value="aidl_test_java_client_sdk1.jar->/data/framework/aidl_test_java_client_sdk1.jar" />
+      <option name="push" value="aidl_test_java_service_sdk1.jar->/data/framework/aidl_test_java_service_sdk1.jar" />
+
+      <option name="push" value="aidl_test_java_client_permission.jar->/data/framework/aidl_test_java_client_permission.jar" />
+      <option name="push" value="aidl_test_java_service_permission.jar->/data/framework/aidl_test_java_service_permission.jar" />
+
+      <option name="cleanup" value="true" />
+    </target_preparer>
+
+    <test class="com.android.tradefed.testtype.python.PythonBinaryHostTest" >
+        <option name="par-file-name" value="aidl_integration_test" />
+        <option name="test-timeout" value="5m" />
+    </test>
+</configuration>
+
diff --git a/tests/aidl_parser_fuzzer.cpp b/tests/aidl_parser_fuzzer.cpp
new file mode 100644
index 0000000..4e37b31
--- /dev/null
+++ b/tests/aidl_parser_fuzzer.cpp
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl.h"
+#include "fake_io_delegate.h"
+#include "options.h"
+
+#include <fuzzer/FuzzedDataProvider.h>
+#include <iostream>
+
+#ifdef FUZZ_LOG
+constexpr bool kFuzzLog = true;
+#else
+constexpr bool kFuzzLog = false;
+#endif
+
+using android::aidl::test::FakeIoDelegate;
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  if (size <= 1) return 0;  // no use
+
+  // b/145447540, large nested expressions sometimes hit the stack depth limit.
+  // Fuzzing things of this size don't provide any additional meaningful
+  // coverage. This is an approximate value which should allow us to explore all
+  // of the language w/o hitting a stack overflow.
+  if (size > 2000) return 0;
+
+  FuzzedDataProvider provider = FuzzedDataProvider(data, size);
+  FakeIoDelegate io;
+  std::vector<std::string> args;
+
+  size_t numArgs = provider.ConsumeIntegralInRange(0, 20);
+  for (size_t i = 0; i < numArgs; i++) {
+    args.emplace_back(provider.ConsumeRandomLengthString());
+  }
+
+  while (provider.remaining_bytes() > 0) {
+    const std::string name = provider.ConsumeRandomLengthString();
+    const std::string contents = provider.ConsumeRandomLengthString();
+    io.SetFileContents(name, contents);
+  }
+
+  if (kFuzzLog) {
+    std::cout << "cmd: ";
+    for (const std::string& arg : args) {
+      std::cout << arg << " ";
+    }
+    std::cout << std::endl;
+
+    for (const auto& [f, input] : io.InputFiles()) {
+      std::cout << "INPUT " << f << ": " << input << std::endl;
+    }
+  }
+
+  int ret = android::aidl::aidl_entry(Options::From(args), io);
+
+  if (kFuzzLog) {
+    std::cout << "RET: " << ret << std::endl;
+    if (ret != 0) {
+      for (const auto& [f, output] : io.OutputFiles()) {
+        std::cout << "OUTPUT " << f << ": " << std::endl;
+        std::cout << output << std::endl;
+      }
+    }
+  }
+
+  return 0;
+}
diff --git a/tests/aidl_parser_fuzzer.dict b/tests/aidl_parser_fuzzer.dict
new file mode 100644
index 0000000..fe59bce
--- /dev/null
+++ b/tests/aidl_parser_fuzzer.dict
@@ -0,0 +1,131 @@
+# keywords
+" parcelable "
+" import "
+" package "
+" in "
+" out "
+" inout "
+" cpp_header "
+" ndk_header "
+" rust_type "
+" const "
+" true "
+" false "
+" interface "
+" oneway "
+" enum "
+" union "
+
+# types
+" void "
+" boolean "
+" byte "
+" char "
+" int "
+" long "
+" float "
+" double "
+" String "
+" List "
+" List< "
+" Map "
+" Map< "
+" IBinder "
+" FileDescriptor "
+" CharSequence "
+" ParcelFileDescriptor "
+" java.util.List "
+" java.util.List< "
+" java.util.Map "
+" java.util.Map< "
+" android.os.ParcelFileDescriptor "
+" ParcelableHolder "
+" > "
+
+# annotations
+" @nullable "
+" @utf8InCpp "
+" @VintfStability "
+" @SensitiveData "
+" @UnsupportedAppUsage "
+" @SystemApi "
+" @JavaPassthrough "
+" @JavaOnlyStableParcelable "
+" @NdkOnlyStableParcelable "
+" @RustOnlyStableParcelable "
+" @Backing "
+" @FixedSize "
+" @Descriptor "
+" @JavaDervie "
+" @RustDerive "
+" /** @hide */ "
+" /** @deprecated reason */ "
+
+# annotation arguments
+" value "
+" toString "
+" expectedSignature "
+" implicitMember "
+" maxTargetSdk "
+" publicAlternatives "
+" trackingBug "
+" type "
+" Copy "
+" Clone "
+" PartialOrd "
+" Ord "
+" PartialEq "
+" Eq "
+" Clone "
+" Hash "
+
+# ignorable imports
+" android.os.IInterface "
+" android.os.IBinder "
+" android.os.Parcelable "
+" android.os.Parcel "
+" android.content.Context "
+" java.lang.String "
+
+# specific to fuzzer
+" a.path "
+" b.path "
+" Foo "
+" a/path/Foo.aidl "
+" b/path/Foo.aidl "
+" path/Foo.aidl "
+
+#arguments
+" aidl "
+" --apimapping "
+" --checkapi=compatible "
+" --checkapi=equal "
+" --hash "
+" --help "
+" --lang=java "
+" --lang=ndk "
+" --lang=ndk "
+" --lang=rust "
+" --log "
+" --ninja "
+" --preprocess "
+" --stability "
+" --stability=vintf "
+" --structured "
+" --trace "
+" --transaction_names "
+" -I "
+" -W "
+" -Werror "
+" -Weverything "
+" -Wno- "
+" -Wno-error "
+" -a "
+" -b "
+" -d "
+" -h "
+" -o "
+" -p "
+" -t "
+" -v "
+" -w "
diff --git a/tests/aidl_test_client.cpp b/tests/aidl_test_client.cpp
new file mode 100644
index 0000000..00fe331
--- /dev/null
+++ b/tests/aidl_test_client.cpp
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "gtest/gtest.h"
+
+int main(int argc, char* argv[]) {
+  ::testing::InitGoogleTest(&argc, argv);
+  return RUN_ALL_TESTS();
+}
diff --git a/tests/aidl_test_client.h b/tests/aidl_test_client.h
new file mode 100644
index 0000000..01d370e
--- /dev/null
+++ b/tests/aidl_test_client.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <android/aidl/tests/ICppJavaTests.h>
+#include <android/aidl/tests/ITestService.h>
+#include <binder/IServiceManager.h>
+#include <binder/ProcessState.h>
+#include <gtest/gtest.h>
+#include <utils/String16.h>
+
+using android::sp;
+using android::aidl::tests::BackendType;
+using android::aidl::tests::ICppJavaTests;
+using android::aidl::tests::ITestService;
+
+class AidlTest : public testing::Test {
+ public:
+  void SetUp() override {
+    using android::OK;
+    using android::String16;
+    using android::waitForService;
+
+    android::ProcessState::self()->setThreadPoolMaxThreadCount(1);
+    android::ProcessState::self()->startThreadPool();
+    service = waitForService<ITestService>(ITestService::descriptor);
+    ASSERT_NE(nullptr, service);
+
+    sp<android::IBinder> ibinder;
+    auto status = service->GetCppJavaTests(&ibinder);
+    ASSERT_TRUE(status.isOk());
+    cpp_java_tests = android::interface_cast<ICppJavaTests>(ibinder);
+
+    status = service->getBackendType(&backend);
+    ASSERT_TRUE(status.isOk()) << status;
+
+    if (backend != BackendType::RUST && backend != BackendType::NDK) {
+      ASSERT_NE(cpp_java_tests, nullptr);
+    }
+  }
+
+  BackendType backend;
+  sp<ITestService> service;
+  sp<ICppJavaTests> cpp_java_tests;
+};
diff --git a/tests/aidl_test_client_builtin_transactions.cpp b/tests/aidl_test_client_builtin_transactions.cpp
new file mode 100644
index 0000000..3252875
--- /dev/null
+++ b/tests/aidl_test_client_builtin_transactions.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl_test_client.h"
+
+#include <binder/IInterface.h>
+
+using android::IInterface;
+using android::OK;
+using android::String16;
+
+TEST_F(AidlTest, Ping) {
+  EXPECT_EQ(OK, IInterface::asBinder(service)->pingBinder());
+}
+
+TEST_F(AidlTest, GetInterfaceDescriptor) {
+  EXPECT_EQ(String16("android.aidl.tests.ITestService"),
+            IInterface::asBinder(service)->getInterfaceDescriptor());
+}
diff --git a/tests/aidl_test_client_defaultimpl.cpp b/tests/aidl_test_client_defaultimpl.cpp
new file mode 100644
index 0000000..df57d2c
--- /dev/null
+++ b/tests/aidl_test_client_defaultimpl.cpp
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "aidl_test_client.h"
+#include "gmock/gmock.h"
+
+using android::binder::Status;
+
+using android::aidl::tests::ITestService;
+using android::aidl::tests::ITestServiceDefault;
+
+using testing::Eq;
+
+static constexpr int32_t kExpectedArgValue = 100;
+static constexpr int32_t kExpectedReturnValue = 200;
+
+static int numCalled = 0;
+static int32_t gotArgument = 0;
+
+struct Def : public ITestServiceDefault {
+  Status UnimplementedMethod(int32_t arg, int32_t* _aidl_return) override {
+    numCalled++;
+    gotArgument = arg;
+    *_aidl_return = kExpectedReturnValue;
+    return android::binder::Status::ok();
+  }
+};
+
+/* Make sure the unimplementedMethod behaves as expected before testing the
+ * default impl
+ */
+TEST_F(AidlTest, unimplementedMethodImpl) {
+  int32_t returned_value;
+  auto status = service->UnimplementedMethod(kExpectedArgValue, &returned_value);
+  ASSERT_FALSE(status.isOk()) << status;
+  ASSERT_EQ(status.exceptionCode(), android::binder::Status::EX_TRANSACTION_FAILED);
+  EXPECT_EQ(status.transactionError(), android::UNKNOWN_TRANSACTION);
+}
+
+TEST_F(AidlTest, defaultImpl) {
+  android::sp<ITestService> defImpl = android::sp<Def>::make();
+  auto ret = ITestService::setDefaultImpl(std::move(defImpl));
+  ASSERT_TRUE(ret);
+
+  int32_t returned_value;
+  auto status = service->UnimplementedMethod(kExpectedArgValue, &returned_value);
+  ASSERT_TRUE(status.isOk()) << status;
+  ASSERT_THAT(numCalled, Eq(1));
+  ASSERT_THAT(gotArgument, Eq(kExpectedArgValue));
+  ASSERT_THAT(returned_value, Eq(kExpectedReturnValue));
+}
diff --git a/tests/aidl_test_client_delegate.cpp b/tests/aidl_test_client_delegate.cpp
new file mode 100644
index 0000000..aaa28b7
--- /dev/null
+++ b/tests/aidl_test_client_delegate.cpp
@@ -0,0 +1,167 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "aidl_test_client.h"
+#include "gmock/gmock.h"
+
+#include "android/aidl/tests/BnNamedCallback.h"
+#include "android/aidl/tests/BnTestService.h"
+
+using android::binder::Status;
+
+using android::String16;
+using android::aidl::tests::INamedCallback;
+using android::aidl::tests::ITestService;
+using android::aidl::tests::ITestServiceDelegator;
+
+static constexpr int8_t kCustomByte = 8;
+
+static_assert(std::is_same<ITestService::DefaultDelegator, ITestServiceDelegator>::value);
+
+struct CustomDelegator : public ITestServiceDelegator {
+ public:
+  CustomDelegator(sp<ITestService>& impl) : ITestServiceDelegator(impl) {}
+
+  // Change RepeatByte to always return the same byte.
+  Status RepeatByte(int8_t /* token */, int8_t* _aidl_return) override {
+    *_aidl_return = kCustomByte;
+    return Status::ok();
+  }
+};
+
+TEST_F(AidlTest, Delegator) {
+  auto delegator = sp<ITestServiceDelegator>::make(service);
+
+  int8_t returned_value;
+  auto status = delegator->RepeatByte(12, &returned_value);
+  ASSERT_TRUE(status.isOk()) << status;
+  EXPECT_EQ(12, returned_value);
+}
+
+TEST_F(AidlTest, CustomDelegator) {
+  auto delegator = sp<CustomDelegator>::make(service);
+
+  int8_t returned_value;
+  auto status = delegator->RepeatByte(12, &returned_value);
+  ASSERT_TRUE(status.isOk()) << status;
+  EXPECT_EQ(kCustomByte, returned_value);
+}
+
+TEST_F(AidlTest, DelegatorWithBinders) {
+  auto delegator = sp<ITestServiceDelegator>::make(service);
+
+  sp<INamedCallback> callback;
+  auto status = delegator->GetOtherTestService(String16("callback1"), &callback);
+  ASSERT_TRUE(status.isOk()) << status;
+
+  bool verified = false;
+  status = delegator->VerifyName(callback, String16("callback1"), &verified);
+  ASSERT_TRUE(status.isOk()) << status;
+  EXPECT_TRUE(verified);
+}
+
+TEST_F(AidlTest, DelegatorSimpl) {
+  auto delegator = sp<ITestServiceDelegator>::make(service);
+  sp<ITestService> impl = delegator->getImpl();
+}
+
+TEST_F(AidlTest, DelegateWrapAndGet) {
+  auto delegator = delegate(service);
+  auto delegator2 = delegate(service);
+  EXPECT_EQ(delegator, delegator2);
+}
+
+TEST_F(AidlTest, DelegateWrapAndUnwrap) {
+  sp<ITestServiceDelegator> delegator = sp<ITestServiceDelegator>::cast(delegate(service));
+  EXPECT_NE(service, delegator);
+
+  sp<ITestService> service2 = delegator->getImpl();
+  EXPECT_EQ(service, service2);
+
+  auto delegator2 = delegate(sp<ITestService>::cast(delegator));
+  EXPECT_EQ(service, delegator2);
+}
+
+TEST_F(AidlTest, DelegatorSetAndGetBinder) {
+  auto delegator = sp<ITestServiceDelegator>::make(service);
+
+  sp<INamedCallback> callback;
+  auto status = delegator->GetCallback(false, &callback);
+  ASSERT_TRUE(status.isOk()) << status;
+
+  // callback will be wrapped for first time and the delegator will be sent
+  bool already_existing;
+  status = delegator->SetOtherTestService(String16("same_one"), callback, &already_existing);
+  ASSERT_TRUE(status.isOk()) << status;
+  ASSERT_FALSE(already_existing);
+
+  // unwrap the delegator here and get the original binder
+  sp<INamedCallback> callback2;
+  status = delegator->GetOtherTestService(String16("same_one"), &callback2);
+  ASSERT_TRUE(status.isOk()) << status;
+  EXPECT_EQ(callback, callback2);
+}
+
+TEST_F(AidlTest, DelegatorSettingSameBinders) {
+  auto delegator = sp<ITestServiceDelegator>::make(service);
+
+  sp<INamedCallback> callback;
+  auto status = delegator->GetCallback(false, &callback);
+  ASSERT_TRUE(status.isOk()) << status;
+
+  bool already_existing = false;
+  status = delegator->SetOtherTestService(String16("same_two"), callback, &already_existing);
+  ASSERT_TRUE(status.isOk()) << status;
+  ASSERT_FALSE(already_existing);
+
+  status = delegator->SetOtherTestService(String16("same_two"), callback, &already_existing);
+  ASSERT_TRUE(status.isOk()) << status;
+  EXPECT_TRUE(already_existing);
+}
+
+TEST_F(AidlTest, DelegatorSameBinders) {
+  auto delegator = sp<ITestServiceDelegator>::make(service);
+
+  sp<INamedCallback> callback1;
+  auto status = delegator->GetOtherTestService(String16("callback1"), &callback1);
+  ASSERT_TRUE(status.isOk()) << status;
+
+  sp<INamedCallback> callback1Copy;
+  status = delegator->GetOtherTestService(String16("callback1"), &callback1Copy);
+  ASSERT_TRUE(status.isOk()) << status;
+  EXPECT_EQ(callback1, callback1Copy);
+}
+
+TEST_F(AidlTest, DelegatorWithCallback) {
+  auto delegator = sp<ITestServiceDelegator>::make(service);
+
+  sp<INamedCallback> callback;
+  auto status = delegator->GetCallback(false, &callback);
+  ASSERT_TRUE(status.isOk()) << status;
+
+  String16 name;
+  status = callback->GetName(&name);
+  ASSERT_TRUE(status.isOk()) << status;
+  EXPECT_TRUE(name.size() != 0);
+}
+
+TEST_F(AidlTest, DelegatorWithNullCallback) {
+  auto delegator = sp<ITestServiceDelegator>::make(service);
+
+  sp<INamedCallback> callback;
+  auto status = delegator->GetCallback(true, &callback);
+  ASSERT_TRUE(status.isOk()) << status;
+  EXPECT_TRUE(callback == nullptr);
+}
diff --git a/tests/aidl_test_client_file_descriptors.cpp b/tests/aidl_test_client_file_descriptors.cpp
new file mode 100644
index 0000000..041ba09
--- /dev/null
+++ b/tests/aidl_test_client_file_descriptors.cpp
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include <vector>
+
+#include <errno.h>
+#include <unistd.h>
+
+#include <android-base/unique_fd.h>
+#include <binder/ParcelFileDescriptor.h>
+
+#include "aidl_test_client.h"
+#include "gmock/gmock.h"
+
+using android::sp;
+using android::base::unique_fd;
+using android::binder::Status;
+using android::os::ParcelFileDescriptor;
+
+using testing::Eq;
+
+struct FdTest : public AidlTest {
+  void DoPipe(unique_fd* read_side, unique_fd* write_side) {
+    int fds[2];
+    int ret = pipe(fds);
+    ASSERT_THAT(ret, Eq(0));
+
+    read_side->reset(fds[0]);
+    write_side->reset(fds[1]);
+  }
+
+  void WriteStringToFd(const std::string& str, const unique_fd& fd) {
+    int wrote;
+    while ((wrote = write(fd.get(), str.data(), str.size())) < 0 && errno == EINTR)
+      ;
+    ASSERT_THAT(wrote, Eq((signed)str.size()));
+  }
+
+  void ReadFdToStringAndCompare(const unique_fd& fd, const std::string& str) {
+    size_t length = str.size();
+    int got;
+    std::string buf;
+    buf.resize(length);
+
+    while ((got = read(fd.get(), &buf[0], length)) < 0 && errno == EINTR)
+      ;
+    ASSERT_THAT(buf, Eq(str));
+  }
+};
+
+TEST_F(FdTest, fileDescriptor) {
+  if (!cpp_java_tests) GTEST_SKIP() << "Service does not support the CPP/Java-only tests.";
+
+  unique_fd read_fd;
+  unique_fd write_fd;
+  DoPipe(&read_fd, &write_fd);
+
+  unique_fd return_fd;
+  auto status = cpp_java_tests->RepeatFileDescriptor(std::move(write_fd), &return_fd);
+  ASSERT_TRUE(status.isOk());
+
+  /* A note on some of the spookier stuff going on here: IIUC writes to pipes
+   * should be atomic and non-blocking so long as the total size doesn't exceed
+   * PIPE_BUF. We thus play a bit fast and loose with failure modes here.
+   */
+  WriteStringToFd("ReturnString", return_fd);
+  ReadFdToStringAndCompare(read_fd, "ReturnString");
+}
+
+TEST_F(FdTest, fileDescriptorArray) {
+  if (!cpp_java_tests) GTEST_SKIP() << "Service does not support the CPP/Java-only tests.";
+
+  std::vector<unique_fd> array;
+  array.resize(2);
+  DoPipe(&array[0], &array[1]);
+
+  std::vector<unique_fd> repeated;
+
+  if (backend == BackendType::JAVA) {
+    // other backends might require these to be valid FDs (not -1), since this
+    // isn't @nullable, but they don't require this to already be the correct
+    // size
+    repeated = std::vector<unique_fd>(array.size());
+  }
+
+  std::vector<unique_fd> reversed;
+  auto status = cpp_java_tests->ReverseFileDescriptorArray(array, &repeated, &reversed);
+  ASSERT_TRUE(status.isOk()) << status;
+
+  WriteStringToFd("First", array[1]);
+  WriteStringToFd("Second", repeated[1]);
+  WriteStringToFd("Third", reversed[0]);
+  ReadFdToStringAndCompare(reversed[1], "FirstSecondThird");
+}
+
+TEST_F(FdTest, parcelFileDescriptor) {
+  unique_fd read_fd;
+  unique_fd write_fd;
+  DoPipe(&read_fd, &write_fd);
+
+  ParcelFileDescriptor return_fd;
+  auto status =
+      service->RepeatParcelFileDescriptor(ParcelFileDescriptor(std::move(write_fd)), &return_fd);
+  ASSERT_TRUE(status.isOk());
+
+  /* A note on some of the spookier stuff going on here: IIUC writes to pipes
+   * should be atomic and non-blocking so long as the total size doesn't exceed
+   * PIPE_BUF. We thus play a bit fast and loose with failure modes here.
+   */
+  WriteStringToFd("ReturnString", return_fd.release());
+  ReadFdToStringAndCompare(read_fd, "ReturnString");
+}
+
+TEST_F(FdTest, parcelFileDescriptorArray) {
+  std::vector<unique_fd> array;
+  array.resize(2);
+  DoPipe(&array[0], &array[1]);
+
+  std::vector<ParcelFileDescriptor> input;
+  for (auto& fd : array) {
+    input.push_back(ParcelFileDescriptor(std::move(fd)));
+  }
+
+  std::vector<ParcelFileDescriptor> repeated;
+
+  if (backend == BackendType::JAVA) {
+    // other backends might require these to be valid FDs (not -1), since this
+    // isn't @nullable, but they don't require this to already be the correct
+    // size
+    repeated = std::vector<ParcelFileDescriptor>(array.size());
+  }
+
+  std::vector<ParcelFileDescriptor> reversed;
+  auto status = service->ReverseParcelFileDescriptorArray(input, &repeated, &reversed);
+  ASSERT_TRUE(status.isOk()) << status;
+
+  WriteStringToFd("First", input[1].release());
+  WriteStringToFd("Second", repeated[1].release());
+  WriteStringToFd("Third", reversed[0].release());
+  ReadFdToStringAndCompare(input[0].release(), "FirstSecondThird");
+}
diff --git a/tests/aidl_test_client_loggable_interface.cpp b/tests/aidl_test_client_loggable_interface.cpp
new file mode 100644
index 0000000..61878af
--- /dev/null
+++ b/tests/aidl_test_client_loggable_interface.cpp
@@ -0,0 +1,137 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android/aidl/loggable/ILoggableInterface.h>
+
+#include "aidl_test_client.h"
+
+#include <android/aidl/loggable/BpLoggableInterface.h>
+#include <android/aidl/tests/BackendType.h>
+#include <binder/IServiceManager.h>
+#include <binder/ParcelFileDescriptor.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <utils/String16.h>
+
+using android::IBinder;
+using android::sp;
+using android::String16;
+using android::aidl::loggable::BpLoggableInterface;
+using android::aidl::loggable::Data;
+using android::aidl::loggable::Enum;
+using android::aidl::loggable::ILoggableInterface;
+using android::aidl::loggable::Union;
+using android::aidl::tests::BackendType;
+using android::os::ParcelFileDescriptor;
+using std::optional;
+using std::pair;
+using std::string;
+using std::vector;
+using testing::Eq;
+
+TEST_F(AidlTest, LoggableInterface) {
+  BackendType backendType;
+  auto status = service->getBackendType(&backendType);
+  EXPECT_TRUE(status.isOk());
+  if (backendType != BackendType::CPP) GTEST_SKIP();
+
+  sp<ILoggableInterface> loggable =
+      android::waitForService<ILoggableInterface>(ILoggableInterface::descriptor);
+  ASSERT_NE(nullptr, loggable);
+
+  BpLoggableInterface::TransactionLog log;
+  BpLoggableInterface::logFunc = [&](const BpLoggableInterface::TransactionLog& tx) { log = tx; };
+
+  bool boolValue = true;
+  vector<bool> boolArray{false, true};
+  int8_t byteValue = 41;
+  vector<uint8_t> byteArray{42, 43};
+  char16_t charValue = 'x';
+  vector<char16_t> charArray{'a', 'b', 'c'};
+  int32_t intValue{44};
+  vector<int32_t> intArray{45, 46};
+  int64_t longValue = 47;
+  vector<int64_t> longArray{48, 49};
+  float floatValue{50};
+  vector<float> floatArray{51, 52};
+  double doubleValue{52};
+  vector<double> doubleArray{53, 54};
+  String16 stringValue("def");
+  vector<String16> stringArray{String16("ghi"), String16("jkl")};
+  vector<String16> listValue{String16("mno")};
+  Data dataValue;
+  dataValue.num = 42;
+  dataValue.str = "abc";
+  dataValue.nestedUnion = "def";
+  dataValue.nestedEnum = Enum::FOO;
+  sp<IBinder> binderValue;
+  optional<ParcelFileDescriptor> pfdValue;
+  vector<ParcelFileDescriptor> pfdArray;
+  vector<String16> _aidl_return;
+
+  status = loggable->LogThis(boolValue, &boolArray, byteValue, &byteArray, charValue, &charArray,
+                             intValue, &intArray, longValue, &longArray, floatValue, &floatArray,
+                             doubleValue, &doubleArray, stringValue, &stringArray, &listValue,
+                             dataValue, binderValue, &pfdValue, &pfdArray, &_aidl_return);
+  EXPECT_TRUE(status.isOk());
+  EXPECT_EQ(vector<String16>{String16("loggable")}, _aidl_return);
+
+  // check the captured log
+  EXPECT_EQ("[loggable]", log.result);
+  EXPECT_EQ("android.aidl.loggable.ILoggableInterface", log.interface_name);
+  EXPECT_EQ("LogThis", log.method_name);
+  EXPECT_EQ(0, log.exception_code);
+  EXPECT_EQ("", log.exception_message);
+  EXPECT_EQ(0, log.transaction_error);
+  EXPECT_EQ(0, log.service_specific_error_code);
+  EXPECT_THAT(
+      log.input_args,
+      Eq(vector<pair<string, string>>{
+          {"boolValue", "true"},
+          {"boolArray", "[false, true]"},
+          {"byteValue", "41"},
+          {"byteArray", "[42, 43]"},
+          {"charValue", "x"},
+          {"charArray", "[a, b, c]"},
+          {"intValue", "44"},
+          {"intArray", "[45, 46]"},
+          {"longValue", "47"},
+          {"longArray", "[48, 49]"},
+          {"floatValue", "50.000000"},
+          {"floatArray", "[51.000000, 52.000000]"},
+          {"doubleValue", "52.000000"},
+          {"doubleArray", "[53.000000, 54.000000]"},
+          {"stringValue", "def"},
+          {"stringArray", "[ghi, jkl]"},
+          {"listValue", "[mno]"},
+          {"dataValue", "Data{num: 42, str: abc, nestedUnion: Union{str: def}, nestedEnum: FOO}"},
+          {"binderValue", "(null)"},
+          {"pfdValue", "(null)"},
+          {"pfdArray", "[]"},
+      }));
+  EXPECT_THAT(log.output_args,
+              Eq(vector<pair<string, string>>{{"boolArray", "[false, true]"},
+                                              {"byteArray", "[42, 43]"},
+                                              {"charArray", "[a, b, c]"},
+                                              {"intArray", "[45, 46]"},
+                                              {"longArray", "[48, 49]"},
+                                              {"floatArray", "[51.000000, 52.000000]"},
+                                              {"doubleArray", "[53.000000, 54.000000]"},
+                                              {"stringArray", "[ghi, jkl]"},
+                                              {"listValue", "[mno]"},
+                                              {"pfdValue", "(null)"},
+                                              {"pfdArray", "[]"}}));
+}
diff --git a/tests/aidl_test_client_ndk_delegate.cpp b/tests/aidl_test_client_ndk_delegate.cpp
new file mode 100644
index 0000000..0f567d2
--- /dev/null
+++ b/tests/aidl_test_client_ndk_delegate.cpp
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <android/binder_auto_utils.h>
+#include <android/binder_manager.h>
+#include <binder/ProcessState.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <aidl/android/aidl/tests/BnTestService.h>
+#include <android-base/logging.h>
+
+using aidl::android::aidl::tests::BackendType;
+using aidl::android::aidl::tests::ITestService;
+using aidl::android::aidl::tests::ITestServiceDelegator;
+
+static constexpr int8_t kCustomByte = 8;
+
+static_assert(std::is_same<ITestService::DefaultDelegator, ITestServiceDelegator>::value);
+
+struct CustomDelegator : public ITestServiceDelegator {
+ public:
+  CustomDelegator(std::shared_ptr<ITestService>& impl) : ITestServiceDelegator(impl) {}
+
+  // Change RepeatByte to always return the same byte.
+  ndk::ScopedAStatus RepeatByte(int8_t /* token */, int8_t* _aidl_return) override {
+    *_aidl_return = kCustomByte;
+    return ndk::ScopedAStatus::ok();
+  }
+};
+
+struct AidlDelegatorTest : testing::Test {
+  template <typename T>
+  std::shared_ptr<T> getService() {
+    android::ProcessState::self()->setThreadPoolMaxThreadCount(1);
+    android::ProcessState::self()->startThreadPool();
+    ndk::SpAIBinder binder = ndk::SpAIBinder(AServiceManager_waitForService(T::descriptor));
+    return T::fromBinder(binder);
+  }
+  void SetUp() override { service = getService<ITestService>(); }
+  std::shared_ptr<ITestService> service;
+};
+
+TEST_F(AidlDelegatorTest, SimpleDelegator) {
+  auto delegator = ndk::SharedRefBase::make<ITestServiceDelegator>(service);
+  int8_t returned_value;
+  auto status = delegator->RepeatByte(12, &returned_value);
+  ASSERT_TRUE(status.isOk()) << status.getMessage();
+  EXPECT_EQ(12, returned_value);
+}
+
+TEST_F(AidlDelegatorTest, CustomDelegator) {
+  auto delegator = ndk::SharedRefBase::make<CustomDelegator>(service);
+  int8_t returned_value;
+  auto status = delegator->RepeatByte(12, &returned_value);
+  ASSERT_TRUE(status.isOk()) << status.getMessage();
+  EXPECT_EQ(kCustomByte, returned_value);
+}
+
+TEST_F(AidlDelegatorTest, SendDelegator) {
+  auto delegator = ndk::SharedRefBase::make<ITestServiceDelegator>(service);
+  auto fromAsBinder = ITestServiceDelegator::fromBinder(delegator->asBinder());
+  // Make sure the delegator works after asBinder -> fromBinder conversions
+  int8_t returned_value = 0;
+  auto status = fromAsBinder->RepeatByte(12, &returned_value);
+  ASSERT_TRUE(status.isOk()) << status.getDescription();
+  EXPECT_EQ(12, returned_value);
+}
diff --git a/tests/aidl_test_client_ndk_loggable_interface.cpp b/tests/aidl_test_client_ndk_loggable_interface.cpp
new file mode 100644
index 0000000..1f7b550
--- /dev/null
+++ b/tests/aidl_test_client_ndk_loggable_interface.cpp
@@ -0,0 +1,145 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/android/aidl/loggable/ILoggableInterface.h>
+
+#include <android/binder_auto_utils.h>
+#include <android/binder_manager.h>
+#include <binder/ProcessState.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <aidl/android/aidl/loggable/BpLoggableInterface.h>
+#include <aidl/android/aidl/tests/BackendType.h>
+#include <aidl/android/aidl/tests/ITestService.h>
+
+using aidl::android::aidl::loggable::BpLoggableInterface;
+using aidl::android::aidl::loggable::Data;
+using aidl::android::aidl::loggable::Enum;
+using aidl::android::aidl::loggable::ILoggableInterface;
+using aidl::android::aidl::tests::BackendType;
+using aidl::android::aidl::tests::ITestService;
+using std::optional;
+using std::pair;
+using std::shared_ptr;
+using std::string;
+using std::vector;
+using testing::Eq;
+
+struct AidlTest : testing::Test {
+  template <typename T>
+  std::shared_ptr<T> getService() {
+    android::ProcessState::self()->setThreadPoolMaxThreadCount(1);
+    android::ProcessState::self()->startThreadPool();
+    ndk::SpAIBinder binder = ndk::SpAIBinder(AServiceManager_waitForService(T::descriptor));
+    return T::fromBinder(binder);
+  }
+};
+
+TEST_F(AidlTest, LoggableInterface) {
+  std::shared_ptr<ITestService> service = getService<ITestService>();
+  ASSERT_NE(nullptr, service.get());
+
+  BackendType backendType;
+  ndk::ScopedAStatus status = service->getBackendType(&backendType);
+  EXPECT_TRUE(status.isOk()) << status.getDescription();
+  if (backendType != BackendType::CPP) GTEST_SKIP();
+
+  shared_ptr<ILoggableInterface> loggable = getService<ILoggableInterface>();
+  ASSERT_NE(nullptr, loggable.get());
+
+  BpLoggableInterface::TransactionLog log;
+  BpLoggableInterface::logFunc = [&](const BpLoggableInterface::TransactionLog& tx) { log = tx; };
+
+  bool boolValue = true;
+  vector<bool> boolArray{false, true};
+  int8_t byteValue = 41;
+  vector<uint8_t> byteArray{42, 43};
+  char16_t charValue = 'x';
+  vector<char16_t> charArray{'a', 'b', 'c'};
+  int32_t intValue{44};
+  vector<int32_t> intArray{45, 46};
+  int64_t longValue = 47;
+  vector<int64_t> longArray{48, 49};
+  float floatValue{50};
+  vector<float> floatArray{51, 52};
+  double doubleValue{52};
+  vector<double> doubleArray{53, 54};
+  string stringValue("def");
+  vector<string> stringArray{string("ghi"), string("jkl")};
+  vector<string> listValue{string("mno")};
+  Data dataValue;
+  dataValue.num = 42;
+  dataValue.str = "abc";
+  dataValue.nestedUnion = "def";
+  dataValue.nestedEnum = Enum::FOO;
+  ndk::SpAIBinder binderValue;
+  ndk::ScopedFileDescriptor pfdValue;
+  vector<ndk::ScopedFileDescriptor> pfdArray;
+  vector<string> _aidl_return;
+  status = loggable->LogThis(boolValue, &boolArray, byteValue, &byteArray, charValue, &charArray,
+                             intValue, &intArray, longValue, &longArray, floatValue, &floatArray,
+                             doubleValue, &doubleArray, stringValue, &stringArray, &listValue,
+                             dataValue, binderValue, &pfdValue, &pfdArray, &_aidl_return);
+  EXPECT_TRUE(status.isOk());
+  EXPECT_EQ(vector<string>{string("loggable")}, _aidl_return);
+
+  // check the captured log
+  EXPECT_EQ("[loggable]", log.result);
+  EXPECT_EQ("android.aidl.loggable.ILoggableInterface", log.interface_name);
+  EXPECT_EQ("LogThis", log.method_name);
+  EXPECT_EQ(0, log.exception_code);
+  EXPECT_EQ("", log.exception_message);
+  EXPECT_EQ(0, log.transaction_error);
+  EXPECT_EQ(0, log.service_specific_error_code);
+  EXPECT_THAT(log.input_args,
+              Eq(vector<pair<string, string>>{
+                  {"in_boolValue", "true"},
+                  {"in_boolArray", "[false, true]"},
+                  {"in_byteValue", "41"},
+                  {"in_byteArray", "[42, 43]"},
+                  {"in_charValue", "x"},
+                  {"in_charArray", "[a, b, c]"},
+                  {"in_intValue", "44"},
+                  {"in_intArray", "[45, 46]"},
+                  {"in_longValue", "47"},
+                  {"in_longArray", "[48, 49]"},
+                  {"in_floatValue", "50.000000"},
+                  {"in_floatArray", "[51.000000, 52.000000]"},
+                  {"in_doubleValue", "52.000000"},
+                  {"in_doubleArray", "[53.000000, 54.000000]"},
+                  {"in_stringValue", "def"},
+                  {"in_stringArray", "[ghi, jkl]"},
+                  {"in_listValue", "[mno]"},
+                  {"in_dataValue",
+                   "Data{num: 42, str: abc, nestedUnion: Union{str: def}, nestedEnum: FOO}"},
+                  {"in_binderValue", "binder:0x0"},
+                  {"in_pfdValue", "fd:-1"},
+                  {"in_pfdArray", "[]"},
+              }));
+  EXPECT_THAT(log.output_args,
+              Eq(vector<pair<string, string>>{{"in_boolArray", "[false, true]"},
+                                              {"in_byteArray", "[42, 43]"},
+                                              {"in_charArray", "[a, b, c]"},
+                                              {"in_intArray", "[45, 46]"},
+                                              {"in_longArray", "[48, 49]"},
+                                              {"in_floatArray", "[51.000000, 52.000000]"},
+                                              {"in_doubleArray", "[53.000000, 54.000000]"},
+                                              {"in_stringArray", "[ghi, jkl]"},
+                                              {"in_listValue", "[mno]"},
+                                              {"in_pfdValue", "fd:-1"},
+                                              {"in_pfdArray", "[]"}}));
+}
diff --git a/tests/aidl_test_client_ndk_nested.cpp b/tests/aidl_test_client_ndk_nested.cpp
new file mode 100644
index 0000000..686219c
--- /dev/null
+++ b/tests/aidl_test_client_ndk_nested.cpp
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android/binder_auto_utils.h>
+#include <android/binder_manager.h>
+#include <binder/IServiceManager.h>
+#include <binder/ProcessState.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <utils/String16.h>
+
+#include <aidl/android/aidl/tests/nested/INestedService.h>
+#include <aidl/android/aidl/tests/nested/ParcelableWithNested.h>
+
+#include <optional>
+
+using aidl::android::aidl::tests::nested::INestedService;
+using aidl::android::aidl::tests::nested::ParcelableWithNested;
+using NestedResult = aidl::android::aidl::tests::nested::INestedService::Result;
+using NestedStatus = aidl::android::aidl::tests::nested::ParcelableWithNested::Status;
+using std::optional;
+using std::shared_ptr;
+using std::vector;
+using testing::Eq;
+using testing::Optional;
+
+struct AidlTest : testing::Test {
+  template <typename T>
+  std::shared_ptr<T> getService() {
+    android::ProcessState::self()->setThreadPoolMaxThreadCount(1);
+    android::ProcessState::self()->startThreadPool();
+    ndk::SpAIBinder binder = ndk::SpAIBinder(AServiceManager_waitForService(T::descriptor));
+    return T::fromBinder(binder);
+  }
+};
+
+TEST_F(AidlTest, NestedService) {
+  auto nestedService = getService<INestedService>();
+  ASSERT_NE(nullptr, nestedService);
+
+  ParcelableWithNested p;
+  p.status = NestedStatus::OK;
+  NestedResult r;
+  // OK -> NOT_OK
+  auto status = nestedService->flipStatus(p, &r);
+  EXPECT_TRUE(status.isOk());
+  EXPECT_EQ(r.status, NestedStatus::NOT_OK);
+
+  // NOT_OK -> OK with callback (nested interface)
+  struct Callback : INestedService::BnCallback {
+    optional<ParcelableWithNested::Status> result;
+    ndk::ScopedAStatus done(ParcelableWithNested::Status st) override {
+      result = st;
+      return ndk::ScopedAStatus::ok();
+    }
+  };
+  auto cb = ndk::SharedRefBase::make<Callback>();
+  status = nestedService->flipStatusWithCallback(r.status, cb);
+  EXPECT_TRUE(status.isOk());
+  EXPECT_THAT(cb->result, Optional(NestedStatus::OK));
+
+  // android::enum_ranges<>
+  vector<NestedStatus> values{ndk::enum_range<NestedStatus>().begin(),
+                              ndk::enum_range<NestedStatus>().end()};
+  EXPECT_EQ(values, vector<NestedStatus>({NestedStatus::OK, NestedStatus::NOT_OK}));
+
+  // toString()
+  EXPECT_EQ(toString(NestedStatus::NOT_OK), "NOT_OK");
+}
diff --git a/tests/aidl_test_client_ndk_nullables.cpp b/tests/aidl_test_client_ndk_nullables.cpp
new file mode 100644
index 0000000..d80db4f
--- /dev/null
+++ b/tests/aidl_test_client_ndk_nullables.cpp
@@ -0,0 +1,149 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android/binder_auto_utils.h>
+#include <android/binder_manager.h>
+#include <binder/ProcessState.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <aidl/android/aidl/tests/ITestService.h>
+
+using aidl::android::aidl::tests::BackendType;
+using aidl::android::aidl::tests::INamedCallback;
+using aidl::android::aidl::tests::ITestService;
+using testing::Eq;
+
+struct AidlTest : testing::Test {
+  template <typename T>
+  std::shared_ptr<T> getService() {
+    android::ProcessState::self()->setThreadPoolMaxThreadCount(1);
+    android::ProcessState::self()->startThreadPool();
+    ndk::SpAIBinder binder = ndk::SpAIBinder(AServiceManager_waitForService(T::descriptor));
+    return T::fromBinder(binder);
+  }
+  void SetUp() override {
+    service = getService<ITestService>();
+    auto status = service->getBackendType(&backend);
+    ASSERT_TRUE(status.isOk()) << status.getDescription();
+  }
+  std::shared_ptr<ITestService> service;
+  BackendType backend;
+
+  template <typename T>
+  void DoTest(ndk::ScopedAStatus (ITestService::*func)(const std::optional<T>&, std::optional<T>*),
+              std::optional<T> input) {
+    std::optional<T> output;
+    auto status = (*service.*func)(input, &output);
+    ASSERT_TRUE(status.isOk());
+    ASSERT_TRUE(output.has_value());
+    ASSERT_THAT(*output, Eq(*input));
+
+    input.reset();
+    status = (*service.*func)(input, &output);
+    ASSERT_TRUE(status.isOk());
+    ASSERT_FALSE(output.has_value());
+  }
+};
+
+TEST_F(AidlTest, parcelableArray) {
+  std::vector<std::optional<ITestService::Empty>> input;
+  input.push_back(ITestService::Empty());
+  input.push_back(std::nullopt);
+  DoTest(&ITestService::RepeatNullableParcelableArray, std::make_optional(input));
+}
+
+TEST_F(AidlTest, parcelableList) {
+  std::vector<std::optional<ITestService::Empty>> input;
+  input.push_back(ITestService::Empty());
+  input.push_back(std::nullopt);
+  DoTest(&ITestService::RepeatNullableParcelableList, std::make_optional(input));
+}
+
+TEST_F(AidlTest, nullBinder) {
+  auto status = service->TakesAnIBinder(nullptr);
+  ASSERT_THAT(status.getStatus(), Eq(STATUS_UNEXPECTED_NULL)) << status.getDescription();
+  // Note that NDK backend checks null before transaction while C++ backends doesn't.
+}
+
+TEST_F(AidlTest, binderListWithNull) {
+  std::vector<ndk::SpAIBinder> input{service->asBinder(), nullptr};
+  auto status = service->TakesAnIBinderList(input);
+  ASSERT_THAT(status.getStatus(), Eq(STATUS_UNEXPECTED_NULL));
+  // Note that NDK backend checks null before transaction while C++ backends doesn't.
+}
+
+TEST_F(AidlTest, nonNullBinder) {
+  auto status = service->TakesAnIBinder(service->asBinder());
+  ASSERT_TRUE(status.isOk());
+}
+
+TEST_F(AidlTest, binderListWithoutNull) {
+  std::vector<ndk::SpAIBinder> input{service->asBinder()};
+  auto status = service->TakesAnIBinderList(input);
+  ASSERT_TRUE(status.isOk());
+}
+
+TEST_F(AidlTest, nullBinderToAnnotatedMethod) {
+  auto status = service->TakesANullableIBinder(nullptr);
+  ASSERT_TRUE(status.isOk());
+}
+
+TEST_F(AidlTest, binderListWithNullToAnnotatedMethod) {
+  std::vector<ndk::SpAIBinder> input{service->asBinder(), nullptr};
+  auto status = service->TakesANullableIBinderList(input);
+  ASSERT_TRUE(status.isOk());
+}
+
+TEST_F(AidlTest, binderArray) {
+  std::vector<ndk::SpAIBinder> repeated;
+  if (backend == BackendType::JAVA) {
+    // Java can only modify out-argument arrays in-place
+    repeated.resize(2);
+  }
+  // get INamedCallback for "SpAIBinder" object
+  std::shared_ptr<INamedCallback> callback;
+  auto status = service->GetCallback(false, &callback);
+  ASSERT_TRUE(status.isOk()) << status.getDescription();
+
+  std::vector<ndk::SpAIBinder> reversed;
+  std::vector<ndk::SpAIBinder> input{service->asBinder(), callback->asBinder()};
+  status = service->ReverseIBinderArray(input, &repeated, &reversed);
+  ASSERT_TRUE(status.isOk()) << status.getDescription();
+
+  EXPECT_THAT(input, Eq(repeated));
+  std::reverse(std::begin(reversed), std::end(reversed));
+  EXPECT_THAT(input, Eq(reversed));
+}
+
+TEST_F(AidlTest, nullableBinderArray) {
+  std::optional<std::vector<ndk::SpAIBinder>> repeated;
+  if (backend == BackendType::JAVA) {
+    // Java can only modify out-argument arrays in-place
+    repeated = std::vector<ndk::SpAIBinder>(2);
+  }
+
+  std::optional<std::vector<ndk::SpAIBinder>> reversed;
+  std::optional<std::vector<ndk::SpAIBinder>> input =
+      std::vector<ndk::SpAIBinder>{service->asBinder(), service->asBinder()};
+  auto status = service->ReverseNullableIBinderArray(input, &repeated, &reversed);
+  ASSERT_TRUE(status.isOk()) << status.getDescription();
+
+  EXPECT_THAT(input, Eq(repeated));
+  ASSERT_TRUE(reversed);
+  std::reverse(std::begin(*reversed), std::end(*reversed));
+  EXPECT_THAT(input, Eq(reversed));
+}
diff --git a/tests/aidl_test_client_ndk_parcelables.cpp b/tests/aidl_test_client_ndk_parcelables.cpp
new file mode 100644
index 0000000..37d0405
--- /dev/null
+++ b/tests/aidl_test_client_ndk_parcelables.cpp
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/android/aidl/loggable/ILoggableInterface.h>
+
+#include <functional>
+
+#include <android/binder_auto_utils.h>
+#include <android/binder_manager.h>
+#include <binder/ProcessState.h>
+#include <gtest/gtest.h>
+
+#include <aidl/android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <aidl/android/aidl/tests/ITestService.h>
+#include <aidl/android/aidl/tests/RecursiveList.h>
+#include <aidl/android/aidl/tests/Union.h>
+
+using aidl::android::aidl::fixedsizearray::FixedSizeArrayExample;
+using BnRepeatFixedSizeArray =
+    aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::BnRepeatFixedSizeArray;
+using BpRepeatFixedSizeArray =
+    aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::BpRepeatFixedSizeArray;
+using IntParcelable = aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable;
+using IRepeatFixedSizeArray =
+    aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IRepeatFixedSizeArray;
+using BnEmptyInterface =
+    aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::BnEmptyInterface;
+using aidl::android::aidl::tests::BackendType;
+using aidl::android::aidl::tests::ITestService;
+using aidl::android::aidl::tests::RecursiveList;
+using aidl::android::aidl::tests::Union;
+using android::OK;
+using ndk::AParcel_readData;
+using ndk::AParcel_writeData;
+using ndk::ScopedAStatus;
+using ndk::SharedRefBase;
+using ndk::SpAIBinder;
+
+struct AidlTest : testing::Test {
+  template <typename T>
+  std::shared_ptr<T> getService() {
+    android::ProcessState::self()->setThreadPoolMaxThreadCount(1);
+    android::ProcessState::self()->startThreadPool();
+    ndk::SpAIBinder binder = ndk::SpAIBinder(AServiceManager_waitForService(T::descriptor));
+    return T::fromBinder(binder);
+  }
+};
+
+// TODO(b/196454897): copy more tests from aidl_test_client
+
+TEST_F(AidlTest, ReverseRecursiveList) {
+  std::unique_ptr<RecursiveList> head;
+  for (int i = 0; i < 10; i++) {
+    auto node = std::make_unique<RecursiveList>();
+    node->value = i;
+    node->next = std::move(head);
+    head = std::move(node);
+  }
+  // head: [9, 8, ... 0]
+
+  RecursiveList reversed;
+  auto status = getService<ITestService>()->ReverseList(*head, &reversed);
+  ASSERT_TRUE(status.isOk());
+
+  // reversed should be [0, 1, .. 9]
+  RecursiveList* cur = &reversed;
+  for (int i = 0; i < 10; i++) {
+    EXPECT_EQ(i, cur->value);
+    cur = cur->next.get();
+  }
+  EXPECT_EQ(nullptr, cur);
+}
+
+TEST_F(AidlTest, GetUnionTags) {
+  std::vector<Union> unions;
+  std::vector<Union::Tag> tags;
+  // test empty
+  auto status = getService<ITestService>()->GetUnionTags(unions, &tags);
+  ASSERT_TRUE(status.isOk());
+  EXPECT_EQ(tags, (std::vector<Union::Tag>{}));
+  // test non-empty
+  unions.push_back(Union::make<Union::n>());
+  unions.push_back(Union::make<Union::ns>());
+  status = getService<ITestService>()->GetUnionTags(unions, &tags);
+  ASSERT_TRUE(status.isOk());
+  EXPECT_EQ(tags, (std::vector<Union::Tag>{Union::n, Union::ns}));
+}
+
+TEST_F(AidlTest, FixedSizeArray) {
+  auto parcel = AParcel_create();
+
+  FixedSizeArrayExample p;
+  p.byteMatrix[0][0] = 0;
+  p.byteMatrix[0][1] = 1;
+  p.byteMatrix[1][0] = 2;
+  p.byteMatrix[1][1] = 3;
+  p.floatMatrix[0][0] = 0.f;
+  p.floatMatrix[0][1] = 1.f;
+  p.floatMatrix[1][0] = 2.f;
+  p.floatMatrix[1][1] = 3.f;
+  EXPECT_EQ(OK, p.writeToParcel(parcel));
+
+  AParcel_setDataPosition(parcel, 0);
+
+  FixedSizeArrayExample q;
+  EXPECT_EQ(OK, q.readFromParcel(parcel));
+  EXPECT_EQ(p, q);
+
+  AParcel_delete(parcel);
+}
+
+TEST_F(AidlTest, FixedSizeArrayWithValuesAtNullableFields) {
+  auto parcel = AParcel_create();
+
+  FixedSizeArrayExample p;
+  p.boolNullableArray = std::array<bool, 2>{true, false};
+  p.byteNullableArray = std::array<uint8_t, 2>{42, 0};
+  p.stringNullableArray = std::array<std::optional<std::string>, 2>{"hello", "world"};
+
+  p.boolNullableMatrix.emplace();
+  p.boolNullableMatrix->at(0) = std::array<bool, 2>{true, false};
+  p.byteNullableMatrix.emplace();
+  p.byteNullableMatrix->at(0) = std::array<uint8_t, 2>{42, 0};
+  p.stringNullableMatrix.emplace();
+  p.stringNullableMatrix->at(0) = std::array<std::optional<std::string>, 2>{"hello", "world"};
+
+  EXPECT_EQ(OK, p.writeToParcel(parcel));
+
+  AParcel_setDataPosition(parcel, 0);
+
+  FixedSizeArrayExample q;
+  EXPECT_EQ(OK, q.readFromParcel(parcel));
+  EXPECT_EQ(p, q);
+
+  AParcel_delete(parcel);
+}
+
+TEST_F(AidlTest, FixedSizeArrayOfBytesShouldBePacked) {
+  auto parcel = AParcel_create();
+
+  std::array<std::array<uint8_t, 3>, 2> byte_array;
+  byte_array[0] = {1, 2, 3};
+  byte_array[1] = {4, 5, 6};
+  EXPECT_EQ(OK, AParcel_writeData(parcel, byte_array));
+
+  AParcel_setDataPosition(parcel, 0);
+
+  int32_t len;
+  EXPECT_EQ(OK, AParcel_readData(parcel, &len));
+  EXPECT_EQ(2, len);
+  std::vector<uint8_t> byte_vector;
+  EXPECT_EQ(OK, AParcel_readData(parcel, &byte_vector));
+  EXPECT_EQ(byte_vector, (std::vector<uint8_t>{1, 2, 3}));
+  EXPECT_EQ(OK, AParcel_readData(parcel, &byte_vector));
+  EXPECT_EQ(byte_vector, (std::vector<uint8_t>{4, 5, 6}));
+
+  AParcel_delete(parcel);
+}
+
+template <typename Service, typename MemFn, typename Input>
+void CheckRepeat(Service service, MemFn fn, Input input) {
+  Input out1, out2;
+  EXPECT_TRUE(std::invoke(fn, service, input, &out1, &out2).isOk());
+  EXPECT_EQ(input, out1);
+  EXPECT_EQ(input, out2);
+}
+
+template <typename T>
+std::array<std::array<T, 3>, 2> Make2dArray(std::initializer_list<T> values) {
+  std::array<std::array<T, 3>, 2> arr = {};
+  auto it = std::begin(values);
+  for (auto& row : arr) {
+    for (auto& el : row) {
+      if (it == std::end(values)) break;
+      el = *it++;
+    }
+  }
+  return arr;
+}
+
+TEST_F(AidlTest, FixedSizeArrayOverBinder) {
+  auto service = getService<IRepeatFixedSizeArray>();
+
+  CheckRepeat(service, &IRepeatFixedSizeArray::RepeatBytes, (std::array<uint8_t, 3>{1, 2, 3}));
+
+  CheckRepeat(service, &IRepeatFixedSizeArray::RepeatInts, (std::array<int32_t, 3>{1, 2, 3}));
+
+  auto binder1 = SharedRefBase::make<BnEmptyInterface>()->asBinder();
+  auto binder2 = SharedRefBase::make<BnEmptyInterface>()->asBinder();
+  auto binder3 = SharedRefBase::make<BnEmptyInterface>()->asBinder();
+  CheckRepeat(service, &IRepeatFixedSizeArray::RepeatBinders,
+              (std::array<SpAIBinder, 3>{binder1, binder2, binder3}));
+
+  IntParcelable p1, p2, p3;
+  p1.value = 1;
+  p2.value = 2;
+  p3.value = 3;
+  CheckRepeat(service, &IRepeatFixedSizeArray::RepeatParcelables,
+              (std::array<IntParcelable, 3>{p1, p2, p3}));
+
+  CheckRepeat(service, &IRepeatFixedSizeArray::Repeat2dBytes, Make2dArray<uint8_t>({1, 2, 3}));
+
+  CheckRepeat(service, &IRepeatFixedSizeArray::Repeat2dInts, Make2dArray<int32_t>({1, 2, 3}));
+
+  // Not-nullable
+  CheckRepeat(service, &IRepeatFixedSizeArray::Repeat2dBinders,
+              Make2dArray<SpAIBinder>({binder1, binder2, binder3, binder1, binder2, binder3}));
+
+  CheckRepeat(service, &IRepeatFixedSizeArray::Repeat2dParcelables,
+              Make2dArray<IntParcelable>({p1, p2, p3}));
+}
diff --git a/tests/aidl_test_client_ndk_primitives_test.cpp b/tests/aidl_test_client_ndk_primitives_test.cpp
new file mode 100644
index 0000000..56df3be
--- /dev/null
+++ b/tests/aidl_test_client_ndk_primitives_test.cpp
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android/binder_auto_utils.h>
+#include <android/binder_manager.h>
+#include <binder/ProcessState.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <aidl/android/aidl/tests/ITestService.h>
+
+using aidl::android::aidl::tests::INamedCallback;
+using aidl::android::aidl::tests::ITestService;
+using testing::Eq;
+
+struct AidlTest : testing::Test {
+  template <typename T>
+  std::shared_ptr<T> getService() {
+    android::ProcessState::self()->setThreadPoolMaxThreadCount(1);
+    android::ProcessState::self()->startThreadPool();
+    ndk::SpAIBinder binder = ndk::SpAIBinder(AServiceManager_waitForService(T::descriptor));
+    return T::fromBinder(binder);
+  }
+};
+
+TEST_F(AidlTest, InterfaceExchange) {
+  auto service = getService<ITestService>();
+  std::vector<std::string> names = {"Larry", "Curly", "Moe"};
+
+  for (size_t i = 0; i < names.size(); i++) {
+    std::shared_ptr<INamedCallback> got;
+    ASSERT_TRUE(service->GetOtherTestService(names[i], &got).isOk());
+    std::string name;
+    ASSERT_TRUE(got->GetName(&name).isOk());
+    ASSERT_THAT(name, Eq(names[i]));
+  }
+  {
+    std::vector<std::shared_ptr<INamedCallback>> got;
+    ASSERT_TRUE(service->GetInterfaceArray(names, &got).isOk());
+
+    bool verified = false;
+    ASSERT_TRUE(service->VerifyNamesWithInterfaceArray(got, names, &verified).isOk());
+    ASSERT_TRUE(verified);
+
+    for (size_t i = 0; i < names.size(); i++) {
+      std::string name;
+      ASSERT_TRUE(got[i]->GetName(&name).isOk());
+      ASSERT_THAT(name, Eq(names[i]));
+    }
+  }
+  {
+    std::vector<std::optional<std::string>> names = {"Larry", std::nullopt, "Moe"};
+    std::optional<std::vector<std::shared_ptr<INamedCallback>>> got;
+    ASSERT_TRUE(service->GetNullableInterfaceArray(names, &got).isOk());
+    bool verified = false;
+    ASSERT_TRUE(service->VerifyNamesWithNullableInterfaceArray(got, names, &verified).isOk());
+    ASSERT_TRUE(verified);
+    ASSERT_TRUE(got.has_value());
+    for (size_t i = 0; i < names.size(); i++) {
+      if (names[i].has_value()) {
+        ASSERT_NE(got->at(i).get(), nullptr);
+        std::string name;
+        ASSERT_TRUE(got->at(i)->GetName(&name).isOk());
+        ASSERT_THAT(name, Eq(names[i].value()));
+      } else {
+        ASSERT_EQ(got->at(i).get(), nullptr);
+      }
+    }
+  }
+  {
+    std::vector<std::optional<std::string>> names = {"Larry", std::nullopt, "Moe"};
+    std::optional<std::vector<std::shared_ptr<INamedCallback>>> got;
+    ASSERT_TRUE(service->GetInterfaceList(names, &got).isOk());
+    bool verified = false;
+    ASSERT_TRUE(service->VerifyNamesWithInterfaceList(got, names, &verified).isOk());
+    ASSERT_TRUE(verified);
+    ASSERT_TRUE(got.has_value());
+    for (size_t i = 0; i < names.size(); i++) {
+      if (names[i].has_value()) {
+        ASSERT_NE(got->at(i).get(), nullptr);
+        std::string name;
+        ASSERT_TRUE(got->at(i)->GetName(&name).isOk());
+        ASSERT_THAT(name, Eq(names[i].value()));
+      } else {
+        ASSERT_EQ(got->at(i).get(), nullptr);
+      }
+    }
+  }
+}
diff --git a/tests/aidl_test_client_ndk_strings_test.cpp b/tests/aidl_test_client_ndk_strings_test.cpp
new file mode 100644
index 0000000..782357c
--- /dev/null
+++ b/tests/aidl_test_client_ndk_strings_test.cpp
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android/binder_auto_utils.h>
+#include <android/binder_manager.h>
+#include <binder/ProcessState.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <aidl/android/aidl/tests/ITestService.h>
+
+using aidl::android::aidl::tests::BackendType;
+using aidl::android::aidl::tests::ITestService;
+using testing::Eq;
+
+struct AidlTest : testing::Test {
+  template <typename T>
+  std::shared_ptr<T> getService() {
+    android::ProcessState::self()->setThreadPoolMaxThreadCount(1);
+    android::ProcessState::self()->startThreadPool();
+    ndk::SpAIBinder binder = ndk::SpAIBinder(AServiceManager_waitForService(T::descriptor));
+    return T::fromBinder(binder);
+  }
+  void SetUp() override {
+    service = getService<ITestService>();
+    auto status = service->getBackendType(&backend);
+    ASSERT_TRUE(status.isOk()) << status.getDescription();
+  }
+  std::shared_ptr<ITestService> service;
+  BackendType backend;
+};
+
+TEST_F(AidlTest, repeatUtf8String) {
+  const std::vector<std::string> utf8_inputs = {
+      std::string("Deliver us from evil."),
+      std::string(),
+      std::string("\0\0", 2),
+      // Similarly, the utf8 encodings of the small letter yee and euro sign.
+      std::string("\xF0\x90\x90\xB7\xE2\x82\xAC"),
+      ITestService::STRING_CONSTANT_UTF8,
+  };
+
+  for (const auto& input : utf8_inputs) {
+    std::string reply;
+    auto status = service->RepeatUtf8CppString(input, &reply);
+    ASSERT_TRUE(status.isOk());
+    ASSERT_THAT(reply, Eq(input));
+  }
+
+  std::optional<std::string> reply;
+  auto status = service->RepeatNullableUtf8CppString(std::nullopt, &reply);
+  ASSERT_TRUE(status.isOk());
+  ASSERT_FALSE(reply.has_value());
+
+  for (const auto& input : utf8_inputs) {
+    std::optional<std::string> reply;
+    auto status = service->RepeatNullableUtf8CppString(input, &reply);
+    ASSERT_TRUE(status.isOk());
+    ASSERT_TRUE(reply.has_value());
+    ASSERT_THAT(*reply, Eq(input));
+  }
+}
+
+TEST_F(AidlTest, reverseUtf8StringArray) {
+  std::vector<std::string> input = {"a", "", "\xc3\xb8"};
+  decltype(input) repeated;
+  if (backend == BackendType::JAVA) {
+    repeated = decltype(input)(input.size());
+  }
+  decltype(input) reversed;
+
+  auto status = service->ReverseUtf8CppString(input, &repeated, &reversed);
+  ASSERT_TRUE(status.isOk()) << status.getDescription();
+  ASSERT_THAT(repeated, Eq(input));
+
+  decltype(input) reversed_input(input);
+  std::reverse(reversed_input.begin(), reversed_input.end());
+  ASSERT_THAT(reversed, Eq(reversed_input));
+}
+
+struct AidlStringArrayTest : public AidlTest {
+  void DoTest(::ndk::ScopedAStatus (ITestService::*func)(
+      const std::optional<std::vector<std::optional<std::string>>>&,
+      std::optional<std::vector<std::optional<std::string>>>*,
+      std::optional<std::vector<std::optional<std::string>>>*)) {
+    std::optional<std::vector<std::optional<std::string>>> input;
+    decltype(input) repeated;
+    decltype(input) reversed;
+
+    auto status = (*service.*func)(input, &repeated, &reversed);
+    ASSERT_TRUE(status.isOk()) << status.getDescription();
+
+    if (func == &ITestService::ReverseUtf8CppStringList && backend == BackendType::JAVA) {
+      // Java cannot clear the input variable to return a null value. It can
+      // only ever fill out a list.
+      ASSERT_TRUE(repeated.has_value());
+    } else {
+      ASSERT_FALSE(repeated.has_value());
+    }
+
+    ASSERT_FALSE(reversed.has_value());
+
+    input = std::vector<std::optional<std::string>>();
+    input->push_back("Deliver us from evil.");
+    input->push_back(std::nullopt);
+    input->push_back("\xF0\x90\x90\xB7\xE2\x82\xAC");
+
+    // usable size needs to be initialized for Java
+    repeated = std::vector<std::optional<std::string>>(input->size());
+
+    status = (*service.*func)(input, &repeated, &reversed);
+    ASSERT_TRUE(status.isOk()) << status.getDescription();
+    ASSERT_TRUE(reversed.has_value());
+    ASSERT_TRUE(repeated.has_value());
+    ASSERT_THAT(reversed->size(), Eq(input->size()));
+    ASSERT_THAT(repeated->size(), Eq(input->size()));
+
+    for (size_t i = 0; i < input->size(); i++) {
+      auto input_str = (*input)[i];
+      auto repeated_str = (*repeated)[i];
+      auto reversed_str = (*reversed)[(reversed->size() - 1) - i];
+      if (!input_str) {
+        ASSERT_FALSE(repeated_str.has_value());
+        ASSERT_FALSE(reversed_str.has_value());
+        // 3 nullptrs to strings.  No need to compare values.
+        continue;
+      }
+      ASSERT_TRUE(repeated_str.has_value());
+      ASSERT_TRUE(reversed_str.has_value());
+
+      ASSERT_THAT(*repeated_str, Eq(*input_str));
+      ASSERT_THAT(*reversed_str, Eq(*input_str));
+    }
+  }
+};
+
+TEST_F(AidlStringArrayTest, nullableList) {
+  DoTest(&ITestService::ReverseUtf8CppStringList);
+}
+
+TEST_F(AidlStringArrayTest, nullableArray) {
+  DoTest(&ITestService::ReverseNullableUtf8CppString);
+}
diff --git a/tests/aidl_test_client_ndk_trunk_stable.cpp b/tests/aidl_test_client_ndk_trunk_stable.cpp
new file mode 100644
index 0000000..54c1bef
--- /dev/null
+++ b/tests/aidl_test_client_ndk_trunk_stable.cpp
@@ -0,0 +1,205 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <aidl/android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android/binder_auto_utils.h>
+#include <android/binder_manager.h>
+#include <binder/ProcessState.h>
+#include <gtest/gtest.h>
+
+#ifdef AIDL_USE_UNFROZEN
+constexpr bool kUseUnfrozen = true;
+#else
+constexpr bool kUseUnfrozen = false;
+#endif
+
+using aidl::android::aidl::test::trunk::ITrunkStableTest;
+using ndk::ScopedAStatus;
+using MyParcelable = aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable;
+using MyOtherParcelable = aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable;
+using MyEnum = aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum;
+using MyUnion = aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion;
+
+class TrunkInterfaceTest : public testing::Test {
+ public:
+  void SetUp() override {
+    android::ProcessState::self()->setThreadPoolMaxThreadCount(1);
+    android::ProcessState::self()->startThreadPool();
+    ndk::SpAIBinder binder =
+        ndk::SpAIBinder(AServiceManager_waitForService(ITrunkStableTest::descriptor));
+    service = ITrunkStableTest::fromBinder(binder);
+    ASSERT_NE(nullptr, service);
+  }
+
+  std::shared_ptr<ITrunkStableTest> service;
+};
+
+TEST_F(TrunkInterfaceTest, getInterfaceVersion) {
+  // TODO(b/292539129) this should be done with an annotation instead of ifdefs
+  // We have to match on a single char with #if, even though it is
+  // really "enabled"/"disabled"
+  int32_t ver = 0;
+  auto status = service->getInterfaceVersion(&ver);
+  ASSERT_TRUE(status.isOk());
+  if (kUseUnfrozen) {
+    EXPECT_EQ(2, ver);
+    // Check the local version as well
+    EXPECT_EQ(2, ITrunkStableTest::version);
+  } else {
+    EXPECT_EQ(1, ver);
+    // Check the local version as well
+    EXPECT_EQ(1, ITrunkStableTest::version);
+  }
+}
+
+TEST_F(TrunkInterfaceTest, getInterfaceHash) {
+  std::string hash;
+  std::string localHash;
+  auto status = service->getInterfaceHash(&hash);
+  ASSERT_TRUE(status.isOk());
+  if (kUseUnfrozen) {
+    EXPECT_EQ("notfrozen", hash);
+    // Check the local hash as well
+    EXPECT_EQ("notfrozen", ITrunkStableTest::hash);
+  } else {
+    EXPECT_EQ("88311b9118fb6fe9eff4a2ca19121de0587f6d5f", hash);
+    // Check the local hash as well
+    EXPECT_EQ("88311b9118fb6fe9eff4a2ca19121de0587f6d5f", ITrunkStableTest::hash);
+  }
+}
+
+// `c` is a new field that isn't read from the reply parcel
+TEST_F(TrunkInterfaceTest, repeatParcelable) {
+  MyParcelable in, out;
+  in.a = 14;
+  in.b = 15;
+  in.c = 16;
+
+  auto status = service->repeatParcelable(in, &out);
+  ASSERT_TRUE(status.isOk()) << status;
+  if (kUseUnfrozen) {
+    EXPECT_EQ(in.a, out.a);
+    EXPECT_EQ(in.b, out.b);
+    EXPECT_EQ(in.c, out.c);
+  } else {
+    EXPECT_EQ(in.a, out.a);
+    EXPECT_EQ(in.b, out.b);
+    EXPECT_NE(in.c, out.c);
+    EXPECT_EQ(0, out.c);
+  }
+}
+
+// repeatOtherParcelable is a new API that isn't implemented
+TEST_F(TrunkInterfaceTest, repeatOtherParcelable) {
+  MyOtherParcelable in, out;
+  in.a = 14;
+  in.b = 15;
+
+  auto status = service->repeatOtherParcelable(in, &out);
+  if (kUseUnfrozen) {
+    ASSERT_TRUE(status.isOk()) << status;
+    EXPECT_EQ(in.a, out.a);
+    EXPECT_EQ(in.b, out.b);
+  } else {
+    EXPECT_FALSE(status.isOk()) << status;
+    EXPECT_EQ(STATUS_UNKNOWN_TRANSACTION, status.getStatus()) << status;
+  }
+}
+
+// enums aren't handled differently.
+TEST_F(TrunkInterfaceTest, repeatEnum) {
+  MyEnum in = MyEnum::THREE;
+  MyEnum out = MyEnum::ZERO;
+
+  auto status = service->repeatEnum(in, &out);
+  ASSERT_TRUE(status.isOk()) << status;
+  EXPECT_EQ(in, out);
+}
+
+// `c` is a new field that causes a failure if used
+// `b` is from V1 and will cause no failure
+TEST_F(TrunkInterfaceTest, repeatUnion) {
+  MyUnion in_ok = MyUnion::make<MyUnion::b>(13);
+  MyUnion in_test = MyUnion::make<MyUnion::c>(12);
+  MyUnion out;
+
+  auto status = service->repeatUnion(in_ok, &out);
+  ASSERT_TRUE(status.isOk()) << status;
+  EXPECT_EQ(in_ok, out);
+
+  status = service->repeatUnion(in_test, &out);
+  if (kUseUnfrozen) {
+    ASSERT_TRUE(status.isOk()) << status;
+    EXPECT_EQ(in_test, out);
+  } else {
+    ASSERT_FALSE(status.isOk()) << status;
+    EXPECT_NE(in_test, out);
+  }
+}
+
+class MyCallback : public ITrunkStableTest::BnMyCallback {
+ public:
+  MyCallback() {}
+  virtual ~MyCallback() = default;
+
+  ScopedAStatus repeatParcelable(const MyParcelable& input, MyParcelable* _aidl_return) override {
+    *_aidl_return = input;
+    repeatParcelableCalled = true;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus repeatEnum(MyEnum input, MyEnum* _aidl_return) override {
+    *_aidl_return = input;
+    repeatEnumCalled = true;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus repeatUnion(const MyUnion& input, MyUnion* _aidl_return) override {
+    *_aidl_return = input;
+    repeatUnionCalled = true;
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus repeatOtherParcelable(const MyOtherParcelable& input,
+                                      MyOtherParcelable* _aidl_return) override {
+    *_aidl_return = input;
+    repeatOtherParcelableCalled = true;
+    return ScopedAStatus::ok();
+  }
+
+  bool repeatParcelableCalled = false;
+  bool repeatEnumCalled = false;
+  bool repeatUnionCalled = false;
+  bool repeatOtherParcelableCalled = false;
+};
+
+// repeatOtherParcelable is new in V2, so it won't be called
+TEST_F(TrunkInterfaceTest, callMyCallback) {
+  std::shared_ptr<MyCallback> cb = ndk::SharedRefBase::make<MyCallback>();
+
+  auto status = service->callMyCallback(cb);
+  ASSERT_TRUE(status.isOk()) << status;
+  if (kUseUnfrozen) {
+    EXPECT_TRUE(cb->repeatParcelableCalled);
+    EXPECT_TRUE(cb->repeatEnumCalled);
+    EXPECT_TRUE(cb->repeatUnionCalled);
+    EXPECT_TRUE(cb->repeatOtherParcelableCalled);
+  } else {
+    EXPECT_TRUE(cb->repeatParcelableCalled);
+    EXPECT_TRUE(cb->repeatEnumCalled);
+    EXPECT_TRUE(cb->repeatUnionCalled);
+    EXPECT_FALSE(cb->repeatOtherParcelableCalled);
+  }
+}
diff --git a/tests/aidl_test_client_ndk_versioned_interface.cpp b/tests/aidl_test_client_ndk_versioned_interface.cpp
new file mode 100644
index 0000000..9011e99
--- /dev/null
+++ b/tests/aidl_test_client_ndk_versioned_interface.cpp
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/android/aidl/tests/BackendType.h>
+#include <aidl/android/aidl/tests/ITestService.h>
+#include <aidl/android/aidl/versioned/tests/IFooInterface.h>
+
+#include <android/binder_auto_utils.h>
+#include <android/binder_manager.h>
+#include <binder/ProcessState.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+using aidl::android::aidl::tests::BackendType;
+using aidl::android::aidl::tests::ITestService;
+using aidl::android::aidl::versioned::tests::BazUnion;
+using aidl::android::aidl::versioned::tests::Foo;
+using aidl::android::aidl::versioned::tests::IFooInterface;
+using std::optional;
+using std::pair;
+using std::shared_ptr;
+using std::string;
+using std::vector;
+using testing::Eq;
+
+struct VersionedInterfaceTest : ::testing::Test {
+  void SetUp() override {
+    android::ProcessState::self()->setThreadPoolMaxThreadCount(1);
+    android::ProcessState::self()->startThreadPool();
+    ndk::SpAIBinder binder =
+        ndk::SpAIBinder(AServiceManager_waitForService(IFooInterface::descriptor));
+    versioned = IFooInterface::fromBinder(binder);
+    ASSERT_NE(nullptr, versioned);
+
+    ndk::SpAIBinder testServiceBinder =
+        ndk::SpAIBinder(AServiceManager_waitForService(ITestService::descriptor));
+    auto service = ITestService::fromBinder(testServiceBinder);
+    auto status = service->getBackendType(&backend);
+    EXPECT_TRUE(status.isOk()) << status.getDescription();
+  }
+  shared_ptr<IFooInterface> versioned;
+  BackendType backend;
+};
+
+TEST_F(VersionedInterfaceTest, getInterfaceVersion) {
+  int32_t version;
+  auto status = versioned->getInterfaceVersion(&version);
+  EXPECT_TRUE(status.isOk()) << status.getDescription();
+  EXPECT_EQ(1, version);
+}
+
+TEST_F(VersionedInterfaceTest, getInterfaceHash) {
+  string hash;
+  auto status = versioned->getInterfaceHash(&hash);
+  EXPECT_TRUE(status.isOk()) << status.getDescription();
+  EXPECT_EQ("9e7be1859820c59d9d55dd133e71a3687b5d2e5b", hash);
+}
+
+TEST_F(VersionedInterfaceTest, noProblemWhenPassingAUnionWithOldField) {
+  std::string result;
+  auto status =
+      versioned->acceptUnionAndReturnString(BazUnion::make<BazUnion::intNum>(42), &result);
+  EXPECT_TRUE(status.isOk()) << status.getDescription();
+  EXPECT_EQ("42", result);
+}
+
+TEST_F(VersionedInterfaceTest, errorWhenPassingAUnionWithNewField) {
+  std::string result;
+  auto status =
+      versioned->acceptUnionAndReturnString(BazUnion::make<BazUnion::longNum>(42L), &result);
+  // b/173458620 - Java and C++ return different errors
+  if (backend == BackendType::JAVA) {
+    EXPECT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode());
+  } else {
+    EXPECT_EQ(STATUS_BAD_VALUE, status.getStatus());
+  }
+}
+
+TEST_F(VersionedInterfaceTest, arrayOfParcelableWithNewField) {
+  vector<Foo> foos(42);
+  int32_t length;
+  auto status = versioned->returnsLengthOfFooArray(foos, &length);
+  EXPECT_TRUE(status.isOk()) << status.getDescription();
+  EXPECT_EQ(42, length);
+}
+
+TEST_F(VersionedInterfaceTest, readDataCorrectlyAfterParcelableWithNewField) {
+  Foo inFoo, inoutFoo, outFoo;
+  inoutFoo.intDefault42 = 0;
+  outFoo.intDefault42 = 0;
+  int32_t ret;
+  auto status = versioned->ignoreParcelablesAndRepeatInt(inFoo, &inoutFoo, &outFoo, 43, &ret);
+  EXPECT_TRUE(status.isOk()) << status.getDescription();
+  EXPECT_EQ(43, ret);
+  EXPECT_EQ(0, inoutFoo.intDefault42);
+  EXPECT_EQ(0, outFoo.intDefault42);
+}
+
+TEST_F(VersionedInterfaceTest, errorWhenCallingV2Api) {
+  auto status = versioned->newApi();
+  EXPECT_EQ(STATUS_UNKNOWN_TRANSACTION, status.getStatus());
+}
diff --git a/tests/aidl_test_client_nested.cpp b/tests/aidl_test_client_nested.cpp
new file mode 100644
index 0000000..116203c
--- /dev/null
+++ b/tests/aidl_test_client_nested.cpp
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl_test_client.h"
+
+#include <android/aidl/tests/nested/INestedService.h>
+#include <binder/IServiceManager.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <utils/String16.h>
+
+using android::IBinder;
+using android::sp;
+using android::String16;
+using android::aidl::tests::nested::INestedService;
+using android::aidl::tests::nested::ParcelableWithNested;
+using android::binder::Status;
+using NestedResult = android::aidl::tests::nested::INestedService::Result;
+using NestedStatus = android::aidl::tests::nested::ParcelableWithNested::Status;
+using std::optional;
+using std::pair;
+using std::string;
+using std::vector;
+using testing::Eq;
+using testing::Optional;
+
+TEST_F(AidlTest, NestedService) {
+  sp<INestedService> nestedService =
+      android::waitForService<INestedService>(INestedService::descriptor);
+  ASSERT_NE(nullptr, nestedService);
+
+  ParcelableWithNested p;
+  p.status = NestedStatus::OK;
+  NestedResult r;
+  // OK -> NOT_OK
+  EXPECT_TRUE(nestedService->flipStatus(p, &r).isOk());
+  EXPECT_EQ(r.status, NestedStatus::NOT_OK);
+
+  // NOT_OK -> OK with callback nested interface
+  struct Callback : INestedService::BnCallback {
+    optional<NestedStatus> result;
+    Status done(NestedStatus st) override {
+      result = st;
+      return Status::ok();
+    }
+  };
+  sp<Callback> cb = new Callback;
+  EXPECT_TRUE(nestedService->flipStatusWithCallback(r.status, cb).isOk());
+  EXPECT_THAT(cb->result, Optional(NestedStatus::OK));
+
+  // android::enum_ranges<>
+  vector<NestedStatus> values{android::enum_range<NestedStatus>().begin(),
+                              android::enum_range<NestedStatus>().end()};
+  EXPECT_EQ(values, vector<NestedStatus>({NestedStatus::OK, NestedStatus::NOT_OK}));
+
+  // toString()
+  EXPECT_EQ(toString(NestedStatus::NOT_OK), "NOT_OK");
+}
diff --git a/tests/aidl_test_client_nullables.cpp b/tests/aidl_test_client_nullables.cpp
new file mode 100644
index 0000000..6c7685c
--- /dev/null
+++ b/tests/aidl_test_client_nullables.cpp
@@ -0,0 +1,233 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <optional>
+#include <vector>
+
+#include <utils/String16.h>
+#include <utils/String8.h>
+
+#include "aidl_test_client.h"
+#include "gmock/gmock.h"
+
+using android::BBinder;
+using android::IBinder;
+using android::sp;
+using android::String16;
+using android::String8;
+using android::binder::Status;
+
+using android::aidl::tests::BackendType;
+using android::aidl::tests::ByteEnum;
+using android::aidl::tests::INamedCallback;
+using android::aidl::tests::IntEnum;
+using android::aidl::tests::ITestService;
+using android::aidl::tests::LongEnum;
+using android::aidl::tests::SimpleParcelable;
+using android::aidl::tests::StructuredParcelable;
+
+using testing::Eq;
+using testing::Ne;
+
+struct RepeatNullableTest : public AidlTest {
+  template <typename T>
+  void DoTest(Status (ITestService::*func)(const std::optional<T>&, std::optional<T>*),
+              std::optional<T> input) {
+    std::optional<T> output;
+    auto status = (*service.*func)(input, &output);
+    ASSERT_TRUE(status.isOk());
+    ASSERT_TRUE(output.has_value());
+    ASSERT_THAT(*output, Eq(*input));
+
+    input.reset();
+    status = (*service.*func)(input, &output);
+    ASSERT_TRUE(status.isOk());
+    ASSERT_FALSE(output.has_value());
+  }
+};
+
+TEST_F(RepeatNullableTest, intArray) {
+  DoTest(&ITestService::RepeatNullableIntArray, std::make_optional(std::vector<int32_t>{1, 2, 3}));
+}
+
+TEST_F(RepeatNullableTest, byteEnumArray) {
+  DoTest(&ITestService::RepeatNullableByteEnumArray,
+         std::make_optional(std::vector<ByteEnum>{ByteEnum::FOO, ByteEnum::BAR}));
+}
+
+TEST_F(RepeatNullableTest, intEnumArray) {
+  DoTest(&ITestService::RepeatNullableIntEnumArray,
+         std::make_optional(std::vector<IntEnum>{IntEnum::FOO, IntEnum::BAR}));
+}
+
+TEST_F(RepeatNullableTest, longEnumArray) {
+  DoTest(&ITestService::RepeatNullableLongEnumArray,
+         std::make_optional(std::vector<LongEnum>{LongEnum::FOO, LongEnum::BAR}));
+}
+
+TEST_F(RepeatNullableTest, string) {
+  DoTest(&ITestService::RepeatNullableString, std::optional<String16>("Blooob"));
+}
+
+TEST_F(RepeatNullableTest, stringArray) {
+  std::vector<std::optional<String16>> input;
+  input.push_back(String16("Wat"));
+  input.push_back(String16("Blooob"));
+  input.push_back(String16("Wat"));
+  input.push_back(std::nullopt);
+  input.push_back(String16("YEAH"));
+  input.push_back(String16("OKAAAAY"));
+
+  DoTest(&ITestService::RepeatNullableStringList, std::make_optional(input));
+}
+
+TEST_F(RepeatNullableTest, parcelable) {
+  auto input = std::make_optional<ITestService::Empty>();
+  std::optional<ITestService::Empty> output;
+  auto status = service->RepeatNullableParcelable(input, &output);
+  ASSERT_TRUE(status.isOk());
+  ASSERT_TRUE(output.has_value());
+  ASSERT_THAT(*output, Eq(*input));
+
+  input.reset();
+  status = service->RepeatNullableParcelable(input, &output);
+  ASSERT_TRUE(status.isOk());
+  ASSERT_FALSE(output.has_value());
+}
+
+TEST_F(RepeatNullableTest, parcelableArray) {
+  std::vector<std::optional<ITestService::Empty>> input;
+  input.push_back(ITestService::Empty());
+  input.push_back(std::nullopt);
+  DoTest(&ITestService::RepeatNullableParcelableArray, std::make_optional(input));
+}
+
+TEST_F(RepeatNullableTest, parcelableList) {
+  std::vector<std::optional<ITestService::Empty>> input;
+  input.push_back(ITestService::Empty());
+  input.push_back(std::nullopt);
+  DoTest(&ITestService::RepeatNullableParcelableList, std::make_optional(input));
+}
+
+TEST_F(AidlTest, nullBinder) {
+  auto status = service->TakesAnIBinder(nullptr);
+
+  if (backend == BackendType::JAVA) {
+    ASSERT_TRUE(status.isOk()) << status;
+  } else if (backend == BackendType::NDK) {
+    ASSERT_THAT(status.transactionError(), Eq(android::UNEXPECTED_NULL)) << status;
+  } else {
+    ASSERT_THAT(status.exceptionCode(), Eq(android::binder::Status::EX_NULL_POINTER)) << status;
+  }
+}
+
+TEST_F(AidlTest, binderListWithNull) {
+  std::vector<sp<IBinder>> input{new BBinder(), nullptr};
+  auto status = service->TakesAnIBinderList(input);
+
+  if (backend == BackendType::JAVA) {
+    ASSERT_TRUE(status.isOk()) << status;
+  } else if (backend == BackendType::NDK) {
+    ASSERT_THAT(status.transactionError(), Eq(android::UNEXPECTED_NULL)) << status;
+  } else {
+    ASSERT_THAT(status.exceptionCode(), Eq(android::binder::Status::EX_NULL_POINTER)) << status;
+  }
+}
+
+TEST_F(AidlTest, nonNullBinder) {
+  sp<IBinder> input = new BBinder();
+  auto status = service->TakesAnIBinder(input);
+  ASSERT_TRUE(status.isOk());
+}
+
+TEST_F(AidlTest, binderListWithoutNull) {
+  std::vector<sp<IBinder>> input{new BBinder(), new BBinder()};
+  auto status = service->TakesAnIBinderList(input);
+  ASSERT_TRUE(status.isOk());
+}
+
+TEST_F(AidlTest, nullBinderToAnnotatedMethod) {
+  auto status = service->TakesANullableIBinder(nullptr);
+  ASSERT_TRUE(status.isOk());
+}
+
+TEST_F(AidlTest, binderListWithNullToAnnotatedMethod) {
+  std::vector<sp<IBinder>> input{new BBinder(), nullptr};
+  auto status = service->TakesANullableIBinderList(input);
+  ASSERT_TRUE(status.isOk());
+}
+
+TEST_F(AidlTest, binderArray) {
+  std::vector<sp<IBinder>> repeated;
+  if (backend == BackendType::JAVA) {
+    // Java can only modify out-argument arrays in-place
+    repeated.resize(2);
+  }
+
+  std::vector<sp<IBinder>> reversed;
+  std::vector<sp<IBinder>> input{new BBinder(), new BBinder()};
+  auto status = service->ReverseIBinderArray(input, &repeated, &reversed);
+  ASSERT_TRUE(status.isOk()) << status;
+
+  EXPECT_THAT(input, Eq(repeated));
+  std::reverse(std::begin(reversed), std::end(reversed));
+  EXPECT_THAT(input, Eq(reversed));
+}
+
+TEST_F(AidlTest, nullableBinderArray) {
+  std::optional<std::vector<sp<IBinder>>> repeated;
+  if (backend == BackendType::JAVA) {
+    // Java can only modify out-argument arrays in-place
+    repeated = std::vector<sp<IBinder>>();
+    repeated->resize(2);
+  }
+
+  std::optional<std::vector<sp<IBinder>>> reversed;
+  std::optional<std::vector<sp<IBinder>>> input = std::vector<sp<IBinder>>{new BBinder(), nullptr};
+  auto status = service->ReverseNullableIBinderArray(input, &repeated, &reversed);
+  ASSERT_TRUE(status.isOk()) << status;
+
+  EXPECT_THAT(input, Eq(repeated));
+  ASSERT_TRUE(reversed);
+  std::reverse(std::begin(*reversed), std::end(*reversed));
+  EXPECT_THAT(input, Eq(reversed));
+}
+
+TEST_F(AidlTest, nonNullBinderToAnnotatedMethod) {
+  sp<IBinder> input = new BBinder();
+  auto status = service->TakesANullableIBinder(input);
+  ASSERT_TRUE(status.isOk());
+}
+
+TEST_F(AidlTest, binderListWithoutNullToAnnotatedMethod) {
+  std::vector<sp<IBinder>> input{new BBinder(), new BBinder()};
+  auto status = service->TakesANullableIBinderList(input);
+  ASSERT_TRUE(status.isOk());
+}
+
+TEST_F(AidlTest, interface) {
+  sp<INamedCallback> callback;
+  auto status = service->GetCallback(false, &callback);
+  ASSERT_TRUE(status.isOk());
+  ASSERT_THAT(callback.get(), Ne(nullptr));
+}
+
+TEST_F(AidlTest, nullInterface) {
+  sp<INamedCallback> callback;
+  auto status = service->GetCallback(true, &callback);
+  ASSERT_TRUE(status.isOk());
+  ASSERT_THAT(callback.get(), Eq(nullptr));
+}
diff --git a/tests/aidl_test_client_parcelables.cpp b/tests/aidl_test_client_parcelables.cpp
new file mode 100644
index 0000000..17f194d
--- /dev/null
+++ b/tests/aidl_test_client_parcelables.cpp
@@ -0,0 +1,711 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <android/aidl/tests/ParcelableForToString.h>
+#include <android/aidl/tests/extension/MyExt.h>
+#include <android/aidl/tests/extension/MyExt2.h>
+#include <android/aidl/tests/extension/MyExtLike.h>
+#include <android/aidl/tests/unions/EnumUnion.h>
+#include <binder/Binder.h>
+#include "aidl_test_client.h"
+
+#include <string>
+#include <vector>
+
+using android::IInterface;
+using android::sp;
+using android::String16;
+using android::String8;
+using android::aidl::fixedsizearray::FixedSizeArrayExample;
+using android::aidl::tests::BadParcelable;
+using android::aidl::tests::ConstantExpressionEnum;
+using android::aidl::tests::GenericStructuredParcelable;
+using android::aidl::tests::INamedCallback;
+using android::aidl::tests::IntEnum;
+using android::aidl::tests::ITestService;
+using android::aidl::tests::OtherParcelableForToString;
+using android::aidl::tests::ParcelableForToString;
+using android::aidl::tests::RecursiveList;
+using android::aidl::tests::SimpleParcelable;
+using android::aidl::tests::StructuredParcelable;
+using android::aidl::tests::Union;
+using android::aidl::tests::extension::ExtendableParcelable;
+using android::aidl::tests::extension::MyExt;
+using android::aidl::tests::extension::MyExt2;
+using android::aidl::tests::extension::MyExtLike;
+using android::aidl::tests::unions::EnumUnion;
+using IntParcelable = android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable;
+using IRepeatFixedSizeArray =
+    android::aidl::fixedsizearray::FixedSizeArrayExample::IRepeatFixedSizeArray;
+using android::BBinder;
+using android::IBinder;
+using android::OK;
+using android::binder::Status;
+using android::os::PersistableBundle;
+using std::string;
+using std::vector;
+
+TEST_F(AidlTest, BadParcelable) {
+  if (!cpp_java_tests) GTEST_SKIP() << "Service does not support the CPP/Java-only tests.";
+
+  BadParcelable output;
+  {
+    BadParcelable bad(/*bad=*/true, "Booya", 42);
+    Status status = cpp_java_tests->RepeatBadParcelable(bad, &output);
+    ASSERT_FALSE(status.isOk());
+    EXPECT_EQ(status.exceptionCode(), Status::Exception::EX_BAD_PARCELABLE);
+  }
+  {
+    BadParcelable not_bad(/*bad=*/false, "Booya", 42);
+    Status status = cpp_java_tests->RepeatBadParcelable(not_bad, &output);
+    ASSERT_TRUE(status.isOk());
+    EXPECT_EQ(not_bad, output);
+  }
+}
+
+TEST_F(AidlTest, RepeatSimpleParcelable) {
+  if (!cpp_java_tests) GTEST_SKIP() << "Service does not support the CPP/Java-only tests.";
+
+  SimpleParcelable input("Booya", 42);
+  SimpleParcelable out_param, returned;
+  Status status = cpp_java_tests->RepeatSimpleParcelable(input, &out_param, &returned);
+  ASSERT_TRUE(status.isOk()) << status.toString8();
+  EXPECT_EQ(input, out_param) << input.toString() << " " << out_param.toString();
+  EXPECT_EQ(input, returned) << input.toString() << " " << returned.toString();
+}
+
+TEST_F(AidlTest, RepeatGenericStructureParcelable) {
+  if (!cpp_java_tests) GTEST_SKIP() << "Service does not support the CPP/Java-only tests.";
+
+  GenericStructuredParcelable<int32_t, StructuredParcelable, IntEnum> input, out_param, returned;
+  input.a = 41;
+  input.b = 42;
+  Status status = cpp_java_tests->RepeatGenericParcelable(input, &out_param, &returned);
+  ASSERT_TRUE(status.isOk()) << status.toString8();
+  EXPECT_EQ(input, out_param);
+  EXPECT_EQ(input, returned);
+}
+
+TEST_F(AidlTest, ReverseSimpleParcelable) {
+  if (!cpp_java_tests) GTEST_SKIP() << "Service does not support the CPP/Java-only tests.";
+
+  const vector<SimpleParcelable> original{SimpleParcelable("first", 0),
+                                          SimpleParcelable("second", 1),
+                                          SimpleParcelable("third", 2)};
+  vector<SimpleParcelable> repeated;
+  if (backend == BackendType::JAVA) {
+    repeated = vector<SimpleParcelable>(original.size());
+  }
+  vector<SimpleParcelable> reversed;
+  Status status = cpp_java_tests->ReverseSimpleParcelables(original, &repeated, &reversed);
+  ASSERT_TRUE(status.isOk()) << status.toString8();
+
+  EXPECT_EQ(repeated, original);
+
+  std::reverse(reversed.begin(), reversed.end());
+  EXPECT_EQ(reversed, original);
+}
+
+TEST_F(AidlTest, ConfirmPersistableBundles) {
+  if (!cpp_java_tests) GTEST_SKIP() << "Service does not support the CPP/Java-only tests.";
+
+  PersistableBundle empty_bundle, returned;
+  Status status = cpp_java_tests->RepeatPersistableBundle(empty_bundle, &returned);
+  ASSERT_TRUE(status.isOk()) << status.toString8();
+  EXPECT_EQ(empty_bundle, returned);
+}
+
+TEST_F(AidlTest, ConfirmPersistableBundlesNonEmpty) {
+  if (!cpp_java_tests) GTEST_SKIP() << "Service does not support the CPP/Java-only tests.";
+
+  PersistableBundle non_empty_bundle, returned;
+  non_empty_bundle.putBoolean(String16("test_bool"), false);
+  non_empty_bundle.putInt(String16("test_int"), 33);
+  non_empty_bundle.putLong(String16("test_long"), 34359738368L);
+  non_empty_bundle.putDouble(String16("test_double"), 1.1);
+  non_empty_bundle.putString(String16("test_string"), String16("Woot!"));
+  non_empty_bundle.putBooleanVector(String16("test_bool_vector"),
+                                    {true, false, true});
+  non_empty_bundle.putIntVector(String16("test_int_vector"), {33, 44, 55, 142});
+  non_empty_bundle.putLongVector(String16("test_long_vector"),
+                                 {34L, 8371L, 34359738375L});
+  non_empty_bundle.putDoubleVector(String16("test_double_vector"), {2.2, 5.4});
+  non_empty_bundle.putStringVector(String16("test_string_vector"),
+                                   {String16("hello"), String16("world!")});
+  PersistableBundle nested_bundle;
+  nested_bundle.putInt(String16("test_nested_int"), 345);
+  non_empty_bundle.putPersistableBundle(String16("test_persistable_bundle"),
+                                        nested_bundle);
+
+  Status status = cpp_java_tests->RepeatPersistableBundle(non_empty_bundle, &returned);
+  ASSERT_TRUE(status.isOk()) << status.toString8();
+  EXPECT_EQ(non_empty_bundle, returned);
+}
+
+TEST_F(AidlTest, ReversePersistableBundles) {
+  if (!cpp_java_tests) GTEST_SKIP() << "Service does not support the CPP/Java-only tests.";
+
+  PersistableBundle first;
+  PersistableBundle second;
+  PersistableBundle third;
+  first.putInt(String16("test_int"), 1231);
+  second.putLong(String16("test_long"), 222222L);
+  third.putDouble(String16("test_double"), 10.8);
+  const vector<PersistableBundle> original{first, second, third};
+
+  vector<PersistableBundle> repeated;
+  if (backend == BackendType::JAVA) {
+    repeated = vector<PersistableBundle>(original.size());
+  }
+  vector<PersistableBundle> reversed;
+  Status status = cpp_java_tests->ReversePersistableBundles(original, &repeated, &reversed);
+  ASSERT_TRUE(status.isOk()) << status.toString8();
+
+  EXPECT_EQ(repeated, original);
+
+  std::reverse(reversed.begin(), reversed.end());
+  EXPECT_EQ(reversed, original);
+}
+
+TEST_F(AidlTest, ReverseUnion) {
+  if (!cpp_java_tests) GTEST_SKIP() << "Service does not support the CPP/Java-only tests.";
+
+  Union original = Union::make<Union::ns>({1, 2, 3});
+  Union repeated, reversed;
+  Status status = cpp_java_tests->ReverseUnion(original, &repeated, &reversed);
+  ASSERT_TRUE(status.isOk()) << status.toString8();
+
+  EXPECT_EQ(repeated, original);
+
+  std::reverse(reversed.get<Union::ns>().begin(), reversed.get<Union::ns>().end());
+  EXPECT_EQ(reversed, original);
+}
+
+TEST_F(AidlTest, UnionUsage) {
+  // default ctor inits with first member's default value
+  EXPECT_EQ(Union::make<Union::ns>(), Union());
+
+  // make<tag>(...) to create a value for a tag.
+  Union one_two_three = Union::make<Union::ns>({1, 2, 3});
+
+  // getTag() queries the tag of the content
+  EXPECT_EQ(Union::ns, one_two_three.getTag());
+
+  // Ctor(...) works if a target tag has a unique type among fields.
+  EXPECT_EQ(one_two_three, Union(std::vector{1, 2, 3}));
+  EXPECT_EQ(one_two_three, std::vector<int>({1, 2, 3}));
+
+  // Use std::in_place_index<tag> to avoid "move"
+  // Note that make<tag>(...) involves "move" of the content value
+  EXPECT_EQ(Union::make<Union::ns>(3, 0),
+            Union(std::in_place_index<static_cast<size_t>(Union::ns)>, 3, 0));
+
+  Union one_two = one_two_three;
+  // get<tag> can be used to modify the content
+  one_two.get<Union::ns>().pop_back();
+  EXPECT_EQ(one_two, std::vector<int>({1, 2}));
+  // get<tag> can be lvalue
+  one_two.get<Union::ns>() = std::vector<int>{1, 2};
+  EXPECT_EQ(one_two, std::vector<int>({1, 2}));
+
+  // abort with a bad access
+  EXPECT_DEATH(one_two.get<Union::n>(), "bad access");
+
+  // set<tag>(...) overwrites the content with a new tag
+  one_two_three.set<Union::s>("123");
+  EXPECT_EQ(one_two_three, std::string("123"));
+
+  // Or, you can simply assign a new value.
+  // note that this works only if the target type is unique
+  one_two_three = std::vector<std::string>{"1", "2", "3"};
+  EXPECT_EQ(Union::ss, one_two_three.getTag());
+}
+
+TEST_F(AidlTest, UnionDefaultConstructorInitializeWithFirstMember) {
+  EXPECT_EQ(Union::make<Union::ns>(), Union());  // int[] ns
+  EXPECT_EQ(EnumUnion::make<EnumUnion::intEnum>(IntEnum::FOO),
+            EnumUnion());  // IntEnum intEnum = IntEnum.FOO
+}
+
+TEST_F(AidlTest, StructuredParcelableEquality) {
+  // TODO: break up equality tests, these are hard to read, because you need to
+  // keep the state of the parcelables in mind
+  StructuredParcelable parcelable1;
+  StructuredParcelable parcelable2;
+
+  parcelable1.f = 11;
+  parcelable2.f = 11;
+
+  service->FillOutStructuredParcelable(&parcelable1);
+  service->FillOutStructuredParcelable(&parcelable2);
+
+  sp<INamedCallback> callback1;
+  sp<INamedCallback> callback2;
+  service->GetOtherTestService(String16("callback1"), &callback1);
+  service->GetOtherTestService(String16("callback2"), &callback2);
+
+  parcelable1.ibinder = IInterface::asBinder(callback1);
+  parcelable2.ibinder = IInterface::asBinder(callback1);
+
+  EXPECT_EQ(parcelable1, parcelable2);
+
+  parcelable1.f = 0;
+  EXPECT_LT(parcelable1, parcelable2);
+  parcelable1.f = 11;
+
+  parcelable1.shouldBeJerry = "Jarry";
+  EXPECT_LT(parcelable1, parcelable2);
+  parcelable1.shouldBeJerry = "Jerry";
+
+  parcelable2.shouldContainThreeFs = {};
+  EXPECT_GT(parcelable1, parcelable2);
+  parcelable2.shouldContainThreeFs = {parcelable2.f, parcelable2.f, parcelable2.f};
+
+  parcelable2.shouldBeIntBar = IntEnum::FOO;
+  EXPECT_GT(parcelable1, parcelable2);
+  parcelable2.shouldBeIntBar = IntEnum::BAR;
+
+  parcelable2.ibinder = IInterface::asBinder(callback2);
+  EXPECT_NE(parcelable1, parcelable2);
+}
+
+TEST_F(AidlTest, ConfirmStructuredParcelables) {
+  constexpr int kDesiredValue = 23;
+
+  StructuredParcelable parcelable;
+  parcelable.f = kDesiredValue;
+
+  EXPECT_EQ(parcelable.stringDefaultsToFoo, String16("foo"));
+  EXPECT_EQ(parcelable.byteDefaultsToFour, 4);
+  EXPECT_EQ(parcelable.intDefaultsToFive, 5);
+  EXPECT_EQ(parcelable.longDefaultsToNegativeSeven, -7);
+  EXPECT_EQ(parcelable.booleanDefaultsToTrue, true);
+  EXPECT_EQ(parcelable.charDefaultsToC, 'C');
+  EXPECT_TRUE(parcelable.floatDefaultsToPi == 3.14f) << parcelable.floatDefaultsToPi;
+  EXPECT_TRUE(parcelable.doubleWithDefault == -3.14e17) << parcelable.doubleWithDefault;
+
+  EXPECT_EQ(parcelable.boolDefault, false);
+  EXPECT_EQ(parcelable.byteDefault, 0);
+  EXPECT_EQ(parcelable.intDefault, 0);
+  EXPECT_EQ(parcelable.longDefault, 0);
+  EXPECT_EQ(parcelable.floatDefault, 0.0f);
+  EXPECT_EQ(parcelable.doubleDefault, 0.0);
+
+  ASSERT_EQ(parcelable.arrayDefaultsTo123.size(), 3u);
+  EXPECT_EQ(parcelable.arrayDefaultsTo123[0], 1);
+  EXPECT_EQ(parcelable.arrayDefaultsTo123[1], 2);
+  EXPECT_EQ(parcelable.arrayDefaultsTo123[2], 3);
+  EXPECT_TRUE(parcelable.arrayDefaultsToEmpty.empty());
+
+  EXPECT_EQ(parcelable.defaultWithFoo, IntEnum::FOO);
+
+  service->FillOutStructuredParcelable(&parcelable);
+
+  ASSERT_EQ(parcelable.shouldContainThreeFs.size(), 3u);
+  EXPECT_EQ(parcelable.shouldContainThreeFs[0], kDesiredValue);
+  EXPECT_EQ(parcelable.shouldContainThreeFs[1], kDesiredValue);
+  EXPECT_EQ(parcelable.shouldContainThreeFs[2], kDesiredValue);
+
+  EXPECT_EQ(parcelable.shouldBeJerry, "Jerry");
+  EXPECT_EQ(parcelable.int32_min, INT32_MIN);
+  EXPECT_EQ(parcelable.int32_max, INT32_MAX);
+  EXPECT_EQ(parcelable.int64_max, INT64_MAX);
+  EXPECT_EQ(parcelable.hexInt32_neg_1, -1);
+
+  for (size_t ndx = 0; ndx < parcelable.int8_1.size(); ndx++) {
+    EXPECT_EQ(parcelable.int8_1[ndx], 1) << ndx;
+  }
+
+  for (size_t ndx = 0; ndx < parcelable.int32_1.size(); ndx++) {
+    EXPECT_EQ(parcelable.int32_1[ndx], 1) << ndx;
+  }
+
+  for (size_t ndx = 0; ndx < parcelable.int64_1.size(); ndx++) {
+    EXPECT_EQ(parcelable.int64_1[ndx], 1) << ndx;
+  }
+
+  EXPECT_EQ(parcelable.hexInt32_pos_1, 1);
+  EXPECT_EQ(parcelable.hexInt64_pos_1, 1);
+
+  EXPECT_EQ(static_cast<int>(parcelable.const_exprs_1), 1);
+  EXPECT_EQ(static_cast<int>(parcelable.const_exprs_2), 1);
+  EXPECT_EQ(static_cast<int>(parcelable.const_exprs_3), 1);
+  EXPECT_EQ(static_cast<int>(parcelable.const_exprs_4), 1);
+  EXPECT_EQ(static_cast<int>(parcelable.const_exprs_5), 1);
+  EXPECT_EQ(static_cast<int>(parcelable.const_exprs_6), 1);
+  EXPECT_EQ(static_cast<int>(parcelable.const_exprs_7), 1);
+  EXPECT_EQ(static_cast<int>(parcelable.const_exprs_8), 1);
+  EXPECT_EQ(static_cast<int>(parcelable.const_exprs_9), 1);
+  EXPECT_EQ(static_cast<int>(parcelable.const_exprs_10), 1);
+
+  EXPECT_EQ(parcelable.addString1, "hello world!");
+  EXPECT_EQ(parcelable.addString2, "The quick brown fox jumps over the lazy dog.");
+
+  EXPECT_EQ(StructuredParcelable::BIT0 | StructuredParcelable::BIT2,
+            parcelable.shouldSetBit0AndBit2);
+
+  EXPECT_EQ(parcelable.u->get<Union::ns>(), vector<int32_t>({1, 2, 3}));
+  EXPECT_EQ(parcelable.shouldBeConstS1->get<Union::s>(), Union::S1());
+}
+
+TEST_F(AidlTest, EmptyParcelableHolder) {
+  using namespace android::aidl::tests::extension;
+  android::Parcel parcel;
+  {
+    ExtendableParcelable ep;
+    ep.writeToParcel(&parcel);
+    std::shared_ptr<MyExt> emptyExt;
+    ep.ext.getParcelable(&emptyExt);
+    EXPECT_FALSE(emptyExt);
+  }
+  {
+    parcel.setDataPosition(0);
+    ExtendableParcelable ep;
+    ep.readFromParcel(&parcel);
+    std::shared_ptr<MyExt> emptyExt;
+    ep.ext.getParcelable(&emptyExt);
+    EXPECT_FALSE(emptyExt);
+  }
+}
+
+TEST_F(AidlTest, ParcelableHolderEqualityOperator) {
+  auto ph1 = android::os::ParcelableHolder(android::Parcelable::Stability::STABILITY_LOCAL);
+  auto ph2 = android::os::ParcelableHolder(android::Parcelable::Stability::STABILITY_LOCAL);
+  auto ph3 = android::os::ParcelableHolder(android::Parcelable::Stability::STABILITY_LOCAL);
+  auto ptr1 = std::make_shared<MyExt>();
+  auto ptr2 = std::make_shared<MyExt>();
+  ptr1->a = 1;
+  ptr1->b = "a";
+  ptr2->a = 1;
+  ptr2->b = "a";
+
+  ph1.setParcelable(ptr1);
+  ph2.setParcelable(ptr1);
+  ph3.setParcelable(ptr2);
+
+  // ParcelableHolder always uses its address as a comparison criterion.
+  EXPECT_TRUE(ph1 != ph2);
+  EXPECT_TRUE(ph2 != ph3);
+  EXPECT_TRUE(ph1 == ph1);
+  EXPECT_TRUE(ph2 == ph2);
+  EXPECT_TRUE(ph3 == ph3);
+
+  android::Parcel parcel;
+  ph1.writeToParcel(&parcel);
+  ph2.writeToParcel(&parcel);
+  ph3.writeToParcel(&parcel);
+  parcel.setDataPosition(0);
+
+  ph1.readFromParcel(&parcel);
+  ph2.readFromParcel(&parcel);
+  ph3.readFromParcel(&parcel);
+
+  // ParcelableHolder always uses its address as a comparison criterion.
+  EXPECT_TRUE(ph1 != ph2);
+  EXPECT_TRUE(ph2 != ph3);
+  EXPECT_TRUE(ph1 == ph1);
+  EXPECT_TRUE(ph2 == ph2);
+  EXPECT_TRUE(ph3 == ph3);
+}
+
+TEST_F(AidlTest, NativeExtednableParcelable) {
+  using namespace android::aidl::tests::extension;
+  MyExt ext;
+  ext.a = 42;
+  ext.b = "EXT";
+
+  MyExt2 ext2;
+  ext2.a = 42;
+  ext2.b.a = 24;
+  ext2.b.b = "INEXT";
+  ext2.c = "EXT2";
+  android::Parcel parcel;
+  {
+    ExtendableParcelable ep;
+    ep.a = 1;
+    ep.b = "a";
+    ep.c = 42L;
+
+    EXPECT_TRUE(ep.ext.setParcelable(ext) == android::OK);
+    EXPECT_TRUE(ep.ext2.setParcelable(ext2) == android::OK);
+
+    std::shared_ptr<MyExtLike> extLike;
+    ep.ext.getParcelable(&extLike);
+    EXPECT_FALSE(extLike) << "The extension type must be MyExt, so it has to fail even though "
+                             "MyExtLike has the same structure as MyExt.";
+
+    std::shared_ptr<MyExt> actualExt;
+    ep.ext.getParcelable(&actualExt);
+    std::shared_ptr<MyExt2> actualExt2;
+    ep.ext2.getParcelable(&actualExt2);
+
+    EXPECT_TRUE(actualExt);
+    EXPECT_TRUE(actualExt2);
+
+    EXPECT_EQ(ext, *actualExt);
+    EXPECT_EQ(ext2, *actualExt2);
+
+    ep.writeToParcel(&parcel);
+  }
+
+  parcel.setDataPosition(0);
+  {
+    ExtendableParcelable ep;
+    ep.readFromParcel(&parcel);
+
+    std::shared_ptr<MyExtLike> extLike;
+    ep.ext.getParcelable(&extLike);
+    EXPECT_FALSE(extLike) << "The extension type must be MyExt, so it has to fail even though "
+                             "MyExtLike has the same structure as MyExt.";
+
+    std::shared_ptr<MyExt> actualExt;
+    ep.ext.getParcelable(&actualExt);
+    std::shared_ptr<MyExt2> actualExt2;
+    ep.ext2.getParcelable(&actualExt2);
+
+    std::shared_ptr<MyExt> emptyExt;
+    ep.ext2.getParcelable(&emptyExt);
+    EXPECT_FALSE(emptyExt);
+
+    EXPECT_TRUE(actualExt);
+    EXPECT_TRUE(actualExt2);
+
+    EXPECT_EQ(ext, *actualExt);
+    EXPECT_EQ(ext2, *actualExt2);
+  }
+}
+
+TEST_F(AidlTest, ParcelableToString) {
+  ParcelableForToString p;
+  p.intValue = 10;
+  p.intArray = {20, 30};
+  p.longValue = 100L;
+  p.longArray = {200L, 300L};
+  p.doubleValue = 3.14;
+  p.doubleArray = {1.1, 1.2};
+  p.floatValue = 3.14f;
+  p.floatArray = {1.1f, 1.2f};
+  p.byteValue = 3;
+  p.byteArray = {5, 6};
+  p.booleanValue = true;
+  p.booleanArray = {true, false};
+  p.stringValue = String16("this is a string");
+  p.stringArray = {String16("hello"), String16("world")};
+  p.stringList = {String16("alice"), String16("bob")};
+  OtherParcelableForToString op;
+  op.field = String16("other");
+  p.parcelableValue = op;
+  p.parcelableArray = {op, op};
+  p.enumValue = IntEnum::FOO;
+  p.enumArray = {IntEnum::FOO, IntEnum::BAR};
+  // p.nullArray = null;
+  // p.nullList = null;
+  GenericStructuredParcelable<int32_t, StructuredParcelable, IntEnum> gen;
+  gen.a = 1;
+  gen.b = 2;
+  p.parcelableGeneric = gen;
+  p.unionValue = Union(std::vector<std::string>{"union", "value"});
+
+  const string expected =
+      "ParcelableForToString{"
+      "intValue: 10, "
+      "intArray: [20, 30], "
+      "longValue: 100, "
+      "longArray: [200, 300], "
+      "doubleValue: 3.140000, "
+      "doubleArray: [1.100000, 1.200000], "
+      "floatValue: 3.140000, "
+      "floatArray: [1.100000, 1.200000], "
+      "byteValue: 3, "
+      "byteArray: [5, 6], "
+      "booleanValue: true, "
+      "booleanArray: [true, false], "
+      "stringValue: this is a string, "
+      "stringArray: [hello, world], "
+      "stringList: [alice, bob], "
+      "parcelableValue: OtherParcelableForToString{field: other}, "
+      "parcelableArray: ["
+      "OtherParcelableForToString{field: other}, "
+      "OtherParcelableForToString{field: other}], "
+      "enumValue: FOO, "
+      "enumArray: [FOO, BAR], "
+      "nullArray: [], "
+      "nullList: [], "
+      "parcelableGeneric: GenericStructuredParcelable{a: 1, b: 2}, "
+      "unionValue: Union{ss: [union, value]}"
+      "}";
+
+  EXPECT_EQ(expected, p.toString());
+}
+
+TEST_F(AidlTest, ReverseRecursiveList) {
+  std::unique_ptr<RecursiveList> head;
+  for (int i = 0; i < 10; i++) {
+    auto node = std::make_unique<RecursiveList>();
+    node->value = i;
+    node->next = std::move(head);
+    head = std::move(node);
+  }
+  // head: [9, 8, ... 0]
+
+  RecursiveList reversed;
+  auto status = service->ReverseList(*head, &reversed);
+  ASSERT_TRUE(status.isOk()) << status.toString8();
+
+  // reversed should be [0, 1, .. 9]
+  RecursiveList* cur = &reversed;
+  for (int i = 0; i < 10; i++) {
+    EXPECT_EQ(i, cur->value);
+    cur = cur->next.get();
+  }
+  EXPECT_EQ(nullptr, cur);
+}
+
+TEST_F(AidlTest, GetUnionTags) {
+  std::vector<Union> unions;
+  std::vector<Union::Tag> tags;
+  // test empty
+  auto status = service->GetUnionTags(unions, &tags);
+  ASSERT_TRUE(status.isOk()) << status.toString8();
+  EXPECT_EQ(tags, (std::vector<Union::Tag>{}));
+  // test non-empty
+  unions.push_back(Union::make<Union::n>());
+  unions.push_back(Union::make<Union::ns>());
+  status = service->GetUnionTags(unions, &tags);
+  ASSERT_TRUE(status.isOk()) << status.toString8();
+  EXPECT_EQ(tags, (std::vector<Union::Tag>{Union::n, Union::ns}));
+}
+
+TEST_F(AidlTest, FixedSizeArray) {
+  android::Parcel parcel;
+
+  FixedSizeArrayExample p;
+  p.byteMatrix[0][0] = 0;
+  p.byteMatrix[0][1] = 1;
+  p.byteMatrix[1][0] = 2;
+  p.byteMatrix[1][1] = 3;
+  p.floatMatrix[0][0] = 0.f;
+  p.floatMatrix[0][1] = 1.f;
+  p.floatMatrix[1][0] = 2.f;
+  p.floatMatrix[1][1] = 3.f;
+  EXPECT_EQ(OK, p.writeToParcel(&parcel));
+
+  parcel.setDataPosition(0);
+
+  FixedSizeArrayExample q;
+  EXPECT_EQ(OK, q.readFromParcel(&parcel));
+  EXPECT_EQ(p, q);
+}
+
+TEST_F(AidlTest, FixedSizeArrayWithValuesAtNullableFields) {
+  android::Parcel parcel;
+
+  FixedSizeArrayExample p;
+  p.boolNullableArray = std::array<bool, 2>{true, false};
+  p.byteNullableArray = std::array<uint8_t, 2>{42, 0};
+  p.stringNullableArray = std::array<std::optional<std::string>, 2>{"hello", "world"};
+
+  p.boolNullableMatrix.emplace();
+  p.boolNullableMatrix->at(0) = std::array<bool, 2>{true, false};
+  p.byteNullableMatrix.emplace();
+  p.byteNullableMatrix->at(0) = std::array<uint8_t, 2>{42, 0};
+  p.stringNullableMatrix.emplace();
+  p.stringNullableMatrix->at(0) = std::array<std::optional<std::string>, 2>{"hello", "world"};
+
+  EXPECT_EQ(OK, p.writeToParcel(&parcel));
+
+  parcel.setDataPosition(0);
+
+  FixedSizeArrayExample q;
+  EXPECT_EQ(OK, q.readFromParcel(&parcel));
+  EXPECT_EQ(p, q);
+}
+
+TEST_F(AidlTest, FixedSizeArrayOfBytesShouldBePacked) {
+  android::Parcel parcel;
+
+  std::array<std::array<uint8_t, 3>, 2> byte_array;
+  byte_array[0] = {1, 2, 3};
+  byte_array[1] = {4, 5, 6};
+  EXPECT_EQ(OK, parcel.writeFixedArray(byte_array));
+
+  parcel.setDataPosition(0);
+
+  int32_t len;
+  EXPECT_EQ(OK, parcel.readInt32(&len));
+  EXPECT_EQ(2, len);
+  std::vector<uint8_t> byte_vector;
+  EXPECT_EQ(OK, parcel.readByteVector(&byte_vector));
+  EXPECT_EQ(byte_vector, (std::vector<uint8_t>{1, 2, 3}));
+  EXPECT_EQ(OK, parcel.readByteVector(&byte_vector));
+  EXPECT_EQ(byte_vector, (std::vector<uint8_t>{4, 5, 6}));
+}
+
+template <typename Service, typename MemFn, typename Input>
+void CheckRepeat(Service service, MemFn fn, Input input) {
+  Input out1, out2;
+  EXPECT_TRUE(std::invoke(fn, service, input, &out1, &out2).isOk());
+  EXPECT_EQ(input, out1);
+  EXPECT_EQ(input, out2);
+}
+
+template <typename T>
+std::array<std::array<T, 3>, 2> Make2dArray(std::initializer_list<T> values) {
+  std::array<std::array<T, 3>, 2> arr = {};
+  auto it = std::begin(values);
+  for (auto& row : arr) {
+    for (auto& el : row) {
+      if (it == std::end(values)) break;
+      el = *it++;
+    }
+  }
+  return arr;
+}
+
+TEST_F(AidlTest, FixedSizeArrayOverBinder) {
+  sp<IRepeatFixedSizeArray> service =
+      android::waitForService<IRepeatFixedSizeArray>(IRepeatFixedSizeArray::descriptor);
+  ASSERT_NE(service, nullptr);
+
+  CheckRepeat(service, &IRepeatFixedSizeArray::RepeatBytes, (std::array<uint8_t, 3>{1, 2, 3}));
+
+  CheckRepeat(service, &IRepeatFixedSizeArray::RepeatInts, (std::array<int32_t, 3>{1, 2, 3}));
+
+  sp<IBinder> binder1 = new BBinder();
+  sp<IBinder> binder2 = new BBinder();
+  sp<IBinder> binder3 = new BBinder();
+  CheckRepeat(service, &IRepeatFixedSizeArray::RepeatBinders,
+              (std::array<sp<IBinder>, 3>{binder1, binder2, binder3}));
+
+  IntParcelable p1, p2, p3;
+  p1.value = 1;
+  p2.value = 2;
+  p3.value = 3;
+  CheckRepeat(service, &IRepeatFixedSizeArray::RepeatParcelables,
+              (std::array<IntParcelable, 3>{p1, p2, p3}));
+
+  CheckRepeat(service, &IRepeatFixedSizeArray::Repeat2dBytes, Make2dArray<uint8_t>({1, 2, 3}));
+
+  CheckRepeat(service, &IRepeatFixedSizeArray::Repeat2dInts, Make2dArray<int32_t>({1, 2, 3}));
+
+  // Not-nullable
+  CheckRepeat(service, &IRepeatFixedSizeArray::Repeat2dBinders,
+              Make2dArray<sp<IBinder>>({binder1, binder2, binder3, binder1, binder2, binder3}));
+
+  CheckRepeat(service, &IRepeatFixedSizeArray::Repeat2dParcelables,
+              Make2dArray<IntParcelable>({p1, p2, p3}));
+}
diff --git a/tests/aidl_test_client_primitives.cpp b/tests/aidl_test_client_primitives.cpp
new file mode 100644
index 0000000..1544f3b
--- /dev/null
+++ b/tests/aidl_test_client_primitives.cpp
@@ -0,0 +1,367 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <vector>
+
+#include <utils/String16.h>
+#include <utils/String8.h>
+
+#include "android/aidl/tests/ByteEnum.h"
+#include "android/aidl/tests/INamedCallback.h"
+#include "android/aidl/tests/IntEnum.h"
+#include "android/aidl/tests/LongEnum.h"
+
+#include "aidl_test_client.h"
+#include "gmock/gmock.h"
+
+using android::IBinder;
+using android::sp;
+using android::String16;
+using android::String8;
+using android::binder::Status;
+
+// generated
+using android::aidl::tests::ByteEnum;
+using android::aidl::tests::INamedCallback;
+using android::aidl::tests::IntEnum;
+using android::aidl::tests::ITestService;
+using android::aidl::tests::LongEnum;
+
+using testing::Eq;
+
+struct AidlPrimitiveTest : public AidlTest {
+  template <typename T, typename U, typename V>
+  void DoTest(Status (ITestService::*func)(T, U*), V input) {
+    U repeated;
+    auto status = (*service.*func)(input, &repeated);
+    ASSERT_TRUE(status.isOk()) << status;
+    ASSERT_THAT(repeated, Eq(input));
+  }
+
+  template <typename T>
+  void DoTest(Status (ITestService::*func)(const std::vector<T>&, std::vector<T>*, std::vector<T>*),
+              const std::vector<T>& input) {
+    // must be preallocated for Java servers
+    std::vector<T> repeated(input.size());
+    std::vector<T> reversed;
+    auto status = (*service.*func)(input, &repeated, &reversed);
+    ASSERT_TRUE(status.isOk()) << status;
+    ASSERT_THAT(repeated, Eq(input));
+
+    std::vector<T> reversed_input(input);
+    std::reverse(reversed_input.begin(), reversed_input.end());
+    ASSERT_THAT(reversed, Eq(reversed_input));
+  }
+};
+
+TEST_F(AidlPrimitiveTest, aBoolean) {
+  DoTest(&ITestService::RepeatBoolean, true);
+}
+
+TEST_F(AidlPrimitiveTest, aByte) {
+  DoTest(&ITestService::RepeatByte, int8_t{-128});
+}
+
+TEST_F(AidlPrimitiveTest, aChar) {
+  DoTest(&ITestService::RepeatChar, char16_t{'A'});
+}
+
+TEST_F(AidlPrimitiveTest, aInt) {
+  DoTest(&ITestService::RepeatInt, int32_t{1 << 30});
+}
+
+TEST_F(AidlPrimitiveTest, aLong) {
+  DoTest(&ITestService::RepeatLong, int64_t{1LL << 60});
+}
+
+TEST_F(AidlPrimitiveTest, aFloat) {
+  DoTest(&ITestService::RepeatFloat, float{1.0f / 3.0f});
+}
+
+TEST_F(AidlPrimitiveTest, aDouble) {
+  DoTest(&ITestService::RepeatDouble, double{1.0 / 3.0});
+}
+
+TEST_F(AidlPrimitiveTest, byteConstants) {
+  constexpr int8_t consts[] = {ITestService::BYTE_CONSTANT};
+  for (auto sent : consts) {
+    DoTest(&ITestService::RepeatByte, sent);
+  }
+}
+
+TEST_F(AidlPrimitiveTest, intConstants) {
+  constexpr int32_t consts[] = {
+      ITestService::CONSTANT,   ITestService::CONSTANT2,  ITestService::CONSTANT3,
+      ITestService::CONSTANT4,  ITestService::CONSTANT5,  ITestService::CONSTANT6,
+      ITestService::CONSTANT7,  ITestService::CONSTANT8,  ITestService::CONSTANT9,
+      ITestService::CONSTANT10, ITestService::CONSTANT11, ITestService::CONSTANT12};
+  for (auto sent : consts) {
+    DoTest(&ITestService::RepeatInt, sent);
+  }
+}
+
+TEST_F(AidlPrimitiveTest, longConstants) {
+  constexpr int64_t consts[] = {ITestService::LONG_CONSTANT};
+  for (auto sent : consts) {
+    DoTest(&ITestService::RepeatLong, sent);
+  }
+}
+
+TEST_F(AidlPrimitiveTest, floatConstants) {
+  constexpr float consts[] = {
+      ITestService::FLOAT_CONSTANT,  ITestService::FLOAT_CONSTANT2, ITestService::FLOAT_CONSTANT3,
+      ITestService::FLOAT_CONSTANT4, ITestService::FLOAT_CONSTANT5, ITestService::FLOAT_CONSTANT6,
+      ITestService::FLOAT_CONSTANT7,
+  };
+  for (auto sent : consts) {
+    DoTest(&ITestService::RepeatFloat, sent);
+  }
+}
+
+TEST_F(AidlPrimitiveTest, doubleConstants) {
+  constexpr double consts[] = {
+      ITestService::DOUBLE_CONSTANT,  ITestService::DOUBLE_CONSTANT2,
+      ITestService::DOUBLE_CONSTANT3, ITestService::DOUBLE_CONSTANT4,
+      ITestService::DOUBLE_CONSTANT5, ITestService::DOUBLE_CONSTANT6,
+      ITestService::DOUBLE_CONSTANT7, ITestService::DOUBLE_CONSTANT8,
+      ITestService::DOUBLE_CONSTANT9,
+  };
+  for (auto sent : consts) {
+    DoTest(&ITestService::RepeatDouble, sent);
+  }
+}
+
+TEST_F(AidlPrimitiveTest, strings) {
+  std::vector<String16> strings = {
+      String16("Deliver us from evil."), String16(), String16("\0\0", 2),
+      // This is actually two unicode code points:
+      //   U+10437: The 'small letter yee' character in the deseret alphabet
+      //   U+20AC: A euro sign
+      String16("\xD8\x01\xDC\x37\x20\xAC"), ITestService::STRING_CONSTANT(),
+      ITestService::STRING_CONSTANT2()};
+  for (auto sent : strings) {
+    DoTest(&ITestService::RepeatString, sent);
+  }
+}
+
+TEST_F(AidlPrimitiveTest, booleanArray) {
+  DoTest(&ITestService::ReverseBoolean, {true, false, false});
+}
+
+TEST_F(AidlPrimitiveTest, byteArrvay) {
+  DoTest(&ITestService::ReverseByte, {uint8_t{255}, uint8_t{0}, uint8_t{127}});
+}
+
+TEST_F(AidlPrimitiveTest, charArray) {
+  DoTest(&ITestService::ReverseChar, {char16_t{'A'}, char16_t{'B'}, char16_t{'C'}});
+}
+
+TEST_F(AidlPrimitiveTest, intArray) {
+  DoTest(&ITestService::ReverseInt, {1, 2, 3});
+}
+
+TEST_F(AidlPrimitiveTest, longArrayr) {
+  DoTest(&ITestService::ReverseLong, {-1LL, 0LL, int64_t{1LL << 60}});
+}
+
+TEST_F(AidlPrimitiveTest, floatArrays) {
+  DoTest(&ITestService::ReverseFloat, {-0.3f, -0.7f, 8.0f});
+}
+
+TEST_F(AidlPrimitiveTest, doubleArray) {
+  DoTest(&ITestService::ReverseDouble, {1.0 / 3.0, 1.0 / 7.0, 42.0});
+}
+
+TEST_F(AidlPrimitiveTest, stringArray) {
+  DoTest(&ITestService::ReverseString, {String16{"f"}, String16{"a"}, String16{"b"}});
+}
+
+TEST_F(AidlPrimitiveTest, byteEnumArray) {
+  DoTest(&ITestService::ReverseByteEnum, {ByteEnum::FOO, ByteEnum::BAR, ByteEnum::BAR});
+}
+
+TEST_F(AidlPrimitiveTest, byteEnumArray2) {
+  DoTest(&ITestService::ReverseByteEnum, {std::begin(::android::enum_range<ByteEnum>()),
+                                          std::end(::android::enum_range<ByteEnum>())});
+}
+
+TEST_F(AidlPrimitiveTest, intEnumArray) {
+  DoTest(&ITestService::ReverseIntEnum, {IntEnum::FOO, IntEnum::BAR, IntEnum::BAR});
+}
+
+TEST_F(AidlPrimitiveTest, longEnumArray) {
+  DoTest(&ITestService::ReverseLongEnum, {LongEnum::FOO, LongEnum::BAR, LongEnum::BAR});
+}
+
+TEST_F(AidlPrimitiveTest, stringList) {
+  DoTest(&ITestService::ReverseStringList, {String16{"f"}, String16{"a"}, String16{"b"}});
+}
+
+TEST_F(AidlPrimitiveTest, binderArray) {
+  std::vector<String16> names = {String16{"Larry"}, String16{"Curly"}, String16{"Moe"}};
+
+  std::vector<sp<IBinder>> input;
+  for (int i = 0; i < 3; i++) {
+    sp<INamedCallback> got;
+    auto status = service->GetOtherTestService(names[i], &got);
+    ASSERT_TRUE(status.isOk());
+    input.push_back(INamedCallback::asBinder(got));
+  }
+  {
+    std::vector<sp<INamedCallback>> got;
+    auto status = service->GetInterfaceArray(names, &got);
+    ASSERT_TRUE(status.isOk());
+    bool verified = false;
+    status = service->VerifyNamesWithInterfaceArray(got, names, &verified);
+    ASSERT_TRUE(status.isOk());
+    ASSERT_TRUE(verified);
+    for (int i = 0; i < 3; i++) {
+      String16 name;
+      ASSERT_TRUE(got[i]->GetName(&name).isOk());
+      ASSERT_THAT(name, Eq(names[i]));
+    }
+  }
+  {
+    std::vector<std::optional<String16>> names = {String16{"Larry"}, std::nullopt, String16{"Moe"}};
+    std::optional<std::vector<sp<INamedCallback>>> got;
+    auto status = service->GetNullableInterfaceArray(names, &got);
+    ASSERT_TRUE(status.isOk());
+    bool verified = false;
+    status = service->VerifyNamesWithNullableInterfaceArray(got, names, &verified);
+    ASSERT_TRUE(status.isOk());
+    ASSERT_TRUE(verified);
+    ASSERT_TRUE(got.has_value());
+    for (int i = 0; i < 3; i++) {
+      if (names[i].has_value()) {
+        ASSERT_NE(got->at(i).get(), nullptr);
+        String16 name;
+        ASSERT_TRUE(got->at(i)->GetName(&name).isOk());
+        ASSERT_THAT(name, Eq(names[i].value()));
+      } else {
+        ASSERT_EQ(got->at(i).get(), nullptr);
+      }
+    }
+  }
+  {
+    std::vector<std::optional<String16>> names = {String16{"Larry"}, std::nullopt, String16{"Moe"}};
+    std::optional<std::vector<sp<INamedCallback>>> got;
+    auto status = service->GetInterfaceList(names, &got);
+    ASSERT_TRUE(status.isOk());
+    bool verified = false;
+    status = service->VerifyNamesWithInterfaceList(got, names, &verified);
+    ASSERT_TRUE(status.isOk());
+    ASSERT_TRUE(verified);
+    ASSERT_TRUE(got.has_value());
+    for (int i = 0; i < 3; i++) {
+      if (names[i].has_value()) {
+        ASSERT_NE(got->at(i).get(), nullptr);
+        String16 name;
+        ASSERT_TRUE(got->at(i)->GetName(&name).isOk());
+        ASSERT_THAT(name, Eq(names[i].value()));
+      } else {
+        ASSERT_EQ(got->at(i).get(), nullptr);
+      }
+    }
+  }
+  if (cpp_java_tests) {
+    std::vector<sp<IBinder>> output;
+    std::vector<sp<IBinder>> reversed;
+    auto status = cpp_java_tests->ReverseNamedCallbackList(input, &output, &reversed);
+    ASSERT_TRUE(status.isOk());
+    ASSERT_THAT(output.size(), Eq(3u));
+    ASSERT_THAT(reversed.size(), Eq(3u));
+
+    for (int i = 0; i < 3; i++) {
+      String16 ret;
+      sp<INamedCallback> named_callback = android::interface_cast<INamedCallback>(output[i]);
+      auto status = named_callback->GetName(&ret);
+      ASSERT_TRUE(status.isOk());
+      ASSERT_THAT(ret, Eq(names[i]));
+    }
+
+    for (int i = 0; i < 3; i++) {
+      String16 ret;
+      sp<INamedCallback> named_callback = android::interface_cast<INamedCallback>(reversed[i]);
+      auto status = named_callback->GetName(&ret);
+      ASSERT_TRUE(status.isOk());
+      ASSERT_THAT(ret, Eq(names[2 - i]));
+    }
+  }
+}
+
+TEST_F(AidlPrimitiveTest, constantExpressions) {
+  EXPECT_THAT(ITestService::A1, Eq(1));
+  EXPECT_THAT(ITestService::A2, Eq(1));
+  EXPECT_THAT(ITestService::A3, Eq(1));
+  EXPECT_THAT(ITestService::A4, Eq(1));
+  EXPECT_THAT(ITestService::A5, Eq(1));
+  EXPECT_THAT(ITestService::A6, Eq(1));
+  EXPECT_THAT(ITestService::A7, Eq(1));
+  EXPECT_THAT(ITestService::A8, Eq(1));
+  EXPECT_THAT(ITestService::A9, Eq(1));
+  EXPECT_THAT(ITestService::A10, Eq(1));
+  EXPECT_THAT(ITestService::A11, Eq(1));
+  EXPECT_THAT(ITestService::A12, Eq(1));
+  EXPECT_THAT(ITestService::A13, Eq(1));
+  EXPECT_THAT(ITestService::A14, Eq(1));
+  EXPECT_THAT(ITestService::A15, Eq(1));
+  EXPECT_THAT(ITestService::A16, Eq(1));
+  EXPECT_THAT(ITestService::A17, Eq(1));
+  EXPECT_THAT(ITestService::A18, Eq(1));
+  EXPECT_THAT(ITestService::A19, Eq(1));
+  EXPECT_THAT(ITestService::A20, Eq(1));
+  EXPECT_THAT(ITestService::A21, Eq(1));
+  EXPECT_THAT(ITestService::A22, Eq(1));
+  EXPECT_THAT(ITestService::A23, Eq(1));
+  EXPECT_THAT(ITestService::A24, Eq(1));
+  EXPECT_THAT(ITestService::A25, Eq(1));
+  EXPECT_THAT(ITestService::A26, Eq(1));
+  EXPECT_THAT(ITestService::A27, Eq(1));
+  EXPECT_THAT(ITestService::A28, Eq(1));
+  EXPECT_THAT(ITestService::A29, Eq(1));
+  EXPECT_THAT(ITestService::A30, Eq(1));
+  EXPECT_THAT(ITestService::A31, Eq(1));
+  EXPECT_THAT(ITestService::A32, Eq(1));
+  EXPECT_THAT(ITestService::A33, Eq(1));
+  EXPECT_THAT(ITestService::A34, Eq(1));
+  EXPECT_THAT(ITestService::A35, Eq(1));
+  EXPECT_THAT(ITestService::A36, Eq(1));
+  EXPECT_THAT(ITestService::A37, Eq(1));
+  EXPECT_THAT(ITestService::A38, Eq(1));
+  EXPECT_THAT(ITestService::A39, Eq(1));
+  EXPECT_THAT(ITestService::A40, Eq(1));
+  EXPECT_THAT(ITestService::A41, Eq(1));
+  EXPECT_THAT(ITestService::A42, Eq(1));
+  EXPECT_THAT(ITestService::A43, Eq(1));
+  EXPECT_THAT(ITestService::A44, Eq(1));
+  EXPECT_THAT(ITestService::A45, Eq(1));
+  EXPECT_THAT(ITestService::A46, Eq(1));
+  EXPECT_THAT(ITestService::A47, Eq(1));
+  EXPECT_THAT(ITestService::A48, Eq(1));
+  EXPECT_THAT(ITestService::A49, Eq(1));
+  EXPECT_THAT(ITestService::A50, Eq(1));
+  EXPECT_THAT(ITestService::A51, Eq(1));
+  EXPECT_THAT(ITestService::A52, Eq(1));
+  EXPECT_THAT(ITestService::A53, Eq(1));
+  EXPECT_THAT(ITestService::A54, Eq(1));
+  EXPECT_THAT(ITestService::A55, Eq(1));
+  EXPECT_THAT(ITestService::A56, Eq(1));
+  EXPECT_THAT(ITestService::A57, Eq(1));
+  EXPECT_THAT(ITestService::FLOAT_CONSTANT4, Eq(2.2f));
+  EXPECT_THAT(ITestService::FLOAT_CONSTANT5, Eq(-2.2f));
+  EXPECT_THAT(ITestService::DOUBLE_CONSTANT4, Eq(2.2));
+  EXPECT_THAT(ITestService::DOUBLE_CONSTANT5, Eq(-2.2));
+}
diff --git a/tests/aidl_test_client_renamed_interface.cpp b/tests/aidl_test_client_renamed_interface.cpp
new file mode 100644
index 0000000..7bb2296
--- /dev/null
+++ b/tests/aidl_test_client_renamed_interface.cpp
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl_test_client.h"
+#include "gmock/gmock.h"
+
+#include <android/aidl/tests/INewName.h>
+#include <android/aidl/tests/IOldName.h>
+
+using android::IInterface;
+using android::String16;
+using android::aidl::tests::INewName;
+using android::aidl::tests::IOldName;
+using testing::Eq;
+
+class RenamedInterfaceTest : public AidlTest {
+ public:
+  void SetUp() override {
+    AidlTest::SetUp();
+
+    ASSERT_TRUE(service->GetOldNameInterface(&oldName).isOk());
+    ASSERT_TRUE(service->GetNewNameInterface(&newName).isOk());
+  }
+
+  sp<IOldName> oldName;
+  sp<INewName> newName;
+};
+
+TEST_F(RenamedInterfaceTest, oldAsOld) {
+  ASSERT_THAT(String16("android.aidl.tests.IOldName"), oldName->getInterfaceDescriptor());
+  String16 realName;
+  ASSERT_TRUE(oldName->RealName(&realName).isOk());
+  ASSERT_THAT(String16("OldName"), realName);
+}
+
+TEST_F(RenamedInterfaceTest, newAsNew) {
+  ASSERT_THAT(String16("android.aidl.tests.IOldName"), newName->getInterfaceDescriptor());
+  String16 realName;
+  ASSERT_TRUE(newName->RealName(&realName).isOk());
+  ASSERT_THAT(String16("NewName"), realName);
+}
+
+TEST_F(RenamedInterfaceTest, oldAsNew) {
+  sp<INewName> oldAsNew = INewName::asInterface(IInterface::asBinder(oldName));
+  ASSERT_THAT(String16("android.aidl.tests.IOldName"), oldAsNew->getInterfaceDescriptor());
+  String16 realName;
+  ASSERT_TRUE(oldAsNew->RealName(&realName).isOk());
+  ASSERT_THAT(String16("OldName"), realName);
+}
+
+TEST_F(RenamedInterfaceTest, newAsOld) {
+  sp<IOldName> newAsOld = IOldName::asInterface(IInterface::asBinder(newName));
+  ASSERT_THAT(String16("android.aidl.tests.IOldName"), newAsOld->getInterfaceDescriptor());
+  String16 realName;
+  ASSERT_TRUE(newAsOld->RealName(&realName).isOk());
+  ASSERT_THAT(String16("NewName"), realName);
+}
diff --git a/tests/aidl_test_client_service_exceptions.cpp b/tests/aidl_test_client_service_exceptions.cpp
new file mode 100644
index 0000000..89dc19c
--- /dev/null
+++ b/tests/aidl_test_client_service_exceptions.cpp
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "aidl_test_client.h"
+#include "gmock/gmock.h"
+
+TEST_F(AidlTest, onewayNoError) {
+  // oneway servers try to return an error
+  auto status = service->TestOneway();
+  EXPECT_TRUE(status.isOk()) << status;
+}
+
+TEST_F(AidlTest, serviceSpecificException) {
+  using testing::Eq;
+
+  for (int32_t i = -1; i < 2; ++i) {
+    auto status = service->ThrowServiceException(i);
+    EXPECT_THAT(status.exceptionCode(), Eq(android::binder::Status::EX_SERVICE_SPECIFIC))
+        << status << " for " << i;
+    EXPECT_THAT(status.serviceSpecificErrorCode(), Eq(i)) << status << " for " << i;
+  }
+}
diff --git a/tests/aidl_test_client_trunk_stable.cpp b/tests/aidl_test_client_trunk_stable.cpp
new file mode 100644
index 0000000..67f32cd
--- /dev/null
+++ b/tests/aidl_test_client_trunk_stable.cpp
@@ -0,0 +1,234 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <binder/IServiceManager.h>
+#include <binder/ProcessState.h>
+#include <gtest/gtest.h>
+#include <utils/String16.h>
+
+#include "aidl_test_client.h"
+
+#ifdef AIDL_USE_UNFROZEN
+constexpr bool kUseUnfrozen = true;
+#else
+constexpr bool kUseUnfrozen = false;
+#endif
+
+using android::OK;
+using android::sp;
+using android::String16;
+using android::aidl::test::trunk::ITrunkStableTest;
+using android::binder::Status;
+using MyParcelable = android::aidl::test::trunk::ITrunkStableTest::MyParcelable;
+#ifdef AIDL_USE_V2_INTERFACE
+using MyOtherParcelable = android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable;
+#endif  // AIDL_USE_V2_INTERFACE
+using MyEnum = android::aidl::test::trunk::ITrunkStableTest::MyEnum;
+using MyUnion = android::aidl::test::trunk::ITrunkStableTest::MyUnion;
+
+class TrunkInterfaceTest : public AidlTest {
+ public:
+  void SetUp() override {
+    android::ProcessState::self()->setThreadPoolMaxThreadCount(1);
+    android::ProcessState::self()->startThreadPool();
+    service = android::waitForService<ITrunkStableTest>(ITrunkStableTest::descriptor);
+    ASSERT_NE(nullptr, service);
+
+    AidlTest::SetUp();
+  }
+
+  sp<ITrunkStableTest> service;
+};
+
+TEST_F(TrunkInterfaceTest, getInterfaceVersion) {
+  // TODO(b/292539129) this should be done with an annotation instead of ifdefs
+  // We have to match on a single char with #if, even though it is
+  // really "enabled"/"disabled"
+  if (kUseUnfrozen) {
+    EXPECT_EQ(2, service->getInterfaceVersion());
+    // Check the local version as well
+#ifdef AIDL_USE_V2_INTERFACE
+    EXPECT_EQ(2, ITrunkStableTest::VERSION);
+#else
+    // linked against V1 explicitly
+    EXPECT_EQ(1, ITrunkStableTest::VERSION);
+#endif
+  } else {
+    EXPECT_EQ(1, service->getInterfaceVersion());
+    // Check the local version as well
+    EXPECT_EQ(1, ITrunkStableTest::VERSION);
+  }
+}
+
+TEST_F(TrunkInterfaceTest, getInterfaceHash) {
+  if (kUseUnfrozen) {
+    EXPECT_EQ("notfrozen", service->getInterfaceHash());
+    // Check the local hash as well
+#ifdef AIDL_USE_V2_INTERFACE
+    EXPECT_EQ("notfrozen", ITrunkStableTest::HASH);
+#else
+    // linked against V1 explicitly
+    EXPECT_EQ("88311b9118fb6fe9eff4a2ca19121de0587f6d5f", ITrunkStableTest::HASH);
+#endif
+  } else {
+    EXPECT_EQ("88311b9118fb6fe9eff4a2ca19121de0587f6d5f", service->getInterfaceHash());
+    // Check the local hash as well
+    EXPECT_EQ("88311b9118fb6fe9eff4a2ca19121de0587f6d5f", ITrunkStableTest::HASH);
+  }
+}
+
+// `c` is a new field that isn't read from the reply parcel
+TEST_F(TrunkInterfaceTest, repeatParcelable) {
+  MyParcelable in, out;
+  in.a = 14;
+  in.b = 15;
+#ifdef AIDL_USE_V2_INTERFACE
+  in.c = 16;
+#endif  // AIDL_USE_V2_INTERFACE
+  auto status = service->repeatParcelable(in, &out);
+  ASSERT_TRUE(status.isOk()) << status;
+  if (kUseUnfrozen) {
+    EXPECT_EQ(in.a, out.a);
+    EXPECT_EQ(in.b, out.b);
+#ifdef AIDL_USE_V2_INTERFACE
+    EXPECT_EQ(in.c, out.c);
+#endif  // AIDL_USE_V2_INTERFACE
+  } else {
+    EXPECT_EQ(in.a, out.a);
+    EXPECT_EQ(in.b, out.b);
+#ifdef AIDL_USE_V2_INTERFACE
+    EXPECT_NE(in.c, out.c);
+    EXPECT_EQ(0, out.c);
+#endif  // AIDL_USE_V2_INTERFACE
+  }
+}
+
+#ifdef AIDL_USE_V2_INTERFACE
+// repeatOtherParcelable is a new API that isn't implemented
+TEST_F(TrunkInterfaceTest, repeatOtherParcelable) {
+  MyOtherParcelable in, out;
+  in.a = 14;
+  in.b = 15;
+
+  auto status = service->repeatOtherParcelable(in, &out);
+  if (kUseUnfrozen) {
+    ASSERT_TRUE(status.isOk()) << status;
+    EXPECT_EQ(in.a, out.a);
+    EXPECT_EQ(in.b, out.b);
+  } else {
+    EXPECT_FALSE(status.isOk()) << status;
+    EXPECT_EQ(::android::UNKNOWN_TRANSACTION, status.transactionError()) << status;
+  }
+}
+#endif  // AIDL_USE_V2_INTERFACE
+
+// enums aren't handled differently.
+TEST_F(TrunkInterfaceTest, repeatEnum) {
+  MyEnum in = MyEnum::TWO;
+  MyEnum out = MyEnum::ZERO;
+
+  auto status = service->repeatEnum(in, &out);
+  ASSERT_TRUE(status.isOk()) << status;
+  EXPECT_EQ(in, out);
+}
+
+// `c` is a new field that causes a failure if used
+// `b` is from V1 and will cause no failure
+TEST_F(TrunkInterfaceTest, repeatUnion) {
+  MyUnion in_ok = MyUnion::make<MyUnion::b>(13);
+  ;
+#ifdef AIDL_USE_V2_INTERFACE
+  MyUnion in_test = MyUnion::make<MyUnion::c>(12);
+  ;
+#endif  // AIDL_USE_V2_INTERFACE
+  MyUnion out;
+
+  auto status = service->repeatUnion(in_ok, &out);
+  ASSERT_TRUE(status.isOk()) << status;
+  EXPECT_EQ(in_ok, out);
+
+#ifdef AIDL_USE_V2_INTERFACE
+  status = service->repeatUnion(in_test, &out);
+  if (kUseUnfrozen) {
+    ASSERT_TRUE(status.isOk()) << status;
+    EXPECT_EQ(in_test, out);
+  } else {
+    ASSERT_FALSE(status.isOk()) << status;
+    EXPECT_NE(in_test, out);
+  }
+#endif  // AIDL_USE_V2_INTERFACE
+}
+
+class MyCallback : public ITrunkStableTest::BnMyCallback {
+ public:
+  MyCallback() {}
+  virtual ~MyCallback() = default;
+
+  Status repeatParcelable(const MyParcelable& input, MyParcelable* _aidl_return) override {
+    *_aidl_return = input;
+    repeatParcelableCalled = true;
+    return Status::ok();
+  }
+  Status repeatEnum(MyEnum input, MyEnum* _aidl_return) override {
+    *_aidl_return = input;
+    repeatEnumCalled = true;
+    return Status::ok();
+  }
+  Status repeatUnion(const MyUnion& input, MyUnion* _aidl_return) override {
+    *_aidl_return = input;
+    repeatUnionCalled = true;
+    return Status::ok();
+  }
+#ifdef AIDL_USE_V2_INTERFACE
+  Status repeatOtherParcelable(const MyOtherParcelable& input,
+                               MyOtherParcelable* _aidl_return) override {
+    *_aidl_return = input;
+    repeatOtherParcelableCalled = true;
+    return Status::ok();
+  }
+#endif  // AIDL_USE_V2_INTERFACE
+  bool repeatParcelableCalled = false;
+  bool repeatEnumCalled = false;
+  bool repeatUnionCalled = false;
+#ifdef AIDL_USE_V2_INTERFACE
+  bool repeatOtherParcelableCalled = false;
+#endif  // AIDL_USE_V2_INTERFACE
+};
+
+// repeatOtherParcelable is new in V2, so it won't be called
+TEST_F(TrunkInterfaceTest, callMyCallback) {
+  sp<MyCallback> cb = sp<MyCallback>::make();
+
+  auto status = service->callMyCallback(cb);
+  ASSERT_TRUE(status.isOk()) << status;
+  if (kUseUnfrozen) {
+    EXPECT_TRUE(cb->repeatParcelableCalled);
+    EXPECT_TRUE(cb->repeatEnumCalled);
+    EXPECT_TRUE(cb->repeatUnionCalled);
+#ifdef AIDL_USE_V2_INTERFACE
+    EXPECT_TRUE(cb->repeatOtherParcelableCalled);
+#endif  // AIDL_USE_V2_INTERFACE
+  } else {
+    EXPECT_TRUE(cb->repeatParcelableCalled);
+    EXPECT_TRUE(cb->repeatEnumCalled);
+    EXPECT_TRUE(cb->repeatUnionCalled);
+#ifdef AIDL_USE_V2_INTERFACE
+    EXPECT_FALSE(cb->repeatOtherParcelableCalled);
+#endif  // AIDL_USE_V2_INTERFACE
+  }
+}
diff --git a/tests/aidl_test_client_utf8_strings.cpp b/tests/aidl_test_client_utf8_strings.cpp
new file mode 100644
index 0000000..8339137
--- /dev/null
+++ b/tests/aidl_test_client_utf8_strings.cpp
@@ -0,0 +1,148 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <optional>
+#include <string>
+#include <vector>
+
+#include <utils/String16.h>
+#include <utils/String8.h>
+
+#include "aidl_test_client.h"
+#include "gmock/gmock.h"
+
+using android::IBinder;
+using android::sp;
+using android::String16;
+using android::String8;
+using android::binder::Status;
+
+using android::aidl::tests::BackendType;
+using android::aidl::tests::ITestService;
+
+using testing::Eq;
+
+TEST_F(AidlTest, repeatUtf8String) {
+  const std::vector<std::string> utf8_inputs = {
+      std::string("Deliver us from evil."),
+      std::string(),
+      std::string("\0\0", 2),
+      // Similarly, the utf8 encodings of the small letter yee and euro sign.
+      std::string("\xF0\x90\x90\xB7\xE2\x82\xAC"),
+      ITestService::STRING_CONSTANT_UTF8(),
+  };
+
+  for (const auto& input : utf8_inputs) {
+    std::string reply;
+    auto status = service->RepeatUtf8CppString(input, &reply);
+    ASSERT_TRUE(status.isOk());
+    ASSERT_THAT(reply, Eq(input));
+  }
+
+  std::optional<std::string> reply;
+  auto status = service->RepeatNullableUtf8CppString(std::nullopt, &reply);
+  ASSERT_TRUE(status.isOk());
+  ASSERT_FALSE(reply.has_value());
+
+  for (const auto& input : utf8_inputs) {
+    std::optional<std::string> reply;
+    auto status = service->RepeatNullableUtf8CppString(input, &reply);
+    ASSERT_TRUE(status.isOk());
+    ASSERT_TRUE(reply.has_value());
+    ASSERT_THAT(*reply, Eq(input));
+  }
+}
+
+TEST_F(AidlTest, reverseUtf8StringArray) {
+  std::vector<std::string> input = {"a", "", "\xc3\xb8"};
+  decltype(input) repeated;
+  if (backend == BackendType::JAVA) {
+    repeated = decltype(input)(input.size());
+  }
+  decltype(input) reversed;
+
+  auto status = service->ReverseUtf8CppString(input, &repeated, &reversed);
+  ASSERT_TRUE(status.isOk()) << status;
+  ASSERT_THAT(repeated, Eq(input));
+
+  decltype(input) reversed_input(input);
+  std::reverse(reversed_input.begin(), reversed_input.end());
+  ASSERT_THAT(reversed, Eq(reversed_input));
+}
+
+struct AidlStringArrayTest : public AidlTest {
+  void DoTest(
+      Status (ITestService::*func)(const std::optional<std::vector<std::optional<std::string>>>&,
+                                   std::optional<std::vector<std::optional<std::string>>>*,
+                                   std::optional<std::vector<std::optional<std::string>>>*)) {
+    std::optional<std::vector<std::optional<std::string>>> input;
+    decltype(input) repeated;
+    decltype(input) reversed;
+
+    auto status = (*service.*func)(input, &repeated, &reversed);
+    ASSERT_TRUE(status.isOk()) << status;
+
+    if (func == &ITestService::ReverseUtf8CppStringList && backend == BackendType::JAVA) {
+      // Java cannot clear the input variable to return a null value. It can
+      // only ever fill out a list.
+      ASSERT_TRUE(repeated.has_value());
+    } else {
+      ASSERT_FALSE(repeated.has_value());
+    }
+
+    ASSERT_FALSE(reversed.has_value());
+
+    input = std::vector<std::optional<std::string>>();
+    input->push_back("Deliver us from evil.");
+    input->push_back(std::nullopt);
+    input->push_back("\xF0\x90\x90\xB7\xE2\x82\xAC");
+
+    // usable size needs to be initialized for Java
+    repeated = std::vector<std::optional<std::string>>(input->size());
+
+    status = (*service.*func)(input, &repeated, &reversed);
+    ASSERT_TRUE(status.isOk()) << status;
+    ASSERT_TRUE(reversed.has_value());
+    ASSERT_TRUE(repeated.has_value());
+    ASSERT_THAT(reversed->size(), Eq(input->size()));
+    ASSERT_THAT(repeated->size(), Eq(input->size()));
+
+    for (size_t i = 0; i < input->size(); i++) {
+      auto input_str = (*input)[i];
+      auto repeated_str = (*repeated)[i];
+      auto reversed_str = (*reversed)[(reversed->size() - 1) - i];
+      if (!input_str) {
+        ASSERT_FALSE(repeated_str.has_value());
+        ASSERT_FALSE(reversed_str.has_value());
+        // 3 nullptrs to strings.  No need to compare values.
+        continue;
+      }
+      ASSERT_TRUE(repeated_str.has_value());
+      ASSERT_TRUE(reversed_str.has_value());
+
+      ASSERT_THAT(*repeated_str, Eq(*input_str));
+      ASSERT_THAT(*reversed_str, Eq(*input_str));
+    }
+  }
+};
+
+TEST_F(AidlStringArrayTest, nullableList) {
+  DoTest(&ITestService::ReverseUtf8CppStringList);
+}
+
+TEST_F(AidlStringArrayTest, nullableArray) {
+  DoTest(&ITestService::ReverseNullableUtf8CppString);
+}
diff --git a/tests/aidl_test_client_versioned_interface.cpp b/tests/aidl_test_client_versioned_interface.cpp
new file mode 100644
index 0000000..943752a
--- /dev/null
+++ b/tests/aidl_test_client_versioned_interface.cpp
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <android/aidl/versioned/tests/IFooInterface.h>
+#include <binder/IServiceManager.h>
+#include <binder/ProcessState.h>
+#include <gtest/gtest.h>
+#include <utils/String16.h>
+
+#include "aidl_test_client.h"
+
+using android::OK;
+using android::sp;
+using android::String16;
+using android::aidl::versioned::tests::BazUnion;
+using android::aidl::versioned::tests::Foo;
+using android::aidl::versioned::tests::IFooInterface;
+using android::aidl::versioned::tests::IFooInterfaceDelegator;
+
+class VersionedInterfaceTest : public AidlTest {
+ public:
+  void SetUp() override {
+    android::ProcessState::self()->setThreadPoolMaxThreadCount(1);
+    android::ProcessState::self()->startThreadPool();
+    versioned = android::waitForService<IFooInterface>(IFooInterface::descriptor);
+    ASSERT_NE(nullptr, versioned);
+
+    AidlTest::SetUp();
+  }
+
+  sp<IFooInterface> versioned;
+};
+
+TEST_F(VersionedInterfaceTest, getInterfaceVersion) {
+  EXPECT_EQ(1, versioned->getInterfaceVersion());
+}
+
+TEST_F(VersionedInterfaceTest, getInterfaceHash) {
+  EXPECT_EQ("9e7be1859820c59d9d55dd133e71a3687b5d2e5b", versioned->getInterfaceHash());
+}
+
+TEST_F(VersionedInterfaceTest, noProblemWhenPassingAUnionWithOldField) {
+  std::string result;
+  auto status =
+      versioned->acceptUnionAndReturnString(BazUnion::make<BazUnion::intNum>(42), &result);
+  EXPECT_TRUE(status.isOk());
+  EXPECT_EQ("42", result);
+}
+
+TEST_F(VersionedInterfaceTest, errorWhenPassingAUnionWithNewField) {
+  std::string result;
+  auto status =
+      versioned->acceptUnionAndReturnString(BazUnion::make<BazUnion::longNum>(42L), &result);
+  // b/173458620 - Java and C++ return different errors
+  if (backend == BackendType::JAVA) {
+    EXPECT_EQ(::android::binder::Status::EX_ILLEGAL_ARGUMENT, status.exceptionCode()) << status;
+  } else {
+    EXPECT_EQ(::android::BAD_VALUE, status.transactionError()) << status;
+  }
+}
+
+TEST_F(VersionedInterfaceTest, arrayOfParcelableWithNewParam) {
+  std::vector<Foo> foos(42);
+  int32_t length;
+  auto status = versioned->returnsLengthOfFooArray(foos, &length);
+  EXPECT_TRUE(status.isOk());
+  EXPECT_EQ(42, length);
+}
+
+TEST_F(VersionedInterfaceTest, readDataCorrectlyAfterParcelableWithNewField) {
+  Foo inFoo, inoutFoo, outFoo;
+  inoutFoo.intDefault42 = 0;
+  outFoo.intDefault42 = 0;
+  int32_t ret;
+  auto status = versioned->ignoreParcelablesAndRepeatInt(inFoo, &inoutFoo, &outFoo, 43, &ret);
+  EXPECT_TRUE(status.isOk());
+  EXPECT_EQ(43, ret);
+  EXPECT_EQ(0, inoutFoo.intDefault42);
+  EXPECT_EQ(0, outFoo.intDefault42);
+}
+
+TEST_F(VersionedInterfaceTest, newerDelegatorReturnsImplVersion) {
+  auto delegator = sp<IFooInterfaceDelegator>::make(versioned);
+  EXPECT_EQ(1, delegator->getInterfaceVersion());
+}
+
+TEST_F(VersionedInterfaceTest, newerDelegatorReturnsImplHash) {
+  auto delegator = sp<IFooInterfaceDelegator>::make(versioned);
+  EXPECT_EQ("9e7be1859820c59d9d55dd133e71a3687b5d2e5b", delegator->getInterfaceHash());
+}
+
+TEST_F(VersionedInterfaceTest, errorWhenCallingV2Api) {
+  auto status = versioned->newApi();
+  EXPECT_EQ(::android::UNKNOWN_TRANSACTION, status.transactionError()) << status;
+}
diff --git a/tests/aidl_test_service.cpp b/tests/aidl_test_service.cpp
new file mode 100644
index 0000000..aff5b62
--- /dev/null
+++ b/tests/aidl_test_service.cpp
@@ -0,0 +1,1027 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#define LOG_TAG "aidl_native_service"
+
+#include <map>
+#include <mutex>
+#include <optional>
+#include <sstream>
+#include <string>
+#include <vector>
+
+#include <unistd.h>
+
+#include <android-base/unique_fd.h>
+#include <binder/IInterface.h>
+#include <binder/IPCThreadState.h>
+#include <binder/IServiceManager.h>
+#include <binder/ProcessState.h>
+#include <binder/Status.h>
+#include <utils/Errors.h>
+#include <utils/Log.h>
+#include <utils/Looper.h>
+#include <utils/String8.h>
+#include <utils/StrongPointer.h>
+
+#include "android/aidl/tests/BackendType.h"
+#include "android/aidl/tests/BnTestService.h"
+#include "android/aidl/tests/ITestService.h"
+
+#include "android/aidl/tests/BnNamedCallback.h"
+#include "android/aidl/tests/INamedCallback.h"
+
+#include "android/aidl/versioned/tests/BnFooInterface.h"
+#include "android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+
+#include "android/aidl/tests/BnNewName.h"
+#include "android/aidl/tests/BnOldName.h"
+
+#include "android/aidl/tests/BnCppJavaTests.h"
+#include "android/aidl/tests/ICppJavaTests.h"
+
+#include "android/aidl/tests/Union.h"
+#include "android/aidl/tests/extension/MyExt.h"
+#include "android/aidl/tests/extension/MyExt2.h"
+
+#include "android/aidl/tests/nested/BnNestedService.h"
+
+#include "android/aidl/tests/BnCircular.h"
+#include "android/aidl/tests/ICircular.h"
+
+#include "android/aidl/loggable/BnLoggableInterface.h"
+#include "android/aidl/loggable/Data.h"
+
+#include "android/aidl/fixedsizearray/FixedSizeArrayExample.h"
+
+// libbase
+using android::base::unique_fd;
+
+// libutils:
+using android::Looper;
+using android::LooperCallback;
+using android::OK;
+using android::sp;
+using android::status_t;
+using android::String16;
+using android::String8;
+
+// libbinder:
+using android::BnInterface;
+using android::defaultServiceManager;
+using android::IBinder;
+using android::IInterface;
+using android::IPCThreadState;
+using android::Parcel;
+using android::ProcessState;
+using android::binder::Status;
+
+// Generated code:
+using android::aidl::tests::BackendType;
+using android::aidl::tests::BadParcelable;
+using android::aidl::tests::BnCircular;
+using android::aidl::tests::BnCppJavaTests;
+using android::aidl::tests::BnNamedCallback;
+using android::aidl::tests::BnNewName;
+using android::aidl::tests::BnOldName;
+using android::aidl::tests::BnTestService;
+using android::aidl::tests::ByteEnum;
+using android::aidl::tests::CircularParcelable;
+using android::aidl::tests::ConstantExpressionEnum;
+using android::aidl::tests::GenericStructuredParcelable;
+using android::aidl::tests::ICircular;
+using android::aidl::tests::ICppJavaTests;
+using android::aidl::tests::INamedCallback;
+using android::aidl::tests::INewName;
+using android::aidl::tests::IntEnum;
+using android::aidl::tests::IOldName;
+using android::aidl::tests::ITestService;
+using android::aidl::tests::LongEnum;
+using android::aidl::tests::RecursiveList;
+using android::aidl::tests::SimpleParcelable;
+using android::aidl::tests::StructuredParcelable;
+using android::aidl::tests::Union;
+using android::os::ParcelFileDescriptor;
+using android::os::PersistableBundle;
+
+// Standard library
+using std::map;
+using std::optional;
+using std::string;
+using std::vector;
+
+namespace {
+
+class NamedCallback : public BnNamedCallback {
+ public:
+  explicit NamedCallback(String16 name) : name_(name) {}
+
+  Status GetName(String16* ret) {
+    *ret = name_;
+    return Status::ok();
+  }
+
+ private:
+  String16 name_;
+};
+
+class OldName : public BnOldName {
+ public:
+  OldName() = default;
+  ~OldName() = default;
+
+  Status RealName(String16* output) override {
+    *output = String16("OldName");
+    return Status::ok();
+  }
+};
+
+class NewName : public BnNewName {
+ public:
+  NewName() = default;
+  ~NewName() = default;
+
+  Status RealName(String16* output) override {
+    *output = String16("NewName");
+    return Status::ok();
+  }
+};
+
+class Circular : public BnCircular {
+ public:
+  Circular(sp<ITestService> srv) : mSrv(srv) {}
+  ~Circular() = default;
+
+  Status GetTestService(sp<ITestService>* _aidl_return) override {
+    *_aidl_return = mSrv;
+    return Status::ok();
+  }
+
+ private:
+  sp<ITestService> mSrv;
+};
+
+template <typename T>
+Status ReverseArray(const vector<T>& input, vector<T>* repeated, vector<T>* _aidl_return) {
+  ALOGI("Reversing array of length %zu", input.size());
+  *repeated = input;
+  *_aidl_return = input;
+  std::reverse(_aidl_return->begin(), _aidl_return->end());
+  return Status::ok();
+}
+
+template <typename T>
+Status RepeatNullable(const optional<T>& input, optional<T>* _aidl_return) {
+  ALOGI("Repeating nullable value");
+  *_aidl_return = input;
+  return Status::ok();
+}
+
+class CppJavaTests : public BnCppJavaTests {
+ public:
+  CppJavaTests() = default;
+  ~CppJavaTests() = default;
+
+  Status RepeatBadParcelable(const BadParcelable& input, BadParcelable* _aidl_return) override {
+    *_aidl_return = input;
+    return Status::ok();
+  }
+
+  Status RepeatSimpleParcelable(const SimpleParcelable& input, SimpleParcelable* repeat,
+                                SimpleParcelable* _aidl_return) override {
+    ALOGI("Repeated a SimpleParcelable %s", input.toString().c_str());
+    *repeat = input;
+    *_aidl_return = input;
+    return Status::ok();
+  }
+
+  Status RepeatGenericParcelable(
+      const GenericStructuredParcelable<int32_t, StructuredParcelable, IntEnum>& input,
+      GenericStructuredParcelable<int32_t, StructuredParcelable, IntEnum>* repeat,
+      GenericStructuredParcelable<int32_t, StructuredParcelable, IntEnum>* _aidl_return) {
+    ALOGI("Repeating Generic Parcelable");
+    *repeat = input;
+    *_aidl_return = input;
+    return Status::ok();
+  }
+
+  Status RepeatPersistableBundle(const PersistableBundle& input,
+                                 PersistableBundle* _aidl_return) override {
+    ALOGI("Repeated a PersistableBundle");
+    *_aidl_return = input;
+    return Status::ok();
+  }
+
+  Status ReverseSimpleParcelables(const vector<SimpleParcelable>& input,
+                                  vector<SimpleParcelable>* repeated,
+                                  vector<SimpleParcelable>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  Status ReversePersistableBundles(const vector<PersistableBundle>& input,
+                                   vector<PersistableBundle>* repeated,
+                                   vector<PersistableBundle>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  Status ReverseUnion(const Union& input, Union* repeated, Union* _aidl_return) override {
+    ALOGI("Repeated a Union");
+    *repeated = input;
+    *_aidl_return = input;
+    auto reverse = [](auto& reversible) {
+      std::reverse(std::begin(reversible), std::end(reversible));
+    };
+    switch (input.getTag()) {
+      case Union::ns:  // int[]
+        reverse(_aidl_return->get<Union::ns>());
+        break;
+      case Union::s:  // String
+        reverse(_aidl_return->get<Union::s>());
+        break;
+      case Union::ss:  // List<String>
+        reverse(_aidl_return->get<Union::ss>());
+        break;
+      default:
+        break;
+    }
+    return Status::ok();
+  }
+  Status ReverseNamedCallbackList(const vector<sp<IBinder>>& input, vector<sp<IBinder>>* repeated,
+                                  vector<sp<IBinder>>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+
+  Status RepeatFileDescriptor(unique_fd read, unique_fd* _aidl_return) override {
+    ALOGE("Repeating file descriptor");
+    *_aidl_return = unique_fd(dup(read.get()));
+    return Status::ok();
+  }
+
+  Status ReverseFileDescriptorArray(const vector<unique_fd>& input, vector<unique_fd>* repeated,
+                                    vector<unique_fd>* _aidl_return) override {
+    ALOGI("Reversing descriptor array of length %zu", input.size());
+    repeated->clear();
+    for (const auto& item : input) {
+      repeated->push_back(unique_fd(dup(item.get())));
+      _aidl_return->push_back(unique_fd(dup(item.get())));
+    }
+    std::reverse(_aidl_return->begin(), _aidl_return->end());
+    return Status::ok();
+  }
+};
+
+class NativeService : public BnTestService {
+ public:
+  NativeService() {}
+  virtual ~NativeService() = default;
+
+  void LogRepeatedStringToken(const String16& token) {
+    ALOGI("Repeating '%s' of length=%zu", android::String8(token).c_str(), token.size());
+  }
+
+  template <typename T>
+  void LogRepeatedToken(const T& token) {
+    std::ostringstream token_str;
+    token_str << token;
+    ALOGI("Repeating token %s", token_str.str().c_str());
+  }
+
+  Status TestOneway() override { return Status::fromStatusT(android::UNKNOWN_ERROR); }
+
+  Status Deprecated() override { return Status::ok(); }
+
+  Status RepeatBoolean(bool token, bool* _aidl_return) override {
+    LogRepeatedToken(token ? 1 : 0);
+    *_aidl_return = token;
+    return Status::ok();
+  }
+  Status RepeatByte(int8_t token, int8_t* _aidl_return) override {
+    LogRepeatedToken(token);
+    *_aidl_return = token;
+    return Status::ok();
+  }
+  Status RepeatChar(char16_t token, char16_t* _aidl_return) override {
+    LogRepeatedStringToken(String16(&token, 1));
+    *_aidl_return = token;
+    return Status::ok();
+  }
+  Status RepeatInt(int32_t token, int32_t* _aidl_return) override {
+    LogRepeatedToken(token);
+    *_aidl_return = token;
+    return Status::ok();
+  }
+  Status RepeatLong(int64_t token, int64_t* _aidl_return) override {
+    LogRepeatedToken(token);
+    *_aidl_return = token;
+    return Status::ok();
+  }
+  Status RepeatFloat(float token, float* _aidl_return) override {
+    LogRepeatedToken(token);
+    *_aidl_return = token;
+    return Status::ok();
+  }
+  Status RepeatDouble(double token, double* _aidl_return) override {
+    LogRepeatedToken(token);
+    *_aidl_return = token;
+    return Status::ok();
+  }
+  Status RepeatString(const String16& token, String16* _aidl_return) override {
+    LogRepeatedStringToken(token);
+    *_aidl_return = token;
+    return Status::ok();
+  }
+  Status RepeatByteEnum(ByteEnum token, ByteEnum* _aidl_return) override {
+    ALOGI("Repeating ByteEnum token %s", toString(token).c_str());
+    *_aidl_return = token;
+    return Status::ok();
+  }
+  Status RepeatIntEnum(IntEnum token, IntEnum* _aidl_return) override {
+    ALOGI("Repeating IntEnum token %s", toString(token).c_str());
+    *_aidl_return = token;
+    return Status::ok();
+  }
+  Status RepeatLongEnum(LongEnum token, LongEnum* _aidl_return) override {
+    ALOGI("Repeating LongEnum token %s", toString(token).c_str());
+    *_aidl_return = token;
+    return Status::ok();
+  }
+
+  Status ReverseBoolean(const vector<bool>& input,
+                        vector<bool>* repeated,
+                        vector<bool>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  Status ReverseByte(const vector<uint8_t>& input,
+                     vector<uint8_t>* repeated,
+                     vector<uint8_t>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  Status ReverseChar(const vector<char16_t>& input,
+                     vector<char16_t>* repeated,
+                     vector<char16_t>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  Status ReverseInt(const vector<int32_t>& input,
+                    vector<int32_t>* repeated,
+                    vector<int32_t>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  Status ReverseLong(const vector<int64_t>& input,
+                     vector<int64_t>* repeated,
+                     vector<int64_t>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  Status ReverseFloat(const vector<float>& input,
+                      vector<float>* repeated,
+                      vector<float>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  Status ReverseDouble(const vector<double>& input,
+                       vector<double>* repeated,
+                       vector<double>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  Status ReverseString(const vector<String16>& input,
+                       vector<String16>* repeated,
+                       vector<String16>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  Status ReverseByteEnum(const vector<ByteEnum>& input, vector<ByteEnum>* repeated,
+                         vector<ByteEnum>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  Status ReverseIntEnum(const vector<IntEnum>& input, vector<IntEnum>* repeated,
+                        vector<IntEnum>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  Status ReverseLongEnum(const vector<LongEnum>& input, vector<LongEnum>* repeated,
+                         vector<LongEnum>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+
+  Status SetOtherTestService(const String16& name, const sp<INamedCallback>& service,
+                             bool* _aidl_return) override {
+    std::lock_guard<std::mutex> guard(service_map_mutex_);
+    const auto& existing = service_map_.find(name);
+    if (existing != service_map_.end() && existing->second == service) {
+      *_aidl_return = true;
+
+      return Status::ok();
+    } else {
+      *_aidl_return = false;
+      service_map_[name] = service;
+
+      return Status::ok();
+    }
+  }
+
+  Status GetOtherTestService(const String16& name,
+                             sp<INamedCallback>* returned_service) override {
+    std::lock_guard<std::mutex> guard(service_map_mutex_);
+    if (service_map_.find(name) == service_map_.end()) {
+      sp<INamedCallback> new_item(new NamedCallback(name));
+      service_map_[name] = new_item;
+    }
+
+    *returned_service = service_map_[name];
+    return Status::ok();
+  }
+
+  Status VerifyName(const sp<INamedCallback>& service, const String16& name,
+                    bool* returned_value) override {
+    String16 foundName;
+    Status status = service->GetName(&foundName);
+
+    if (status.isOk()) {
+      *returned_value = foundName == name;
+    }
+
+    return status;
+  }
+
+  Status GetInterfaceArray(const vector<String16>& names,
+                           vector<sp<INamedCallback>>* _aidl_return) override {
+    vector<sp<INamedCallback>> services(names.size());
+    for (size_t i = 0; i < names.size(); i++) {
+      if (auto st = GetOtherTestService(names[i], &services[i]); !st.isOk()) {
+        return st;
+      }
+    }
+    *_aidl_return = std::move(services);
+    return Status::ok();
+  }
+
+  Status VerifyNamesWithInterfaceArray(const vector<sp<INamedCallback>>& services,
+                                       const vector<String16>& names, bool* _aidl_ret) override {
+    if (services.size() == names.size()) {
+      for (size_t i = 0; i < services.size(); i++) {
+        if (auto st = VerifyName(services[i], names[i], _aidl_ret); !st.isOk() || !*_aidl_ret) {
+          return st;
+        }
+      }
+      *_aidl_ret = true;
+    } else {
+      *_aidl_ret = false;
+    }
+    return Status::ok();
+  }
+
+  Status GetNullableInterfaceArray(const optional<vector<optional<String16>>>& names,
+                                   optional<vector<sp<INamedCallback>>>* _aidl_ret) override {
+    vector<sp<INamedCallback>> services;
+    if (names.has_value()) {
+      for (const auto& name : *names) {
+        if (name.has_value()) {
+          sp<INamedCallback> ret;
+          if (auto st = GetOtherTestService(*name, &ret); !st.isOk()) {
+            return st;
+          }
+          services.push_back(std::move(ret));
+        } else {
+          services.emplace_back();
+        }
+      }
+    }
+    *_aidl_ret = std::move(services);
+    return Status::ok();
+  }
+
+  Status VerifyNamesWithNullableInterfaceArray(const optional<vector<sp<INamedCallback>>>& services,
+                                               const optional<vector<optional<String16>>>& names,
+                                               bool* _aidl_ret) override {
+    if (services.has_value() && names.has_value()) {
+      if (services->size() == names->size()) {
+        for (size_t i = 0; i < services->size(); i++) {
+          if (services->at(i).get() && names->at(i).has_value()) {
+            if (auto st = VerifyName(services->at(i), names->at(i).value(), _aidl_ret);
+                !st.isOk() || !*_aidl_ret) {
+              return st;
+            }
+          } else if (services->at(i).get() || names->at(i).has_value()) {
+            *_aidl_ret = false;
+            return Status::ok();
+          } else {
+            // ok if service=null && name=null
+          }
+        }
+        *_aidl_ret = true;
+      } else {
+        *_aidl_ret = false;
+      }
+    } else {
+      *_aidl_ret = services.has_value() == names.has_value();
+    }
+    return Status::ok();
+  }
+
+  Status GetInterfaceList(const optional<vector<optional<String16>>>& names,
+                          optional<vector<sp<INamedCallback>>>* _aidl_ret) override {
+    return GetNullableInterfaceArray(names, _aidl_ret);
+  }
+
+  Status VerifyNamesWithInterfaceList(const optional<vector<sp<INamedCallback>>>& services,
+                                      const optional<vector<optional<String16>>>& names,
+                                      bool* _aidl_ret) override {
+    return VerifyNamesWithNullableInterfaceArray(services, names, _aidl_ret);
+  }
+
+  Status ReverseStringList(const vector<String16>& input,
+                           vector<String16>* repeated,
+                           vector<String16>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+
+  Status RepeatParcelFileDescriptor(const ParcelFileDescriptor& read,
+                                    ParcelFileDescriptor* _aidl_return) override {
+    ALOGE("Repeating parcel file descriptor");
+    _aidl_return->reset(unique_fd(dup(read.get())));
+    return Status::ok();
+  }
+
+  Status ReverseParcelFileDescriptorArray(const vector<ParcelFileDescriptor>& input,
+                                          vector<ParcelFileDescriptor>* repeated,
+                                          vector<ParcelFileDescriptor>* _aidl_return) override {
+    ALOGI("Reversing parcel descriptor array of length %zu", input.size());
+    for (const auto& item : input) {
+      repeated->push_back(ParcelFileDescriptor(unique_fd(dup(item.get()))));
+    }
+
+    for (auto i = input.rbegin(); i != input.rend(); i++) {
+      _aidl_return->push_back(ParcelFileDescriptor(unique_fd(dup(i->get()))));
+    }
+    return Status::ok();
+  }
+
+  Status ThrowServiceException(int code) override {
+    return Status::fromServiceSpecificError(code);
+  }
+
+  Status RepeatNullableIntArray(const optional<vector<int32_t>>& input,
+                                optional<vector<int32_t>>* _aidl_return) {
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  Status RepeatNullableByteEnumArray(const optional<vector<ByteEnum>>& input,
+                                     optional<vector<ByteEnum>>* _aidl_return) {
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  Status RepeatNullableIntEnumArray(const optional<vector<IntEnum>>& input,
+                                    optional<vector<IntEnum>>* _aidl_return) {
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  Status RepeatNullableLongEnumArray(const optional<vector<LongEnum>>& input,
+                                     optional<vector<LongEnum>>* _aidl_return) {
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  Status RepeatNullableStringList(const optional<vector<optional<String16>>>& input,
+                                  optional<vector<optional<String16>>>* _aidl_return) {
+    ALOGI("Repeating nullable string list");
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  Status RepeatNullableString(const optional<String16>& input, optional<String16>* _aidl_return) {
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  Status RepeatNullableParcelable(const optional<ITestService::Empty>& input,
+                                  optional<ITestService::Empty>* _aidl_return) {
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  Status RepeatNullableParcelableList(
+      const optional<vector<optional<ITestService::Empty>>>& input,
+      optional<vector<optional<ITestService::Empty>>>* _aidl_return) {
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  Status RepeatNullableParcelableArray(
+      const optional<vector<optional<ITestService::Empty>>>& input,
+      optional<vector<optional<ITestService::Empty>>>* _aidl_return) {
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  Status TakesAnIBinder(const sp<IBinder>& input) override {
+    (void)input;
+    return Status::ok();
+  }
+  Status TakesANullableIBinder(const sp<IBinder>& input) {
+    (void)input;
+    return Status::ok();
+  }
+  Status TakesAnIBinderList(const vector<sp<IBinder>>& input) override {
+    (void)input;
+    return Status::ok();
+  }
+  Status TakesANullableIBinderList(const optional<vector<sp<IBinder>>>& input) {
+    (void)input;
+    return Status::ok();
+  }
+
+  Status RepeatUtf8CppString(const string& token,
+                             string* _aidl_return) override {
+    ALOGI("Repeating utf8 string '%s' of length=%zu", token.c_str(), token.size());
+    *_aidl_return = token;
+    return Status::ok();
+  }
+
+  Status RepeatNullableUtf8CppString(const optional<string>& token,
+                                     optional<string>* _aidl_return) override {
+    if (!token) {
+      ALOGI("Received null @utf8InCpp string");
+      return Status::ok();
+    }
+    ALOGI("Repeating utf8 string '%s' of length=%zu",
+          token->c_str(), token->size());
+    *_aidl_return = token;
+    return Status::ok();
+  }
+
+  Status ReverseUtf8CppString(const vector<string>& input,
+                              vector<string>* repeated,
+                              vector<string>* _aidl_return) {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+
+  Status ReverseNullableUtf8CppString(const optional<vector<optional<string>>>& input,
+                                      optional<vector<optional<string>>>* repeated,
+                                      optional<vector<optional<string>>>* _aidl_return) {
+    return ReverseUtf8CppStringList(input, repeated, _aidl_return);
+  }
+
+  Status ReverseUtf8CppStringList(const optional<vector<optional<string>>>& input,
+                                  optional<vector<optional<string>>>* repeated,
+                                  optional<vector<optional<string>>>* _aidl_return) {
+    if (!input) {
+      ALOGI("Received null list of utf8 strings");
+      return Status::ok();
+    }
+    *_aidl_return = input;
+    *repeated = input;
+    std::reverse((*_aidl_return)->begin(), (*_aidl_return)->end());
+    return Status::ok();
+  }
+
+  Status GetCallback(bool return_null, sp<INamedCallback>* ret) {
+    if (!return_null) {
+      return GetOtherTestService(String16("ABT: always be testing"), ret);
+    }
+    return Status::ok();
+  }
+
+  virtual ::android::binder::Status FillOutStructuredParcelable(StructuredParcelable* parcelable) {
+    parcelable->shouldBeJerry = "Jerry";
+    parcelable->shouldContainThreeFs = {parcelable->f, parcelable->f, parcelable->f};
+    parcelable->shouldBeByteBar = ByteEnum::BAR;
+    parcelable->shouldBeIntBar = IntEnum::BAR;
+    parcelable->shouldBeLongBar = LongEnum::BAR;
+    parcelable->shouldContainTwoByteFoos = {ByteEnum::FOO, ByteEnum::FOO};
+    parcelable->shouldContainTwoIntFoos = {IntEnum::FOO, IntEnum::FOO};
+    parcelable->shouldContainTwoLongFoos = {LongEnum::FOO, LongEnum::FOO};
+
+    parcelable->const_exprs_1 = ConstantExpressionEnum::decInt32_1;
+    parcelable->const_exprs_2 = ConstantExpressionEnum::decInt32_2;
+    parcelable->const_exprs_3 = ConstantExpressionEnum::decInt64_1;
+    parcelable->const_exprs_4 = ConstantExpressionEnum::decInt64_2;
+    parcelable->const_exprs_5 = ConstantExpressionEnum::decInt64_3;
+    parcelable->const_exprs_6 = ConstantExpressionEnum::decInt64_4;
+    parcelable->const_exprs_7 = ConstantExpressionEnum::hexInt32_1;
+    parcelable->const_exprs_8 = ConstantExpressionEnum::hexInt32_2;
+    parcelable->const_exprs_9 = ConstantExpressionEnum::hexInt32_3;
+    parcelable->const_exprs_10 = ConstantExpressionEnum::hexInt64_1;
+
+    parcelable->shouldSetBit0AndBit2 = StructuredParcelable::BIT0 | StructuredParcelable::BIT2;
+
+    parcelable->u = Union::make<Union::ns>({1, 2, 3});
+    parcelable->shouldBeConstS1 = Union::S1();
+    return Status::ok();
+  }
+
+  ::android::binder::Status RepeatExtendableParcelable(
+      const ::android::aidl::tests::extension::ExtendableParcelable& ep,
+      ::android::aidl::tests::extension::ExtendableParcelable* ep2) {
+    ep2->a = ep.a;
+    ep2->b = ep.b;
+    std::shared_ptr<android::aidl::tests::extension::MyExt> myExt;
+    ep.ext.getParcelable(&myExt);
+    ep2->ext.setParcelable(myExt);
+
+    return Status::ok();
+  }
+
+  ::android::binder::Status ReverseList(const RecursiveList& list, RecursiveList* ret) override {
+    std::unique_ptr<RecursiveList> reversed;
+    const RecursiveList* cur = &list;
+    while (cur) {
+      auto node = std::make_unique<RecursiveList>();
+      node->value = cur->value;
+      node->next = std::move(reversed);
+      reversed = std::move(node);
+      cur = cur->next.get();
+    }
+    *ret = std::move(*reversed);
+    return Status::ok();
+  }
+
+  Status ReverseIBinderArray(const vector<sp<IBinder>>& input, vector<sp<IBinder>>* repeated,
+                             vector<sp<IBinder>>* _aidl_return) override {
+    *repeated = input;
+    *_aidl_return = input;
+    std::reverse(_aidl_return->begin(), _aidl_return->end());
+    return Status::ok();
+  }
+
+  Status ReverseNullableIBinderArray(const std::optional<vector<sp<IBinder>>>& input,
+                                     std::optional<vector<sp<IBinder>>>* repeated,
+                                     std::optional<vector<sp<IBinder>>>* _aidl_return) override {
+    *repeated = input;
+    *_aidl_return = input;
+    if (*_aidl_return) {
+      std::reverse((*_aidl_return)->begin(), (*_aidl_return)->end());
+    }
+    return Status::ok();
+  }
+
+  Status UnimplementedMethod(int32_t /* arg */, int32_t* /* _aidl_return */) override {
+    LOG_ALWAYS_FATAL("UnimplementedMethod shouldn't be called");
+  }
+
+  Status GetOldNameInterface(sp<IOldName>* ret) {
+    *ret = new OldName;
+    return Status::ok();
+  }
+
+  Status GetNewNameInterface(sp<INewName>* ret) {
+    *ret = new NewName;
+    return Status::ok();
+  }
+
+  Status GetUnionTags(const std::vector<Union>& input,
+                      std::vector<Union::Tag>* _aidl_return) override {
+    std::vector<Union::Tag> tags;
+    std::transform(input.begin(), input.end(), std::back_inserter(tags),
+                   std::mem_fn(&Union::getTag));
+    *_aidl_return = std::move(tags);
+    return Status::ok();
+  }
+
+  Status GetCppJavaTests(sp<IBinder>* ret) {
+    *ret = new CppJavaTests;
+    return Status::ok();
+  }
+
+  Status getBackendType(BackendType* _aidl_return) override {
+    *_aidl_return = BackendType::CPP;
+    return Status::ok();
+  }
+
+  Status GetCircular(CircularParcelable* cp, sp<ICircular>* _aidl_return) override {
+    auto srv = sp<ITestService>::fromExisting(this);
+    cp->testService = srv;
+    *_aidl_return = new Circular(srv);
+    return Status::ok();
+  }
+
+  status_t onTransact(uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) override {
+    if (code == ::android::IBinder::FIRST_CALL_TRANSACTION + 0 /* UnimplementedMethod */) {
+      // pretend that UnimplementedMethod isn't implemented by this service.
+      return android::UNKNOWN_TRANSACTION;
+    } else {
+      return BnTestService::onTransact(code, data, reply, flags);
+    }
+  }
+
+ private:
+  map<String16, sp<INamedCallback>> service_map_;
+  std::mutex service_map_mutex_;
+};
+
+class VersionedService : public android::aidl::versioned::tests::BnFooInterface {
+ public:
+  VersionedService() {}
+  virtual ~VersionedService() = default;
+
+  Status originalApi() override { return Status::ok(); }
+  Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u,
+                                    std::string* _aidl_return) override {
+    switch (u.getTag()) {
+      case ::android::aidl::versioned::tests::BazUnion::intNum:
+        *_aidl_return =
+            std::to_string(u.get<::android::aidl::versioned::tests::BazUnion::intNum>());
+        break;
+    }
+    return Status::ok();
+  }
+  Status returnsLengthOfFooArray(const vector<::android::aidl::versioned::tests::Foo>& foos,
+                                 int32_t* ret) override {
+    *ret = static_cast<int32_t>(foos.size());
+    return Status::ok();
+  }
+  Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo,
+                                       ::android::aidl::versioned::tests::Foo* inoutFoo,
+                                       ::android::aidl::versioned::tests::Foo* outFoo,
+                                       int32_t value, int32_t* ret) override {
+    (void)inFoo;
+    (void)inoutFoo;
+    (void)outFoo;
+    *ret = value;
+    return Status::ok();
+  }
+};
+
+class TrunkStableService : public android::aidl::test::trunk::BnTrunkStableTest {
+ public:
+  TrunkStableService() {}
+  virtual ~TrunkStableService() = default;
+
+  Status repeatParcelable(
+      const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input,
+      ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override {
+    *_aidl_return = input;
+    return Status::ok();
+  }
+  Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input,
+                    ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override {
+    *_aidl_return = input;
+    return Status::ok();
+  }
+  Status repeatUnion(
+      const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input,
+      ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override {
+    *_aidl_return = input;
+    return Status::ok();
+  }
+  Status callMyCallback(
+      const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb)
+      override {
+    if (!cb) return Status::fromExceptionCode(Status::Exception::EX_NULL_POINTER);
+    MyParcelable a, b;
+    MyEnum c = MyEnum::ZERO, d = MyEnum::ZERO;
+    MyUnion e, f;
+    auto status = cb->repeatParcelable(a, &b);
+    if (!status.isOk()) {
+      return status;
+    }
+    status = cb->repeatEnum(c, &d);
+    if (!status.isOk()) {
+      return status;
+    }
+    status = cb->repeatUnion(e, &f);
+    if (!status.isOk()) {
+      return status;
+    }
+    MyOtherParcelable g, h;
+    status = cb->repeatOtherParcelable(g, &h);
+    return Status::ok();
+  }
+
+  Status repeatOtherParcelable(
+      const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input,
+      ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override {
+    *_aidl_return = input;
+    return Status::ok();
+  }
+};
+
+class LoggableInterfaceService : public android::aidl::loggable::BnLoggableInterface {
+ public:
+  LoggableInterfaceService() {}
+  virtual ~LoggableInterfaceService() = default;
+
+  virtual Status LogThis(bool, vector<bool>*, int8_t, vector<uint8_t>*, char16_t, vector<char16_t>*,
+                         int32_t, vector<int32_t>*, int64_t, vector<int64_t>*, float,
+                         vector<float>*, double, vector<double>*, const String16&,
+                         vector<String16>*, vector<String16>*, const android::aidl::loggable::Data&,
+                         const sp<IBinder>&, optional<ParcelFileDescriptor>*,
+                         vector<ParcelFileDescriptor>*, vector<String16>* _aidl_return) override {
+    *_aidl_return = vector<String16>{String16("loggable")};
+    return Status::ok();
+  }
+};
+
+using namespace android::aidl::tests::nested;
+class NestedService : public BnNestedService {
+ public:
+  NestedService() {}
+  virtual ~NestedService() = default;
+
+  virtual Status flipStatus(const ParcelableWithNested& p, INestedService::Result* _aidl_return) {
+    if (p.status == ParcelableWithNested::Status::OK) {
+      _aidl_return->status = ParcelableWithNested::Status::NOT_OK;
+    } else {
+      _aidl_return->status = ParcelableWithNested::Status::OK;
+    }
+    return Status::ok();
+  }
+  virtual Status flipStatusWithCallback(ParcelableWithNested::Status status,
+                                        const sp<INestedService::ICallback>& cb) {
+    if (status == ParcelableWithNested::Status::OK) {
+      return cb->done(ParcelableWithNested::Status::NOT_OK);
+    } else {
+      return cb->done(ParcelableWithNested::Status::OK);
+    }
+  }
+};
+
+using android::aidl::fixedsizearray::FixedSizeArrayExample;
+class FixedSizeArrayService : public FixedSizeArrayExample::BnRepeatFixedSizeArray {
+ public:
+  FixedSizeArrayService() {}
+  virtual ~FixedSizeArrayService() = default;
+
+  Status RepeatBytes(const std::array<uint8_t, 3>& in_input, std::array<uint8_t, 3>* out_repeated,
+                     std::array<uint8_t, 3>* _aidl_return) override {
+    *out_repeated = in_input;
+    *_aidl_return = in_input;
+    return Status::ok();
+  }
+  Status RepeatInts(const std::array<int32_t, 3>& in_input, std::array<int32_t, 3>* out_repeated,
+                    std::array<int32_t, 3>* _aidl_return) override {
+    *out_repeated = in_input;
+    *_aidl_return = in_input;
+    return Status::ok();
+  }
+  Status RepeatBinders(const std::array<sp<IBinder>, 3>& in_input,
+                       std::array<sp<IBinder>, 3>* out_repeated,
+                       std::array<sp<IBinder>, 3>* _aidl_return) override {
+    *out_repeated = in_input;
+    *_aidl_return = in_input;
+    return Status::ok();
+  }
+  Status RepeatParcelables(
+      const std::array<FixedSizeArrayExample::IntParcelable, 3>& in_input,
+      std::array<FixedSizeArrayExample::IntParcelable, 3>* out_repeated,
+      std::array<FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) override {
+    *out_repeated = in_input;
+    *_aidl_return = in_input;
+    return Status::ok();
+  }
+  Status Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& in_input,
+                       std::array<std::array<uint8_t, 3>, 2>* out_repeated,
+                       std::array<std::array<uint8_t, 3>, 2>* _aidl_return) override {
+    *out_repeated = in_input;
+    *_aidl_return = in_input;
+    return Status::ok();
+  }
+  Status Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& in_input,
+                      std::array<std::array<int32_t, 3>, 2>* out_repeated,
+                      std::array<std::array<int32_t, 3>, 2>* _aidl_return) override {
+    *out_repeated = in_input;
+    *_aidl_return = in_input;
+    return Status::ok();
+  }
+  Status Repeat2dBinders(const std::array<std::array<sp<IBinder>, 3>, 2>& in_input,
+                         std::array<std::array<sp<IBinder>, 3>, 2>* out_repeated,
+                         std::array<std::array<sp<IBinder>, 3>, 2>* _aidl_return) override {
+    *out_repeated = in_input;
+    *_aidl_return = in_input;
+    return Status::ok();
+  }
+  Status Repeat2dParcelables(
+      const std::array<std::array<FixedSizeArrayExample::IntParcelable, 3>, 2>& in_input,
+      std::array<std::array<FixedSizeArrayExample::IntParcelable, 3>, 2>* out_repeated,
+      std::array<std::array<FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) override {
+    *out_repeated = in_input;
+    *_aidl_return = in_input;
+    return Status::ok();
+  }
+};
+
+}  // namespace
+
+int main(int /* argc */, char* /* argv */[]) {
+  IPCThreadState::self()->disableBackgroundScheduling(true);
+
+  std::vector<sp<IBinder>> services = {
+      sp<FixedSizeArrayService>::make(), sp<LoggableInterfaceService>::make(),
+      sp<NativeService>::make(),         sp<NestedService>::make(),
+      sp<TrunkStableService>::make(),    sp<VersionedService>::make(),
+  };
+
+  for (const auto& service : services) {
+    status_t status =
+        defaultServiceManager()->addService(service->getInterfaceDescriptor(), service);
+    if (status != OK) {
+      ALOGE("Failed to add service %s", String8(service->getInterfaceDescriptor()).c_str());
+      return EXIT_FAILURE;
+    }
+  }
+
+  IPCThreadState::self()->joinThreadPool();
+  return EXIT_FAILURE;
+}
diff --git a/tests/aidl_test_service_ndk.cpp b/tests/aidl_test_service_ndk.cpp
new file mode 100644
index 0000000..59b41d1
--- /dev/null
+++ b/tests/aidl_test_service_ndk.cpp
@@ -0,0 +1,884 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#define LOG_TAG "aidl_ndk_service"
+
+#include <aidl/android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <aidl/android/aidl/loggable/BnLoggableInterface.h>
+#include <aidl/android/aidl/loggable/Data.h>
+#include <aidl/android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <aidl/android/aidl/test/trunk/ITrunkStableTest.h>
+#include <aidl/android/aidl/tests/BackendType.h>
+#include <aidl/android/aidl/tests/BnCircular.h>
+#include <aidl/android/aidl/tests/BnNamedCallback.h>
+#include <aidl/android/aidl/tests/BnNewName.h>
+#include <aidl/android/aidl/tests/BnOldName.h>
+#include <aidl/android/aidl/tests/BnTestService.h>
+#include <aidl/android/aidl/tests/ICircular.h>
+#include <aidl/android/aidl/tests/INamedCallback.h>
+#include <aidl/android/aidl/tests/ITestService.h>
+#include <aidl/android/aidl/tests/Union.h>
+#include <aidl/android/aidl/tests/extension/MyExt.h>
+#include <aidl/android/aidl/tests/extension/MyExt2.h>
+#include <aidl/android/aidl/tests/nested/BnNestedService.h>
+#include <aidl/android/aidl/versioned/tests/BnFooInterface.h>
+#include <aidl/android/aidl/versioned/tests/IFooInterface.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+
+#include <map>
+#include <mutex>
+#include <optional>
+#include <sstream>
+#include <string>
+#include <vector>
+
+#include <unistd.h>
+
+using aidl::android::aidl::tests::BackendType;
+using aidl::android::aidl::tests::BnCircular;
+using aidl::android::aidl::tests::BnNamedCallback;
+using aidl::android::aidl::tests::BnNewName;
+using aidl::android::aidl::tests::BnOldName;
+using aidl::android::aidl::tests::BnTestService;
+using aidl::android::aidl::tests::ByteEnum;
+using aidl::android::aidl::tests::CircularParcelable;
+using aidl::android::aidl::tests::ConstantExpressionEnum;
+using aidl::android::aidl::tests::ICircular;
+using aidl::android::aidl::tests::INamedCallback;
+using aidl::android::aidl::tests::INewName;
+using aidl::android::aidl::tests::IntEnum;
+using aidl::android::aidl::tests::IOldName;
+using aidl::android::aidl::tests::ITestService;
+using aidl::android::aidl::tests::LongEnum;
+using aidl::android::aidl::tests::RecursiveList;
+using aidl::android::aidl::tests::StructuredParcelable;
+using aidl::android::aidl::tests::Union;
+using aidl::android::aidl::tests::extension::ExtendableParcelable;
+
+using std::optional;
+using std::string;
+using std::vector;
+
+using ndk::ScopedAStatus;
+using ndk::ScopedFileDescriptor;
+using ndk::SharedRefBase;
+using ndk::SpAIBinder;
+
+namespace {
+
+class NamedCallback : public BnNamedCallback {
+ public:
+  explicit NamedCallback(std::string name) : name_(name) {}
+
+  ScopedAStatus GetName(std::string* ret) override {
+    *ret = name_;
+    return ScopedAStatus::ok();
+  }
+
+ private:
+  std::string name_;
+};
+
+class OldName : public BnOldName {
+ public:
+  OldName() = default;
+  ~OldName() = default;
+
+  ScopedAStatus RealName(std::string* output) override {
+    *output = std::string("OldName");
+    return ScopedAStatus::ok();
+  }
+};
+
+class NewName : public BnNewName {
+ public:
+  NewName() = default;
+  ~NewName() = default;
+
+  ScopedAStatus RealName(std::string* output) override {
+    *output = std::string("NewName");
+    return ScopedAStatus::ok();
+  }
+};
+
+class Circular : public BnCircular {
+ public:
+  Circular(std::shared_ptr<ITestService> srv) : mSrv(srv) {}
+  ~Circular() = default;
+
+  ScopedAStatus GetTestService(std::shared_ptr<ITestService>* _aidl_return) override {
+    *_aidl_return = mSrv;
+    return ScopedAStatus::ok();
+  }
+
+ private:
+  std::shared_ptr<ITestService> mSrv;
+};
+
+template <typename T>
+ScopedAStatus ReverseArray(const vector<T>& input, vector<T>* repeated, vector<T>* _aidl_return) {
+  ALOGI("Reversing array of length %zu", input.size());
+  *repeated = input;
+  *_aidl_return = input;
+  std::reverse(_aidl_return->begin(), _aidl_return->end());
+  return ScopedAStatus::ok();
+}
+
+template <typename T>
+ScopedAStatus RepeatNullable(const optional<T>& input, optional<T>* _aidl_return) {
+  ALOGI("Repeating nullable value");
+  *_aidl_return = input;
+  return ScopedAStatus::ok();
+}
+
+class NativeService : public BnTestService {
+ public:
+  NativeService() {}
+  virtual ~NativeService() = default;
+
+  void LogRepeatedStringToken(const std::string& token) {
+    ALOGI("Repeating '%s' of length=%zu", token.c_str(), token.size());
+  }
+
+  template <typename T>
+  void LogRepeatedToken(const T& token) {
+    std::ostringstream token_str;
+    token_str << token;
+    ALOGI("Repeating token %s", token_str.str().c_str());
+  }
+
+  ScopedAStatus TestOneway() override { return ScopedAStatus::fromStatus(android::UNKNOWN_ERROR); }
+
+  ScopedAStatus Deprecated() override { return ScopedAStatus::ok(); }
+
+  ScopedAStatus RepeatBoolean(bool token, bool* _aidl_return) override {
+    LogRepeatedToken(token ? 1 : 0);
+    *_aidl_return = token;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus RepeatByte(int8_t token, int8_t* _aidl_return) override {
+    LogRepeatedToken(token);
+    *_aidl_return = token;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus RepeatChar(char16_t token, char16_t* _aidl_return) override {
+    LogRepeatedToken(token);
+    *_aidl_return = token;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus RepeatInt(int32_t token, int32_t* _aidl_return) override {
+    LogRepeatedToken(token);
+    *_aidl_return = token;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus RepeatLong(int64_t token, int64_t* _aidl_return) override {
+    LogRepeatedToken(token);
+    *_aidl_return = token;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus RepeatFloat(float token, float* _aidl_return) override {
+    LogRepeatedToken(token);
+    *_aidl_return = token;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus RepeatDouble(double token, double* _aidl_return) override {
+    LogRepeatedToken(token);
+    *_aidl_return = token;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus RepeatString(const std::string& token, std::string* _aidl_return) override {
+    LogRepeatedStringToken(token);
+    *_aidl_return = token;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus RepeatByteEnum(ByteEnum token, ByteEnum* _aidl_return) override {
+    ALOGI("Repeating ByteEnum token %s", toString(token).c_str());
+    *_aidl_return = token;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus RepeatIntEnum(IntEnum token, IntEnum* _aidl_return) override {
+    ALOGI("Repeating IntEnum token %s", toString(token).c_str());
+    *_aidl_return = token;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus RepeatLongEnum(LongEnum token, LongEnum* _aidl_return) override {
+    ALOGI("Repeating LongEnum token %s", toString(token).c_str());
+    *_aidl_return = token;
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus ReverseBoolean(const vector<bool>& input, vector<bool>* repeated,
+                               vector<bool>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  ScopedAStatus ReverseByte(const vector<uint8_t>& input, vector<uint8_t>* repeated,
+                            vector<uint8_t>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  ScopedAStatus ReverseChar(const vector<char16_t>& input, vector<char16_t>* repeated,
+                            vector<char16_t>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  ScopedAStatus ReverseInt(const vector<int32_t>& input, vector<int32_t>* repeated,
+                           vector<int32_t>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  ScopedAStatus ReverseLong(const vector<int64_t>& input, vector<int64_t>* repeated,
+                            vector<int64_t>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  ScopedAStatus ReverseFloat(const vector<float>& input, vector<float>* repeated,
+                             vector<float>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  ScopedAStatus ReverseDouble(const vector<double>& input, vector<double>* repeated,
+                              vector<double>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  ScopedAStatus ReverseString(const vector<std::string>& input, vector<std::string>* repeated,
+                              vector<std::string>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  ScopedAStatus ReverseByteEnum(const vector<ByteEnum>& input, vector<ByteEnum>* repeated,
+                                vector<ByteEnum>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  ScopedAStatus ReverseIntEnum(const vector<IntEnum>& input, vector<IntEnum>* repeated,
+                               vector<IntEnum>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+  ScopedAStatus ReverseLongEnum(const vector<LongEnum>& input, vector<LongEnum>* repeated,
+                                vector<LongEnum>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+
+  ScopedAStatus SetOtherTestService(const std::string& name,
+                                    const std::shared_ptr<INamedCallback>& service,
+                                    bool* _aidl_return) override {
+    std::lock_guard<std::mutex> guard(service_map_mutex_);
+    const auto& existing = service_map_.find(name);
+    if (existing != service_map_.end() && existing->second == service) {
+      *_aidl_return = true;
+
+      return ScopedAStatus::ok();
+    } else {
+      *_aidl_return = false;
+      service_map_[name] = service;
+
+      return ScopedAStatus::ok();
+    }
+  }
+
+  ScopedAStatus GetOtherTestService(const std::string& name,
+                                    std::shared_ptr<INamedCallback>* returned_service) override {
+    std::lock_guard<std::mutex> guard(service_map_mutex_);
+    if (service_map_.find(name) == service_map_.end()) {
+      service_map_[name] = SharedRefBase::make<NamedCallback>(name);
+    }
+
+    *returned_service = service_map_[name];
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus VerifyName(const std::shared_ptr<INamedCallback>& service, const std::string& name,
+                           bool* returned_value) override {
+    std::string foundName;
+    ScopedAStatus status = service->GetName(&foundName);
+
+    if (status.isOk()) {
+      *returned_value = foundName == name;
+    }
+
+    return status;
+  }
+
+  ScopedAStatus GetInterfaceArray(const vector<std::string>& names,
+                                  vector<std::shared_ptr<INamedCallback>>* _aidl_return) override {
+    vector<std::shared_ptr<INamedCallback>> services(names.size());
+    for (size_t i = 0; i < names.size(); i++) {
+      if (auto st = GetOtherTestService(names[i], &services[i]); !st.isOk()) {
+        return st;
+      }
+    }
+    *_aidl_return = std::move(services);
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus VerifyNamesWithInterfaceArray(
+      const vector<std::shared_ptr<INamedCallback>>& services, const vector<std::string>& names,
+      bool* _aidl_ret) override {
+    if (services.size() == names.size()) {
+      for (size_t i = 0; i < services.size(); i++) {
+        if (auto st = VerifyName(services[i], names[i], _aidl_ret); !st.isOk() || !*_aidl_ret) {
+          return st;
+        }
+      }
+      *_aidl_ret = true;
+    } else {
+      *_aidl_ret = false;
+    }
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus GetNullableInterfaceArray(
+      const optional<vector<optional<std::string>>>& names,
+      optional<vector<std::shared_ptr<INamedCallback>>>* _aidl_ret) override {
+    vector<std::shared_ptr<INamedCallback>> services;
+    if (names.has_value()) {
+      for (const auto& name : *names) {
+        if (name.has_value()) {
+          std::shared_ptr<INamedCallback> ret;
+          if (auto st = GetOtherTestService(*name, &ret); !st.isOk()) {
+            return st;
+          }
+          services.push_back(std::move(ret));
+        } else {
+          services.emplace_back();
+        }
+      }
+    }
+    *_aidl_ret = std::move(services);
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus VerifyNamesWithNullableInterfaceArray(
+      const optional<vector<std::shared_ptr<INamedCallback>>>& services,
+      const optional<vector<optional<std::string>>>& names, bool* _aidl_ret) override {
+    if (services.has_value() && names.has_value()) {
+      if (services->size() == names->size()) {
+        for (size_t i = 0; i < services->size(); i++) {
+          if (services->at(i).get() && names->at(i).has_value()) {
+            if (auto st = VerifyName(services->at(i), names->at(i).value(), _aidl_ret);
+                !st.isOk() || !*_aidl_ret) {
+              return st;
+            }
+          } else if (services->at(i).get() || names->at(i).has_value()) {
+            *_aidl_ret = false;
+            return ScopedAStatus::ok();
+          } else {
+            // ok if service=null && name=null
+          }
+        }
+        *_aidl_ret = true;
+      } else {
+        *_aidl_ret = false;
+      }
+    } else {
+      *_aidl_ret = services.has_value() == names.has_value();
+    }
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus GetInterfaceList(
+      const optional<vector<optional<std::string>>>& names,
+      optional<vector<std::shared_ptr<INamedCallback>>>* _aidl_ret) override {
+    return GetNullableInterfaceArray(names, _aidl_ret);
+  }
+
+  ScopedAStatus VerifyNamesWithInterfaceList(
+      const optional<vector<std::shared_ptr<INamedCallback>>>& services,
+      const optional<vector<optional<std::string>>>& names, bool* _aidl_ret) override {
+    return VerifyNamesWithNullableInterfaceArray(services, names, _aidl_ret);
+  }
+
+  ScopedAStatus ReverseStringList(const vector<std::string>& input, vector<std::string>* repeated,
+                                  vector<std::string>* _aidl_return) override {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+
+  ScopedAStatus RepeatParcelFileDescriptor(const ScopedFileDescriptor& read,
+                                           ScopedFileDescriptor* _aidl_return) override {
+    ALOGE("Repeating parcel file descriptor");
+    *_aidl_return = read.dup();
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus ReverseParcelFileDescriptorArray(
+      const vector<ScopedFileDescriptor>& input, vector<ScopedFileDescriptor>* repeated,
+      vector<ScopedFileDescriptor>* _aidl_return) override {
+    ALOGI("Reversing parcel descriptor array of length %zu", input.size());
+    for (const auto& item : input) {
+      repeated->push_back(item.dup());
+    }
+
+    for (auto i = input.rbegin(); i != input.rend(); i++) {
+      _aidl_return->push_back(i->dup());
+    }
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus ThrowServiceException(int code) override {
+    return ScopedAStatus::fromServiceSpecificError(code);
+  }
+
+  ScopedAStatus RepeatNullableIntArray(const optional<vector<int32_t>>& input,
+                                       optional<vector<int32_t>>* _aidl_return) {
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  ScopedAStatus RepeatNullableByteEnumArray(const optional<vector<ByteEnum>>& input,
+                                            optional<vector<ByteEnum>>* _aidl_return) {
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  ScopedAStatus RepeatNullableIntEnumArray(const optional<vector<IntEnum>>& input,
+                                           optional<vector<IntEnum>>* _aidl_return) {
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  ScopedAStatus RepeatNullableLongEnumArray(const optional<vector<LongEnum>>& input,
+                                            optional<vector<LongEnum>>* _aidl_return) {
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  ScopedAStatus RepeatNullableStringList(const optional<vector<optional<std::string>>>& input,
+                                         optional<vector<optional<std::string>>>* _aidl_return) {
+    ALOGI("Repeating nullable string list");
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  ScopedAStatus RepeatNullableString(const optional<std::string>& input,
+                                     optional<std::string>* _aidl_return) {
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  ScopedAStatus RepeatNullableParcelable(const optional<ITestService::Empty>& input,
+                                         optional<ITestService::Empty>* _aidl_return) {
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  ScopedAStatus RepeatNullableParcelableList(
+      const optional<vector<optional<ITestService::Empty>>>& input,
+      optional<vector<optional<ITestService::Empty>>>* _aidl_return) {
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  ScopedAStatus RepeatNullableParcelableArray(
+      const optional<vector<optional<ITestService::Empty>>>& input,
+      optional<vector<optional<ITestService::Empty>>>* _aidl_return) {
+    return RepeatNullable(input, _aidl_return);
+  }
+
+  ScopedAStatus TakesAnIBinder(const SpAIBinder& input) override {
+    (void)input;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus TakesANullableIBinder(const SpAIBinder& input) {
+    (void)input;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus TakesAnIBinderList(const vector<SpAIBinder>& input) override {
+    (void)input;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus TakesANullableIBinderList(const optional<vector<SpAIBinder>>& input) {
+    (void)input;
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus RepeatUtf8CppString(const string& token, string* _aidl_return) override {
+    ALOGI("Repeating utf8 string '%s' of length=%zu", token.c_str(), token.size());
+    *_aidl_return = token;
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus RepeatNullableUtf8CppString(const optional<string>& token,
+                                            optional<string>* _aidl_return) override {
+    if (!token) {
+      ALOGI("Received null @utf8InCpp string");
+      return ScopedAStatus::ok();
+    }
+    ALOGI("Repeating utf8 string '%s' of length=%zu", token->c_str(), token->size());
+    *_aidl_return = token;
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus ReverseUtf8CppString(const vector<string>& input, vector<string>* repeated,
+                                     vector<string>* _aidl_return) {
+    return ReverseArray(input, repeated, _aidl_return);
+  }
+
+  ScopedAStatus ReverseNullableUtf8CppString(const optional<vector<optional<string>>>& input,
+                                             optional<vector<optional<string>>>* repeated,
+                                             optional<vector<optional<string>>>* _aidl_return) {
+    return ReverseUtf8CppStringList(input, repeated, _aidl_return);
+  }
+
+  ScopedAStatus ReverseUtf8CppStringList(const optional<vector<optional<string>>>& input,
+                                         optional<vector<optional<string>>>* repeated,
+                                         optional<vector<optional<string>>>* _aidl_return) {
+    if (!input) {
+      ALOGI("Received null list of utf8 strings");
+      return ScopedAStatus::ok();
+    }
+    *_aidl_return = input;
+    *repeated = input;
+    std::reverse((*_aidl_return)->begin(), (*_aidl_return)->end());
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus GetCallback(bool return_null, std::shared_ptr<INamedCallback>* ret) {
+    if (!return_null) {
+      return GetOtherTestService(std::string("ABT: always be testing"), ret);
+    }
+    return ScopedAStatus::ok();
+  }
+
+  virtual ScopedAStatus FillOutStructuredParcelable(StructuredParcelable* parcelable) {
+    parcelable->shouldBeJerry = "Jerry";
+    parcelable->shouldContainThreeFs = {parcelable->f, parcelable->f, parcelable->f};
+    parcelable->shouldBeByteBar = ByteEnum::BAR;
+    parcelable->shouldBeIntBar = IntEnum::BAR;
+    parcelable->shouldBeLongBar = LongEnum::BAR;
+    parcelable->shouldContainTwoByteFoos = {ByteEnum::FOO, ByteEnum::FOO};
+    parcelable->shouldContainTwoIntFoos = {IntEnum::FOO, IntEnum::FOO};
+    parcelable->shouldContainTwoLongFoos = {LongEnum::FOO, LongEnum::FOO};
+
+    parcelable->const_exprs_1 = ConstantExpressionEnum::decInt32_1;
+    parcelable->const_exprs_2 = ConstantExpressionEnum::decInt32_2;
+    parcelable->const_exprs_3 = ConstantExpressionEnum::decInt64_1;
+    parcelable->const_exprs_4 = ConstantExpressionEnum::decInt64_2;
+    parcelable->const_exprs_5 = ConstantExpressionEnum::decInt64_3;
+    parcelable->const_exprs_6 = ConstantExpressionEnum::decInt64_4;
+    parcelable->const_exprs_7 = ConstantExpressionEnum::hexInt32_1;
+    parcelable->const_exprs_8 = ConstantExpressionEnum::hexInt32_2;
+    parcelable->const_exprs_9 = ConstantExpressionEnum::hexInt32_3;
+    parcelable->const_exprs_10 = ConstantExpressionEnum::hexInt64_1;
+
+    parcelable->shouldSetBit0AndBit2 = StructuredParcelable::BIT0 | StructuredParcelable::BIT2;
+
+    parcelable->u = Union::make<Union::ns>({1, 2, 3});
+    parcelable->shouldBeConstS1 = Union::S1;
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus RepeatExtendableParcelable(
+      const ::aidl::android::aidl::tests::extension::ExtendableParcelable& ep,
+      ::aidl::android::aidl::tests::extension::ExtendableParcelable* ep2) {
+    ep2->a = ep.a;
+    ep2->b = ep.b;
+    std::optional<aidl::android::aidl::tests::extension::MyExt> myExt;
+    ep.ext.getParcelable(&myExt);
+
+    if (myExt == std::nullopt) {
+      return ScopedAStatus::fromStatus(android::UNKNOWN_ERROR);
+    }
+
+    ep2->ext.setParcelable(*myExt);
+
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus ReverseList(const RecursiveList& list, RecursiveList* ret) override {
+    std::unique_ptr<RecursiveList> reversed;
+    const RecursiveList* cur = &list;
+    while (cur) {
+      auto node = std::make_unique<RecursiveList>();
+      node->value = cur->value;
+      node->next = std::move(reversed);
+      reversed = std::move(node);
+      cur = cur->next.get();
+    }
+    *ret = std::move(*reversed);
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus ReverseIBinderArray(const vector<SpAIBinder>& input, vector<SpAIBinder>* repeated,
+                                    vector<SpAIBinder>* _aidl_return) override {
+    *repeated = input;
+    *_aidl_return = input;
+    std::reverse(_aidl_return->begin(), _aidl_return->end());
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus ReverseNullableIBinderArray(
+      const std::optional<vector<SpAIBinder>>& input, std::optional<vector<SpAIBinder>>* repeated,
+      std::optional<vector<SpAIBinder>>* _aidl_return) override {
+    *repeated = input;
+    *_aidl_return = input;
+    if (*_aidl_return) {
+      std::reverse((*_aidl_return)->begin(), (*_aidl_return)->end());
+    }
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus UnimplementedMethod(int32_t /* arg */, int32_t* /* _aidl_return */) override {
+    return ScopedAStatus::fromStatus(STATUS_UNKNOWN_TRANSACTION);
+  }
+
+  ScopedAStatus GetOldNameInterface(std::shared_ptr<IOldName>* ret) {
+    *ret = SharedRefBase::make<OldName>();
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus GetNewNameInterface(std::shared_ptr<INewName>* ret) {
+    *ret = SharedRefBase::make<NewName>();
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus GetUnionTags(const std::vector<Union>& input,
+                             std::vector<Union::Tag>* _aidl_return) override {
+    std::vector<Union::Tag> tags;
+    std::transform(input.begin(), input.end(), std::back_inserter(tags),
+                   std::mem_fn(&Union::getTag));
+    *_aidl_return = std::move(tags);
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus GetCppJavaTests(SpAIBinder* ret) {
+    *ret = nullptr;
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus getBackendType(BackendType* _aidl_return) override {
+    *_aidl_return = BackendType::NDK;
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus GetCircular(CircularParcelable* cp,
+                            std::shared_ptr<ICircular>* _aidl_return) override {
+    auto thiz = ref<ITestService>();
+    cp->testService = thiz;
+    *_aidl_return = SharedRefBase::make<Circular>(thiz);
+    return ScopedAStatus::ok();
+  }
+
+ private:
+  std::map<std::string, std::shared_ptr<INamedCallback>> service_map_;
+  std::mutex service_map_mutex_;
+};
+
+class VersionedService : public aidl::android::aidl::versioned::tests::BnFooInterface {
+ public:
+  VersionedService() {}
+  virtual ~VersionedService() = default;
+
+  ScopedAStatus originalApi() override { return ScopedAStatus::ok(); }
+  ScopedAStatus acceptUnionAndReturnString(
+      const ::aidl::android::aidl::versioned::tests::BazUnion& u,
+      std::string* _aidl_return) override {
+    switch (u.getTag()) {
+      case ::aidl::android::aidl::versioned::tests::BazUnion::intNum:
+        *_aidl_return =
+            std::to_string(u.get<::aidl::android::aidl::versioned::tests::BazUnion::intNum>());
+        break;
+    }
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus returnsLengthOfFooArray(
+      const vector<::aidl::android::aidl::versioned::tests::Foo>& foos, int32_t* ret) override {
+    *ret = static_cast<int32_t>(foos.size());
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus ignoreParcelablesAndRepeatInt(
+      const ::aidl::android::aidl::versioned::tests::Foo& inFoo,
+      ::aidl::android::aidl::versioned::tests::Foo* inoutFoo,
+      ::aidl::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* ret) override {
+    (void)inFoo;
+    (void)inoutFoo;
+    (void)outFoo;
+    *ret = value;
+    return ScopedAStatus::ok();
+  }
+};
+
+class LoggableInterfaceService : public aidl::android::aidl::loggable::BnLoggableInterface {
+ public:
+  LoggableInterfaceService() {}
+  virtual ~LoggableInterfaceService() = default;
+
+  virtual ScopedAStatus LogThis(bool, vector<bool>*, int8_t, vector<uint8_t>*, char16_t,
+                                vector<char16_t>*, int32_t, vector<int32_t>*, int64_t,
+                                vector<int64_t>*, float, vector<float>*, double, vector<double>*,
+                                const std::string&, vector<std::string>*, vector<std::string>*,
+                                const aidl::android::aidl::loggable::Data&, const SpAIBinder&,
+                                ScopedFileDescriptor*, vector<ScopedFileDescriptor>*,
+                                vector<std::string>* _aidl_return) override {
+    *_aidl_return = vector<std::string>{std::string("loggable")};
+    return ScopedAStatus::ok();
+  }
+};
+
+using namespace aidl::android::aidl::tests::nested;
+class NestedService : public BnNestedService {
+ public:
+  NestedService() {}
+  virtual ~NestedService() = default;
+
+  virtual ScopedAStatus flipStatus(const ParcelableWithNested& p,
+                                   INestedService::Result* _aidl_return) {
+    if (p.status == ParcelableWithNested::Status::OK) {
+      _aidl_return->status = ParcelableWithNested::Status::NOT_OK;
+    } else {
+      _aidl_return->status = ParcelableWithNested::Status::OK;
+    }
+    return ScopedAStatus::ok();
+  }
+  virtual ScopedAStatus flipStatusWithCallback(
+      ParcelableWithNested::Status status, const std::shared_ptr<INestedService::ICallback>& cb) {
+    if (status == ParcelableWithNested::Status::OK) {
+      return cb->done(ParcelableWithNested::Status::NOT_OK);
+    } else {
+      return cb->done(ParcelableWithNested::Status::OK);
+    }
+  }
+};
+
+using aidl::android::aidl::fixedsizearray::FixedSizeArrayExample;
+class FixedSizeArrayService : public FixedSizeArrayExample::BnRepeatFixedSizeArray {
+ public:
+  FixedSizeArrayService() {}
+  virtual ~FixedSizeArrayService() = default;
+
+  ScopedAStatus RepeatBytes(const std::array<uint8_t, 3>& in_input,
+                            std::array<uint8_t, 3>* out_repeated,
+                            std::array<uint8_t, 3>* _aidl_return) override {
+    *out_repeated = in_input;
+    *_aidl_return = in_input;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus RepeatInts(const std::array<int32_t, 3>& in_input,
+                           std::array<int32_t, 3>* out_repeated,
+                           std::array<int32_t, 3>* _aidl_return) override {
+    *out_repeated = in_input;
+    *_aidl_return = in_input;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus RepeatBinders(const std::array<SpAIBinder, 3>& in_input,
+                              std::array<SpAIBinder, 3>* out_repeated,
+                              std::array<SpAIBinder, 3>* _aidl_return) override {
+    *out_repeated = in_input;
+    *_aidl_return = in_input;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus RepeatParcelables(
+      const std::array<FixedSizeArrayExample::IntParcelable, 3>& in_input,
+      std::array<FixedSizeArrayExample::IntParcelable, 3>* out_repeated,
+      std::array<FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) override {
+    *out_repeated = in_input;
+    *_aidl_return = in_input;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& in_input,
+                              std::array<std::array<uint8_t, 3>, 2>* out_repeated,
+                              std::array<std::array<uint8_t, 3>, 2>* _aidl_return) override {
+    *out_repeated = in_input;
+    *_aidl_return = in_input;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& in_input,
+                             std::array<std::array<int32_t, 3>, 2>* out_repeated,
+                             std::array<std::array<int32_t, 3>, 2>* _aidl_return) override {
+    *out_repeated = in_input;
+    *_aidl_return = in_input;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus Repeat2dBinders(const std::array<std::array<SpAIBinder, 3>, 2>& in_input,
+                                std::array<std::array<SpAIBinder, 3>, 2>* out_repeated,
+                                std::array<std::array<SpAIBinder, 3>, 2>* _aidl_return) override {
+    *out_repeated = in_input;
+    *_aidl_return = in_input;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus Repeat2dParcelables(
+      const std::array<std::array<FixedSizeArrayExample::IntParcelable, 3>, 2>& in_input,
+      std::array<std::array<FixedSizeArrayExample::IntParcelable, 3>, 2>* out_repeated,
+      std::array<std::array<FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) override {
+    *out_repeated = in_input;
+    *_aidl_return = in_input;
+    return ScopedAStatus::ok();
+  }
+};
+
+class TrunkStableService : public aidl::android::aidl::test::trunk::BnTrunkStableTest {
+ public:
+  TrunkStableService() {}
+  virtual ~TrunkStableService() = default;
+
+  ScopedAStatus repeatParcelable(
+      const aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input,
+      aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override {
+    *_aidl_return = input;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus repeatEnum(
+      aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum input,
+      aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override {
+    *_aidl_return = input;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus repeatUnion(
+      const aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input,
+      aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override {
+    *_aidl_return = input;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus callMyCallback(
+      const std::shared_ptr<aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb)
+      override {
+    if (!cb) return ScopedAStatus::fromStatus(android::UNEXPECTED_NULL);
+    MyParcelable a, b;
+    MyEnum c = MyEnum::ZERO, d = MyEnum::ZERO;
+    MyUnion e, f;
+    auto status = cb->repeatParcelable(a, &b);
+    if (!status.isOk()) {
+      return status;
+    }
+    status = cb->repeatEnum(c, &d);
+    if (!status.isOk()) {
+      return status;
+    }
+    status = cb->repeatUnion(e, &f);
+    if (!status.isOk()) {
+      return status;
+    }
+    MyOtherParcelable g, h;
+    status = cb->repeatOtherParcelable(g, &h);
+    return ScopedAStatus::ok();
+  }
+
+  ScopedAStatus repeatOtherParcelable(
+      const aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input,
+      aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return)
+      override {
+    *_aidl_return = input;
+    return ScopedAStatus::ok();
+  }
+};
+
+}  // namespace
+
+int main(int /* argc */, char* /* argv */[]) {
+  std::vector<SpAIBinder> binders = {
+      SharedRefBase::make<NativeService>()->asBinder(),
+      SharedRefBase::make<VersionedService>()->asBinder(),
+      SharedRefBase::make<LoggableInterfaceService>()->asBinder(),
+      SharedRefBase::make<NestedService>()->asBinder(),
+      SharedRefBase::make<FixedSizeArrayService>()->asBinder(),
+      SharedRefBase::make<TrunkStableService>()->asBinder(),
+  };
+
+  for (const SpAIBinder& binder : binders) {
+    const char* desc = AIBinder_Class_getDescriptor(AIBinder_getClass(binder.get()));
+    if (STATUS_OK != AServiceManager_addService(binder.get(), desc)) {
+      ALOGE("Failed to add service %s", desc);
+      return EXIT_FAILURE;
+    }
+  }
+
+  ABinderProcess_joinThreadPool();
+  return EXIT_FAILURE;  // should not reach
+}
diff --git a/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl b/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
new file mode 100644
index 0000000..2c76c87
--- /dev/null
+++ b/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.fixedsizearray;
+
+@JavaDerive(toString=true)
+@RustDerive(PartialEq=true)
+parcelable FixedSizeArrayExample {
+    // to see if NxM array works
+    int[2][3] int2x3 = {{1, 2, 3}, {4, 5, 6}};
+
+    boolean[2] boolArray;
+    byte[2] byteArray;
+    char[2] charArray;
+    int[2] intArray;
+    long[2] longArray;
+    float[2] floatArray;
+    double[2] doubleArray;
+    @utf8InCpp String[2] stringArray = {"hello", "world"};
+    ByteEnum[2] byteEnumArray;
+    IntEnum[2] intEnumArray;
+    LongEnum[2] longEnumArray;
+    IntParcelable[2] parcelableArray;
+    // Following fields are not test-friendly because they should be initialized as non-null.
+    // IBinder[2] binderArray;
+    // ParcelFileDescriptor[2] pfdArray;
+    // IEmptyInterface[2] interfaceArray;
+
+    boolean[2][2] boolMatrix;
+    byte[2][2] byteMatrix;
+    char[2][2] charMatrix;
+    int[2][2] intMatrix;
+    long[2][2] longMatrix;
+    float[2][2] floatMatrix;
+    double[2][2] doubleMatrix;
+    @utf8InCpp String[2][2] stringMatrix = {{"hello", "world"}, {"Ciao", "mondo"}};
+    ByteEnum[2][2] byteEnumMatrix;
+    IntEnum[2][2] intEnumMatrix;
+    LongEnum[2][2] longEnumMatrix;
+    IntParcelable[2][2] parcelableMatrix;
+    // Following fields are not test-friendly because they should be initialized as non-null.
+    // ParcelFileDescriptor[2][2] pfdMatrix;
+    // IBinder[2][2] binderMatrix;
+    // IEmptyInterface[2][2] interfaceMatrix;
+
+    @nullable boolean[2] boolNullableArray;
+    @nullable byte[2] byteNullableArray;
+    @nullable char[2] charNullableArray;
+    @nullable int[2] intNullableArray;
+    @nullable long[2] longNullableArray;
+    @nullable float[2] floatNullableArray;
+    @nullable double[2] doubleNullableArray;
+    @nullable @utf8InCpp String[2] stringNullableArray = {"hello", "world"};
+    @nullable ByteEnum[2] byteEnumNullableArray;
+    @nullable IntEnum[2] intEnumNullableArray;
+    @nullable LongEnum[2] longEnumNullableArray;
+    @nullable IBinder[2] binderNullableArray;
+    @nullable ParcelFileDescriptor[2] pfdNullableArray;
+    @nullable IntParcelable[2] parcelableNullableArray;
+    @nullable IEmptyInterface[2] interfaceNullableArray;
+
+    @nullable boolean[2][2] boolNullableMatrix;
+    @nullable byte[2][2] byteNullableMatrix;
+    @nullable char[2][2] charNullableMatrix;
+    @nullable int[2][2] intNullableMatrix;
+    @nullable long[2][2] longNullableMatrix;
+    @nullable float[2][2] floatNullableMatrix;
+    @nullable double[2][2] doubleNullableMatrix;
+    @nullable @utf8InCpp String[2][2] stringNullableMatrix = {
+            {"hello", "world"}, {"Ciao", "mondo"}};
+    @nullable ByteEnum[2][2] byteEnumNullableMatrix;
+    @nullable IntEnum[2][2] intEnumNullableMatrix;
+    @nullable LongEnum[2][2] longEnumNullableMatrix;
+    @nullable IBinder[2][2] binderNullableMatrix;
+    @nullable ParcelFileDescriptor[2][2] pfdNullableMatrix;
+    @nullable IntParcelable[2][2] parcelableNullableMatrix;
+    @nullable IEmptyInterface[2][2] interfaceNullableMatrix;
+
+    @SuppressWarnings(value={"out-array"})
+    interface IRepeatFixedSizeArray {
+        byte[3] RepeatBytes(in byte[3] input, out byte[3] repeated);
+        int[3] RepeatInts(in int[3] input, out int[3] repeated);
+        IBinder[3] RepeatBinders(in IBinder[3] input, out IBinder[3] repeated);
+        IntParcelable[3] RepeatParcelables(
+                in IntParcelable[3] input, out IntParcelable[3] repeated);
+
+        byte[2][3] Repeat2dBytes(in byte[2][3] input, out byte[2][3] repeated);
+        int[2][3] Repeat2dInts(in int[2][3] input, out int[2][3] repeated);
+        IBinder[2][3] Repeat2dBinders(in IBinder[2][3] input, out IBinder[2][3] repeated);
+        IntParcelable[2][3] Repeat2dParcelables(
+                in IntParcelable[2][3] input, out IntParcelable[2][3] repeated);
+    }
+
+    enum ByteEnum { A }
+
+    @Backing(type="int") enum IntEnum { A }
+
+    @Backing(type="long") enum LongEnum { A }
+
+    @JavaDerive(equals=true)
+    @RustDerive(Clone=true, Copy=true, PartialEq=true)
+    parcelable IntParcelable {
+        int value;
+    }
+
+    interface IEmptyInterface {}
+}
diff --git a/tests/android/aidl/loggable/Data.aidl b/tests/android/aidl/loggable/Data.aidl
new file mode 100644
index 0000000..63e8da4
--- /dev/null
+++ b/tests/android/aidl/loggable/Data.aidl
@@ -0,0 +1,11 @@
+package android.aidl.loggable;
+
+import android.aidl.loggable.Enum;
+import android.aidl.loggable.Union;
+
+parcelable Data {
+    int num;
+    @utf8InCpp String str;
+    Union nestedUnion;
+    Enum nestedEnum = Enum.FOO;
+}
diff --git a/tests/android/aidl/loggable/Enum.aidl b/tests/android/aidl/loggable/Enum.aidl
new file mode 100644
index 0000000..efdfa94
--- /dev/null
+++ b/tests/android/aidl/loggable/Enum.aidl
@@ -0,0 +1,3 @@
+package android.aidl.loggable;
+
+enum Enum { FOO = 42 }
diff --git a/tests/android/aidl/loggable/ILoggableInterface.aidl b/tests/android/aidl/loggable/ILoggableInterface.aidl
new file mode 100644
index 0000000..066884d
--- /dev/null
+++ b/tests/android/aidl/loggable/ILoggableInterface.aidl
@@ -0,0 +1,18 @@
+package android.aidl.loggable;
+import android.aidl.loggable.Data;
+
+interface ILoggableInterface {
+    @SuppressWarnings(value={"inout-parameter", "out-array", "out-nullable"})
+    String[] LogThis(boolean boolValue, inout boolean[] boolArray, byte byteValue,
+            inout byte[] byteArray, char charValue, inout char[] charArray, int intValue,
+            inout int[] intArray, long longValue, inout long[] longArray, float floatValue,
+            inout float[] floatArray, double doubleValue, inout double[] doubleArray,
+            String stringValue, inout String[] stringArray, inout List<String> listValue,
+            in Data dataValue, @nullable IBinder binderValue,
+            inout @nullable ParcelFileDescriptor pfdValue,
+            inout ParcelFileDescriptor[] pfdArray);
+
+    interface ISub {
+        void Log(int value);
+    }
+}
diff --git a/tests/android/aidl/loggable/Union.aidl b/tests/android/aidl/loggable/Union.aidl
new file mode 100644
index 0000000..8e89808
--- /dev/null
+++ b/tests/android/aidl/loggable/Union.aidl
@@ -0,0 +1,6 @@
+package android.aidl.loggable;
+
+union Union {
+    int num = 43;
+    @utf8InCpp String str;
+}
diff --git a/tests/android/aidl/tests/ArrayOfInterfaces.aidl b/tests/android/aidl/tests/ArrayOfInterfaces.aidl
new file mode 100644
index 0000000..c95db2a
--- /dev/null
+++ b/tests/android/aidl/tests/ArrayOfInterfaces.aidl
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+@SuppressWarnings(value={"inout-parameter", "out-array"})
+parcelable ArrayOfInterfaces {
+    interface IEmptyInterface {}
+
+    interface IMyInterface {
+        @nullable IEmptyInterface[] methodWithInterfaces(IEmptyInterface iface,
+                @nullable IEmptyInterface nullable_iface,
+                in IEmptyInterface[] iface_array_in, out IEmptyInterface[] iface_array_out,
+                inout IEmptyInterface[] iface_array_inout,
+                in @nullable IEmptyInterface[] nullable_iface_array_in,
+                out @nullable IEmptyInterface[] nullable_iface_array_out,
+                inout @nullable IEmptyInterface[] nullable_iface_array_inout);
+    }
+
+    @JavaDerive(toString=true, equals=true)
+    parcelable MyParcelable {
+        IEmptyInterface iface;
+        @nullable IEmptyInterface nullable_iface;
+        IEmptyInterface[] iface_array;
+        @nullable IEmptyInterface[] nullable_iface_array;
+    }
+
+    @JavaDerive(toString=true, equals=true)
+    union MyUnion {
+        IEmptyInterface iface;
+        @nullable IEmptyInterface nullable_iface;
+        IEmptyInterface[] iface_array;
+        @nullable IEmptyInterface[] nullable_iface_array;
+    }
+}
diff --git a/tests/android/aidl/tests/BackendType.aidl b/tests/android/aidl/tests/BackendType.aidl
new file mode 100644
index 0000000..56a6aa1
--- /dev/null
+++ b/tests/android/aidl/tests/BackendType.aidl
@@ -0,0 +1,8 @@
+package android.aidl.tests;
+
+enum BackendType {
+    CPP,
+    JAVA,
+    NDK,
+    RUST,
+}
diff --git a/tests/android/aidl/tests/BadParcelable.aidl b/tests/android/aidl/tests/BadParcelable.aidl
new file mode 100644
index 0000000..3fc6ed5
--- /dev/null
+++ b/tests/android/aidl/tests/BadParcelable.aidl
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+parcelable BadParcelable cpp_header "tests/bad_parcelable.h";
diff --git a/tests/android/aidl/tests/ByteEnum.aidl b/tests/android/aidl/tests/ByteEnum.aidl
new file mode 100644
index 0000000..8934b52
--- /dev/null
+++ b/tests/android/aidl/tests/ByteEnum.aidl
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+/*
+ * Hello, world!
+ */
+@Backing(type="byte")
+enum ByteEnum {
+    // Comment about FOO.
+    FOO = 1,
+    BAR = 2,
+    BAZ,
+}
diff --git a/tests/android/aidl/tests/CircularParcelable.aidl b/tests/android/aidl/tests/CircularParcelable.aidl
new file mode 100644
index 0000000..c314a59
--- /dev/null
+++ b/tests/android/aidl/tests/CircularParcelable.aidl
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import android.aidl.tests.ITestService;
+
+parcelable CircularParcelable {
+    @nullable ITestService testService;
+}
diff --git a/tests/android/aidl/tests/ConstantExpressionEnum.aidl b/tests/android/aidl/tests/ConstantExpressionEnum.aidl
new file mode 100644
index 0000000..413cf36
--- /dev/null
+++ b/tests/android/aidl/tests/ConstantExpressionEnum.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+@SuppressWarnings(value={"const-name"})
+@Backing(type="int")
+enum ConstantExpressionEnum {
+    // Should be all true / ones.
+    // dec literals are either int or long
+    decInt32_1 = (~(-1)) == 0,
+    decInt32_2 = ~~(1 << 31) == (1 << 31),
+    decInt64_1 = (~(-1L)) == 0,
+    decInt64_2 = (~4294967295L) != 0,
+    decInt64_3 = (~4294967295) != 0,
+    decInt64_4 = ~~(1L << 63) == (1L << 63),
+
+    // hex literals could be int or long
+    // 0x7fffffff is int, hence can be negated
+    hexInt32_1 = -0x7fffffff < 0,
+
+    // 0x80000000 is int32_t max + 1
+    hexInt32_2 = 0x80000000 < 0,
+
+    // 0xFFFFFFFF is int32_t, not long; if it were long then ~(long)0xFFFFFFFF != 0
+    hexInt32_3 = ~0xFFFFFFFF == 0,
+
+    // 0x7FFFFFFFFFFFFFFF is long, hence can be negated
+    hexInt64_1 = -0x7FFFFFFFFFFFFFFF < 0
+}
diff --git a/tests/android/aidl/tests/DeprecatedEnum.aidl b/tests/android/aidl/tests/DeprecatedEnum.aidl
new file mode 100644
index 0000000..465a600
--- /dev/null
+++ b/tests/android/aidl/tests/DeprecatedEnum.aidl
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+/** @deprecated test */
+@Backing(type="int")
+enum DeprecatedEnum {
+    A,
+    B,
+    C,
+}
diff --git a/tests/android/aidl/tests/DeprecatedParcelable.aidl b/tests/android/aidl/tests/DeprecatedParcelable.aidl
new file mode 100644
index 0000000..42737c4
--- /dev/null
+++ b/tests/android/aidl/tests/DeprecatedParcelable.aidl
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+/** @deprecated test */
+parcelable DeprecatedParcelable {}
diff --git a/tests/android/aidl/tests/FixedSize.aidl b/tests/android/aidl/tests/FixedSize.aidl
new file mode 100644
index 0000000..295199f
--- /dev/null
+++ b/tests/android/aidl/tests/FixedSize.aidl
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import android.aidl.tests.LongEnum;
+
+parcelable FixedSize {
+    @FixedSize
+    parcelable FixedParcelable {
+        boolean booleanValue;
+        byte byteValue;
+        char charValue;
+        int intValue;
+        long longValue;
+        float floatValue;
+        double doubleValue;
+        LongEnum enumValue = LongEnum.FOO;
+        FixedUnion parcelableValue;
+    }
+
+    @FixedSize
+    union FixedUnion {
+        boolean booleanValue = false;
+        byte byteValue;
+        char charValue;
+        int intValue;
+        long longValue;
+        float floatValue;
+        double doubleValue;
+        LongEnum enumValue;
+    }
+}
diff --git a/tests/android/aidl/tests/GenericStructuredParcelable.aidl b/tests/android/aidl/tests/GenericStructuredParcelable.aidl
new file mode 100644
index 0000000..ffbe6bd
--- /dev/null
+++ b/tests/android/aidl/tests/GenericStructuredParcelable.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+@JavaDerive(toString=true)
+@RustDerive(PartialEq=true, Eq=true, Clone=true, Copy=true)
+parcelable GenericStructuredParcelable<T, U, B> {
+    int a;
+    int b;
+}
diff --git a/tests/android/aidl/tests/ICircular.aidl b/tests/android/aidl/tests/ICircular.aidl
new file mode 100644
index 0000000..10c857f
--- /dev/null
+++ b/tests/android/aidl/tests/ICircular.aidl
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import android.aidl.tests.ITestService;
+
+interface ICircular {
+    @nullable ITestService GetTestService();
+}
diff --git a/tests/android/aidl/tests/ICppJavaTests.aidl b/tests/android/aidl/tests/ICppJavaTests.aidl
new file mode 100644
index 0000000..243d110
--- /dev/null
+++ b/tests/android/aidl/tests/ICppJavaTests.aidl
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import android.aidl.tests.BadParcelable;
+import android.aidl.tests.GenericStructuredParcelable;
+import android.aidl.tests.IntEnum;
+import android.aidl.tests.SimpleParcelable;
+import android.aidl.tests.StructuredParcelable;
+import android.aidl.tests.Union;
+import android.os.PersistableBundle;
+
+// Tests that are only supported by the C++/Java backends, not NDK/Rust
+interface ICppJavaTests {
+    BadParcelable RepeatBadParcelable(in BadParcelable input);
+
+    SimpleParcelable RepeatSimpleParcelable(in SimpleParcelable input, out SimpleParcelable repeat);
+    GenericStructuredParcelable<int, StructuredParcelable, IntEnum> RepeatGenericParcelable(
+            in GenericStructuredParcelable<int, StructuredParcelable, IntEnum> input,
+            out GenericStructuredParcelable<int, StructuredParcelable, IntEnum> repeat);
+    PersistableBundle RepeatPersistableBundle(in PersistableBundle input);
+
+    SimpleParcelable[] ReverseSimpleParcelables(
+            in SimpleParcelable[] input, out SimpleParcelable[] repeated);
+    PersistableBundle[] ReversePersistableBundles(
+            in PersistableBundle[] input, out PersistableBundle[] repeated);
+    Union ReverseUnion(in Union input, out Union repeated);
+    // Test that List<T> types work correctly.
+    List<IBinder> ReverseNamedCallbackList(in List<IBinder> input, out List<IBinder> repeated);
+
+    FileDescriptor RepeatFileDescriptor(in FileDescriptor read);
+    FileDescriptor[] ReverseFileDescriptorArray(
+            in FileDescriptor[] input, out FileDescriptor[] repeated);
+}
diff --git a/tests/android/aidl/tests/IDeprecated.aidl b/tests/android/aidl/tests/IDeprecated.aidl
new file mode 100644
index 0000000..f143b69
--- /dev/null
+++ b/tests/android/aidl/tests/IDeprecated.aidl
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+/** @deprecated test */
+interface IDeprecated {}
diff --git a/tests/android/aidl/tests/INamedCallback.aidl b/tests/android/aidl/tests/INamedCallback.aidl
new file mode 100644
index 0000000..003c16f
--- /dev/null
+++ b/tests/android/aidl/tests/INamedCallback.aidl
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+interface INamedCallback {
+    String GetName();
+}
diff --git a/tests/android/aidl/tests/INewName.aidl b/tests/android/aidl/tests/INewName.aidl
new file mode 100644
index 0000000..d19500b
--- /dev/null
+++ b/tests/android/aidl/tests/INewName.aidl
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+@Descriptor(value="android.aidl.tests.IOldName")
+interface INewName {
+    String RealName();
+}
diff --git a/tests/android/aidl/tests/IOldName.aidl b/tests/android/aidl/tests/IOldName.aidl
new file mode 100644
index 0000000..fb27513
--- /dev/null
+++ b/tests/android/aidl/tests/IOldName.aidl
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+interface IOldName {
+    String RealName();
+}
diff --git a/tests/android/aidl/tests/ITestService.aidl b/tests/android/aidl/tests/ITestService.aidl
new file mode 100644
index 0000000..887a9c7
--- /dev/null
+++ b/tests/android/aidl/tests/ITestService.aidl
@@ -0,0 +1,338 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import android.aidl.tests.BackendType;
+import android.aidl.tests.ByteEnum;
+import android.aidl.tests.CircularParcelable;
+import android.aidl.tests.ICircular;
+import android.aidl.tests.INamedCallback;
+import android.aidl.tests.INewName;
+import android.aidl.tests.IOldName;
+import android.aidl.tests.IntEnum;
+import android.aidl.tests.LongEnum;
+import android.aidl.tests.RecursiveList;
+import android.aidl.tests.StructuredParcelable;
+import android.aidl.tests.Union;
+import android.aidl.tests.extension.ExtendableParcelable;
+
+/**
+ * interface comment
+ */
+@SuppressWarnings(value={"inout-parameter", "mixed-oneway", "out-array", "interface-name"})
+@SensitiveData
+@JavaDefault
+@JavaDelegator
+interface ITestService {
+    // Test that constants are accessible
+
+    /**
+     * extra doc comment
+     */
+    // extra line comment
+    /*
+     * extra regular comment
+     */
+    /**
+     * const comment
+     */
+    const int CONSTANT = 42;
+    const int CONSTANT2 = -42;
+    const int CONSTANT3 = +42;
+    const int CONSTANT4 = +4;
+    const int CONSTANT5 = -4;
+    const int CONSTANT6 = -0;
+    const int CONSTANT7 = +0;
+    const int CONSTANT8 = 0;
+    const int CONSTANT9 = 0x56;
+    const int CONSTANT10 = 0xa5;
+    const int CONSTANT11 = 0xFA;
+    const int CONSTANT12 = 0xffffffff;
+
+    const byte BYTE_CONSTANT = 17;
+    const long LONG_CONSTANT = 1L << 40;
+
+    const String STRING_CONSTANT = "foo";
+    const String STRING_CONSTANT2 = "bar";
+
+    const float FLOAT_CONSTANT = 1.0f;
+    const float FLOAT_CONSTANT2 = -1.0f;
+    const float FLOAT_CONSTANT3 = +1.0f;
+    const float FLOAT_CONSTANT4 = +2.2f;
+    const float FLOAT_CONSTANT5 = -2.2f;
+    const float FLOAT_CONSTANT6 = -0.0f;
+    const float FLOAT_CONSTANT7 = +0.0f;
+
+    const double DOUBLE_CONSTANT = 1.0;
+    const double DOUBLE_CONSTANT2 = -1.0;
+    const double DOUBLE_CONSTANT3 = +1.0;
+    const double DOUBLE_CONSTANT4 = +2.2;
+    const double DOUBLE_CONSTANT5 = -2.2;
+    const double DOUBLE_CONSTANT6 = -0.0;
+    const double DOUBLE_CONSTANT7 = +0.0;
+    const double DOUBLE_CONSTANT8 = 1.1f;
+    const double DOUBLE_CONSTANT9 = -1.1f;
+
+    const @utf8InCpp String STRING_CONSTANT_UTF8 = "baz";
+
+    // This is to emulate a method that is added after the service is implemented.
+    // So the client cannot assume that a call to this method will be successful
+    // or not. However, inside the test environment, we can't build client and
+    // the server with different version of this AIDL file. So, we let the server
+    // actually implement this and intercept the dispatch to the method
+    // inside onTransact().
+    // WARNING: Must be first method.
+    // This requires hard coding the transaction number. As long as this method is
+    // the first in this interface, it can keep the
+    // "::android::IBinder::FIRST_CALL_TRANSACTION + 0" value and allow
+    // methods to be added and removed.
+    int UnimplementedMethod(int arg);
+
+    /**
+     * @deprecated to make sure we have something in system/tools/aidl which does a compile check
+     *     of deprecated and make sure this is reflected in goldens
+     */
+    void Deprecated();
+
+    oneway void TestOneway();
+
+    // Test that primitives work as parameters and return types.
+    boolean RepeatBoolean(boolean token);
+    byte RepeatByte(byte token);
+    char RepeatChar(char token);
+    int RepeatInt(int token);
+    long RepeatLong(long token);
+    float RepeatFloat(float token);
+    double RepeatDouble(double token);
+    String RepeatString(String token);
+    ByteEnum RepeatByteEnum(ByteEnum token);
+    IntEnum RepeatIntEnum(IntEnum token);
+    LongEnum RepeatLongEnum(LongEnum token);
+
+    // Test that arrays work as parameters and return types.
+    boolean[] ReverseBoolean(in boolean[] input, out boolean[] repeated);
+    byte[] ReverseByte(in byte[] input, out byte[] repeated);
+    char[] ReverseChar(in char[] input, out char[] repeated);
+    int[] ReverseInt(in int[] input, out int[] repeated);
+    long[] ReverseLong(in long[] input, out long[] repeated);
+    float[] ReverseFloat(in float[] input, out float[] repeated);
+    double[] ReverseDouble(in double[] input, out double[] repeated);
+    String[] ReverseString(in String[] input, out String[] repeated);
+    ByteEnum[] ReverseByteEnum(in ByteEnum[] input, out ByteEnum[] repeated);
+    IntEnum[] ReverseIntEnum(in IntEnum[] input, out IntEnum[] repeated);
+    LongEnum[] ReverseLongEnum(in LongEnum[] input, out LongEnum[] repeated);
+
+    // Test that clients can send and receive Binders.
+    @PropagateAllowBlocking INamedCallback GetOtherTestService(String name);
+    // returns true if the same service is already registered with the same name
+    boolean SetOtherTestService(String name, INamedCallback service);
+    boolean VerifyName(INamedCallback service, String name);
+    INamedCallback[] GetInterfaceArray(in String[] names);
+    boolean VerifyNamesWithInterfaceArray(in INamedCallback[] services, in String[] names);
+    @nullable INamedCallback[] GetNullableInterfaceArray(
+            in @nullable String[] names);
+    boolean VerifyNamesWithNullableInterfaceArray(
+            in @nullable INamedCallback[] services, in @nullable String[] names);
+
+    @nullable List<INamedCallback> GetInterfaceList(in @nullable String[] names);
+    boolean VerifyNamesWithInterfaceList(in @nullable List<INamedCallback> services,
+            in @nullable String[] names);
+
+    // Test that List<T> types work correctly.
+    List<String> ReverseStringList(in List<String> input, out List<String> repeated);
+
+    ParcelFileDescriptor RepeatParcelFileDescriptor(in ParcelFileDescriptor read);
+    ParcelFileDescriptor[] ReverseParcelFileDescriptorArray(
+            in ParcelFileDescriptor[] input, out ParcelFileDescriptor[] repeated);
+
+    // Test that service specific exceptions work correctly.
+    void ThrowServiceException(int code);
+
+    // Test nullability
+    @nullable int[] RepeatNullableIntArray(in @nullable int[] input);
+    @nullable ByteEnum[] RepeatNullableByteEnumArray(in @nullable ByteEnum[] input);
+    @nullable IntEnum[] RepeatNullableIntEnumArray(in @nullable IntEnum[] input);
+    @nullable LongEnum[] RepeatNullableLongEnumArray(in @nullable LongEnum[] input);
+    @nullable String RepeatNullableString(in @nullable String input);
+    @nullable List<String> RepeatNullableStringList(
+            in @nullable List<String> input);
+
+    // Small empty parcelable for nullability check
+    @JavaDerive(equals=true)
+    @RustDerive(Clone=true, PartialEq=true)
+    parcelable Empty {}
+    @nullable Empty RepeatNullableParcelable(in @nullable Empty input);
+    @nullable Empty[] RepeatNullableParcelableArray(in @nullable Empty[] input);
+    @nullable List<Empty> RepeatNullableParcelableList(
+            in @nullable List<Empty> input);
+
+    void TakesAnIBinder(in IBinder input);
+    void TakesANullableIBinder(in @nullable IBinder input);
+    void TakesAnIBinderList(in List<IBinder> input);
+    void TakesANullableIBinderList(in @nullable List<IBinder> input);
+
+    // Test utf8 decoding from utf16 wire format
+    @utf8InCpp String RepeatUtf8CppString(@utf8InCpp String token);
+    @nullable @utf8InCpp String RepeatNullableUtf8CppString(
+            @nullable @utf8InCpp String token);
+
+    @utf8InCpp String[] ReverseUtf8CppString(
+            in @utf8InCpp String[] input, out @utf8InCpp String[] repeated);
+
+    @SuppressWarnings(value={"out-nullable"})
+    @nullable @utf8InCpp String[] ReverseNullableUtf8CppString(
+            in @nullable @utf8InCpp String[] input,
+            out @nullable @utf8InCpp String[] repeated);
+
+    @SuppressWarnings(value={"out-nullable"})
+    @nullable @utf8InCpp List<String> ReverseUtf8CppStringList(
+            in @nullable @utf8InCpp List<String> input,
+            out @nullable @utf8InCpp List<String> repeated);
+
+    /**
+     * comment before annotation
+     */
+    @nullable INamedCallback GetCallback(boolean return_null);
+
+    // Since this paracelable has clearly defined default values, it would be
+    // inefficient to use an IPC to fill it out in practice.
+    void FillOutStructuredParcelable(inout StructuredParcelable parcel);
+
+    void RepeatExtendableParcelable(in ExtendableParcelable ep, out ExtendableParcelable ep2);
+
+    RecursiveList ReverseList(in RecursiveList list);
+
+    IBinder[] ReverseIBinderArray(in IBinder[] input, out IBinder[] repeated);
+    @nullable IBinder[] ReverseNullableIBinderArray(
+            in @nullable IBinder[] input, out @nullable IBinder[] repeated);
+
+    // All these constant expressions should be equal to 1
+    const int A1 = (~(-1)) == 0;
+    const int A2 = ~~(1 << 31) == (1 << 31);
+    const int A3 = -0x7fffffff < 0;
+    const int A4 = 0x80000000 < 0;
+    const int A5 = 0x7fffffff == 2147483647;
+    const int A6 = (1 << 31) == 0x80000000;
+    const int A7 = (1 + 2) == 3;
+    const int A8 = (8 - 9) == -1;
+    const int A9 = (9 * 9) == 81;
+    const int A10 = (29 / 3) == 9;
+    const int A11 = (29 % 3) == 2;
+    const int A12 = (0xC0010000 | 0xF00D) == (0xC001F00D);
+    const int A13 = (10 | 6) == 14;
+    const int A14 = (10 & 6) == 2;
+    const int A15 = (10 ^ 6) == 12;
+    const int A16 = 6 < 10;
+    const int A17 = (10 < 10) == 0;
+    const int A18 = (6 > 10) == 0;
+    const int A19 = (10 > 10) == 0;
+    const int A20 = 19 >= 10;
+    const int A21 = 10 >= 10;
+    const int A22 = 5 <= 10;
+    const int A23 = (19 <= 10) == 0;
+    const int A24 = 19 != 10;
+    const int A25 = (10 != 10) == 0;
+    const int A26 = (22 << 1) == 44;
+    const int A27 = (11 >> 1) == 5;
+    const int A28 = (1 || 0) == 1;
+    const int A29 = (1 || 1) == 1;
+    const int A30 = (0 || 0) == 0;
+    const int A31 = (0 || 1) == 1;
+    const int A32 = (1 && 0) == 0;
+    const int A33 = (1 && 1) == 1;
+    const int A34 = (0 && 0) == 0;
+    const int A35 = (0 && 1) == 0;
+    const int A36 = 4 == 4;
+    const int A37 = -4 < 0;
+    const int A38 = 0xffffffff == -1;
+    const int A39 = 4 + 1 == 5;
+    const int A40 = 2 + 3 - 4;
+    const int A41 = 2 - 3 + 4 == 3;
+    const int A42 = 1 == 4 == 0;
+    const int A43 = 1 && 1;
+    const int A44 = 1 || 1 && 0; // && higher than ||
+    const int A45 = 1 < 2;
+    const int A46 = !!((3 != 4 || (2 < 3 <= 3 > 4)) >= 0);
+    const int A47 = !(1 == 7) && ((3 != 4 || (2 < 3 <= 3 > 4)) >= 0);
+    const int A48 = (1 << 2) >= 0;
+    const int A49 = (4 >> 1) == 2;
+    const int A50 = (8 << -1) == 4;
+    const int A51 = (1 << 30 >> 30) == 1;
+    const int A52 = (1 | 16 >> 2) == 5;
+    const int A53 = (0x0f ^ 0x33 & 0x99) == 0x1e; // & higher than ^
+    const int A54 = (~42 & (1 << 3 | 16 >> 2) ^ 7) == 3;
+    const int A55 = (2 + 3 - 4 * -7 / (10 % 3)) - 33 == 0;
+    const int A56 = (2 + (-3 & 4 / 7)) == 2;
+    const int A57 = (((((1 + 0)))));
+
+    IOldName GetOldNameInterface();
+    INewName GetNewNameInterface();
+
+    Union.Tag[] GetUnionTags(in Union[] input);
+
+    // Retrieve the ICppJavaTests if the server supports it
+    @nullable IBinder GetCppJavaTests();
+
+    BackendType getBackendType();
+
+    parcelable CompilerChecks {
+        // IBinder
+        IBinder binder;
+        @nullable IBinder nullable_binder;
+        IBinder[] binder_array;
+        @nullable IBinder[] nullable_binder_array;
+        List<IBinder> binder_list;
+        @nullable List<IBinder> nullable_binder_list;
+
+        // ParcelFileDescriptor
+        ParcelFileDescriptor pfd;
+        @nullable ParcelFileDescriptor nullable_pfd;
+        ParcelFileDescriptor[] pfd_array;
+        @nullable ParcelFileDescriptor[] nullable_pfd_array;
+        List<ParcelFileDescriptor> pfd_list;
+        @nullable List<ParcelFileDescriptor> nullable_pfd_list;
+
+        // parcelable
+        Empty parcel;
+        @nullable Empty nullable_parcel;
+        Empty[] parcel_array;
+        @nullable Empty[] nullable_parcel_array;
+        List<Empty> parcel_list;
+        @nullable List<Empty> nullable_parcel_list;
+
+        // interface without I-
+        interface Foo {}
+
+        parcelable HasDeprecated {
+            /** @deprecated field */
+            int deprecated;
+        }
+        union UsingHasDeprecated {
+            int n;
+            HasDeprecated m;
+        }
+        interface NoPrefixInterface {
+            parcelable Nested {}
+            interface NestedNoPrefixInterface {
+                void foo();
+            }
+            void foo();
+        }
+    }
+
+    ICircular GetCircular(out CircularParcelable cp);
+}
diff --git a/tests/android/aidl/tests/IntEnum.aidl b/tests/android/aidl/tests/IntEnum.aidl
new file mode 100644
index 0000000..7ab63f3
--- /dev/null
+++ b/tests/android/aidl/tests/IntEnum.aidl
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+@JavaDerive(toString=true)
+@Backing(type="int")
+enum IntEnum {
+    FOO = 1000,
+    BAR = 2000,
+    BAZ,
+    /** @deprecated do not use this */
+    QUX,
+}
diff --git a/tests/android/aidl/tests/ListOfInterfaces.aidl b/tests/android/aidl/tests/ListOfInterfaces.aidl
new file mode 100644
index 0000000..07ba2ac
--- /dev/null
+++ b/tests/android/aidl/tests/ListOfInterfaces.aidl
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+@SuppressWarnings(value={"inout-parameter", "out-nullable"})
+parcelable ListOfInterfaces {
+    interface IEmptyInterface {}
+
+    interface IMyInterface {
+        @nullable List<IEmptyInterface> methodWithInterfaces(IEmptyInterface iface,
+                @nullable IEmptyInterface nullable_iface,
+                in List<IEmptyInterface> iface_list_in, out List<IEmptyInterface> iface_list_out,
+                inout List<IEmptyInterface> iface_list_inout,
+                in @nullable List<IEmptyInterface> nullable_iface_list_in,
+                out @nullable List<IEmptyInterface> nullable_iface_list_out,
+                inout @nullable List<IEmptyInterface> nullable_iface_list_inout);
+    }
+
+    @JavaDerive(toString=true, equals=true)
+    parcelable MyParcelable {
+        IEmptyInterface iface;
+        @nullable IEmptyInterface nullable_iface;
+        List<IEmptyInterface> iface_list;
+        @nullable List<IEmptyInterface> nullable_iface_list;
+    }
+
+    @JavaDerive(toString=true, equals=true)
+    union MyUnion {
+        IEmptyInterface iface;
+        @nullable IEmptyInterface nullable_iface;
+        List<IEmptyInterface> iface_list;
+        @nullable List<IEmptyInterface> nullable_iface_list;
+    }
+}
diff --git a/tests/android/aidl/tests/LongEnum.aidl b/tests/android/aidl/tests/LongEnum.aidl
new file mode 100644
index 0000000..2cd1707
--- /dev/null
+++ b/tests/android/aidl/tests/LongEnum.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+@Backing(type="long")
+enum LongEnum {
+    FOO = 100000000000,
+    BAR = 200000000000,
+    BAZ,
+}
diff --git a/tests/android/aidl/tests/OtherParcelableForToString.aidl b/tests/android/aidl/tests/OtherParcelableForToString.aidl
new file mode 100644
index 0000000..f042ab5
--- /dev/null
+++ b/tests/android/aidl/tests/OtherParcelableForToString.aidl
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+@JavaDerive(toString=true)
+parcelable OtherParcelableForToString {
+    String field;
+}
diff --git a/tests/android/aidl/tests/ParcelableForToString.aidl b/tests/android/aidl/tests/ParcelableForToString.aidl
new file mode 100644
index 0000000..bbb56c7
--- /dev/null
+++ b/tests/android/aidl/tests/ParcelableForToString.aidl
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import android.aidl.tests.GenericStructuredParcelable;
+import android.aidl.tests.IntEnum;
+import android.aidl.tests.OtherParcelableForToString;
+import android.aidl.tests.StructuredParcelable;
+import android.aidl.tests.Union;
+
+@JavaDerive(toString=true)
+parcelable ParcelableForToString {
+    int intValue;
+    int[] intArray;
+    long longValue;
+    long[] longArray;
+    double doubleValue;
+    double[] doubleArray;
+    float floatValue;
+    float[] floatArray;
+    byte byteValue;
+    byte[] byteArray;
+    boolean booleanValue;
+    boolean[] booleanArray;
+    String stringValue;
+    String[] stringArray;
+    List<String> stringList;
+    OtherParcelableForToString parcelableValue;
+    OtherParcelableForToString[] parcelableArray;
+    IntEnum enumValue = IntEnum.FOO;
+    IntEnum[] enumArray;
+    String[] nullArray;
+    List<String> nullList;
+    GenericStructuredParcelable<int, StructuredParcelable, IntEnum> parcelableGeneric;
+    Union unionValue;
+}
diff --git a/tests/android/aidl/tests/RecursiveList.aidl b/tests/android/aidl/tests/RecursiveList.aidl
new file mode 100644
index 0000000..7af10d3
--- /dev/null
+++ b/tests/android/aidl/tests/RecursiveList.aidl
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+parcelable RecursiveList {
+    int value;
+    @nullable(heap=true) RecursiveList next;
+}
diff --git a/tests/android/aidl/tests/SimpleParcelable.aidl b/tests/android/aidl/tests/SimpleParcelable.aidl
new file mode 100644
index 0000000..8573999
--- /dev/null
+++ b/tests/android/aidl/tests/SimpleParcelable.aidl
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+parcelable SimpleParcelable cpp_header "tests/simple_parcelable.h";
diff --git a/tests/android/aidl/tests/StructuredParcelable.aidl b/tests/android/aidl/tests/StructuredParcelable.aidl
new file mode 100644
index 0000000..41fcdfb
--- /dev/null
+++ b/tests/android/aidl/tests/StructuredParcelable.aidl
@@ -0,0 +1,199 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import android.aidl.tests.ByteEnum;
+import android.aidl.tests.ConstantExpressionEnum;
+import android.aidl.tests.IntEnum;
+import android.aidl.tests.LongEnum;
+import android.aidl.tests.Union;
+
+@SuppressWarnings(value={"enum-explicit-default"})
+@JavaDerive(toString=true, equals=true)
+@RustDerive(Clone=true, PartialEq=true)
+parcelable StructuredParcelable {
+    int[] shouldContainThreeFs;
+    int f;
+    @utf8InCpp String shouldBeJerry;
+    ByteEnum shouldBeByteBar;
+    IntEnum shouldBeIntBar;
+    LongEnum shouldBeLongBar;
+    ByteEnum[] shouldContainTwoByteFoos;
+    IntEnum[] shouldContainTwoIntFoos;
+    LongEnum[] shouldContainTwoLongFoos;
+
+    String stringDefaultsToFoo = "foo";
+    byte byteDefaultsToFour = 4;
+    int intDefaultsToFive = 5;
+    long longDefaultsToNegativeSeven = -7;
+    boolean booleanDefaultsToTrue = true;
+    char charDefaultsToC = 'C';
+    float floatDefaultsToPi = 3.14f;
+    double doubleWithDefault = -3.14e17;
+    int[] arrayDefaultsTo123 = {
+            1,
+            2,
+            3,
+    };
+    int[] arrayDefaultsToEmpty = {};
+
+    boolean boolDefault;
+    byte byteDefault;
+    int intDefault;
+    long longDefault;
+    float floatDefault;
+    double doubleDefault;
+
+    // parse checks only
+    double checkDoubleFromFloat = 3.14f;
+    String[] checkStringArray1 = {"a", "b"};
+    @utf8InCpp String[] checkStringArray2 = {"a", "b"};
+
+    // Add test to verify corner cases
+    int int32_min = -2147483648;
+    int int32_max = 2147483647;
+    long int64_max = 9223372036854775807;
+    int hexInt32_neg_1 = 0xffffffff;
+
+    @nullable IBinder ibinder;
+
+    // Make sure we can send an empty parcelable
+    @JavaDerive(toString=true, equals=true)
+    @RustDerive(Clone=true, PartialEq=true)
+    parcelable Empty {}
+
+    Empty empty;
+
+    // Constant expressions that evaluate to 1
+    byte[] int8_1 = {
+            1,
+            0xffu8 + 1 == 0,
+            255u8 + 1 == 0,
+            0x80u8 == -128,
+            // u8 type is reinterpreted as a signed type
+            0x80u8 / 2 == -0x40u8,
+    };
+    int[] int32_1 = {
+            (~(-1)) == 0,
+            ~~(1 << 31) == (1 << 31),
+            -0x7fffffff < 0,
+            0x80000000 < 0,
+
+            0x7fffffff == 2147483647,
+
+            // Shifting for more than 31 bits are undefined. Not tested.
+            (1 << 31) == 0x80000000,
+
+            // Should be all true / ones.
+            (1 + 2) == 3,
+            (8 - 9) == -1,
+            (9 * 9) == 81,
+            (29 / 3) == 9,
+            (29 % 3) == 2,
+            (0xC0010000 | 0xF00D) == (0xC001F00D),
+            (10 | 6) == 14,
+            (10 & 6) == 2,
+            (10 ^ 6) == 12,
+            6 < 10,
+            (10 < 10) == 0,
+            (6 > 10) == 0,
+            (10 > 10) == 0,
+            19 >= 10,
+            10 >= 10,
+            5 <= 10,
+            (19 <= 10) == 0,
+            19 != 10,
+            (10 != 10) == 0,
+            (22 << 1) == 44,
+            (11 >> 1) == 5,
+            (1 || 0) == 1,
+            (1 || 1) == 1,
+            (0 || 0) == 0,
+            (0 || 1) == 1,
+            (1 && 0) == 0,
+            (1 && 1) == 1,
+            (0 && 0) == 0,
+            (0 && 1) == 0,
+
+            // precedence tests -- all 1s
+            4 == 4,
+            -4 < 0,
+            0xffffffff == -1,
+            4 + 1 == 5,
+            2 + 3 - 4,
+            2 - 3 + 4 == 3,
+            1 == 4 == 0,
+            1 && 1,
+            1 || 1 && 0, // && higher than ||
+            1 < 2,
+            !!((3 != 4 || (2 < 3 <= 3 > 4)) >= 0),
+            !(1 == 7) && ((3 != 4 || (2 < 3 <= 3 > 4)) >= 0),
+            (1 << 2) >= 0,
+            (4 >> 1) == 2,
+            (8 << -1) == 4,
+            (1 << 30 >> 30) == 1,
+            (1 | 16 >> 2) == 5,
+            (0x0f ^ 0x33 & 0x99) == 0x1e, // & higher than ^
+            (~42 & (1 << 3 | 16 >> 2) ^ 7) == 3,
+            (2 + 3 - 4 * -7 / (10 % 3)) - 33 == 0,
+            (2 + (-3 & 4 / 7)) == 2,
+            (((((1 + 0))))),
+    };
+
+    long[] int64_1 = {
+            (~(-1)) == 0,
+            (~4294967295) != 0,
+            (~4294967295) != 0,
+            ~~(1L << 63) == (1L << 63),
+            -0x7FFFFFFFFFFFFFFF < 0,
+
+            0x7fffffff == 2147483647,
+            0xfffffffff == 68719476735,
+            0xffffffffffffffff == -1,
+            (0xfL << 32L) == 0xf00000000,
+            (0xfL << 32) == 0xf00000000,
+    };
+    int hexInt32_pos_1 = -0xffffffff;
+    int hexInt64_pos_1 = -0xfffffffffff < 0;
+
+    ConstantExpressionEnum const_exprs_1;
+    ConstantExpressionEnum const_exprs_2;
+    ConstantExpressionEnum const_exprs_3;
+    ConstantExpressionEnum const_exprs_4;
+    ConstantExpressionEnum const_exprs_5;
+    ConstantExpressionEnum const_exprs_6;
+    ConstantExpressionEnum const_exprs_7;
+    ConstantExpressionEnum const_exprs_8;
+    ConstantExpressionEnum const_exprs_9;
+    ConstantExpressionEnum const_exprs_10;
+
+    // String expressions
+    @utf8InCpp String addString1 = "hello"
+            + " world!";
+    @utf8InCpp String addString2 = "The quick brown fox jumps "
+            + "over the lazy dog.";
+
+    const int BIT0 = 0x1;
+    const int BIT1 = 0x1 << 1;
+    const int BIT2 = 0x1 << 2;
+    int shouldSetBit0AndBit2;
+
+    @nullable Union u;
+    @nullable Union shouldBeConstS1;
+
+    IntEnum defaultWithFoo = IntEnum.FOO;
+}
diff --git a/tests/android/aidl/tests/Union.aidl b/tests/android/aidl/tests/Union.aidl
new file mode 100644
index 0000000..bf1444e
--- /dev/null
+++ b/tests/android/aidl/tests/Union.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+import android.aidl.tests.ByteEnum;
+
+@JavaDerive(toString=true, equals=true)
+@RustDerive(Clone=true, PartialEq=true)
+union Union {
+    int[] ns = {};
+    int n;
+    int m;
+    @utf8InCpp String s;
+    @nullable IBinder ibinder;
+    @utf8InCpp List<String> ss;
+    ByteEnum be;
+
+    const @utf8InCpp String S1 = "a string constant in union";
+}
diff --git a/tests/android/aidl/tests/UnionWithFd.aidl b/tests/android/aidl/tests/UnionWithFd.aidl
new file mode 100644
index 0000000..5f59695
--- /dev/null
+++ b/tests/android/aidl/tests/UnionWithFd.aidl
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+union UnionWithFd {
+    int num;
+    ParcelFileDescriptor pfd;
+}
diff --git a/tests/android/aidl/tests/extension/ExtendableParcelable.aidl b/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
new file mode 100644
index 0000000..c3dbfd3
--- /dev/null
+++ b/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.extension;
+
+parcelable ExtendableParcelable {
+    int a;
+    @utf8InCpp String b;
+    ParcelableHolder ext;
+    long c;
+    ParcelableHolder ext2;
+}
diff --git a/tests/android/aidl/tests/extension/MyExt.aidl b/tests/android/aidl/tests/extension/MyExt.aidl
new file mode 100644
index 0000000..6605b8f
--- /dev/null
+++ b/tests/android/aidl/tests/extension/MyExt.aidl
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.extension;
+
+parcelable MyExt {
+    int a;
+    @utf8InCpp String b;
+}
diff --git a/tests/android/aidl/tests/extension/MyExt2.aidl b/tests/android/aidl/tests/extension/MyExt2.aidl
new file mode 100644
index 0000000..3dff232
--- /dev/null
+++ b/tests/android/aidl/tests/extension/MyExt2.aidl
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.extension;
+
+import android.aidl.tests.extension.MyExt;
+
+parcelable MyExt2 {
+    int a;
+    MyExt b;
+    @utf8InCpp String c;
+}
diff --git a/tests/android/aidl/tests/extension/MyExtLike.aidl b/tests/android/aidl/tests/extension/MyExtLike.aidl
new file mode 100644
index 0000000..56778b5
--- /dev/null
+++ b/tests/android/aidl/tests/extension/MyExtLike.aidl
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.extension;
+
+parcelable MyExtLike {
+    int a;
+    String b;
+}
diff --git a/tests/android/aidl/tests/generic/Baz.aidl b/tests/android/aidl/tests/generic/Baz.aidl
new file mode 100644
index 0000000..293d4c3
--- /dev/null
+++ b/tests/android/aidl/tests/generic/Baz.aidl
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.generic;
+
+parcelable Baz {
+    int a;
+}
diff --git a/tests/android/aidl/tests/generic/IFaz.aidl b/tests/android/aidl/tests/generic/IFaz.aidl
new file mode 100644
index 0000000..e467f59
--- /dev/null
+++ b/tests/android/aidl/tests/generic/IFaz.aidl
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.generic;
+
+import android.aidl.tests.IntEnum;
+import android.aidl.tests.generic.Baz;
+import android.aidl.tests.generic.Pair;
+
+interface IFaz {
+    Pair<int, String> getPair();
+    Pair<Baz, Baz> getPair2();
+    Pair<int, IntEnum> getPair3();
+}
diff --git a/tests/android/aidl/tests/generic/Pair.aidl b/tests/android/aidl/tests/generic/Pair.aidl
new file mode 100644
index 0000000..7284a4d
--- /dev/null
+++ b/tests/android/aidl/tests/generic/Pair.aidl
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.generic;
+
+parcelable Pair<A, B>;
diff --git a/tests/android/aidl/tests/immutable/Bar.aidl b/tests/android/aidl/tests/immutable/Bar.aidl
new file mode 100644
index 0000000..4fa0648
--- /dev/null
+++ b/tests/android/aidl/tests/immutable/Bar.aidl
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.immutable;
+
+@JavaOnlyImmutable
+parcelable Bar {
+    String s = "bar";
+}
diff --git a/tests/android/aidl/tests/immutable/Foo.aidl b/tests/android/aidl/tests/immutable/Foo.aidl
new file mode 100644
index 0000000..b13377b
--- /dev/null
+++ b/tests/android/aidl/tests/immutable/Foo.aidl
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.immutable;
+
+import android.aidl.tests.immutable.Bar;
+import android.aidl.tests.immutable.Union;
+
+@JavaOnlyImmutable
+parcelable Foo {
+    int a = 10;
+    Bar b;
+    List<Bar> c;
+    Map<String, Bar> d;
+    Bar[] e;
+    Union u;
+}
diff --git a/tests/android/aidl/tests/immutable/IBaz.aidl b/tests/android/aidl/tests/immutable/IBaz.aidl
new file mode 100644
index 0000000..1981b4a
--- /dev/null
+++ b/tests/android/aidl/tests/immutable/IBaz.aidl
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.immutable;
+
+import android.aidl.tests.immutable.Foo;
+
+interface IBaz {
+    Foo RepeatFoo(in Foo a);
+}
diff --git a/tests/android/aidl/tests/immutable/Union.aidl b/tests/android/aidl/tests/immutable/Union.aidl
new file mode 100644
index 0000000..99a08d4
--- /dev/null
+++ b/tests/android/aidl/tests/immutable/Union.aidl
@@ -0,0 +1,10 @@
+package android.aidl.tests.immutable;
+
+import android.aidl.tests.immutable.Bar;
+
+@JavaOnlyImmutable
+union Union {
+    int num;
+    String[] str;
+    Bar bar;
+}
diff --git a/tests/android/aidl/tests/map/Bar.aidl b/tests/android/aidl/tests/map/Bar.aidl
new file mode 100644
index 0000000..9bd1a1d
--- /dev/null
+++ b/tests/android/aidl/tests/map/Bar.aidl
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.map;
+
+parcelable Bar {
+    int a;
+    String b;
+}
diff --git a/tests/android/aidl/tests/map/Foo.aidl b/tests/android/aidl/tests/map/Foo.aidl
new file mode 100644
index 0000000..74746d2
--- /dev/null
+++ b/tests/android/aidl/tests/map/Foo.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.map;
+
+import android.aidl.tests.map.Bar;
+import android.aidl.tests.map.IEmpty;
+import android.aidl.tests.map.IntEnum;
+
+parcelable Foo {
+    Map<String, IntEnum[]> intEnumArrayMap;
+    Map<String, int[]> intArrayMap;
+    Map<String, Bar> barMap;
+    Map<String, Bar[]> barArrayMap;
+    Map<String, String> stringMap;
+    Map<String, String[]> stringArrayMap;
+    Map<String, IEmpty> interfaceMap;
+    Map<String, IBinder> ibinderMap;
+}
diff --git a/tests/android/aidl/tests/map/IEmpty.aidl b/tests/android/aidl/tests/map/IEmpty.aidl
new file mode 100644
index 0000000..c425c43
--- /dev/null
+++ b/tests/android/aidl/tests/map/IEmpty.aidl
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.map;
+
+interface IEmpty {}
diff --git a/tests/android/aidl/tests/map/IMapTest.aidl b/tests/android/aidl/tests/map/IMapTest.aidl
new file mode 100644
index 0000000..f1188db
--- /dev/null
+++ b/tests/android/aidl/tests/map/IMapTest.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.map;
+
+import android.aidl.tests.map.Bar;
+import android.aidl.tests.map.IEmpty;
+import android.aidl.tests.map.IntEnum;
+
+interface IMapTest {
+    Map<String, IntEnum[]> repeatIntEnumArrayMap(
+            in Map<String, IntEnum[]> input, out Map<String, IntEnum[]> output);
+    Map<String, int[]> repeatIntArrayMap(
+            in Map<String, int[]> input, out Map<String, int[]> output);
+    Map<String, Bar> repeatBarMap(in Map<String, Bar> input, out Map<String, Bar> output);
+    Map<String, Bar[]> repeatBarArrayMap(
+            in Map<String, Bar[]> input, out Map<String, Bar[]> output);
+    Map<String, String> repeatStringMap(
+            in Map<String, String> input, out Map<String, String> output);
+    Map<String, String[]> repeatStringArrayMap(
+            in Map<String, String[]> input, out Map<String, String[]> output);
+    Map<String, IEmpty> repeatInterfaceMap(
+            in Map<String, IEmpty> input, out Map<String, IEmpty> output);
+    Map<String, IBinder> repeatIbinderMap(
+            in Map<String, IBinder> input, out Map<String, IBinder> output);
+}
diff --git a/tests/android/aidl/tests/map/IntEnum.aidl b/tests/android/aidl/tests/map/IntEnum.aidl
new file mode 100644
index 0000000..27edeeb
--- /dev/null
+++ b/tests/android/aidl/tests/map/IntEnum.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.map;
+
+@Backing(type="int")
+enum IntEnum {
+    FOO = 1000,
+    BAR = 2000,
+    BAZ,
+}
diff --git a/tests/android/aidl/tests/nested/DeeplyNested.aidl b/tests/android/aidl/tests/nested/DeeplyNested.aidl
new file mode 100644
index 0000000..ff6dc38
--- /dev/null
+++ b/tests/android/aidl/tests/nested/DeeplyNested.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.nested;
+
+parcelable DeeplyNested {
+    parcelable A {
+        // Can reference deeply nested type of a sibling type.
+        B.C.D.E e = B.C.D.E.OK;
+    }
+    parcelable B {
+        parcelable C {
+            parcelable D {
+                enum E { OK }
+            }
+        }
+    }
+}
diff --git a/tests/android/aidl/tests/nested/INestedService.aidl b/tests/android/aidl/tests/nested/INestedService.aidl
new file mode 100644
index 0000000..d23f5be
--- /dev/null
+++ b/tests/android/aidl/tests/nested/INestedService.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.nested;
+
+import android.aidl.tests.nested.ParcelableWithNested;
+
+interface INestedService {
+    @RustDerive(PartialEq=true)
+    parcelable Result {
+        ParcelableWithNested.Status status = ParcelableWithNested.Status.OK;
+    }
+
+    Result flipStatus(in ParcelableWithNested p);
+
+    interface ICallback {
+        void done(ParcelableWithNested.Status status);
+    }
+    void flipStatusWithCallback(ParcelableWithNested.Status status, ICallback cb);
+}
diff --git a/tests/android/aidl/tests/nested/ParcelableWithNested.aidl b/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
new file mode 100644
index 0000000..fbcfa2c
--- /dev/null
+++ b/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.nested;
+
+parcelable ParcelableWithNested {
+    enum Status { OK, NOT_OK }
+    Status status = Status.OK;
+}
diff --git a/tests/android/aidl/tests/permission/INoPermission.aidl b/tests/android/aidl/tests/permission/INoPermission.aidl
new file mode 100644
index 0000000..f72f0bf
--- /dev/null
+++ b/tests/android/aidl/tests/permission/INoPermission.aidl
@@ -0,0 +1,6 @@
+package android.aidl.tests.permission;
+
+@RequiresNoPermission
+interface INoPermission {
+    void foo();
+}
diff --git a/tests/android/aidl/tests/permission/IProtected.aidl b/tests/android/aidl/tests/permission/IProtected.aidl
new file mode 100644
index 0000000..2504bc8
--- /dev/null
+++ b/tests/android/aidl/tests/permission/IProtected.aidl
@@ -0,0 +1,17 @@
+package android.aidl.tests.permission;
+
+interface IProtected {
+    @EnforcePermission("READ_PHONE_STATE") void PermissionProtected();
+
+    @EnforcePermission(allOf={"INTERNET", "VIBRATE"}) void MultiplePermissionsAll();
+
+    @EnforcePermission(anyOf={"INTERNET", "VIBRATE"}) void MultiplePermissionsAny();
+
+    @EnforcePermission("android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK")
+    void NonManifestPermission();
+
+    // Used by the integration tests to dynamically set permissions that are considered granted.
+    @RequiresNoPermission void Grant(in String permission);
+    @RequiresNoPermission void Revoke(in String permission);
+    @RequiresNoPermission void RevokeAll();
+}
diff --git a/tests/android/aidl/tests/permission/IProtectedInterface.aidl b/tests/android/aidl/tests/permission/IProtectedInterface.aidl
new file mode 100644
index 0000000..f8d8cb4
--- /dev/null
+++ b/tests/android/aidl/tests/permission/IProtectedInterface.aidl
@@ -0,0 +1,7 @@
+package android.aidl.tests.permission;
+
+@EnforcePermission("ACCESS_FINE_LOCATION")
+interface IProtectedInterface {
+    void Method1();
+    void Method2();
+}
diff --git a/tests/android/aidl/tests/permission/platform/IProtected.aidl b/tests/android/aidl/tests/permission/platform/IProtected.aidl
new file mode 100644
index 0000000..d4670a6
--- /dev/null
+++ b/tests/android/aidl/tests/permission/platform/IProtected.aidl
@@ -0,0 +1,8 @@
+package android.aidl.tests.permission.platform;
+
+import android.content.AttributionSource;
+
+interface IProtected {
+    @EnforcePermission(allOf={"INTERNET", "VIBRATE"})
+    void ProtectedWithSourceAttribution(in AttributionSource source);
+}
diff --git a/tests/android/aidl/tests/unions/EnumUnion.aidl b/tests/android/aidl/tests/unions/EnumUnion.aidl
new file mode 100644
index 0000000..817ea1c
--- /dev/null
+++ b/tests/android/aidl/tests/unions/EnumUnion.aidl
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.unions;
+import android.aidl.tests.IntEnum;
+import android.aidl.tests.LongEnum;
+
+@JavaDerive(toString=true, equals=true)
+@RustDerive(Clone=true, PartialEq=true)
+union EnumUnion {
+    IntEnum intEnum = IntEnum.FOO;
+    LongEnum longEnum;
+    /** @deprecated do not use this */
+    int deprecatedField;
+}
diff --git a/tests/android/aidl/tests/unions/UnionInUnion.aidl b/tests/android/aidl/tests/unions/UnionInUnion.aidl
new file mode 100644
index 0000000..b3ddf05
--- /dev/null
+++ b/tests/android/aidl/tests/unions/UnionInUnion.aidl
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.unions;
+import android.aidl.tests.unions.EnumUnion;
+
+@JavaDerive(toString=true, equals=true)
+@RustDerive(Clone=true, PartialEq=true)
+union UnionInUnion {
+    EnumUnion first;
+    int second;
+}
diff --git a/tests/bad_parcelable.cpp b/tests/bad_parcelable.cpp
new file mode 100644
index 0000000..0b80977
--- /dev/null
+++ b/tests/bad_parcelable.cpp
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "tests/bad_parcelable.h"
+
+#include <android-base/stringprintf.h>
+#include <binder/Parcel.h>
+#include <utils/String8.h>
+
+using android::base::StringPrintf;
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BadParcelable::BadParcelable(bool bad, const std::string& name, int32_t number)
+    : bad_(bad), name_(name.c_str(), name.length()), number_(number) {}
+
+status_t BadParcelable::writeToParcel(Parcel* parcel) const {
+  if (auto status = parcel->writeBool(bad_); status != OK) return status;
+  if (auto status = parcel->writeString16(name_); status != OK) return status;
+  if (auto status = parcel->writeInt32(number_); status != OK) return status;
+  // BAD! write superfluous data
+  if (bad_) parcel->writeInt32(42);
+  return OK;
+}
+
+status_t BadParcelable::readFromParcel(const Parcel* parcel) {
+  if (auto status = parcel->readBool(&bad_); status != OK) return status;
+  if (auto status = parcel->readString16(&name_); status != OK) return status;
+  if (auto status = parcel->readInt32(&number_); status != OK) return status;
+  return OK;
+}
+
+std::string BadParcelable::toString() const {
+  return StringPrintf("BadParcelable{bad=%d,name=%s,number=%d}", bad_, String8(name_).c_str(),
+                      number_);
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/bad_parcelable.h b/tests/bad_parcelable.h
new file mode 100644
index 0000000..3dcc9bf
--- /dev/null
+++ b/tests/bad_parcelable.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <cstdint>
+#include <string>
+
+#include <binder/Parcelable.h>
+#include <utils/Errors.h>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+class BadParcelable : public Parcelable {
+ public:
+  BadParcelable() = default;
+  BadParcelable(bool bad, const std::string& name, int32_t number);
+  virtual ~BadParcelable() = default;
+
+  status_t writeToParcel(Parcel* parcel) const override;
+  status_t readFromParcel(const Parcel* parcel) override;
+
+  std::string toString() const;
+
+  friend bool operator==(const BadParcelable& lhs, const BadParcelable& rhs) {
+    return (lhs.bad_ == rhs.bad_) && (lhs.name_ == rhs.name_) && (lhs.number_ == rhs.number_);
+  }
+  friend bool operator!=(const BadParcelable& lhs, const BadParcelable& rhs) {
+    return !(lhs == rhs);
+  }
+
+ private:
+  bool bad_;
+  String16 name_;
+  int32_t number_ = 0;
+};  // class BadParcelable
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/corpus/example_cpp b/tests/corpus/example_cpp
new file mode 100644
index 0000000..2865db1
--- /dev/null
+++ b/tests/corpus/example_cpp
@@ -0,0 +1 @@
+aidl\ --lang=cpp\ tests/IFoo.aidl\ --out\ .\ --header_out\ .\ tests/IFoo.aidl\ interface IFoo { const int a = 3 + 3; void doFoo(); }
\ No newline at end of file
diff --git a/tests/corpus/example_enforce b/tests/corpus/example_enforce
new file mode 100644
index 0000000..73b5587
--- /dev/null
+++ b/tests/corpus/example_enforce
@@ -0,0 +1 @@
+aidl\ --lang=java\ tests/IFoo.aidl\ --out\ .\ --header_out\ .\ tests/IFoo.aidl\ interface IFoo {  @Enforce("permission = ABC || permission=DEF") void doFoo(); }
diff --git a/tests/corpus/example_java b/tests/corpus/example_java
new file mode 100644
index 0000000..188f6c1
--- /dev/null
+++ b/tests/corpus/example_java
@@ -0,0 +1 @@
+aidl\ --lang=java\ tests/IFoo.aidl\ --out\ .\ --header_out\ .\ tests/IFoo.aidl\ interface IFoo { const int a = 3 + 3; void doFoo(); }
\ No newline at end of file
diff --git a/tests/corpus/example_ndk b/tests/corpus/example_ndk
new file mode 100644
index 0000000..5f48c23
--- /dev/null
+++ b/tests/corpus/example_ndk
@@ -0,0 +1 @@
+aidl\ --lang=ndk\ tests/IFoo.aidl\ --out\ .\ --header_out\ .\ tests/IFoo.aidl\ interface IFoo { const int a = 3 + 3; void doFoo(); }
\ No newline at end of file
diff --git a/tests/corpus/example_rust b/tests/corpus/example_rust
new file mode 100644
index 0000000..c792b89
--- /dev/null
+++ b/tests/corpus/example_rust
@@ -0,0 +1 @@
+aidl\ --lang=rust\ tests/IFoo.aidl\ --out\ .\ --header_out\ .\ tests/IFoo.aidl\ interface IFoo { const int a = 3 + 3; void doFoo(); }
\ No newline at end of file
diff --git a/tests/corpus/java_map b/tests/corpus/java_map
new file mode 100644
index 0000000..b335b8c
--- /dev/null
+++ b/tests/corpus/java_map
@@ -0,0 +1 @@
+aidl\ --lang=java\ tests/IFoo.aidl\ --out\ .\ --header_out\ .\ tests/IFoo.aidl\ interface IFoo { boolean getFds(out Map<String,FileDescriptor> fds); }
\ No newline at end of file
diff --git a/tests/corpus/overflow_in_nested_interface b/tests/corpus/overflow_in_nested_interface
new file mode 100644
index 0000000..7e00f88
--- /dev/null
+++ b/tests/corpus/overflow_in_nested_interface
@@ -0,0 +1 @@
+\ -a\ tests/IFoo.aidl\ -t\ \ tests/IFoo.aidl\ interface oo{interface o{const int a=0/0;}}
\ No newline at end of file
diff --git a/tests/fake_io_delegate.cpp b/tests/fake_io_delegate.cpp
new file mode 100644
index 0000000..41fa2a1
--- /dev/null
+++ b/tests/fake_io_delegate.cpp
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "fake_io_delegate.h"
+
+#include <android-base/stringprintf.h>
+#include <android-base/strings.h>
+
+#include "logging.h"
+#include "os.h"
+#include "tests/test_util.h"
+
+using android::base::Result;
+using android::base::StringAppendF;
+using android::base::StringPrintf;
+using std::string;
+using std::unique_ptr;
+using std::vector;
+
+namespace android {
+namespace aidl {
+namespace test {
+
+// Claims to always write successfully, but can't close the file.
+class BrokenCodeWriter : public CodeWriter {
+  bool Write(const char* /* format */, ...) override {  return true; }
+  bool Close() override { return false; }
+  ~BrokenCodeWriter() override = default;
+};  // class BrokenCodeWriter
+
+unique_ptr<string> FakeIoDelegate::GetFileContents(
+    const string& relative_filename,
+    const string& content_suffix) const {
+  string filename = CleanPath(relative_filename);
+  unique_ptr<string> contents;
+  auto it = file_contents_.find(filename);
+  if (it == file_contents_.end()) {
+    return contents;
+  }
+  contents.reset(new string);
+  *contents = it->second;
+  contents->append(content_suffix);
+
+  return contents;
+}
+
+bool FakeIoDelegate::FileIsReadable(const string& path) const {
+  return file_contents_.find(CleanPath(path)) != file_contents_.end();
+}
+
+std::unique_ptr<CodeWriter> FakeIoDelegate::GetCodeWriter(
+    const std::string& file_path) const {
+  if (broken_files_.count(file_path) > 0) {
+    return unique_ptr<CodeWriter>(new BrokenCodeWriter);
+  }
+  written_file_contents_[file_path] = "";
+  return CodeWriter::ForString(&written_file_contents_[file_path]);
+}
+
+void FakeIoDelegate::SetFileContents(const string& filename,
+                                     const string& contents) {
+  file_contents_[filename] = contents;
+}
+
+Result<vector<string>> FakeIoDelegate::ListFiles(const string& dir) const {
+  const string dir_name = dir.back() == OS_PATH_SEPARATOR ? dir : dir + OS_PATH_SEPARATOR;
+  vector<string> files;
+  for (auto it = file_contents_.begin(); it != file_contents_.end(); it++) {
+    if (android::base::StartsWith(it->first, dir_name)) {
+      files.emplace_back(it->first);
+    }
+  }
+  return files;
+}
+
+void FakeIoDelegate::AddBrokenFilePath(const std::string& path) {
+  broken_files_.insert(path);
+}
+
+bool FakeIoDelegate::GetWrittenContents(const string& path, string* content) const {
+  const auto it = written_file_contents_.find(path);
+  if (it == written_file_contents_.end()) {
+    return false;
+  }
+  if (content) {
+    *content = it->second;
+  }
+  return true;
+}
+
+const std::map<std::string, std::string>& FakeIoDelegate::InputFiles() const {
+  return file_contents_;
+}
+
+const std::map<std::string, std::string>& FakeIoDelegate::OutputFiles() const {
+  return written_file_contents_;
+}
+
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/fake_io_delegate.h b/tests/fake_io_delegate.h
new file mode 100644
index 0000000..2503cce
--- /dev/null
+++ b/tests/fake_io_delegate.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include <map>
+#include <memory>
+#include <set>
+#include <string>
+#include <vector>
+
+#include "io_delegate.h"
+
+namespace android {
+namespace aidl {
+namespace test {
+
+class FakeIoDelegate : public IoDelegate {
+ public:
+  FakeIoDelegate() = default;
+  virtual ~FakeIoDelegate() = default;
+
+  // non-copyable, non-movable
+  FakeIoDelegate(const FakeIoDelegate&) = delete;
+  FakeIoDelegate(FakeIoDelegate&&) = delete;
+  FakeIoDelegate& operator=(const FakeIoDelegate&) = delete;
+  FakeIoDelegate& operator=(FakeIoDelegate&&) = delete;
+
+  // Overrides from the real IoDelegate
+  std::unique_ptr<std::string> GetFileContents(
+      const std::string& filename,
+      const std::string& append_content_suffix = "") const override;
+  bool FileIsReadable(const std::string& path) const override;
+  std::unique_ptr<CodeWriter> GetCodeWriter(
+      const std::string& file_path) const override;
+  android::base::Result<std::vector<std::string>> ListFiles(const std::string& dir) const override;
+
+  // Methods added to facilitate testing.
+  void SetFileContents(const std::string& filename, const std::string& contents);
+  void AddBrokenFilePath(const std::string& path);
+  // Returns true iff we've previously written to |path|.
+  // When we return true, we'll set *contents to the written string.
+  bool GetWrittenContents(const std::string& path, std::string* content) const;
+  const std::map<std::string, std::string>& InputFiles() const;
+  const std::map<std::string, std::string>& OutputFiles() const;
+
+ private:
+  std::map<std::string, std::string> file_contents_;
+  // Normally, writing to files leaves the IoDelegate unchanged, so
+  // GetCodeWriter is a const method.  However, for tests, we break this
+  // intentionally by storing the written strings.
+  mutable std::map<std::string, std::string> written_file_contents_;
+
+  // We normally just write to strings in |written_file_contents_| but for
+  // files in this list, we simulate I/O errors.
+  std::set<std::string> broken_files_;
+};  // class FakeIoDelegate
+
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/.clang-format b/tests/golden_output/.clang-format
new file mode 100644
index 0000000..1b1c664
--- /dev/null
+++ b/tests/golden_output/.clang-format
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2020 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+DisableFormat: true
+SortIncludes: false
diff --git a/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp b/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp
new file mode 100644
index 0000000..b96e90d
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp
@@ -0,0 +1,1476 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/staging/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+::android::status_t FixedSizeArrayExample::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&int2x3);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&boolArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&byteArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&charArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&intArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&longArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&floatArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&doubleArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&stringArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&byteEnumArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&intEnumArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&longEnumArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&parcelableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&boolMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&byteMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&charMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&intMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&longMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&floatMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&doubleMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&stringMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&byteEnumMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&intEnumMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&longEnumMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&parcelableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&boolNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&byteNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&charNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&intNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&longNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&floatNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&doubleNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&stringNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&byteEnumNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&intEnumNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&longEnumNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&binderNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&pfdNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&parcelableNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&interfaceNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&boolNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&byteNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&charNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&intNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&longNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&floatNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&doubleNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&stringNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&byteEnumNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&intEnumNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&longEnumNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&binderNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&pfdNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&parcelableNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&interfaceNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t FixedSizeArrayExample::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(int2x3);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(boolArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(byteArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(charArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(intArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(longArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(floatArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(doubleArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(stringArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(byteEnumArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(intEnumArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(longEnumArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(parcelableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(boolMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(byteMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(charMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(intMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(longMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(floatMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(doubleMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(stringMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(byteEnumMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(intEnumMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(longEnumMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(parcelableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(boolNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(byteNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(charNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(intNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(longNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(floatNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(doubleNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(stringNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(byteEnumNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(intEnumNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(longEnumNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(binderNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(pfdNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(parcelableNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(interfaceNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(boolNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(byteNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(charNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(intNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(longNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(floatNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(doubleNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(stringNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(byteEnumNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(intEnumNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(longEnumNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(binderNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(pfdNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(parcelableNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(interfaceNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(FixedSizeArrayExample, RepeatFixedSizeArray, "android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray")
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+
+FixedSizeArrayExample::BpRepeatFixedSizeArray::BpRepeatFixedSizeArray(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IRepeatFixedSizeArray>(_aidl_impl){
+}
+
+::android::binder::Status FixedSizeArrayExample::BpRepeatFixedSizeArray::RepeatBytes(const std::array<uint8_t, 3>& input, std::array<uint8_t, 3>* repeated, std::array<uint8_t, 3>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::RepeatBytes::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFixedArray(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(FixedSizeArrayExample::BnRepeatFixedSizeArray::TRANSACTION_RepeatBytes, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl())) {
+     return IRepeatFixedSizeArray::getDefaultImpl()->RepeatBytes(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status FixedSizeArrayExample::BpRepeatFixedSizeArray::RepeatInts(const std::array<int32_t, 3>& input, std::array<int32_t, 3>* repeated, std::array<int32_t, 3>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::RepeatInts::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFixedArray(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(FixedSizeArrayExample::BnRepeatFixedSizeArray::TRANSACTION_RepeatInts, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl())) {
+     return IRepeatFixedSizeArray::getDefaultImpl()->RepeatInts(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status FixedSizeArrayExample::BpRepeatFixedSizeArray::RepeatBinders(const std::array<::android::sp<::android::IBinder>, 3>& input, std::array<::android::sp<::android::IBinder>, 3>* repeated, std::array<::android::sp<::android::IBinder>, 3>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::RepeatBinders::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFixedArray(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(FixedSizeArrayExample::BnRepeatFixedSizeArray::TRANSACTION_RepeatBinders, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl())) {
+     return IRepeatFixedSizeArray::getDefaultImpl()->RepeatBinders(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status FixedSizeArrayExample::BpRepeatFixedSizeArray::RepeatParcelables(const std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& input, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* repeated, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::RepeatParcelables::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFixedArray(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(FixedSizeArrayExample::BnRepeatFixedSizeArray::TRANSACTION_RepeatParcelables, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl())) {
+     return IRepeatFixedSizeArray::getDefaultImpl()->RepeatParcelables(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status FixedSizeArrayExample::BpRepeatFixedSizeArray::Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& input, std::array<std::array<uint8_t, 3>, 2>* repeated, std::array<std::array<uint8_t, 3>, 2>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::Repeat2dBytes::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFixedArray(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(FixedSizeArrayExample::BnRepeatFixedSizeArray::TRANSACTION_Repeat2dBytes, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl())) {
+     return IRepeatFixedSizeArray::getDefaultImpl()->Repeat2dBytes(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status FixedSizeArrayExample::BpRepeatFixedSizeArray::Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& input, std::array<std::array<int32_t, 3>, 2>* repeated, std::array<std::array<int32_t, 3>, 2>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::Repeat2dInts::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFixedArray(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(FixedSizeArrayExample::BnRepeatFixedSizeArray::TRANSACTION_Repeat2dInts, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl())) {
+     return IRepeatFixedSizeArray::getDefaultImpl()->Repeat2dInts(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status FixedSizeArrayExample::BpRepeatFixedSizeArray::Repeat2dBinders(const std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>& input, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* repeated, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::Repeat2dBinders::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFixedArray(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(FixedSizeArrayExample::BnRepeatFixedSizeArray::TRANSACTION_Repeat2dBinders, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl())) {
+     return IRepeatFixedSizeArray::getDefaultImpl()->Repeat2dBinders(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status FixedSizeArrayExample::BpRepeatFixedSizeArray::Repeat2dParcelables(const std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& input, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* repeated, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::Repeat2dParcelables::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFixedArray(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(FixedSizeArrayExample::BnRepeatFixedSizeArray::TRANSACTION_Repeat2dParcelables, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl())) {
+     return IRepeatFixedSizeArray::getDefaultImpl()->Repeat2dParcelables(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+
+FixedSizeArrayExample::BnRepeatFixedSizeArray::BnRepeatFixedSizeArray()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t FixedSizeArrayExample::BnRepeatFixedSizeArray::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnRepeatFixedSizeArray::TRANSACTION_RepeatBytes:
+  {
+    std::array<uint8_t, 3> in_input;
+    std::array<uint8_t, 3> out_repeated;
+    std::array<uint8_t, 3> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::RepeatBytes::cppServer");
+    _aidl_ret_status = _aidl_data.readFixedArray(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatBytes(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnRepeatFixedSizeArray::TRANSACTION_RepeatInts:
+  {
+    std::array<int32_t, 3> in_input;
+    std::array<int32_t, 3> out_repeated;
+    std::array<int32_t, 3> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::RepeatInts::cppServer");
+    _aidl_ret_status = _aidl_data.readFixedArray(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatInts(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnRepeatFixedSizeArray::TRANSACTION_RepeatBinders:
+  {
+    std::array<::android::sp<::android::IBinder>, 3> in_input;
+    std::array<::android::sp<::android::IBinder>, 3> out_repeated;
+    std::array<::android::sp<::android::IBinder>, 3> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::RepeatBinders::cppServer");
+    _aidl_ret_status = _aidl_data.readFixedArray(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatBinders(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnRepeatFixedSizeArray::TRANSACTION_RepeatParcelables:
+  {
+    std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3> in_input;
+    std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3> out_repeated;
+    std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::RepeatParcelables::cppServer");
+    _aidl_ret_status = _aidl_data.readFixedArray(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatParcelables(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnRepeatFixedSizeArray::TRANSACTION_Repeat2dBytes:
+  {
+    std::array<std::array<uint8_t, 3>, 2> in_input;
+    std::array<std::array<uint8_t, 3>, 2> out_repeated;
+    std::array<std::array<uint8_t, 3>, 2> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::Repeat2dBytes::cppServer");
+    _aidl_ret_status = _aidl_data.readFixedArray(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(Repeat2dBytes(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnRepeatFixedSizeArray::TRANSACTION_Repeat2dInts:
+  {
+    std::array<std::array<int32_t, 3>, 2> in_input;
+    std::array<std::array<int32_t, 3>, 2> out_repeated;
+    std::array<std::array<int32_t, 3>, 2> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::Repeat2dInts::cppServer");
+    _aidl_ret_status = _aidl_data.readFixedArray(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(Repeat2dInts(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnRepeatFixedSizeArray::TRANSACTION_Repeat2dBinders:
+  {
+    std::array<std::array<::android::sp<::android::IBinder>, 3>, 2> in_input;
+    std::array<std::array<::android::sp<::android::IBinder>, 3>, 2> out_repeated;
+    std::array<std::array<::android::sp<::android::IBinder>, 3>, 2> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::Repeat2dBinders::cppServer");
+    _aidl_ret_status = _aidl_data.readFixedArray(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(Repeat2dBinders(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnRepeatFixedSizeArray::TRANSACTION_Repeat2dParcelables:
+  {
+    std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2> in_input;
+    std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2> out_repeated;
+    std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::Repeat2dParcelables::cppServer");
+    _aidl_ret_status = _aidl_data.readFixedArray(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(Repeat2dParcelables(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+::android::status_t FixedSizeArrayExample::IntParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&value);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t FixedSizeArrayExample::IntParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(value);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(FixedSizeArrayExample, EmptyInterface, "android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface")
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+
+FixedSizeArrayExample::BpEmptyInterface::BpEmptyInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IEmptyInterface>(_aidl_impl){
+}
+
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+
+FixedSizeArrayExample::BnEmptyInterface::BnEmptyInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t FixedSizeArrayExample::BnEmptyInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d b/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d
new file mode 100644
index 0000000..940e183
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp : \
+  system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
diff --git a/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/BnFixedSizeArrayExample.h b/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/BnFixedSizeArrayExample.h
new file mode 100644
index 0000000..7c80743
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/BnFixedSizeArrayExample.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/staging/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/BpFixedSizeArrayExample.h b/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/BpFixedSizeArrayExample.h
new file mode 100644
index 0000000..a997b4a
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/BpFixedSizeArrayExample.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/staging/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/FixedSizeArrayExample.h b/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/FixedSizeArrayExample.h
new file mode 100644
index 0000000..1679c3e
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/FixedSizeArrayExample.h
@@ -0,0 +1,432 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/staging/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#pragma once
+
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Delegate.h>
+#include <binder/Enums.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Parcel.h>
+#include <binder/ParcelFileDescriptor.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cstdint>
+#include <optional>
+#include <string>
+#include <tuple>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+class FixedSizeArrayExample : public ::android::Parcelable {
+public:
+  class IntParcelable : public ::android::Parcelable {
+  public:
+    int32_t value = 0;
+    inline bool operator!=(const IntParcelable& rhs) const {
+      return std::tie(value) != std::tie(rhs.value);
+    }
+    inline bool operator<(const IntParcelable& rhs) const {
+      return std::tie(value) < std::tie(rhs.value);
+    }
+    inline bool operator<=(const IntParcelable& rhs) const {
+      return std::tie(value) <= std::tie(rhs.value);
+    }
+    inline bool operator==(const IntParcelable& rhs) const {
+      return std::tie(value) == std::tie(rhs.value);
+    }
+    inline bool operator>(const IntParcelable& rhs) const {
+      return std::tie(value) > std::tie(rhs.value);
+    }
+    inline bool operator>=(const IntParcelable& rhs) const {
+      return std::tie(value) >= std::tie(rhs.value);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "IntParcelable{";
+      os << "value: " << ::android::internal::ToString(value);
+      os << "}";
+      return os.str();
+    }
+  };  // class IntParcelable
+  class IRepeatFixedSizeArrayDelegator;
+
+  class IRepeatFixedSizeArray : public ::android::IInterface {
+  public:
+    typedef IRepeatFixedSizeArrayDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(RepeatFixedSizeArray)
+    virtual ::android::binder::Status RepeatBytes(const std::array<uint8_t, 3>& input, std::array<uint8_t, 3>* repeated, std::array<uint8_t, 3>* _aidl_return) = 0;
+    virtual ::android::binder::Status RepeatInts(const std::array<int32_t, 3>& input, std::array<int32_t, 3>* repeated, std::array<int32_t, 3>* _aidl_return) = 0;
+    virtual ::android::binder::Status RepeatBinders(const std::array<::android::sp<::android::IBinder>, 3>& input, std::array<::android::sp<::android::IBinder>, 3>* repeated, std::array<::android::sp<::android::IBinder>, 3>* _aidl_return) = 0;
+    virtual ::android::binder::Status RepeatParcelables(const std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& input, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* repeated, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) = 0;
+    virtual ::android::binder::Status Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& input, std::array<std::array<uint8_t, 3>, 2>* repeated, std::array<std::array<uint8_t, 3>, 2>* _aidl_return) = 0;
+    virtual ::android::binder::Status Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& input, std::array<std::array<int32_t, 3>, 2>* repeated, std::array<std::array<int32_t, 3>, 2>* _aidl_return) = 0;
+    virtual ::android::binder::Status Repeat2dBinders(const std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>& input, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* repeated, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* _aidl_return) = 0;
+    virtual ::android::binder::Status Repeat2dParcelables(const std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& input, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* repeated, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) = 0;
+  };  // class IRepeatFixedSizeArray
+
+  class IRepeatFixedSizeArrayDefault : public IRepeatFixedSizeArray {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+    ::android::binder::Status RepeatBytes(const std::array<uint8_t, 3>& /*input*/, std::array<uint8_t, 3>* /*repeated*/, std::array<uint8_t, 3>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status RepeatInts(const std::array<int32_t, 3>& /*input*/, std::array<int32_t, 3>* /*repeated*/, std::array<int32_t, 3>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status RepeatBinders(const std::array<::android::sp<::android::IBinder>, 3>& /*input*/, std::array<::android::sp<::android::IBinder>, 3>* /*repeated*/, std::array<::android::sp<::android::IBinder>, 3>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status RepeatParcelables(const std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& /*input*/, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* /*repeated*/, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& /*input*/, std::array<std::array<uint8_t, 3>, 2>* /*repeated*/, std::array<std::array<uint8_t, 3>, 2>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& /*input*/, std::array<std::array<int32_t, 3>, 2>* /*repeated*/, std::array<std::array<int32_t, 3>, 2>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status Repeat2dBinders(const std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>& /*input*/, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* /*repeated*/, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status Repeat2dParcelables(const std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& /*input*/, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* /*repeated*/, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+  };  // class IRepeatFixedSizeArrayDefault
+  class BpRepeatFixedSizeArray : public ::android::BpInterface<IRepeatFixedSizeArray> {
+  public:
+    explicit BpRepeatFixedSizeArray(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpRepeatFixedSizeArray() = default;
+    ::android::binder::Status RepeatBytes(const std::array<uint8_t, 3>& input, std::array<uint8_t, 3>* repeated, std::array<uint8_t, 3>* _aidl_return) override;
+    ::android::binder::Status RepeatInts(const std::array<int32_t, 3>& input, std::array<int32_t, 3>* repeated, std::array<int32_t, 3>* _aidl_return) override;
+    ::android::binder::Status RepeatBinders(const std::array<::android::sp<::android::IBinder>, 3>& input, std::array<::android::sp<::android::IBinder>, 3>* repeated, std::array<::android::sp<::android::IBinder>, 3>* _aidl_return) override;
+    ::android::binder::Status RepeatParcelables(const std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& input, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* repeated, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) override;
+    ::android::binder::Status Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& input, std::array<std::array<uint8_t, 3>, 2>* repeated, std::array<std::array<uint8_t, 3>, 2>* _aidl_return) override;
+    ::android::binder::Status Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& input, std::array<std::array<int32_t, 3>, 2>* repeated, std::array<std::array<int32_t, 3>, 2>* _aidl_return) override;
+    ::android::binder::Status Repeat2dBinders(const std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>& input, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* repeated, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* _aidl_return) override;
+    ::android::binder::Status Repeat2dParcelables(const std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& input, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* repeated, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) override;
+  };  // class BpRepeatFixedSizeArray
+  class BnRepeatFixedSizeArray : public ::android::BnInterface<IRepeatFixedSizeArray> {
+  public:
+    static constexpr uint32_t TRANSACTION_RepeatBytes = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+    static constexpr uint32_t TRANSACTION_RepeatInts = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+    static constexpr uint32_t TRANSACTION_RepeatBinders = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+    static constexpr uint32_t TRANSACTION_RepeatParcelables = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
+    static constexpr uint32_t TRANSACTION_Repeat2dBytes = ::android::IBinder::FIRST_CALL_TRANSACTION + 4;
+    static constexpr uint32_t TRANSACTION_Repeat2dInts = ::android::IBinder::FIRST_CALL_TRANSACTION + 5;
+    static constexpr uint32_t TRANSACTION_Repeat2dBinders = ::android::IBinder::FIRST_CALL_TRANSACTION + 6;
+    static constexpr uint32_t TRANSACTION_Repeat2dParcelables = ::android::IBinder::FIRST_CALL_TRANSACTION + 7;
+    explicit BnRepeatFixedSizeArray();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  };  // class BnRepeatFixedSizeArray
+
+  class IRepeatFixedSizeArrayDelegator : public BnRepeatFixedSizeArray {
+  public:
+    explicit IRepeatFixedSizeArrayDelegator(const ::android::sp<IRepeatFixedSizeArray> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<IRepeatFixedSizeArray> getImpl() { return _aidl_delegate; }
+    ::android::binder::Status RepeatBytes(const std::array<uint8_t, 3>& input, std::array<uint8_t, 3>* repeated, std::array<uint8_t, 3>* _aidl_return) override {
+      return _aidl_delegate->RepeatBytes(input, repeated, _aidl_return);
+    }
+    ::android::binder::Status RepeatInts(const std::array<int32_t, 3>& input, std::array<int32_t, 3>* repeated, std::array<int32_t, 3>* _aidl_return) override {
+      return _aidl_delegate->RepeatInts(input, repeated, _aidl_return);
+    }
+    ::android::binder::Status RepeatBinders(const std::array<::android::sp<::android::IBinder>, 3>& input, std::array<::android::sp<::android::IBinder>, 3>* repeated, std::array<::android::sp<::android::IBinder>, 3>* _aidl_return) override {
+      return _aidl_delegate->RepeatBinders(input, repeated, _aidl_return);
+    }
+    ::android::binder::Status RepeatParcelables(const std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& input, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* repeated, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) override {
+      return _aidl_delegate->RepeatParcelables(input, repeated, _aidl_return);
+    }
+    ::android::binder::Status Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& input, std::array<std::array<uint8_t, 3>, 2>* repeated, std::array<std::array<uint8_t, 3>, 2>* _aidl_return) override {
+      return _aidl_delegate->Repeat2dBytes(input, repeated, _aidl_return);
+    }
+    ::android::binder::Status Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& input, std::array<std::array<int32_t, 3>, 2>* repeated, std::array<std::array<int32_t, 3>, 2>* _aidl_return) override {
+      return _aidl_delegate->Repeat2dInts(input, repeated, _aidl_return);
+    }
+    ::android::binder::Status Repeat2dBinders(const std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>& input, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* repeated, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* _aidl_return) override {
+      return _aidl_delegate->Repeat2dBinders(input, repeated, _aidl_return);
+    }
+    ::android::binder::Status Repeat2dParcelables(const std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& input, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* repeated, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) override {
+      return _aidl_delegate->Repeat2dParcelables(input, repeated, _aidl_return);
+    }
+  private:
+    ::android::sp<IRepeatFixedSizeArray> _aidl_delegate;
+  };  // class IRepeatFixedSizeArrayDelegator
+  enum class ByteEnum : int8_t {
+    A = 0,
+  };
+  enum class IntEnum : int32_t {
+    A = 0,
+  };
+  enum class LongEnum : int64_t {
+    A = 0L,
+  };
+  class IEmptyInterfaceDelegator;
+
+  class IEmptyInterface : public ::android::IInterface {
+  public:
+    typedef IEmptyInterfaceDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(EmptyInterface)
+  };  // class IEmptyInterface
+
+  class IEmptyInterfaceDefault : public IEmptyInterface {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+  };  // class IEmptyInterfaceDefault
+  class BpEmptyInterface : public ::android::BpInterface<IEmptyInterface> {
+  public:
+    explicit BpEmptyInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpEmptyInterface() = default;
+  };  // class BpEmptyInterface
+  class BnEmptyInterface : public ::android::BnInterface<IEmptyInterface> {
+  public:
+    explicit BnEmptyInterface();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  };  // class BnEmptyInterface
+
+  class IEmptyInterfaceDelegator : public BnEmptyInterface {
+  public:
+    explicit IEmptyInterfaceDelegator(const ::android::sp<IEmptyInterface> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<IEmptyInterface> getImpl() { return _aidl_delegate; }
+  private:
+    ::android::sp<IEmptyInterface> _aidl_delegate;
+  };  // class IEmptyInterfaceDelegator
+  std::array<std::array<int32_t, 3>, 2> int2x3 = {{{{1, 2, 3}}, {{4, 5, 6}}}};
+  std::array<bool, 2> boolArray = {{}};
+  std::array<uint8_t, 2> byteArray = {{}};
+  std::array<char16_t, 2> charArray = {{}};
+  std::array<int32_t, 2> intArray = {{}};
+  std::array<int64_t, 2> longArray = {{}};
+  std::array<float, 2> floatArray = {{}};
+  std::array<double, 2> doubleArray = {{}};
+  std::array<::std::string, 2> stringArray = {{"hello", "world"}};
+  std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 2> byteEnumArray = {{}};
+  std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 2> intEnumArray = {{}};
+  std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 2> longEnumArray = {{}};
+  std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 2> parcelableArray = {{}};
+  std::array<std::array<bool, 2>, 2> boolMatrix = {{}};
+  std::array<std::array<uint8_t, 2>, 2> byteMatrix = {{}};
+  std::array<std::array<char16_t, 2>, 2> charMatrix = {{}};
+  std::array<std::array<int32_t, 2>, 2> intMatrix = {{}};
+  std::array<std::array<int64_t, 2>, 2> longMatrix = {{}};
+  std::array<std::array<float, 2>, 2> floatMatrix = {{}};
+  std::array<std::array<double, 2>, 2> doubleMatrix = {{}};
+  std::array<std::array<::std::string, 2>, 2> stringMatrix = {{{{"hello", "world"}}, {{"Ciao", "mondo"}}}};
+  std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 2>, 2> byteEnumMatrix = {{}};
+  std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 2>, 2> intEnumMatrix = {{}};
+  std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 2>, 2> longEnumMatrix = {{}};
+  std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 2>, 2> parcelableMatrix = {{}};
+  ::std::optional<std::array<bool, 2>> boolNullableArray;
+  ::std::optional<std::array<uint8_t, 2>> byteNullableArray;
+  ::std::optional<std::array<char16_t, 2>> charNullableArray;
+  ::std::optional<std::array<int32_t, 2>> intNullableArray;
+  ::std::optional<std::array<int64_t, 2>> longNullableArray;
+  ::std::optional<std::array<float, 2>> floatNullableArray;
+  ::std::optional<std::array<double, 2>> doubleNullableArray;
+  ::std::optional<std::array<::std::optional<::std::string>, 2>> stringNullableArray = {{{"hello", "world"}}};
+  ::std::optional<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 2>> byteEnumNullableArray;
+  ::std::optional<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 2>> intEnumNullableArray;
+  ::std::optional<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 2>> longEnumNullableArray;
+  ::std::optional<std::array<::android::sp<::android::IBinder>, 2>> binderNullableArray;
+  ::std::optional<std::array<::std::optional<::android::os::ParcelFileDescriptor>, 2>> pfdNullableArray;
+  ::std::optional<std::array<::std::optional<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable>, 2>> parcelableNullableArray;
+  ::std::optional<std::array<::android::sp<::android::aidl::fixedsizearray::FixedSizeArrayExample::IEmptyInterface>, 2>> interfaceNullableArray;
+  ::std::optional<std::array<std::array<bool, 2>, 2>> boolNullableMatrix;
+  ::std::optional<std::array<std::array<uint8_t, 2>, 2>> byteNullableMatrix;
+  ::std::optional<std::array<std::array<char16_t, 2>, 2>> charNullableMatrix;
+  ::std::optional<std::array<std::array<int32_t, 2>, 2>> intNullableMatrix;
+  ::std::optional<std::array<std::array<int64_t, 2>, 2>> longNullableMatrix;
+  ::std::optional<std::array<std::array<float, 2>, 2>> floatNullableMatrix;
+  ::std::optional<std::array<std::array<double, 2>, 2>> doubleNullableMatrix;
+  ::std::optional<std::array<std::array<::std::optional<::std::string>, 2>, 2>> stringNullableMatrix = {{{{{"hello", "world"}}, {{"Ciao", "mondo"}}}}};
+  ::std::optional<std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 2>, 2>> byteEnumNullableMatrix;
+  ::std::optional<std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 2>, 2>> intEnumNullableMatrix;
+  ::std::optional<std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 2>, 2>> longEnumNullableMatrix;
+  ::std::optional<std::array<std::array<::android::sp<::android::IBinder>, 2>, 2>> binderNullableMatrix;
+  ::std::optional<std::array<std::array<::std::optional<::android::os::ParcelFileDescriptor>, 2>, 2>> pfdNullableMatrix;
+  ::std::optional<std::array<std::array<::std::optional<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable>, 2>, 2>> parcelableNullableMatrix;
+  ::std::optional<std::array<std::array<::android::sp<::android::aidl::fixedsizearray::FixedSizeArrayExample::IEmptyInterface>, 2>, 2>> interfaceNullableMatrix;
+  inline bool operator!=(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) != std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator<(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) < std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator<=(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) <= std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator==(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) == std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator>(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) > std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator>=(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) >= std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.fixedsizearray.FixedSizeArrayExample");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "FixedSizeArrayExample{";
+    os << "int2x3: " << ::android::internal::ToString(int2x3);
+    os << ", boolArray: " << ::android::internal::ToString(boolArray);
+    os << ", byteArray: " << ::android::internal::ToString(byteArray);
+    os << ", charArray: " << ::android::internal::ToString(charArray);
+    os << ", intArray: " << ::android::internal::ToString(intArray);
+    os << ", longArray: " << ::android::internal::ToString(longArray);
+    os << ", floatArray: " << ::android::internal::ToString(floatArray);
+    os << ", doubleArray: " << ::android::internal::ToString(doubleArray);
+    os << ", stringArray: " << ::android::internal::ToString(stringArray);
+    os << ", byteEnumArray: " << ::android::internal::ToString(byteEnumArray);
+    os << ", intEnumArray: " << ::android::internal::ToString(intEnumArray);
+    os << ", longEnumArray: " << ::android::internal::ToString(longEnumArray);
+    os << ", parcelableArray: " << ::android::internal::ToString(parcelableArray);
+    os << ", boolMatrix: " << ::android::internal::ToString(boolMatrix);
+    os << ", byteMatrix: " << ::android::internal::ToString(byteMatrix);
+    os << ", charMatrix: " << ::android::internal::ToString(charMatrix);
+    os << ", intMatrix: " << ::android::internal::ToString(intMatrix);
+    os << ", longMatrix: " << ::android::internal::ToString(longMatrix);
+    os << ", floatMatrix: " << ::android::internal::ToString(floatMatrix);
+    os << ", doubleMatrix: " << ::android::internal::ToString(doubleMatrix);
+    os << ", stringMatrix: " << ::android::internal::ToString(stringMatrix);
+    os << ", byteEnumMatrix: " << ::android::internal::ToString(byteEnumMatrix);
+    os << ", intEnumMatrix: " << ::android::internal::ToString(intEnumMatrix);
+    os << ", longEnumMatrix: " << ::android::internal::ToString(longEnumMatrix);
+    os << ", parcelableMatrix: " << ::android::internal::ToString(parcelableMatrix);
+    os << ", boolNullableArray: " << ::android::internal::ToString(boolNullableArray);
+    os << ", byteNullableArray: " << ::android::internal::ToString(byteNullableArray);
+    os << ", charNullableArray: " << ::android::internal::ToString(charNullableArray);
+    os << ", intNullableArray: " << ::android::internal::ToString(intNullableArray);
+    os << ", longNullableArray: " << ::android::internal::ToString(longNullableArray);
+    os << ", floatNullableArray: " << ::android::internal::ToString(floatNullableArray);
+    os << ", doubleNullableArray: " << ::android::internal::ToString(doubleNullableArray);
+    os << ", stringNullableArray: " << ::android::internal::ToString(stringNullableArray);
+    os << ", byteEnumNullableArray: " << ::android::internal::ToString(byteEnumNullableArray);
+    os << ", intEnumNullableArray: " << ::android::internal::ToString(intEnumNullableArray);
+    os << ", longEnumNullableArray: " << ::android::internal::ToString(longEnumNullableArray);
+    os << ", binderNullableArray: " << ::android::internal::ToString(binderNullableArray);
+    os << ", pfdNullableArray: " << ::android::internal::ToString(pfdNullableArray);
+    os << ", parcelableNullableArray: " << ::android::internal::ToString(parcelableNullableArray);
+    os << ", interfaceNullableArray: " << ::android::internal::ToString(interfaceNullableArray);
+    os << ", boolNullableMatrix: " << ::android::internal::ToString(boolNullableMatrix);
+    os << ", byteNullableMatrix: " << ::android::internal::ToString(byteNullableMatrix);
+    os << ", charNullableMatrix: " << ::android::internal::ToString(charNullableMatrix);
+    os << ", intNullableMatrix: " << ::android::internal::ToString(intNullableMatrix);
+    os << ", longNullableMatrix: " << ::android::internal::ToString(longNullableMatrix);
+    os << ", floatNullableMatrix: " << ::android::internal::ToString(floatNullableMatrix);
+    os << ", doubleNullableMatrix: " << ::android::internal::ToString(doubleNullableMatrix);
+    os << ", stringNullableMatrix: " << ::android::internal::ToString(stringNullableMatrix);
+    os << ", byteEnumNullableMatrix: " << ::android::internal::ToString(byteEnumNullableMatrix);
+    os << ", intEnumNullableMatrix: " << ::android::internal::ToString(intEnumNullableMatrix);
+    os << ", longEnumNullableMatrix: " << ::android::internal::ToString(longEnumNullableMatrix);
+    os << ", binderNullableMatrix: " << ::android::internal::ToString(binderNullableMatrix);
+    os << ", pfdNullableMatrix: " << ::android::internal::ToString(pfdNullableMatrix);
+    os << ", parcelableNullableMatrix: " << ::android::internal::ToString(parcelableNullableMatrix);
+    os << ", interfaceNullableMatrix: " << ::android::internal::ToString(interfaceNullableMatrix);
+    os << "}";
+    return os.str();
+  }
+};  // class FixedSizeArrayExample
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+[[nodiscard]] static inline std::string toString(FixedSizeArrayExample::ByteEnum val) {
+  switch(val) {
+  case FixedSizeArrayExample::ByteEnum::A:
+    return "A";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 1> enum_values<::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum> = {
+  ::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum::A,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+[[nodiscard]] static inline std::string toString(FixedSizeArrayExample::IntEnum val) {
+  switch(val) {
+  case FixedSizeArrayExample::IntEnum::A:
+    return "A";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 1> enum_values<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum> = {
+  ::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum::A,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+[[nodiscard]] static inline std::string toString(FixedSizeArrayExample::LongEnum val) {
+  switch(val) {
+  case FixedSizeArrayExample::LongEnum::A:
+    return "A";
+  default:
+    return std::to_string(static_cast<int64_t>(val));
+  }
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 1> enum_values<::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum> = {
+  ::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum::A,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/timestamp b/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-cpp-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-fixedsizearray-java-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.java b/tests/golden_output/aidl-test-fixedsizearray-java-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.java
new file mode 100644
index 0000000..fae264c
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-java-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.java
@@ -0,0 +1,875 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-java-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+package android.aidl.fixedsizearray;
+public class FixedSizeArrayExample implements android.os.Parcelable
+{
+  // to see if NxM array works
+  public int[][] int2x3 = {{1, 2, 3}, {4, 5, 6}};
+  public boolean[] boolArray;
+  public byte[] byteArray;
+  public char[] charArray;
+  public int[] intArray;
+  public long[] longArray;
+  public float[] floatArray;
+  public double[] doubleArray;
+  public java.lang.String[] stringArray = {"hello", "world"};
+  public byte[] byteEnumArray;
+  public int[] intEnumArray;
+  public long[] longEnumArray;
+  public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] parcelableArray;
+  // Following fields are not test-friendly because they should be initialized as non-null.
+  // IBinder[2] binderArray;
+  // ParcelFileDescriptor[2] pfdArray;
+  // IEmptyInterface[2] interfaceArray;
+  public boolean[][] boolMatrix;
+  public byte[][] byteMatrix;
+  public char[][] charMatrix;
+  public int[][] intMatrix;
+  public long[][] longMatrix;
+  public float[][] floatMatrix;
+  public double[][] doubleMatrix;
+  public java.lang.String[][] stringMatrix = {{"hello", "world"}, {"Ciao", "mondo"}};
+  public byte[][] byteEnumMatrix;
+  public int[][] intEnumMatrix;
+  public long[][] longEnumMatrix;
+  public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] parcelableMatrix;
+  // Following fields are not test-friendly because they should be initialized as non-null.
+  // ParcelFileDescriptor[2][2] pfdMatrix;
+  // IBinder[2][2] binderMatrix;
+  // IEmptyInterface[2][2] interfaceMatrix;
+  public boolean[] boolNullableArray;
+  public byte[] byteNullableArray;
+  public char[] charNullableArray;
+  public int[] intNullableArray;
+  public long[] longNullableArray;
+  public float[] floatNullableArray;
+  public double[] doubleNullableArray;
+  public java.lang.String[] stringNullableArray = {"hello", "world"};
+  public byte[] byteEnumNullableArray;
+  public int[] intEnumNullableArray;
+  public long[] longEnumNullableArray;
+  public android.os.IBinder[] binderNullableArray;
+  public android.os.ParcelFileDescriptor[] pfdNullableArray;
+  public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] parcelableNullableArray;
+  public android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface[] interfaceNullableArray;
+  public boolean[][] boolNullableMatrix;
+  public byte[][] byteNullableMatrix;
+  public char[][] charNullableMatrix;
+  public int[][] intNullableMatrix;
+  public long[][] longNullableMatrix;
+  public float[][] floatNullableMatrix;
+  public double[][] doubleNullableMatrix;
+  public java.lang.String[][] stringNullableMatrix = {{"hello", "world"}, {"Ciao", "mondo"}};
+  public byte[][] byteEnumNullableMatrix;
+  public int[][] intEnumNullableMatrix;
+  public long[][] longEnumNullableMatrix;
+  public android.os.IBinder[][] binderNullableMatrix;
+  public android.os.ParcelFileDescriptor[][] pfdNullableMatrix;
+  public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] parcelableNullableMatrix;
+  public android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface[][] interfaceNullableMatrix;
+  public static final android.os.Parcelable.Creator<FixedSizeArrayExample> CREATOR = new android.os.Parcelable.Creator<FixedSizeArrayExample>() {
+    @Override
+    public FixedSizeArrayExample createFromParcel(android.os.Parcel _aidl_source) {
+      FixedSizeArrayExample _aidl_out = new FixedSizeArrayExample();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public FixedSizeArrayExample[] newArray(int _aidl_size) {
+      return new FixedSizeArrayExample[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeFixedArray(int2x3, _aidl_flag, 2, 3);
+    _aidl_parcel.writeFixedArray(boolArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(byteArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(charArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(intArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(longArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(floatArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(doubleArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(stringArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(byteEnumArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(intEnumArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(longEnumArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(parcelableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(boolMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(byteMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(charMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(intMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(longMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(floatMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(doubleMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(stringMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(byteEnumMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(intEnumMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(longEnumMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(parcelableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(boolNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(byteNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(charNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(intNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(longNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(floatNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(doubleNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(stringNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(byteEnumNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(intEnumNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(longEnumNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(binderNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(pfdNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(parcelableNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(interfaceNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(boolNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(byteNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(charNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(intNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(longNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(floatNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(doubleNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(stringNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(byteEnumNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(intEnumNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(longEnumNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(binderNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(pfdNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(parcelableNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(interfaceNullableMatrix, _aidl_flag, 2, 2);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      int2x3 = _aidl_parcel.createFixedArray(int[][].class, 2, 3);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      boolArray = _aidl_parcel.createFixedArray(boolean[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteArray = _aidl_parcel.createFixedArray(byte[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      charArray = _aidl_parcel.createFixedArray(char[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intArray = _aidl_parcel.createFixedArray(int[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longArray = _aidl_parcel.createFixedArray(long[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      floatArray = _aidl_parcel.createFixedArray(float[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      doubleArray = _aidl_parcel.createFixedArray(double[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      stringArray = _aidl_parcel.createFixedArray(java.lang.String[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteEnumArray = _aidl_parcel.createFixedArray(byte[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intEnumArray = _aidl_parcel.createFixedArray(int[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longEnumArray = _aidl_parcel.createFixedArray(long[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      parcelableArray = _aidl_parcel.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      boolMatrix = _aidl_parcel.createFixedArray(boolean[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteMatrix = _aidl_parcel.createFixedArray(byte[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      charMatrix = _aidl_parcel.createFixedArray(char[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intMatrix = _aidl_parcel.createFixedArray(int[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longMatrix = _aidl_parcel.createFixedArray(long[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      floatMatrix = _aidl_parcel.createFixedArray(float[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      doubleMatrix = _aidl_parcel.createFixedArray(double[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      stringMatrix = _aidl_parcel.createFixedArray(java.lang.String[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteEnumMatrix = _aidl_parcel.createFixedArray(byte[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intEnumMatrix = _aidl_parcel.createFixedArray(int[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longEnumMatrix = _aidl_parcel.createFixedArray(long[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      parcelableMatrix = _aidl_parcel.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      boolNullableArray = _aidl_parcel.createFixedArray(boolean[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteNullableArray = _aidl_parcel.createFixedArray(byte[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      charNullableArray = _aidl_parcel.createFixedArray(char[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intNullableArray = _aidl_parcel.createFixedArray(int[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longNullableArray = _aidl_parcel.createFixedArray(long[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      floatNullableArray = _aidl_parcel.createFixedArray(float[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      doubleNullableArray = _aidl_parcel.createFixedArray(double[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      stringNullableArray = _aidl_parcel.createFixedArray(java.lang.String[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteEnumNullableArray = _aidl_parcel.createFixedArray(byte[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intEnumNullableArray = _aidl_parcel.createFixedArray(int[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longEnumNullableArray = _aidl_parcel.createFixedArray(long[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      binderNullableArray = _aidl_parcel.createFixedArray(android.os.IBinder[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      pfdNullableArray = _aidl_parcel.createFixedArray(android.os.ParcelFileDescriptor[].class, android.os.ParcelFileDescriptor.CREATOR, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      parcelableNullableArray = _aidl_parcel.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      interfaceNullableArray = _aidl_parcel.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface[].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface.Stub::asInterface, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      boolNullableMatrix = _aidl_parcel.createFixedArray(boolean[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteNullableMatrix = _aidl_parcel.createFixedArray(byte[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      charNullableMatrix = _aidl_parcel.createFixedArray(char[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intNullableMatrix = _aidl_parcel.createFixedArray(int[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longNullableMatrix = _aidl_parcel.createFixedArray(long[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      floatNullableMatrix = _aidl_parcel.createFixedArray(float[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      doubleNullableMatrix = _aidl_parcel.createFixedArray(double[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      stringNullableMatrix = _aidl_parcel.createFixedArray(java.lang.String[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteEnumNullableMatrix = _aidl_parcel.createFixedArray(byte[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intEnumNullableMatrix = _aidl_parcel.createFixedArray(int[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longEnumNullableMatrix = _aidl_parcel.createFixedArray(long[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      binderNullableMatrix = _aidl_parcel.createFixedArray(android.os.IBinder[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      pfdNullableMatrix = _aidl_parcel.createFixedArray(android.os.ParcelFileDescriptor[][].class, android.os.ParcelFileDescriptor.CREATOR, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      parcelableNullableMatrix = _aidl_parcel.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      interfaceNullableMatrix = _aidl_parcel.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface[][].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface.Stub::asInterface, 2, 2);
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public String toString() {
+    java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "{", "}");
+    _aidl_sj.add("int2x3: " + (java.util.Arrays.deepToString(int2x3)));
+    _aidl_sj.add("boolArray: " + (java.util.Arrays.toString(boolArray)));
+    _aidl_sj.add("byteArray: " + (java.util.Arrays.toString(byteArray)));
+    _aidl_sj.add("charArray: " + (java.util.Arrays.toString(charArray)));
+    _aidl_sj.add("intArray: " + (java.util.Arrays.toString(intArray)));
+    _aidl_sj.add("longArray: " + (java.util.Arrays.toString(longArray)));
+    _aidl_sj.add("floatArray: " + (java.util.Arrays.toString(floatArray)));
+    _aidl_sj.add("doubleArray: " + (java.util.Arrays.toString(doubleArray)));
+    _aidl_sj.add("stringArray: " + (java.util.Arrays.toString(stringArray)));
+    _aidl_sj.add("byteEnumArray: " + (java.util.Arrays.toString(byteEnumArray)));
+    _aidl_sj.add("intEnumArray: " + (java.util.Arrays.toString(intEnumArray)));
+    _aidl_sj.add("longEnumArray: " + (java.util.Arrays.toString(longEnumArray)));
+    _aidl_sj.add("parcelableArray: " + (java.util.Arrays.toString(parcelableArray)));
+    _aidl_sj.add("boolMatrix: " + (java.util.Arrays.deepToString(boolMatrix)));
+    _aidl_sj.add("byteMatrix: " + (java.util.Arrays.deepToString(byteMatrix)));
+    _aidl_sj.add("charMatrix: " + (java.util.Arrays.deepToString(charMatrix)));
+    _aidl_sj.add("intMatrix: " + (java.util.Arrays.deepToString(intMatrix)));
+    _aidl_sj.add("longMatrix: " + (java.util.Arrays.deepToString(longMatrix)));
+    _aidl_sj.add("floatMatrix: " + (java.util.Arrays.deepToString(floatMatrix)));
+    _aidl_sj.add("doubleMatrix: " + (java.util.Arrays.deepToString(doubleMatrix)));
+    _aidl_sj.add("stringMatrix: " + (java.util.Arrays.deepToString(stringMatrix)));
+    _aidl_sj.add("byteEnumMatrix: " + (java.util.Arrays.deepToString(byteEnumMatrix)));
+    _aidl_sj.add("intEnumMatrix: " + (java.util.Arrays.deepToString(intEnumMatrix)));
+    _aidl_sj.add("longEnumMatrix: " + (java.util.Arrays.deepToString(longEnumMatrix)));
+    _aidl_sj.add("parcelableMatrix: " + (java.util.Arrays.deepToString(parcelableMatrix)));
+    _aidl_sj.add("boolNullableArray: " + (java.util.Arrays.toString(boolNullableArray)));
+    _aidl_sj.add("byteNullableArray: " + (java.util.Arrays.toString(byteNullableArray)));
+    _aidl_sj.add("charNullableArray: " + (java.util.Arrays.toString(charNullableArray)));
+    _aidl_sj.add("intNullableArray: " + (java.util.Arrays.toString(intNullableArray)));
+    _aidl_sj.add("longNullableArray: " + (java.util.Arrays.toString(longNullableArray)));
+    _aidl_sj.add("floatNullableArray: " + (java.util.Arrays.toString(floatNullableArray)));
+    _aidl_sj.add("doubleNullableArray: " + (java.util.Arrays.toString(doubleNullableArray)));
+    _aidl_sj.add("stringNullableArray: " + (java.util.Arrays.toString(stringNullableArray)));
+    _aidl_sj.add("byteEnumNullableArray: " + (java.util.Arrays.toString(byteEnumNullableArray)));
+    _aidl_sj.add("intEnumNullableArray: " + (java.util.Arrays.toString(intEnumNullableArray)));
+    _aidl_sj.add("longEnumNullableArray: " + (java.util.Arrays.toString(longEnumNullableArray)));
+    _aidl_sj.add("binderNullableArray: " + (java.util.Arrays.toString(binderNullableArray)));
+    _aidl_sj.add("pfdNullableArray: " + (java.util.Arrays.toString(pfdNullableArray)));
+    _aidl_sj.add("parcelableNullableArray: " + (java.util.Arrays.toString(parcelableNullableArray)));
+    _aidl_sj.add("interfaceNullableArray: " + (java.util.Arrays.toString(interfaceNullableArray)));
+    _aidl_sj.add("boolNullableMatrix: " + (java.util.Arrays.deepToString(boolNullableMatrix)));
+    _aidl_sj.add("byteNullableMatrix: " + (java.util.Arrays.deepToString(byteNullableMatrix)));
+    _aidl_sj.add("charNullableMatrix: " + (java.util.Arrays.deepToString(charNullableMatrix)));
+    _aidl_sj.add("intNullableMatrix: " + (java.util.Arrays.deepToString(intNullableMatrix)));
+    _aidl_sj.add("longNullableMatrix: " + (java.util.Arrays.deepToString(longNullableMatrix)));
+    _aidl_sj.add("floatNullableMatrix: " + (java.util.Arrays.deepToString(floatNullableMatrix)));
+    _aidl_sj.add("doubleNullableMatrix: " + (java.util.Arrays.deepToString(doubleNullableMatrix)));
+    _aidl_sj.add("stringNullableMatrix: " + (java.util.Arrays.deepToString(stringNullableMatrix)));
+    _aidl_sj.add("byteEnumNullableMatrix: " + (java.util.Arrays.deepToString(byteEnumNullableMatrix)));
+    _aidl_sj.add("intEnumNullableMatrix: " + (java.util.Arrays.deepToString(intEnumNullableMatrix)));
+    _aidl_sj.add("longEnumNullableMatrix: " + (java.util.Arrays.deepToString(longEnumNullableMatrix)));
+    _aidl_sj.add("binderNullableMatrix: " + (java.util.Arrays.deepToString(binderNullableMatrix)));
+    _aidl_sj.add("pfdNullableMatrix: " + (java.util.Arrays.deepToString(pfdNullableMatrix)));
+    _aidl_sj.add("parcelableNullableMatrix: " + (java.util.Arrays.deepToString(parcelableNullableMatrix)));
+    _aidl_sj.add("interfaceNullableMatrix: " + (java.util.Arrays.deepToString(interfaceNullableMatrix)));
+    return "FixedSizeArrayExample" + _aidl_sj.toString()  ;
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    _mask |= describeContents(parcelableArray);
+    _mask |= describeContents(parcelableMatrix);
+    _mask |= describeContents(pfdNullableArray);
+    _mask |= describeContents(parcelableNullableArray);
+    _mask |= describeContents(pfdNullableMatrix);
+    _mask |= describeContents(parcelableNullableMatrix);
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof Object[]) {
+      int _mask = 0;
+      for (Object o : (Object[]) _v) {
+        _mask |= describeContents(o);
+      }
+      return _mask;
+    }
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+  public interface IRepeatFixedSizeArray extends android.os.IInterface
+  {
+    /** Default implementation for IRepeatFixedSizeArray. */
+    public static class Default implements android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray
+    {
+      @Override public byte[] RepeatBytes(byte[] input, byte[] repeated) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public int[] RepeatInts(int[] input, int[] repeated) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public android.os.IBinder[] RepeatBinders(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] RepeatParcelables(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] input, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] repeated) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public byte[][] Repeat2dBytes(byte[][] input, byte[][] repeated) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public int[][] Repeat2dInts(int[][] input, int[][] repeated) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public android.os.IBinder[][] Repeat2dBinders(android.os.IBinder[][] input, android.os.IBinder[][] repeated) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] Repeat2dParcelables(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] input, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] repeated) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray))) {
+          return ((android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray)iin);
+        }
+        return new android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+          data.enforceInterface(descriptor);
+        }
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        switch (code)
+        {
+          case TRANSACTION_RepeatBytes:
+          {
+            byte[] _arg0;
+            _arg0 = data.createFixedArray(byte[].class, 3);
+            byte[] _arg1;
+            _arg1 = new byte[3];
+            data.enforceNoDataAvail();
+            byte[] _result = this.RepeatBytes(_arg0, _arg1);
+            reply.writeNoException();
+            reply.writeFixedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 3);
+            reply.writeFixedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 3);
+            break;
+          }
+          case TRANSACTION_RepeatInts:
+          {
+            int[] _arg0;
+            _arg0 = data.createFixedArray(int[].class, 3);
+            int[] _arg1;
+            _arg1 = new int[3];
+            data.enforceNoDataAvail();
+            int[] _result = this.RepeatInts(_arg0, _arg1);
+            reply.writeNoException();
+            reply.writeFixedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 3);
+            reply.writeFixedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 3);
+            break;
+          }
+          case TRANSACTION_RepeatBinders:
+          {
+            android.os.IBinder[] _arg0;
+            _arg0 = data.createFixedArray(android.os.IBinder[].class, 3);
+            android.os.IBinder[] _arg1;
+            _arg1 = new android.os.IBinder[3];
+            data.enforceNoDataAvail();
+            android.os.IBinder[] _result = this.RepeatBinders(_arg0, _arg1);
+            reply.writeNoException();
+            reply.writeFixedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 3);
+            reply.writeFixedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 3);
+            break;
+          }
+          case TRANSACTION_RepeatParcelables:
+          {
+            android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] _arg0;
+            _arg0 = data.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR, 3);
+            android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] _arg1;
+            _arg1 = new android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[3];
+            data.enforceNoDataAvail();
+            android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] _result = this.RepeatParcelables(_arg0, _arg1);
+            reply.writeNoException();
+            reply.writeFixedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 3);
+            reply.writeFixedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 3);
+            break;
+          }
+          case TRANSACTION_Repeat2dBytes:
+          {
+            byte[][] _arg0;
+            _arg0 = data.createFixedArray(byte[][].class, 2, 3);
+            byte[][] _arg1;
+            _arg1 = new byte[2][3];
+            data.enforceNoDataAvail();
+            byte[][] _result = this.Repeat2dBytes(_arg0, _arg1);
+            reply.writeNoException();
+            reply.writeFixedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 2, 3);
+            reply.writeFixedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 2, 3);
+            break;
+          }
+          case TRANSACTION_Repeat2dInts:
+          {
+            int[][] _arg0;
+            _arg0 = data.createFixedArray(int[][].class, 2, 3);
+            int[][] _arg1;
+            _arg1 = new int[2][3];
+            data.enforceNoDataAvail();
+            int[][] _result = this.Repeat2dInts(_arg0, _arg1);
+            reply.writeNoException();
+            reply.writeFixedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 2, 3);
+            reply.writeFixedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 2, 3);
+            break;
+          }
+          case TRANSACTION_Repeat2dBinders:
+          {
+            android.os.IBinder[][] _arg0;
+            _arg0 = data.createFixedArray(android.os.IBinder[][].class, 2, 3);
+            android.os.IBinder[][] _arg1;
+            _arg1 = new android.os.IBinder[2][3];
+            data.enforceNoDataAvail();
+            android.os.IBinder[][] _result = this.Repeat2dBinders(_arg0, _arg1);
+            reply.writeNoException();
+            reply.writeFixedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 2, 3);
+            reply.writeFixedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 2, 3);
+            break;
+          }
+          case TRANSACTION_Repeat2dParcelables:
+          {
+            android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] _arg0;
+            _arg0 = data.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR, 2, 3);
+            android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] _arg1;
+            _arg1 = new android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[2][3];
+            data.enforceNoDataAvail();
+            android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] _result = this.Repeat2dParcelables(_arg0, _arg1);
+            reply.writeNoException();
+            reply.writeFixedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 2, 3);
+            reply.writeFixedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 2, 3);
+            break;
+          }
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+        return true;
+      }
+      private static class Proxy implements android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+        @Override public byte[] RepeatBytes(byte[] input, byte[] repeated) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          byte[] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeFixedArray(input, 0, 3);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatBytes, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createFixedArray(byte[].class, 3);
+            _reply.readFixedArray(repeated);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public int[] RepeatInts(int[] input, int[] repeated) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          int[] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeFixedArray(input, 0, 3);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatInts, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createFixedArray(int[].class, 3);
+            _reply.readFixedArray(repeated);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public android.os.IBinder[] RepeatBinders(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.os.IBinder[] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeFixedArray(input, 0, 3);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatBinders, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createFixedArray(android.os.IBinder[].class, 3);
+            _reply.readFixedArray(repeated);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] RepeatParcelables(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] input, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] repeated) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeFixedArray(input, 0, 3);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatParcelables, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR, 3);
+            _reply.readFixedArray(repeated, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public byte[][] Repeat2dBytes(byte[][] input, byte[][] repeated) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          byte[][] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeFixedArray(input, 0, 2, 3);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_Repeat2dBytes, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createFixedArray(byte[][].class, 2, 3);
+            _reply.readFixedArray(repeated);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public int[][] Repeat2dInts(int[][] input, int[][] repeated) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          int[][] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeFixedArray(input, 0, 2, 3);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_Repeat2dInts, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createFixedArray(int[][].class, 2, 3);
+            _reply.readFixedArray(repeated);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public android.os.IBinder[][] Repeat2dBinders(android.os.IBinder[][] input, android.os.IBinder[][] repeated) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.os.IBinder[][] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeFixedArray(input, 0, 2, 3);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_Repeat2dBinders, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createFixedArray(android.os.IBinder[][].class, 2, 3);
+            _reply.readFixedArray(repeated);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] Repeat2dParcelables(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] input, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] repeated) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeFixedArray(input, 0, 2, 3);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_Repeat2dParcelables, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR, 2, 3);
+            _reply.readFixedArray(repeated, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+      }
+      static final int TRANSACTION_RepeatBytes = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+      static final int TRANSACTION_RepeatInts = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+      static final int TRANSACTION_RepeatBinders = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+      static final int TRANSACTION_RepeatParcelables = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+      static final int TRANSACTION_Repeat2dBytes = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
+      static final int TRANSACTION_Repeat2dInts = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5);
+      static final int TRANSACTION_Repeat2dBinders = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6);
+      static final int TRANSACTION_Repeat2dParcelables = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7);
+    }
+    public static final java.lang.String DESCRIPTOR = "android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray";
+    public byte[] RepeatBytes(byte[] input, byte[] repeated) throws android.os.RemoteException;
+    public int[] RepeatInts(int[] input, int[] repeated) throws android.os.RemoteException;
+    public android.os.IBinder[] RepeatBinders(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException;
+    public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] RepeatParcelables(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] input, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] repeated) throws android.os.RemoteException;
+    public byte[][] Repeat2dBytes(byte[][] input, byte[][] repeated) throws android.os.RemoteException;
+    public int[][] Repeat2dInts(int[][] input, int[][] repeated) throws android.os.RemoteException;
+    public android.os.IBinder[][] Repeat2dBinders(android.os.IBinder[][] input, android.os.IBinder[][] repeated) throws android.os.RemoteException;
+    public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] Repeat2dParcelables(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] input, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] repeated) throws android.os.RemoteException;
+  }
+  public static @interface ByteEnum {
+    public static final byte A = 0;
+  }
+  public static @interface IntEnum {
+    public static final int A = 0;
+  }
+  public static @interface LongEnum {
+    public static final long A = 0L;
+  }
+  public static class IntParcelable implements android.os.Parcelable
+  {
+    public int value = 0;
+    public static final android.os.Parcelable.Creator<IntParcelable> CREATOR = new android.os.Parcelable.Creator<IntParcelable>() {
+      @Override
+      public IntParcelable createFromParcel(android.os.Parcel _aidl_source) {
+        IntParcelable _aidl_out = new IntParcelable();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public IntParcelable[] newArray(int _aidl_size) {
+        return new IntParcelable[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeInt(value);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        value = _aidl_parcel.readInt();
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public boolean equals(Object other) {
+      if (this == other) return true;
+      if (other == null) return false;
+      if (!(other instanceof IntParcelable)) return false;
+      IntParcelable that = (IntParcelable)other;
+      if (!java.util.Objects.deepEquals(value, that.value)) return false;
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return java.util.Arrays.deepHashCode(java.util.Arrays.asList(value).toArray());
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+  public interface IEmptyInterface extends android.os.IInterface
+  {
+    /** Default implementation for IEmptyInterface. */
+    public static class Default implements android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface
+    {
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface))) {
+          return ((android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface)iin);
+        }
+        return new android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        switch (code)
+        {
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+      }
+      private static class Proxy implements android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface";
+  }
+}
diff --git a/tests/golden_output/aidl-test-fixedsizearray-java-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.java.d b/tests/golden_output/aidl-test-fixedsizearray-java-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.java.d
new file mode 100644
index 0000000..1ed6bda
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-java-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-java-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.java : \
+  system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
diff --git a/tests/golden_output/aidl-test-fixedsizearray-java-source/gen/timestamp b/tests/golden_output/aidl-test-fixedsizearray-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-java-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp b/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp
new file mode 100644
index 0000000..11e90b5
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp
@@ -0,0 +1,1373 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/staging/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#include "aidl/android/aidl/fixedsizearray/FixedSizeArrayExample.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+const char* FixedSizeArrayExample::descriptor = "android.aidl.fixedsizearray.FixedSizeArrayExample";
+
+binder_status_t FixedSizeArrayExample::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &int2x3);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &boolArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &charArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &floatArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &doubleArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &stringArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteEnumArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intEnumArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longEnumArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcelableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &boolMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &charMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &floatMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &doubleMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &stringMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteEnumMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intEnumMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longEnumMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcelableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &boolNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &byteNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &charNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &intNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &longNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &floatNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &doubleNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &stringNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &byteEnumNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &intEnumNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &longEnumNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &binderNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &pfdNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &parcelableNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &interfaceNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &boolNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &byteNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &charNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &intNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &longNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &floatNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &doubleNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &stringNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &byteEnumNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &intEnumNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &longEnumNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &binderNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &pfdNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &parcelableNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &interfaceNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t FixedSizeArrayExample::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, int2x3);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, boolArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, charArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, floatArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, doubleArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, stringArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteEnumArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intEnumArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longEnumArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcelableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, boolMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, charMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, floatMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, doubleMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, stringMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteEnumMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intEnumMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longEnumMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcelableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, boolNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, byteNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, charNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, intNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, longNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, floatNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, doubleNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, stringNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, byteEnumNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, intEnumNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, longEnumNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, binderNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, pfdNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, parcelableNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, interfaceNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, boolNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, byteNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, charNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, intNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, longNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, floatNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, doubleNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, stringNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, byteEnumNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, intEnumNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, longEnumNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, binderNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, pfdNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, parcelableNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, interfaceNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+static binder_status_t _aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IRepeatFixedSizeArray_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<FixedSizeArrayExample::BnRepeatFixedSizeArray> _aidl_impl = std::static_pointer_cast<FixedSizeArrayExample::BnRepeatFixedSizeArray>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*RepeatBytes*/): {
+      std::array<uint8_t, 3> in_input;
+      std::array<uint8_t, 3> out_repeated;
+      std::array<uint8_t, 3> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatBytes(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*RepeatInts*/): {
+      std::array<int32_t, 3> in_input;
+      std::array<int32_t, 3> out_repeated;
+      std::array<int32_t, 3> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatInts(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*RepeatBinders*/): {
+      std::array<::ndk::SpAIBinder, 3> in_input;
+      std::array<::ndk::SpAIBinder, 3> out_repeated;
+      std::array<::ndk::SpAIBinder, 3> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatBinders(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 3 /*RepeatParcelables*/): {
+      std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3> in_input;
+      std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3> out_repeated;
+      std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatParcelables(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 4 /*Repeat2dBytes*/): {
+      std::array<std::array<uint8_t, 3>, 2> in_input;
+      std::array<std::array<uint8_t, 3>, 2> out_repeated;
+      std::array<std::array<uint8_t, 3>, 2> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->Repeat2dBytes(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 5 /*Repeat2dInts*/): {
+      std::array<std::array<int32_t, 3>, 2> in_input;
+      std::array<std::array<int32_t, 3>, 2> out_repeated;
+      std::array<std::array<int32_t, 3>, 2> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->Repeat2dInts(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 6 /*Repeat2dBinders*/): {
+      std::array<std::array<::ndk::SpAIBinder, 3>, 2> in_input;
+      std::array<std::array<::ndk::SpAIBinder, 3>, 2> out_repeated;
+      std::array<std::array<::ndk::SpAIBinder, 3>, 2> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->Repeat2dBinders(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 7 /*Repeat2dParcelables*/): {
+      std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2> in_input;
+      std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2> out_repeated;
+      std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->Repeat2dParcelables(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IRepeatFixedSizeArray_clazz = ::ndk::ICInterface::defineClass(FixedSizeArrayExample::IRepeatFixedSizeArray::descriptor, _aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IRepeatFixedSizeArray_onTransact);
+
+FixedSizeArrayExample::BpRepeatFixedSizeArray::BpRepeatFixedSizeArray(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+FixedSizeArrayExample::BpRepeatFixedSizeArray::~BpRepeatFixedSizeArray() {}
+
+::ndk::ScopedAStatus FixedSizeArrayExample::BpRepeatFixedSizeArray::RepeatBytes(const std::array<uint8_t, 3>& in_input, std::array<uint8_t, 3>* out_repeated, std::array<uint8_t, 3>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*RepeatBytes*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl()) {
+    _aidl_status = IRepeatFixedSizeArray::getDefaultImpl()->RepeatBytes(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::BpRepeatFixedSizeArray::RepeatInts(const std::array<int32_t, 3>& in_input, std::array<int32_t, 3>* out_repeated, std::array<int32_t, 3>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*RepeatInts*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl()) {
+    _aidl_status = IRepeatFixedSizeArray::getDefaultImpl()->RepeatInts(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::BpRepeatFixedSizeArray::RepeatBinders(const std::array<::ndk::SpAIBinder, 3>& in_input, std::array<::ndk::SpAIBinder, 3>* out_repeated, std::array<::ndk::SpAIBinder, 3>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*RepeatBinders*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl()) {
+    _aidl_status = IRepeatFixedSizeArray::getDefaultImpl()->RepeatBinders(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::BpRepeatFixedSizeArray::RepeatParcelables(const std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& in_input, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* out_repeated, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 3 /*RepeatParcelables*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl()) {
+    _aidl_status = IRepeatFixedSizeArray::getDefaultImpl()->RepeatParcelables(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::BpRepeatFixedSizeArray::Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& in_input, std::array<std::array<uint8_t, 3>, 2>* out_repeated, std::array<std::array<uint8_t, 3>, 2>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 4 /*Repeat2dBytes*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl()) {
+    _aidl_status = IRepeatFixedSizeArray::getDefaultImpl()->Repeat2dBytes(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::BpRepeatFixedSizeArray::Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& in_input, std::array<std::array<int32_t, 3>, 2>* out_repeated, std::array<std::array<int32_t, 3>, 2>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 5 /*Repeat2dInts*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl()) {
+    _aidl_status = IRepeatFixedSizeArray::getDefaultImpl()->Repeat2dInts(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::BpRepeatFixedSizeArray::Repeat2dBinders(const std::array<std::array<::ndk::SpAIBinder, 3>, 2>& in_input, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* out_repeated, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 6 /*Repeat2dBinders*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl()) {
+    _aidl_status = IRepeatFixedSizeArray::getDefaultImpl()->Repeat2dBinders(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::BpRepeatFixedSizeArray::Repeat2dParcelables(const std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& in_input, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* out_repeated, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 7 /*Repeat2dParcelables*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl()) {
+    _aidl_status = IRepeatFixedSizeArray::getDefaultImpl()->Repeat2dParcelables(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnRepeatFixedSizeArray
+FixedSizeArrayExample::BnRepeatFixedSizeArray::BnRepeatFixedSizeArray() {}
+FixedSizeArrayExample::BnRepeatFixedSizeArray::~BnRepeatFixedSizeArray() {}
+::ndk::SpAIBinder FixedSizeArrayExample::BnRepeatFixedSizeArray::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IRepeatFixedSizeArray_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IRepeatFixedSizeArray
+const char* FixedSizeArrayExample::IRepeatFixedSizeArray::descriptor = "android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray";
+FixedSizeArrayExample::IRepeatFixedSizeArray::IRepeatFixedSizeArray() {}
+FixedSizeArrayExample::IRepeatFixedSizeArray::~IRepeatFixedSizeArray() {}
+
+
+std::shared_ptr<FixedSizeArrayExample::IRepeatFixedSizeArray> FixedSizeArrayExample::IRepeatFixedSizeArray::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IRepeatFixedSizeArray_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<FixedSizeArrayExample::BpRepeatFixedSizeArray>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IRepeatFixedSizeArray>(interface);
+  }
+  return ::ndk::SharedRefBase::make<FixedSizeArrayExample::BpRepeatFixedSizeArray>(binder);
+}
+
+binder_status_t FixedSizeArrayExample::IRepeatFixedSizeArray::writeToParcel(AParcel* parcel, const std::shared_ptr<IRepeatFixedSizeArray>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t FixedSizeArrayExample::IRepeatFixedSizeArray::readFromParcel(const AParcel* parcel, std::shared_ptr<IRepeatFixedSizeArray>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IRepeatFixedSizeArray::fromBinder(binder);
+  return STATUS_OK;
+}
+bool FixedSizeArrayExample::IRepeatFixedSizeArray::setDefaultImpl(const std::shared_ptr<IRepeatFixedSizeArray>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IRepeatFixedSizeArray::default_impl);
+  if (impl) {
+    IRepeatFixedSizeArray::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<FixedSizeArrayExample::IRepeatFixedSizeArray>& FixedSizeArrayExample::IRepeatFixedSizeArray::getDefaultImpl() {
+  return IRepeatFixedSizeArray::default_impl;
+}
+std::shared_ptr<FixedSizeArrayExample::IRepeatFixedSizeArray> FixedSizeArrayExample::IRepeatFixedSizeArray::default_impl = nullptr;
+::ndk::ScopedAStatus FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::RepeatBytes(const std::array<uint8_t, 3>& /*in_input*/, std::array<uint8_t, 3>* /*out_repeated*/, std::array<uint8_t, 3>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::RepeatInts(const std::array<int32_t, 3>& /*in_input*/, std::array<int32_t, 3>* /*out_repeated*/, std::array<int32_t, 3>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::RepeatBinders(const std::array<::ndk::SpAIBinder, 3>& /*in_input*/, std::array<::ndk::SpAIBinder, 3>* /*out_repeated*/, std::array<::ndk::SpAIBinder, 3>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::RepeatParcelables(const std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& /*in_input*/, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* /*out_repeated*/, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& /*in_input*/, std::array<std::array<uint8_t, 3>, 2>* /*out_repeated*/, std::array<std::array<uint8_t, 3>, 2>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& /*in_input*/, std::array<std::array<int32_t, 3>, 2>* /*out_repeated*/, std::array<std::array<int32_t, 3>, 2>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::Repeat2dBinders(const std::array<std::array<::ndk::SpAIBinder, 3>, 2>& /*in_input*/, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* /*out_repeated*/, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::Repeat2dParcelables(const std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& /*in_input*/, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* /*out_repeated*/, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::isRemote() {
+  return false;
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+const char* FixedSizeArrayExample::IntParcelable::descriptor = "android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable";
+
+binder_status_t FixedSizeArrayExample::IntParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &value);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t FixedSizeArrayExample::IntParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, value);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+static binder_status_t _aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IEmptyInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  (void)_aidl_binder;
+  (void)_aidl_code;
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IEmptyInterface_clazz = ::ndk::ICInterface::defineClass(FixedSizeArrayExample::IEmptyInterface::descriptor, _aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IEmptyInterface_onTransact);
+
+FixedSizeArrayExample::BpEmptyInterface::BpEmptyInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+FixedSizeArrayExample::BpEmptyInterface::~BpEmptyInterface() {}
+
+// Source for BnEmptyInterface
+FixedSizeArrayExample::BnEmptyInterface::BnEmptyInterface() {}
+FixedSizeArrayExample::BnEmptyInterface::~BnEmptyInterface() {}
+::ndk::SpAIBinder FixedSizeArrayExample::BnEmptyInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IEmptyInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IEmptyInterface
+const char* FixedSizeArrayExample::IEmptyInterface::descriptor = "android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface";
+FixedSizeArrayExample::IEmptyInterface::IEmptyInterface() {}
+FixedSizeArrayExample::IEmptyInterface::~IEmptyInterface() {}
+
+
+std::shared_ptr<FixedSizeArrayExample::IEmptyInterface> FixedSizeArrayExample::IEmptyInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IEmptyInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<FixedSizeArrayExample::BpEmptyInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IEmptyInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<FixedSizeArrayExample::BpEmptyInterface>(binder);
+}
+
+binder_status_t FixedSizeArrayExample::IEmptyInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<IEmptyInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t FixedSizeArrayExample::IEmptyInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<IEmptyInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IEmptyInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool FixedSizeArrayExample::IEmptyInterface::setDefaultImpl(const std::shared_ptr<IEmptyInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IEmptyInterface::default_impl);
+  if (impl) {
+    IEmptyInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<FixedSizeArrayExample::IEmptyInterface>& FixedSizeArrayExample::IEmptyInterface::getDefaultImpl() {
+  return IEmptyInterface::default_impl;
+}
+std::shared_ptr<FixedSizeArrayExample::IEmptyInterface> FixedSizeArrayExample::IEmptyInterface::default_impl = nullptr;
+::ndk::SpAIBinder FixedSizeArrayExample::IEmptyInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool FixedSizeArrayExample::IEmptyInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d b/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d
new file mode 100644
index 0000000..1443490
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp : \
+  system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
diff --git a/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/BnFixedSizeArrayExample.h b/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/BnFixedSizeArrayExample.h
new file mode 100644
index 0000000..f360c15
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/BnFixedSizeArrayExample.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/staging/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/BpFixedSizeArrayExample.h b/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/BpFixedSizeArrayExample.h
new file mode 100644
index 0000000..8da98c2
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/BpFixedSizeArrayExample.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/staging/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/FixedSizeArrayExample.h b/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/FixedSizeArrayExample.h
new file mode 100644
index 0000000..f3f4899
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/FixedSizeArrayExample.h
@@ -0,0 +1,413 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/staging/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_ibinder.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+class FixedSizeArrayExample {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  class IntParcelable {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    int32_t value = 0;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const IntParcelable& rhs) const {
+      return std::tie(value) != std::tie(rhs.value);
+    }
+    inline bool operator<(const IntParcelable& rhs) const {
+      return std::tie(value) < std::tie(rhs.value);
+    }
+    inline bool operator<=(const IntParcelable& rhs) const {
+      return std::tie(value) <= std::tie(rhs.value);
+    }
+    inline bool operator==(const IntParcelable& rhs) const {
+      return std::tie(value) == std::tie(rhs.value);
+    }
+    inline bool operator>(const IntParcelable& rhs) const {
+      return std::tie(value) > std::tie(rhs.value);
+    }
+    inline bool operator>=(const IntParcelable& rhs) const {
+      return std::tie(value) >= std::tie(rhs.value);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "IntParcelable{";
+      os << "value: " << ::android::internal::ToString(value);
+      os << "}";
+      return os.str();
+    }
+  };
+  class IRepeatFixedSizeArrayDelegator;
+
+  class IRepeatFixedSizeArray : public ::ndk::ICInterface {
+  public:
+    typedef IRepeatFixedSizeArrayDelegator DefaultDelegator;
+    static const char* descriptor;
+    IRepeatFixedSizeArray();
+    virtual ~IRepeatFixedSizeArray();
+
+    static constexpr uint32_t TRANSACTION_RepeatBytes = FIRST_CALL_TRANSACTION + 0;
+    static constexpr uint32_t TRANSACTION_RepeatInts = FIRST_CALL_TRANSACTION + 1;
+    static constexpr uint32_t TRANSACTION_RepeatBinders = FIRST_CALL_TRANSACTION + 2;
+    static constexpr uint32_t TRANSACTION_RepeatParcelables = FIRST_CALL_TRANSACTION + 3;
+    static constexpr uint32_t TRANSACTION_Repeat2dBytes = FIRST_CALL_TRANSACTION + 4;
+    static constexpr uint32_t TRANSACTION_Repeat2dInts = FIRST_CALL_TRANSACTION + 5;
+    static constexpr uint32_t TRANSACTION_Repeat2dBinders = FIRST_CALL_TRANSACTION + 6;
+    static constexpr uint32_t TRANSACTION_Repeat2dParcelables = FIRST_CALL_TRANSACTION + 7;
+
+    static std::shared_ptr<IRepeatFixedSizeArray> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IRepeatFixedSizeArray>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IRepeatFixedSizeArray>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<IRepeatFixedSizeArray>& impl);
+    static const std::shared_ptr<IRepeatFixedSizeArray>& getDefaultImpl();
+    virtual ::ndk::ScopedAStatus RepeatBytes(const std::array<uint8_t, 3>& in_input, std::array<uint8_t, 3>* out_repeated, std::array<uint8_t, 3>* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus RepeatInts(const std::array<int32_t, 3>& in_input, std::array<int32_t, 3>* out_repeated, std::array<int32_t, 3>* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus RepeatBinders(const std::array<::ndk::SpAIBinder, 3>& in_input, std::array<::ndk::SpAIBinder, 3>* out_repeated, std::array<::ndk::SpAIBinder, 3>* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus RepeatParcelables(const std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& in_input, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* out_repeated, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& in_input, std::array<std::array<uint8_t, 3>, 2>* out_repeated, std::array<std::array<uint8_t, 3>, 2>* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& in_input, std::array<std::array<int32_t, 3>, 2>* out_repeated, std::array<std::array<int32_t, 3>, 2>* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus Repeat2dBinders(const std::array<std::array<::ndk::SpAIBinder, 3>, 2>& in_input, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* out_repeated, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus Repeat2dParcelables(const std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& in_input, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* out_repeated, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) = 0;
+  private:
+    static std::shared_ptr<IRepeatFixedSizeArray> default_impl;
+  };
+  class IRepeatFixedSizeArrayDefault : public IRepeatFixedSizeArray {
+  public:
+    ::ndk::ScopedAStatus RepeatBytes(const std::array<uint8_t, 3>& in_input, std::array<uint8_t, 3>* out_repeated, std::array<uint8_t, 3>* _aidl_return) override;
+    ::ndk::ScopedAStatus RepeatInts(const std::array<int32_t, 3>& in_input, std::array<int32_t, 3>* out_repeated, std::array<int32_t, 3>* _aidl_return) override;
+    ::ndk::ScopedAStatus RepeatBinders(const std::array<::ndk::SpAIBinder, 3>& in_input, std::array<::ndk::SpAIBinder, 3>* out_repeated, std::array<::ndk::SpAIBinder, 3>* _aidl_return) override;
+    ::ndk::ScopedAStatus RepeatParcelables(const std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& in_input, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* out_repeated, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) override;
+    ::ndk::ScopedAStatus Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& in_input, std::array<std::array<uint8_t, 3>, 2>* out_repeated, std::array<std::array<uint8_t, 3>, 2>* _aidl_return) override;
+    ::ndk::ScopedAStatus Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& in_input, std::array<std::array<int32_t, 3>, 2>* out_repeated, std::array<std::array<int32_t, 3>, 2>* _aidl_return) override;
+    ::ndk::ScopedAStatus Repeat2dBinders(const std::array<std::array<::ndk::SpAIBinder, 3>, 2>& in_input, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* out_repeated, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* _aidl_return) override;
+    ::ndk::ScopedAStatus Repeat2dParcelables(const std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& in_input, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* out_repeated, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) override;
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpRepeatFixedSizeArray : public ::ndk::BpCInterface<IRepeatFixedSizeArray> {
+  public:
+    explicit BpRepeatFixedSizeArray(const ::ndk::SpAIBinder& binder);
+    virtual ~BpRepeatFixedSizeArray();
+
+    ::ndk::ScopedAStatus RepeatBytes(const std::array<uint8_t, 3>& in_input, std::array<uint8_t, 3>* out_repeated, std::array<uint8_t, 3>* _aidl_return) override;
+    ::ndk::ScopedAStatus RepeatInts(const std::array<int32_t, 3>& in_input, std::array<int32_t, 3>* out_repeated, std::array<int32_t, 3>* _aidl_return) override;
+    ::ndk::ScopedAStatus RepeatBinders(const std::array<::ndk::SpAIBinder, 3>& in_input, std::array<::ndk::SpAIBinder, 3>* out_repeated, std::array<::ndk::SpAIBinder, 3>* _aidl_return) override;
+    ::ndk::ScopedAStatus RepeatParcelables(const std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& in_input, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* out_repeated, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) override;
+    ::ndk::ScopedAStatus Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& in_input, std::array<std::array<uint8_t, 3>, 2>* out_repeated, std::array<std::array<uint8_t, 3>, 2>* _aidl_return) override;
+    ::ndk::ScopedAStatus Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& in_input, std::array<std::array<int32_t, 3>, 2>* out_repeated, std::array<std::array<int32_t, 3>, 2>* _aidl_return) override;
+    ::ndk::ScopedAStatus Repeat2dBinders(const std::array<std::array<::ndk::SpAIBinder, 3>, 2>& in_input, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* out_repeated, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* _aidl_return) override;
+    ::ndk::ScopedAStatus Repeat2dParcelables(const std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& in_input, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* out_repeated, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) override;
+  };
+  class BnRepeatFixedSizeArray : public ::ndk::BnCInterface<IRepeatFixedSizeArray> {
+  public:
+    BnRepeatFixedSizeArray();
+    virtual ~BnRepeatFixedSizeArray();
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  enum class ByteEnum : int8_t {
+    A = 0,
+  };
+
+  enum class IntEnum : int32_t {
+    A = 0,
+  };
+
+  enum class LongEnum : int64_t {
+    A = 0L,
+  };
+
+  class IEmptyInterfaceDelegator;
+
+  class IEmptyInterface : public ::ndk::ICInterface {
+  public:
+    typedef IEmptyInterfaceDelegator DefaultDelegator;
+    static const char* descriptor;
+    IEmptyInterface();
+    virtual ~IEmptyInterface();
+
+
+    static std::shared_ptr<IEmptyInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IEmptyInterface>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IEmptyInterface>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<IEmptyInterface>& impl);
+    static const std::shared_ptr<IEmptyInterface>& getDefaultImpl();
+  private:
+    static std::shared_ptr<IEmptyInterface> default_impl;
+  };
+  class IEmptyInterfaceDefault : public IEmptyInterface {
+  public:
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpEmptyInterface : public ::ndk::BpCInterface<IEmptyInterface> {
+  public:
+    explicit BpEmptyInterface(const ::ndk::SpAIBinder& binder);
+    virtual ~BpEmptyInterface();
+
+  };
+  class BnEmptyInterface : public ::ndk::BnCInterface<IEmptyInterface> {
+  public:
+    BnEmptyInterface();
+    virtual ~BnEmptyInterface();
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  std::array<std::array<int32_t, 3>, 2> int2x3 = {{{{1, 2, 3}}, {{4, 5, 6}}}};
+  std::array<bool, 2> boolArray = {{}};
+  std::array<uint8_t, 2> byteArray = {{}};
+  std::array<char16_t, 2> charArray = {{}};
+  std::array<int32_t, 2> intArray = {{}};
+  std::array<int64_t, 2> longArray = {{}};
+  std::array<float, 2> floatArray = {{}};
+  std::array<double, 2> doubleArray = {{}};
+  std::array<std::string, 2> stringArray = {{"hello", "world"}};
+  std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 2> byteEnumArray = {{}};
+  std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 2> intEnumArray = {{}};
+  std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 2> longEnumArray = {{}};
+  std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 2> parcelableArray = {{}};
+  std::array<std::array<bool, 2>, 2> boolMatrix = {{}};
+  std::array<std::array<uint8_t, 2>, 2> byteMatrix = {{}};
+  std::array<std::array<char16_t, 2>, 2> charMatrix = {{}};
+  std::array<std::array<int32_t, 2>, 2> intMatrix = {{}};
+  std::array<std::array<int64_t, 2>, 2> longMatrix = {{}};
+  std::array<std::array<float, 2>, 2> floatMatrix = {{}};
+  std::array<std::array<double, 2>, 2> doubleMatrix = {{}};
+  std::array<std::array<std::string, 2>, 2> stringMatrix = {{{{"hello", "world"}}, {{"Ciao", "mondo"}}}};
+  std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 2>, 2> byteEnumMatrix = {{}};
+  std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 2>, 2> intEnumMatrix = {{}};
+  std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 2>, 2> longEnumMatrix = {{}};
+  std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 2>, 2> parcelableMatrix = {{}};
+  std::optional<std::array<bool, 2>> boolNullableArray;
+  std::optional<std::array<uint8_t, 2>> byteNullableArray;
+  std::optional<std::array<char16_t, 2>> charNullableArray;
+  std::optional<std::array<int32_t, 2>> intNullableArray;
+  std::optional<std::array<int64_t, 2>> longNullableArray;
+  std::optional<std::array<float, 2>> floatNullableArray;
+  std::optional<std::array<double, 2>> doubleNullableArray;
+  std::optional<std::array<std::optional<std::string>, 2>> stringNullableArray = {{{"hello", "world"}}};
+  std::optional<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 2>> byteEnumNullableArray;
+  std::optional<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 2>> intEnumNullableArray;
+  std::optional<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 2>> longEnumNullableArray;
+  std::optional<std::array<::ndk::SpAIBinder, 2>> binderNullableArray;
+  std::optional<std::array<::ndk::ScopedFileDescriptor, 2>> pfdNullableArray;
+  std::optional<std::array<std::optional<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable>, 2>> parcelableNullableArray;
+  std::optional<std::array<std::shared_ptr<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IEmptyInterface>, 2>> interfaceNullableArray;
+  std::optional<std::array<std::array<bool, 2>, 2>> boolNullableMatrix;
+  std::optional<std::array<std::array<uint8_t, 2>, 2>> byteNullableMatrix;
+  std::optional<std::array<std::array<char16_t, 2>, 2>> charNullableMatrix;
+  std::optional<std::array<std::array<int32_t, 2>, 2>> intNullableMatrix;
+  std::optional<std::array<std::array<int64_t, 2>, 2>> longNullableMatrix;
+  std::optional<std::array<std::array<float, 2>, 2>> floatNullableMatrix;
+  std::optional<std::array<std::array<double, 2>, 2>> doubleNullableMatrix;
+  std::optional<std::array<std::array<std::optional<std::string>, 2>, 2>> stringNullableMatrix = {{{{{"hello", "world"}}, {{"Ciao", "mondo"}}}}};
+  std::optional<std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 2>, 2>> byteEnumNullableMatrix;
+  std::optional<std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 2>, 2>> intEnumNullableMatrix;
+  std::optional<std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 2>, 2>> longEnumNullableMatrix;
+  std::optional<std::array<std::array<::ndk::SpAIBinder, 2>, 2>> binderNullableMatrix;
+  std::optional<std::array<std::array<::ndk::ScopedFileDescriptor, 2>, 2>> pfdNullableMatrix;
+  std::optional<std::array<std::array<std::optional<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable>, 2>, 2>> parcelableNullableMatrix;
+  std::optional<std::array<std::array<std::shared_ptr<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IEmptyInterface>, 2>, 2>> interfaceNullableMatrix;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) != std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator<(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) < std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator<=(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) <= std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator==(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) == std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator>(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) > std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator>=(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) >= std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "FixedSizeArrayExample{";
+    os << "int2x3: " << ::android::internal::ToString(int2x3);
+    os << ", boolArray: " << ::android::internal::ToString(boolArray);
+    os << ", byteArray: " << ::android::internal::ToString(byteArray);
+    os << ", charArray: " << ::android::internal::ToString(charArray);
+    os << ", intArray: " << ::android::internal::ToString(intArray);
+    os << ", longArray: " << ::android::internal::ToString(longArray);
+    os << ", floatArray: " << ::android::internal::ToString(floatArray);
+    os << ", doubleArray: " << ::android::internal::ToString(doubleArray);
+    os << ", stringArray: " << ::android::internal::ToString(stringArray);
+    os << ", byteEnumArray: " << ::android::internal::ToString(byteEnumArray);
+    os << ", intEnumArray: " << ::android::internal::ToString(intEnumArray);
+    os << ", longEnumArray: " << ::android::internal::ToString(longEnumArray);
+    os << ", parcelableArray: " << ::android::internal::ToString(parcelableArray);
+    os << ", boolMatrix: " << ::android::internal::ToString(boolMatrix);
+    os << ", byteMatrix: " << ::android::internal::ToString(byteMatrix);
+    os << ", charMatrix: " << ::android::internal::ToString(charMatrix);
+    os << ", intMatrix: " << ::android::internal::ToString(intMatrix);
+    os << ", longMatrix: " << ::android::internal::ToString(longMatrix);
+    os << ", floatMatrix: " << ::android::internal::ToString(floatMatrix);
+    os << ", doubleMatrix: " << ::android::internal::ToString(doubleMatrix);
+    os << ", stringMatrix: " << ::android::internal::ToString(stringMatrix);
+    os << ", byteEnumMatrix: " << ::android::internal::ToString(byteEnumMatrix);
+    os << ", intEnumMatrix: " << ::android::internal::ToString(intEnumMatrix);
+    os << ", longEnumMatrix: " << ::android::internal::ToString(longEnumMatrix);
+    os << ", parcelableMatrix: " << ::android::internal::ToString(parcelableMatrix);
+    os << ", boolNullableArray: " << ::android::internal::ToString(boolNullableArray);
+    os << ", byteNullableArray: " << ::android::internal::ToString(byteNullableArray);
+    os << ", charNullableArray: " << ::android::internal::ToString(charNullableArray);
+    os << ", intNullableArray: " << ::android::internal::ToString(intNullableArray);
+    os << ", longNullableArray: " << ::android::internal::ToString(longNullableArray);
+    os << ", floatNullableArray: " << ::android::internal::ToString(floatNullableArray);
+    os << ", doubleNullableArray: " << ::android::internal::ToString(doubleNullableArray);
+    os << ", stringNullableArray: " << ::android::internal::ToString(stringNullableArray);
+    os << ", byteEnumNullableArray: " << ::android::internal::ToString(byteEnumNullableArray);
+    os << ", intEnumNullableArray: " << ::android::internal::ToString(intEnumNullableArray);
+    os << ", longEnumNullableArray: " << ::android::internal::ToString(longEnumNullableArray);
+    os << ", binderNullableArray: " << ::android::internal::ToString(binderNullableArray);
+    os << ", pfdNullableArray: " << ::android::internal::ToString(pfdNullableArray);
+    os << ", parcelableNullableArray: " << ::android::internal::ToString(parcelableNullableArray);
+    os << ", interfaceNullableArray: " << ::android::internal::ToString(interfaceNullableArray);
+    os << ", boolNullableMatrix: " << ::android::internal::ToString(boolNullableMatrix);
+    os << ", byteNullableMatrix: " << ::android::internal::ToString(byteNullableMatrix);
+    os << ", charNullableMatrix: " << ::android::internal::ToString(charNullableMatrix);
+    os << ", intNullableMatrix: " << ::android::internal::ToString(intNullableMatrix);
+    os << ", longNullableMatrix: " << ::android::internal::ToString(longNullableMatrix);
+    os << ", floatNullableMatrix: " << ::android::internal::ToString(floatNullableMatrix);
+    os << ", doubleNullableMatrix: " << ::android::internal::ToString(doubleNullableMatrix);
+    os << ", stringNullableMatrix: " << ::android::internal::ToString(stringNullableMatrix);
+    os << ", byteEnumNullableMatrix: " << ::android::internal::ToString(byteEnumNullableMatrix);
+    os << ", intEnumNullableMatrix: " << ::android::internal::ToString(intEnumNullableMatrix);
+    os << ", longEnumNullableMatrix: " << ::android::internal::ToString(longEnumNullableMatrix);
+    os << ", binderNullableMatrix: " << ::android::internal::ToString(binderNullableMatrix);
+    os << ", pfdNullableMatrix: " << ::android::internal::ToString(pfdNullableMatrix);
+    os << ", parcelableNullableMatrix: " << ::android::internal::ToString(parcelableNullableMatrix);
+    os << ", interfaceNullableMatrix: " << ::android::internal::ToString(interfaceNullableMatrix);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+[[nodiscard]] static inline std::string toString(FixedSizeArrayExample::ByteEnum val) {
+  switch(val) {
+  case FixedSizeArrayExample::ByteEnum::A:
+    return "A";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 1> enum_values<aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum> = {
+  aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum::A,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+[[nodiscard]] static inline std::string toString(FixedSizeArrayExample::IntEnum val) {
+  switch(val) {
+  case FixedSizeArrayExample::IntEnum::A:
+    return "A";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 1> enum_values<aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum> = {
+  aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum::A,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+[[nodiscard]] static inline std::string toString(FixedSizeArrayExample::LongEnum val) {
+  switch(val) {
+  case FixedSizeArrayExample::LongEnum::A:
+    return "A";
+  default:
+    return std::to_string(static_cast<int64_t>(val));
+  }
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 1> enum_values<aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum> = {
+  aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum::A,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/timestamp b/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-ndk-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs b/tests/golden_output/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs
new file mode 100644
index 0000000..7533d9d
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs
@@ -0,0 +1,1074 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug, PartialEq)]
+pub struct r#FixedSizeArrayExample {
+  pub r#int2x3: [[i32; 3]; 2],
+  pub r#boolArray: [bool; 2],
+  pub r#byteArray: [u8; 2],
+  pub r#charArray: [u16; 2],
+  pub r#intArray: [i32; 2],
+  pub r#longArray: [i64; 2],
+  pub r#floatArray: [f32; 2],
+  pub r#doubleArray: [f64; 2],
+  pub r#stringArray: [String; 2],
+  pub r#byteEnumArray: [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_ByteEnum; 2],
+  pub r#intEnumArray: [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_7_IntEnum; 2],
+  pub r#longEnumArray: [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_LongEnum; 2],
+  pub r#parcelableArray: [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 2],
+  pub r#boolMatrix: [[bool; 2]; 2],
+  pub r#byteMatrix: [[u8; 2]; 2],
+  pub r#charMatrix: [[u16; 2]; 2],
+  pub r#intMatrix: [[i32; 2]; 2],
+  pub r#longMatrix: [[i64; 2]; 2],
+  pub r#floatMatrix: [[f32; 2]; 2],
+  pub r#doubleMatrix: [[f64; 2]; 2],
+  pub r#stringMatrix: [[String; 2]; 2],
+  pub r#byteEnumMatrix: [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_ByteEnum; 2]; 2],
+  pub r#intEnumMatrix: [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_7_IntEnum; 2]; 2],
+  pub r#longEnumMatrix: [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_LongEnum; 2]; 2],
+  pub r#parcelableMatrix: [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 2]; 2],
+  pub r#boolNullableArray: Option<[bool; 2]>,
+  pub r#byteNullableArray: Option<[u8; 2]>,
+  pub r#charNullableArray: Option<[u16; 2]>,
+  pub r#intNullableArray: Option<[i32; 2]>,
+  pub r#longNullableArray: Option<[i64; 2]>,
+  pub r#floatNullableArray: Option<[f32; 2]>,
+  pub r#doubleNullableArray: Option<[f64; 2]>,
+  pub r#stringNullableArray: Option<[Option<String>; 2]>,
+  pub r#byteEnumNullableArray: Option<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_ByteEnum; 2]>,
+  pub r#intEnumNullableArray: Option<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_7_IntEnum; 2]>,
+  pub r#longEnumNullableArray: Option<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_LongEnum; 2]>,
+  pub r#binderNullableArray: Option<[Option<binder::SpIBinder>; 2]>,
+  pub r#pfdNullableArray: Option<[Option<binder::ParcelFileDescriptor>; 2]>,
+  pub r#parcelableNullableArray: Option<[Option<crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable>; 2]>,
+  pub r#interfaceNullableArray: Option<[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_15_IEmptyInterface>>; 2]>,
+  pub r#boolNullableMatrix: Option<[[bool; 2]; 2]>,
+  pub r#byteNullableMatrix: Option<[[u8; 2]; 2]>,
+  pub r#charNullableMatrix: Option<[[u16; 2]; 2]>,
+  pub r#intNullableMatrix: Option<[[i32; 2]; 2]>,
+  pub r#longNullableMatrix: Option<[[i64; 2]; 2]>,
+  pub r#floatNullableMatrix: Option<[[f32; 2]; 2]>,
+  pub r#doubleNullableMatrix: Option<[[f64; 2]; 2]>,
+  pub r#stringNullableMatrix: Option<[[Option<String>; 2]; 2]>,
+  pub r#byteEnumNullableMatrix: Option<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_ByteEnum; 2]; 2]>,
+  pub r#intEnumNullableMatrix: Option<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_7_IntEnum; 2]; 2]>,
+  pub r#longEnumNullableMatrix: Option<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_LongEnum; 2]; 2]>,
+  pub r#binderNullableMatrix: Option<[[Option<binder::SpIBinder>; 2]; 2]>,
+  pub r#pfdNullableMatrix: Option<[[Option<binder::ParcelFileDescriptor>; 2]; 2]>,
+  pub r#parcelableNullableMatrix: Option<[[Option<crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable>; 2]; 2]>,
+  pub r#interfaceNullableMatrix: Option<[[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_15_IEmptyInterface>>; 2]; 2]>,
+}
+impl Default for r#FixedSizeArrayExample {
+  fn default() -> Self {
+    Self {
+      r#int2x3: [[1, 2, 3], [4, 5, 6]],
+      r#boolArray: [Default::default(), Default::default()],
+      r#byteArray: [Default::default(), Default::default()],
+      r#charArray: [Default::default(), Default::default()],
+      r#intArray: [Default::default(), Default::default()],
+      r#longArray: [Default::default(), Default::default()],
+      r#floatArray: [Default::default(), Default::default()],
+      r#doubleArray: [Default::default(), Default::default()],
+      r#stringArray: ["hello".into(), "world".into()],
+      r#byteEnumArray: [Default::default(), Default::default()],
+      r#intEnumArray: [Default::default(), Default::default()],
+      r#longEnumArray: [Default::default(), Default::default()],
+      r#parcelableArray: [Default::default(), Default::default()],
+      r#boolMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#byteMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#charMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#intMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#longMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#floatMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#doubleMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#stringMatrix: [["hello".into(), "world".into()], ["Ciao".into(), "mondo".into()]],
+      r#byteEnumMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#intEnumMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#longEnumMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#parcelableMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#boolNullableArray: Default::default(),
+      r#byteNullableArray: Default::default(),
+      r#charNullableArray: Default::default(),
+      r#intNullableArray: Default::default(),
+      r#longNullableArray: Default::default(),
+      r#floatNullableArray: Default::default(),
+      r#doubleNullableArray: Default::default(),
+      r#stringNullableArray: Some([Some("hello".into()), Some("world".into())]),
+      r#byteEnumNullableArray: Default::default(),
+      r#intEnumNullableArray: Default::default(),
+      r#longEnumNullableArray: Default::default(),
+      r#binderNullableArray: Default::default(),
+      r#pfdNullableArray: Default::default(),
+      r#parcelableNullableArray: Default::default(),
+      r#interfaceNullableArray: Default::default(),
+      r#boolNullableMatrix: Default::default(),
+      r#byteNullableMatrix: Default::default(),
+      r#charNullableMatrix: Default::default(),
+      r#intNullableMatrix: Default::default(),
+      r#longNullableMatrix: Default::default(),
+      r#floatNullableMatrix: Default::default(),
+      r#doubleNullableMatrix: Default::default(),
+      r#stringNullableMatrix: Some([[Some("hello".into()), Some("world".into())], [Some("Ciao".into()), Some("mondo".into())]]),
+      r#byteEnumNullableMatrix: Default::default(),
+      r#intEnumNullableMatrix: Default::default(),
+      r#longEnumNullableMatrix: Default::default(),
+      r#binderNullableMatrix: Default::default(),
+      r#pfdNullableMatrix: Default::default(),
+      r#parcelableNullableMatrix: Default::default(),
+      r#interfaceNullableMatrix: Default::default(),
+    }
+  }
+}
+impl binder::Parcelable for r#FixedSizeArrayExample {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#int2x3)?;
+      subparcel.write(&self.r#boolArray)?;
+      subparcel.write(&self.r#byteArray)?;
+      subparcel.write(&self.r#charArray)?;
+      subparcel.write(&self.r#intArray)?;
+      subparcel.write(&self.r#longArray)?;
+      subparcel.write(&self.r#floatArray)?;
+      subparcel.write(&self.r#doubleArray)?;
+      subparcel.write(&self.r#stringArray)?;
+      subparcel.write(&self.r#byteEnumArray)?;
+      subparcel.write(&self.r#intEnumArray)?;
+      subparcel.write(&self.r#longEnumArray)?;
+      subparcel.write(&self.r#parcelableArray)?;
+      subparcel.write(&self.r#boolMatrix)?;
+      subparcel.write(&self.r#byteMatrix)?;
+      subparcel.write(&self.r#charMatrix)?;
+      subparcel.write(&self.r#intMatrix)?;
+      subparcel.write(&self.r#longMatrix)?;
+      subparcel.write(&self.r#floatMatrix)?;
+      subparcel.write(&self.r#doubleMatrix)?;
+      subparcel.write(&self.r#stringMatrix)?;
+      subparcel.write(&self.r#byteEnumMatrix)?;
+      subparcel.write(&self.r#intEnumMatrix)?;
+      subparcel.write(&self.r#longEnumMatrix)?;
+      subparcel.write(&self.r#parcelableMatrix)?;
+      subparcel.write(&self.r#boolNullableArray)?;
+      subparcel.write(&self.r#byteNullableArray)?;
+      subparcel.write(&self.r#charNullableArray)?;
+      subparcel.write(&self.r#intNullableArray)?;
+      subparcel.write(&self.r#longNullableArray)?;
+      subparcel.write(&self.r#floatNullableArray)?;
+      subparcel.write(&self.r#doubleNullableArray)?;
+      subparcel.write(&self.r#stringNullableArray)?;
+      subparcel.write(&self.r#byteEnumNullableArray)?;
+      subparcel.write(&self.r#intEnumNullableArray)?;
+      subparcel.write(&self.r#longEnumNullableArray)?;
+      subparcel.write(&self.r#binderNullableArray)?;
+      subparcel.write(&self.r#pfdNullableArray)?;
+      subparcel.write(&self.r#parcelableNullableArray)?;
+      subparcel.write(&self.r#interfaceNullableArray)?;
+      subparcel.write(&self.r#boolNullableMatrix)?;
+      subparcel.write(&self.r#byteNullableMatrix)?;
+      subparcel.write(&self.r#charNullableMatrix)?;
+      subparcel.write(&self.r#intNullableMatrix)?;
+      subparcel.write(&self.r#longNullableMatrix)?;
+      subparcel.write(&self.r#floatNullableMatrix)?;
+      subparcel.write(&self.r#doubleNullableMatrix)?;
+      subparcel.write(&self.r#stringNullableMatrix)?;
+      subparcel.write(&self.r#byteEnumNullableMatrix)?;
+      subparcel.write(&self.r#intEnumNullableMatrix)?;
+      subparcel.write(&self.r#longEnumNullableMatrix)?;
+      subparcel.write(&self.r#binderNullableMatrix)?;
+      subparcel.write(&self.r#pfdNullableMatrix)?;
+      subparcel.write(&self.r#parcelableNullableMatrix)?;
+      subparcel.write(&self.r#interfaceNullableMatrix)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#int2x3 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#boolArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#charArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#floatArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#doubleArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#stringArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteEnumArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intEnumArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longEnumArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#parcelableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#boolMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#charMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#floatMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#doubleMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#stringMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteEnumMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intEnumMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longEnumMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#parcelableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#boolNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#charNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#floatNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#doubleNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#stringNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteEnumNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intEnumNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longEnumNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#binderNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#pfdNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#parcelableNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#interfaceNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#boolNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#charNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#floatNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#doubleNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#stringNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteEnumNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intEnumNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longEnumNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#binderNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#pfdNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#parcelableNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#interfaceNullableMatrix = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#FixedSizeArrayExample);
+binder::impl_deserialize_for_parcelable!(r#FixedSizeArrayExample);
+impl binder::binder_impl::ParcelableMetadata for r#FixedSizeArrayExample {
+  fn get_descriptor() -> &'static str { "android.aidl.fixedsizearray.FixedSizeArrayExample" }
+}
+pub mod r#IRepeatFixedSizeArray {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    IRepeatFixedSizeArray["android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray"] {
+      native: BnRepeatFixedSizeArray(on_transact),
+      proxy: BpRepeatFixedSizeArray {
+      },
+      async: IRepeatFixedSizeArrayAsync,
+    }
+  }
+  pub trait IRepeatFixedSizeArray: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray" }
+    fn r#RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3]) -> binder::Result<[u8; 3]>;
+    fn r#RepeatInts(&self, _arg_input: &[i32; 3], _arg_repeated: &mut [i32; 3]) -> binder::Result<[i32; 3]>;
+    fn r#RepeatBinders(&self, _arg_input: &[binder::SpIBinder; 3], _arg_repeated: &mut [Option<binder::SpIBinder>; 3]) -> binder::Result<[binder::SpIBinder; 3]>;
+    fn r#RepeatParcelables(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]>;
+    fn r#Repeat2dBytes(&self, _arg_input: &[[u8; 3]; 2], _arg_repeated: &mut [[u8; 3]; 2]) -> binder::Result<[[u8; 3]; 2]>;
+    fn r#Repeat2dInts(&self, _arg_input: &[[i32; 3]; 2], _arg_repeated: &mut [[i32; 3]; 2]) -> binder::Result<[[i32; 3]; 2]>;
+    fn r#Repeat2dBinders(&self, _arg_input: &[[binder::SpIBinder; 3]; 2], _arg_repeated: &mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::Result<[[binder::SpIBinder; 3]; 2]>;
+    fn r#Repeat2dParcelables(&self, _arg_input: &[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]>;
+    fn getDefaultImpl() -> IRepeatFixedSizeArrayDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: IRepeatFixedSizeArrayDefaultRef) -> IRepeatFixedSizeArrayDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait IRepeatFixedSizeArrayAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray" }
+    fn r#RepeatBytes<'a>(&'a self, _arg_input: &'a [u8; 3], _arg_repeated: &'a mut [u8; 3]) -> binder::BoxFuture<'a, binder::Result<[u8; 3]>>;
+    fn r#RepeatInts<'a>(&'a self, _arg_input: &'a [i32; 3], _arg_repeated: &'a mut [i32; 3]) -> binder::BoxFuture<'a, binder::Result<[i32; 3]>>;
+    fn r#RepeatBinders<'a>(&'a self, _arg_input: &'a [binder::SpIBinder; 3], _arg_repeated: &'a mut [Option<binder::SpIBinder>; 3]) -> binder::BoxFuture<'a, binder::Result<[binder::SpIBinder; 3]>>;
+    fn r#RepeatParcelables<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &'a mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::BoxFuture<'a, binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]>>;
+    fn r#Repeat2dBytes<'a>(&'a self, _arg_input: &'a [[u8; 3]; 2], _arg_repeated: &'a mut [[u8; 3]; 2]) -> binder::BoxFuture<'a, binder::Result<[[u8; 3]; 2]>>;
+    fn r#Repeat2dInts<'a>(&'a self, _arg_input: &'a [[i32; 3]; 2], _arg_repeated: &'a mut [[i32; 3]; 2]) -> binder::BoxFuture<'a, binder::Result<[[i32; 3]; 2]>>;
+    fn r#Repeat2dBinders<'a>(&'a self, _arg_input: &'a [[binder::SpIBinder; 3]; 2], _arg_repeated: &'a mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::BoxFuture<'a, binder::Result<[[binder::SpIBinder; 3]; 2]>>;
+    fn r#Repeat2dParcelables<'a>(&'a self, _arg_input: &'a [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &'a mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::BoxFuture<'a, binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]>>;
+  }
+  #[::async_trait::async_trait]
+  pub trait IRepeatFixedSizeArrayAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray" }
+    async fn r#RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3]) -> binder::Result<[u8; 3]>;
+    async fn r#RepeatInts(&self, _arg_input: &[i32; 3], _arg_repeated: &mut [i32; 3]) -> binder::Result<[i32; 3]>;
+    async fn r#RepeatBinders(&self, _arg_input: &[binder::SpIBinder; 3], _arg_repeated: &mut [Option<binder::SpIBinder>; 3]) -> binder::Result<[binder::SpIBinder; 3]>;
+    async fn r#RepeatParcelables(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]>;
+    async fn r#Repeat2dBytes(&self, _arg_input: &[[u8; 3]; 2], _arg_repeated: &mut [[u8; 3]; 2]) -> binder::Result<[[u8; 3]; 2]>;
+    async fn r#Repeat2dInts(&self, _arg_input: &[[i32; 3]; 2], _arg_repeated: &mut [[i32; 3]; 2]) -> binder::Result<[[i32; 3]; 2]>;
+    async fn r#Repeat2dBinders(&self, _arg_input: &[[binder::SpIBinder; 3]; 2], _arg_repeated: &mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::Result<[[binder::SpIBinder; 3]; 2]>;
+    async fn r#Repeat2dParcelables(&self, _arg_input: &[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]>;
+  }
+  impl BnRepeatFixedSizeArray {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IRepeatFixedSizeArray>
+    where
+      T: IRepeatFixedSizeArrayAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> IRepeatFixedSizeArray for Wrapper<T, R>
+      where
+        T: IRepeatFixedSizeArrayAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+        fn r#RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3]) -> binder::Result<[u8; 3]> {
+          self._rt.block_on(self._inner.r#RepeatBytes(_arg_input, _arg_repeated))
+        }
+        fn r#RepeatInts(&self, _arg_input: &[i32; 3], _arg_repeated: &mut [i32; 3]) -> binder::Result<[i32; 3]> {
+          self._rt.block_on(self._inner.r#RepeatInts(_arg_input, _arg_repeated))
+        }
+        fn r#RepeatBinders(&self, _arg_input: &[binder::SpIBinder; 3], _arg_repeated: &mut [Option<binder::SpIBinder>; 3]) -> binder::Result<[binder::SpIBinder; 3]> {
+          self._rt.block_on(self._inner.r#RepeatBinders(_arg_input, _arg_repeated))
+        }
+        fn r#RepeatParcelables(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]> {
+          self._rt.block_on(self._inner.r#RepeatParcelables(_arg_input, _arg_repeated))
+        }
+        fn r#Repeat2dBytes(&self, _arg_input: &[[u8; 3]; 2], _arg_repeated: &mut [[u8; 3]; 2]) -> binder::Result<[[u8; 3]; 2]> {
+          self._rt.block_on(self._inner.r#Repeat2dBytes(_arg_input, _arg_repeated))
+        }
+        fn r#Repeat2dInts(&self, _arg_input: &[[i32; 3]; 2], _arg_repeated: &mut [[i32; 3]; 2]) -> binder::Result<[[i32; 3]; 2]> {
+          self._rt.block_on(self._inner.r#Repeat2dInts(_arg_input, _arg_repeated))
+        }
+        fn r#Repeat2dBinders(&self, _arg_input: &[[binder::SpIBinder; 3]; 2], _arg_repeated: &mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::Result<[[binder::SpIBinder; 3]; 2]> {
+          self._rt.block_on(self._inner.r#Repeat2dBinders(_arg_input, _arg_repeated))
+        }
+        fn r#Repeat2dParcelables(&self, _arg_input: &[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]> {
+          self._rt.block_on(self._inner.r#Repeat2dParcelables(_arg_input, _arg_repeated))
+        }
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait IRepeatFixedSizeArrayDefault: Send + Sync {
+    fn r#RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3]) -> binder::Result<[u8; 3]> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#RepeatInts(&self, _arg_input: &[i32; 3], _arg_repeated: &mut [i32; 3]) -> binder::Result<[i32; 3]> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#RepeatBinders(&self, _arg_input: &[binder::SpIBinder; 3], _arg_repeated: &mut [Option<binder::SpIBinder>; 3]) -> binder::Result<[binder::SpIBinder; 3]> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#RepeatParcelables(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#Repeat2dBytes(&self, _arg_input: &[[u8; 3]; 2], _arg_repeated: &mut [[u8; 3]; 2]) -> binder::Result<[[u8; 3]; 2]> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#Repeat2dInts(&self, _arg_input: &[[i32; 3]; 2], _arg_repeated: &mut [[i32; 3]; 2]) -> binder::Result<[[i32; 3]; 2]> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#Repeat2dBinders(&self, _arg_input: &[[binder::SpIBinder; 3]; 2], _arg_repeated: &mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::Result<[[binder::SpIBinder; 3]; 2]> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#Repeat2dParcelables(&self, _arg_input: &[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+  }
+  pub mod transactions {
+    pub const r#RepeatBytes: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+    pub const r#RepeatInts: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+    pub const r#RepeatBinders: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+    pub const r#RepeatParcelables: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 3;
+    pub const r#Repeat2dBytes: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 4;
+    pub const r#Repeat2dInts: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 5;
+    pub const r#Repeat2dBinders: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 6;
+    pub const r#Repeat2dParcelables: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 7;
+  }
+  pub type IRepeatFixedSizeArrayDefaultRef = Option<std::sync::Arc<dyn IRepeatFixedSizeArrayDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<IRepeatFixedSizeArrayDefaultRef> = std::sync::Mutex::new(None);
+  }
+  impl BpRepeatFixedSizeArray {
+    fn build_parcel_RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3]) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<[u8; 3]> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IRepeatFixedSizeArray>::getDefaultImpl() {
+          return _aidl_default_impl.r#RepeatBytes(_arg_input, _arg_repeated);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: [u8; 3] = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_repeated)?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_RepeatInts(&self, _arg_input: &[i32; 3], _arg_repeated: &mut [i32; 3]) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_RepeatInts(&self, _arg_input: &[i32; 3], _arg_repeated: &mut [i32; 3], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<[i32; 3]> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IRepeatFixedSizeArray>::getDefaultImpl() {
+          return _aidl_default_impl.r#RepeatInts(_arg_input, _arg_repeated);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: [i32; 3] = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_repeated)?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_RepeatBinders(&self, _arg_input: &[binder::SpIBinder; 3], _arg_repeated: &mut [Option<binder::SpIBinder>; 3]) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_RepeatBinders(&self, _arg_input: &[binder::SpIBinder; 3], _arg_repeated: &mut [Option<binder::SpIBinder>; 3], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<[binder::SpIBinder; 3]> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IRepeatFixedSizeArray>::getDefaultImpl() {
+          return _aidl_default_impl.r#RepeatBinders(_arg_input, _arg_repeated);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: [binder::SpIBinder; 3] = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_repeated)?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_RepeatParcelables(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_RepeatParcelables(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IRepeatFixedSizeArray>::getDefaultImpl() {
+          return _aidl_default_impl.r#RepeatParcelables(_arg_input, _arg_repeated);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3] = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_repeated)?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_Repeat2dBytes(&self, _arg_input: &[[u8; 3]; 2], _arg_repeated: &mut [[u8; 3]; 2]) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_Repeat2dBytes(&self, _arg_input: &[[u8; 3]; 2], _arg_repeated: &mut [[u8; 3]; 2], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<[[u8; 3]; 2]> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IRepeatFixedSizeArray>::getDefaultImpl() {
+          return _aidl_default_impl.r#Repeat2dBytes(_arg_input, _arg_repeated);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: [[u8; 3]; 2] = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_repeated)?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_Repeat2dInts(&self, _arg_input: &[[i32; 3]; 2], _arg_repeated: &mut [[i32; 3]; 2]) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_Repeat2dInts(&self, _arg_input: &[[i32; 3]; 2], _arg_repeated: &mut [[i32; 3]; 2], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<[[i32; 3]; 2]> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IRepeatFixedSizeArray>::getDefaultImpl() {
+          return _aidl_default_impl.r#Repeat2dInts(_arg_input, _arg_repeated);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: [[i32; 3]; 2] = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_repeated)?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_Repeat2dBinders(&self, _arg_input: &[[binder::SpIBinder; 3]; 2], _arg_repeated: &mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_Repeat2dBinders(&self, _arg_input: &[[binder::SpIBinder; 3]; 2], _arg_repeated: &mut [[Option<binder::SpIBinder>; 3]; 2], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<[[binder::SpIBinder; 3]; 2]> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IRepeatFixedSizeArray>::getDefaultImpl() {
+          return _aidl_default_impl.r#Repeat2dBinders(_arg_input, _arg_repeated);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: [[binder::SpIBinder; 3]; 2] = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_repeated)?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_Repeat2dParcelables(&self, _arg_input: &[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_Repeat2dParcelables(&self, _arg_input: &[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IRepeatFixedSizeArray>::getDefaultImpl() {
+          return _aidl_default_impl.r#Repeat2dParcelables(_arg_input, _arg_repeated);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2] = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_repeated)?;
+      Ok(_aidl_return)
+    }
+  }
+  impl IRepeatFixedSizeArray for BpRepeatFixedSizeArray {
+    fn r#RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3]) -> binder::Result<[u8; 3]> {
+      let _aidl_data = self.build_parcel_RepeatBytes(_arg_input, _arg_repeated)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatBytes, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_RepeatBytes(_arg_input, _arg_repeated, _aidl_reply)
+    }
+    fn r#RepeatInts(&self, _arg_input: &[i32; 3], _arg_repeated: &mut [i32; 3]) -> binder::Result<[i32; 3]> {
+      let _aidl_data = self.build_parcel_RepeatInts(_arg_input, _arg_repeated)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatInts, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_RepeatInts(_arg_input, _arg_repeated, _aidl_reply)
+    }
+    fn r#RepeatBinders(&self, _arg_input: &[binder::SpIBinder; 3], _arg_repeated: &mut [Option<binder::SpIBinder>; 3]) -> binder::Result<[binder::SpIBinder; 3]> {
+      let _aidl_data = self.build_parcel_RepeatBinders(_arg_input, _arg_repeated)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatBinders, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_RepeatBinders(_arg_input, _arg_repeated, _aidl_reply)
+    }
+    fn r#RepeatParcelables(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]> {
+      let _aidl_data = self.build_parcel_RepeatParcelables(_arg_input, _arg_repeated)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatParcelables, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_RepeatParcelables(_arg_input, _arg_repeated, _aidl_reply)
+    }
+    fn r#Repeat2dBytes(&self, _arg_input: &[[u8; 3]; 2], _arg_repeated: &mut [[u8; 3]; 2]) -> binder::Result<[[u8; 3]; 2]> {
+      let _aidl_data = self.build_parcel_Repeat2dBytes(_arg_input, _arg_repeated)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#Repeat2dBytes, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_Repeat2dBytes(_arg_input, _arg_repeated, _aidl_reply)
+    }
+    fn r#Repeat2dInts(&self, _arg_input: &[[i32; 3]; 2], _arg_repeated: &mut [[i32; 3]; 2]) -> binder::Result<[[i32; 3]; 2]> {
+      let _aidl_data = self.build_parcel_Repeat2dInts(_arg_input, _arg_repeated)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#Repeat2dInts, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_Repeat2dInts(_arg_input, _arg_repeated, _aidl_reply)
+    }
+    fn r#Repeat2dBinders(&self, _arg_input: &[[binder::SpIBinder; 3]; 2], _arg_repeated: &mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::Result<[[binder::SpIBinder; 3]; 2]> {
+      let _aidl_data = self.build_parcel_Repeat2dBinders(_arg_input, _arg_repeated)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#Repeat2dBinders, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_Repeat2dBinders(_arg_input, _arg_repeated, _aidl_reply)
+    }
+    fn r#Repeat2dParcelables(&self, _arg_input: &[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]> {
+      let _aidl_data = self.build_parcel_Repeat2dParcelables(_arg_input, _arg_repeated)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#Repeat2dParcelables, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_Repeat2dParcelables(_arg_input, _arg_repeated, _aidl_reply)
+    }
+  }
+  impl<P: binder::BinderAsyncPool> IRepeatFixedSizeArrayAsync<P> for BpRepeatFixedSizeArray {
+    fn r#RepeatBytes<'a>(&'a self, _arg_input: &'a [u8; 3], _arg_repeated: &'a mut [u8; 3]) -> binder::BoxFuture<'a, binder::Result<[u8; 3]>> {
+      let _aidl_data = match self.build_parcel_RepeatBytes(_arg_input, _arg_repeated) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#RepeatBytes, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_RepeatBytes(_arg_input, _arg_repeated, _aidl_reply)
+        }
+      )
+    }
+    fn r#RepeatInts<'a>(&'a self, _arg_input: &'a [i32; 3], _arg_repeated: &'a mut [i32; 3]) -> binder::BoxFuture<'a, binder::Result<[i32; 3]>> {
+      let _aidl_data = match self.build_parcel_RepeatInts(_arg_input, _arg_repeated) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#RepeatInts, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_RepeatInts(_arg_input, _arg_repeated, _aidl_reply)
+        }
+      )
+    }
+    fn r#RepeatBinders<'a>(&'a self, _arg_input: &'a [binder::SpIBinder; 3], _arg_repeated: &'a mut [Option<binder::SpIBinder>; 3]) -> binder::BoxFuture<'a, binder::Result<[binder::SpIBinder; 3]>> {
+      let _aidl_data = match self.build_parcel_RepeatBinders(_arg_input, _arg_repeated) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#RepeatBinders, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_RepeatBinders(_arg_input, _arg_repeated, _aidl_reply)
+        }
+      )
+    }
+    fn r#RepeatParcelables<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &'a mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::BoxFuture<'a, binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]>> {
+      let _aidl_data = match self.build_parcel_RepeatParcelables(_arg_input, _arg_repeated) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#RepeatParcelables, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_RepeatParcelables(_arg_input, _arg_repeated, _aidl_reply)
+        }
+      )
+    }
+    fn r#Repeat2dBytes<'a>(&'a self, _arg_input: &'a [[u8; 3]; 2], _arg_repeated: &'a mut [[u8; 3]; 2]) -> binder::BoxFuture<'a, binder::Result<[[u8; 3]; 2]>> {
+      let _aidl_data = match self.build_parcel_Repeat2dBytes(_arg_input, _arg_repeated) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#Repeat2dBytes, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_Repeat2dBytes(_arg_input, _arg_repeated, _aidl_reply)
+        }
+      )
+    }
+    fn r#Repeat2dInts<'a>(&'a self, _arg_input: &'a [[i32; 3]; 2], _arg_repeated: &'a mut [[i32; 3]; 2]) -> binder::BoxFuture<'a, binder::Result<[[i32; 3]; 2]>> {
+      let _aidl_data = match self.build_parcel_Repeat2dInts(_arg_input, _arg_repeated) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#Repeat2dInts, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_Repeat2dInts(_arg_input, _arg_repeated, _aidl_reply)
+        }
+      )
+    }
+    fn r#Repeat2dBinders<'a>(&'a self, _arg_input: &'a [[binder::SpIBinder; 3]; 2], _arg_repeated: &'a mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::BoxFuture<'a, binder::Result<[[binder::SpIBinder; 3]; 2]>> {
+      let _aidl_data = match self.build_parcel_Repeat2dBinders(_arg_input, _arg_repeated) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#Repeat2dBinders, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_Repeat2dBinders(_arg_input, _arg_repeated, _aidl_reply)
+        }
+      )
+    }
+    fn r#Repeat2dParcelables<'a>(&'a self, _arg_input: &'a [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &'a mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::BoxFuture<'a, binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]>> {
+      let _aidl_data = match self.build_parcel_Repeat2dParcelables(_arg_input, _arg_repeated) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#Repeat2dParcelables, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_Repeat2dParcelables(_arg_input, _arg_repeated, _aidl_reply)
+        }
+      )
+    }
+  }
+  impl IRepeatFixedSizeArray for binder::binder_impl::Binder<BnRepeatFixedSizeArray> {
+    fn r#RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3]) -> binder::Result<[u8; 3]> { self.0.r#RepeatBytes(_arg_input, _arg_repeated) }
+    fn r#RepeatInts(&self, _arg_input: &[i32; 3], _arg_repeated: &mut [i32; 3]) -> binder::Result<[i32; 3]> { self.0.r#RepeatInts(_arg_input, _arg_repeated) }
+    fn r#RepeatBinders(&self, _arg_input: &[binder::SpIBinder; 3], _arg_repeated: &mut [Option<binder::SpIBinder>; 3]) -> binder::Result<[binder::SpIBinder; 3]> { self.0.r#RepeatBinders(_arg_input, _arg_repeated) }
+    fn r#RepeatParcelables(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]> { self.0.r#RepeatParcelables(_arg_input, _arg_repeated) }
+    fn r#Repeat2dBytes(&self, _arg_input: &[[u8; 3]; 2], _arg_repeated: &mut [[u8; 3]; 2]) -> binder::Result<[[u8; 3]; 2]> { self.0.r#Repeat2dBytes(_arg_input, _arg_repeated) }
+    fn r#Repeat2dInts(&self, _arg_input: &[[i32; 3]; 2], _arg_repeated: &mut [[i32; 3]; 2]) -> binder::Result<[[i32; 3]; 2]> { self.0.r#Repeat2dInts(_arg_input, _arg_repeated) }
+    fn r#Repeat2dBinders(&self, _arg_input: &[[binder::SpIBinder; 3]; 2], _arg_repeated: &mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::Result<[[binder::SpIBinder; 3]; 2]> { self.0.r#Repeat2dBinders(_arg_input, _arg_repeated) }
+    fn r#Repeat2dParcelables(&self, _arg_input: &[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]> { self.0.r#Repeat2dParcelables(_arg_input, _arg_repeated) }
+  }
+  fn on_transact(_aidl_service: &dyn IRepeatFixedSizeArray, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      transactions::r#RepeatBytes => {
+        let _arg_input: [u8; 3] = _aidl_data.read()?;
+        let mut _arg_repeated: [u8; 3] = Default::default();
+        let _aidl_return = _aidl_service.r#RepeatBytes(&_arg_input, &mut _arg_repeated);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_repeated)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#RepeatInts => {
+        let _arg_input: [i32; 3] = _aidl_data.read()?;
+        let mut _arg_repeated: [i32; 3] = Default::default();
+        let _aidl_return = _aidl_service.r#RepeatInts(&_arg_input, &mut _arg_repeated);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_repeated)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#RepeatBinders => {
+        let _arg_input: [binder::SpIBinder; 3] = _aidl_data.read()?;
+        let mut _arg_repeated: [Option<binder::SpIBinder>; 3] = Default::default();
+        let _aidl_return = _aidl_service.r#RepeatBinders(&_arg_input, &mut _arg_repeated);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_repeated)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#RepeatParcelables => {
+        let _arg_input: [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3] = _aidl_data.read()?;
+        let mut _arg_repeated: [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3] = Default::default();
+        let _aidl_return = _aidl_service.r#RepeatParcelables(&_arg_input, &mut _arg_repeated);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_repeated)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#Repeat2dBytes => {
+        let _arg_input: [[u8; 3]; 2] = _aidl_data.read()?;
+        let mut _arg_repeated: [[u8; 3]; 2] = Default::default();
+        let _aidl_return = _aidl_service.r#Repeat2dBytes(&_arg_input, &mut _arg_repeated);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_repeated)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#Repeat2dInts => {
+        let _arg_input: [[i32; 3]; 2] = _aidl_data.read()?;
+        let mut _arg_repeated: [[i32; 3]; 2] = Default::default();
+        let _aidl_return = _aidl_service.r#Repeat2dInts(&_arg_input, &mut _arg_repeated);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_repeated)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#Repeat2dBinders => {
+        let _arg_input: [[binder::SpIBinder; 3]; 2] = _aidl_data.read()?;
+        let mut _arg_repeated: [[Option<binder::SpIBinder>; 3]; 2] = Default::default();
+        let _aidl_return = _aidl_service.r#Repeat2dBinders(&_arg_input, &mut _arg_repeated);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_repeated)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#Repeat2dParcelables => {
+        let _arg_input: [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2] = _aidl_data.read()?;
+        let mut _arg_repeated: [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2] = Default::default();
+        let _aidl_return = _aidl_service.r#Repeat2dParcelables(&_arg_input, &mut _arg_repeated);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_repeated)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub mod r#ByteEnum {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#ByteEnum : [i8; 1] {
+      r#A = 0,
+    }
+  }
+}
+pub mod r#IntEnum {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#IntEnum : [i32; 1] {
+      r#A = 0,
+    }
+  }
+}
+pub mod r#LongEnum {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#LongEnum : [i64; 1] {
+      r#A = 0,
+    }
+  }
+}
+pub mod r#IntParcelable {
+  #[derive(Debug, Clone, Copy, PartialEq)]
+  pub struct r#IntParcelable {
+    pub r#value: i32,
+  }
+  impl Default for r#IntParcelable {
+    fn default() -> Self {
+      Self {
+        r#value: 0,
+      }
+    }
+  }
+  impl binder::Parcelable for r#IntParcelable {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        subparcel.write(&self.r#value)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#value = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#IntParcelable);
+  binder::impl_deserialize_for_parcelable!(r#IntParcelable);
+  impl binder::binder_impl::ParcelableMetadata for r#IntParcelable {
+    fn get_descriptor() -> &'static str { "android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable" }
+  }
+}
+pub mod r#IEmptyInterface {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    IEmptyInterface["android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface"] {
+      native: BnEmptyInterface(on_transact),
+      proxy: BpEmptyInterface {
+      },
+      async: IEmptyInterfaceAsync,
+    }
+  }
+  pub trait IEmptyInterface: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface" }
+    fn getDefaultImpl() -> IEmptyInterfaceDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: IEmptyInterfaceDefaultRef) -> IEmptyInterfaceDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait IEmptyInterfaceAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface" }
+  }
+  #[::async_trait::async_trait]
+  pub trait IEmptyInterfaceAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface" }
+  }
+  impl BnEmptyInterface {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IEmptyInterface>
+    where
+      T: IEmptyInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> IEmptyInterface for Wrapper<T, R>
+      where
+        T: IEmptyInterfaceAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait IEmptyInterfaceDefault: Send + Sync {
+  }
+  pub mod transactions {
+  }
+  pub type IEmptyInterfaceDefaultRef = Option<std::sync::Arc<dyn IEmptyInterfaceDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None);
+  }
+  impl BpEmptyInterface {
+  }
+  impl IEmptyInterface for BpEmptyInterface {
+  }
+  impl<P: binder::BinderAsyncPool> IEmptyInterfaceAsync<P> for BpEmptyInterface {
+  }
+  impl IEmptyInterface for binder::binder_impl::Binder<BnEmptyInterface> {
+  }
+  fn on_transact(_aidl_service: &dyn IEmptyInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#FixedSizeArrayExample as _7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample;
+ pub use super::r#IRepeatFixedSizeArray::r#IRepeatFixedSizeArray as _7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_21_IRepeatFixedSizeArray;
+ pub use super::r#ByteEnum::r#ByteEnum as _7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_ByteEnum;
+ pub use super::r#IntEnum::r#IntEnum as _7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_7_IntEnum;
+ pub use super::r#LongEnum::r#LongEnum as _7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_LongEnum;
+ pub use super::r#IntParcelable::r#IntParcelable as _7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable;
+ pub use super::r#IEmptyInterface::r#IEmptyInterface as _7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_15_IEmptyInterface;
+}
diff --git a/tests/golden_output/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs.d b/tests/golden_output/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs.d
new file mode 100644
index 0000000..5811cd6
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs : \
+  system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
diff --git a/tests/golden_output/aidl-test-fixedsizearray-rust-source/gen/timestamp b/tests/golden_output/aidl-test-fixedsizearray-rust-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-fixedsizearray-rust-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp
new file mode 100644
index 0000000..dee8d5e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d
new file mode 100644
index 0000000..926b7a9
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/BackendType.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/BackendType.cpp
new file mode 100644
index 0000000..9944fa9
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/BackendType.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/BackendType.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/BackendType.cpp.d
new file mode 100644
index 0000000..a8eb8f4
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/BackendType.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/BackendType.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ByteEnum.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ByteEnum.cpp
new file mode 100644
index 0000000..960e196
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ByteEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ByteEnum.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ByteEnum.cpp.d
new file mode 100644
index 0000000..dc5cd10
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ByteEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ByteEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/CircularParcelable.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/CircularParcelable.cpp
new file mode 100644
index 0000000..b911760
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/CircularParcelable.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/CircularParcelable.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/CircularParcelable.cpp.d
new file mode 100644
index 0000000..ca732bc
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/CircularParcelable.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/CircularParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp
new file mode 100644
index 0000000..20e9b51
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d
new file mode 100644
index 0000000..7c62e12
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedEnum.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedEnum.cpp
new file mode 100644
index 0000000..a6ed0dc
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d
new file mode 100644
index 0000000..13e605a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedParcelable.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedParcelable.cpp
new file mode 100644
index 0000000..121a7bc
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedParcelable.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d
new file mode 100644
index 0000000..cb06e1f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/FixedSize.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/FixedSize.cpp
new file mode 100644
index 0000000..51a504c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/FixedSize.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/FixedSize.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/FixedSize.cpp.d
new file mode 100644
index 0000000..6f36764
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/FixedSize.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/FixedSize.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp
new file mode 100644
index 0000000..7a76896
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d
new file mode 100644
index 0000000..bc6d54d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ICircular.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ICircular.cpp
new file mode 100644
index 0000000..b71b8c0
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ICircular.cpp
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#include <iostream>
+#include <binder/Parcel.h>
+#include <android/binder_to_string.h>
+#include <android/aidl/tests/ICircular.h>
+namespace {
+android::status_t analyzeICircular(uint32_t _aidl_code, const android::Parcel& _aidl_data, const android::Parcel& _aidl_reply) {
+  android::status_t _aidl_ret_status;
+  switch(_aidl_code) {
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 0:
+    {
+      std::cout << "ICircular.GetTestService()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ICircular")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::sp<::android::aidl::tests::ITestService> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readNullableStrongBinder(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    default:
+    {
+      std::cout << "  Transaction code " << _aidl_code << " not known." << std::endl;
+    _aidl_ret_status = android::UNKNOWN_TRANSACTION;
+    }
+  }
+  return _aidl_ret_status;
+  // To prevent unused variable warnings
+  (void)_aidl_ret_status; (void)_aidl_data; (void)_aidl_reply;
+}
+
+} // namespace
+
+#include <Analyzer.h>
+using android::aidl::Analyzer;
+__attribute__((constructor)) static void addAnalyzer() {
+  Analyzer::installAnalyzer(std::make_unique<Analyzer>("android.aidl.tests.ICircular", "ICircular", &analyzeICircular));
+}
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ICircular.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ICircular.cpp.d
new file mode 100644
index 0000000..caefda2
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ICircular.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ICircular.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IDeprecated.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IDeprecated.cpp
new file mode 100644
index 0000000..0c56ecd
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IDeprecated.cpp
@@ -0,0 +1,30 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#include <iostream>
+#include <binder/Parcel.h>
+#include <android/binder_to_string.h>
+#include <android/aidl/tests/IDeprecated.h>
+namespace {
+android::status_t analyzeIDeprecated(uint32_t _aidl_code, const android::Parcel& _aidl_data, const android::Parcel& _aidl_reply) {
+  android::status_t _aidl_ret_status;
+  switch(_aidl_code) {
+    default:
+    {
+      std::cout << "  Transaction code " << _aidl_code << " not known." << std::endl;
+    _aidl_ret_status = android::UNKNOWN_TRANSACTION;
+    }
+  }
+  return _aidl_ret_status;
+  // To prevent unused variable warnings
+  (void)_aidl_ret_status; (void)_aidl_data; (void)_aidl_reply;
+}
+
+} // namespace
+
+#include <Analyzer.h>
+using android::aidl::Analyzer;
+__attribute__((constructor)) static void addAnalyzer() {
+  Analyzer::installAnalyzer(std::make_unique<Analyzer>("android.aidl.tests.IDeprecated", "IDeprecated", &analyzeIDeprecated));
+}
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IDeprecated.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IDeprecated.cpp.d
new file mode 100644
index 0000000..afc741e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IDeprecated.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IDeprecated.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INamedCallback.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INamedCallback.cpp
new file mode 100644
index 0000000..45ce556
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INamedCallback.cpp
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#include <iostream>
+#include <binder/Parcel.h>
+#include <android/binder_to_string.h>
+#include <android/aidl/tests/INamedCallback.h>
+namespace {
+android::status_t analyzeINamedCallback(uint32_t _aidl_code, const android::Parcel& _aidl_data, const android::Parcel& _aidl_reply) {
+  android::status_t _aidl_ret_status;
+  switch(_aidl_code) {
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 0:
+    {
+      std::cout << "INamedCallback.GetName()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.INamedCallback")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::String16 _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readString16(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    default:
+    {
+      std::cout << "  Transaction code " << _aidl_code << " not known." << std::endl;
+    _aidl_ret_status = android::UNKNOWN_TRANSACTION;
+    }
+  }
+  return _aidl_ret_status;
+  // To prevent unused variable warnings
+  (void)_aidl_ret_status; (void)_aidl_data; (void)_aidl_reply;
+}
+
+} // namespace
+
+#include <Analyzer.h>
+using android::aidl::Analyzer;
+__attribute__((constructor)) static void addAnalyzer() {
+  Analyzer::installAnalyzer(std::make_unique<Analyzer>("android.aidl.tests.INamedCallback", "INamedCallback", &analyzeINamedCallback));
+}
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INamedCallback.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INamedCallback.cpp.d
new file mode 100644
index 0000000..18e6033
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INamedCallback.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INamedCallback.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INewName.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INewName.cpp
new file mode 100644
index 0000000..5fd13d2
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INewName.cpp
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#include <iostream>
+#include <binder/Parcel.h>
+#include <android/binder_to_string.h>
+#include <android/aidl/tests/INewName.h>
+namespace {
+android::status_t analyzeINewName(uint32_t _aidl_code, const android::Parcel& _aidl_data, const android::Parcel& _aidl_reply) {
+  android::status_t _aidl_ret_status;
+  switch(_aidl_code) {
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 0:
+    {
+      std::cout << "INewName.RealName()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.IOldName")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::String16 _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readString16(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    default:
+    {
+      std::cout << "  Transaction code " << _aidl_code << " not known." << std::endl;
+    _aidl_ret_status = android::UNKNOWN_TRANSACTION;
+    }
+  }
+  return _aidl_ret_status;
+  // To prevent unused variable warnings
+  (void)_aidl_ret_status; (void)_aidl_data; (void)_aidl_reply;
+}
+
+} // namespace
+
+#include <Analyzer.h>
+using android::aidl::Analyzer;
+__attribute__((constructor)) static void addAnalyzer() {
+  Analyzer::installAnalyzer(std::make_unique<Analyzer>("android.aidl.tests.INewName", "INewName", &analyzeINewName));
+}
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INewName.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INewName.cpp.d
new file mode 100644
index 0000000..54b0be5
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INewName.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INewName.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IOldName.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IOldName.cpp
new file mode 100644
index 0000000..2581294
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IOldName.cpp
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#include <iostream>
+#include <binder/Parcel.h>
+#include <android/binder_to_string.h>
+#include <android/aidl/tests/IOldName.h>
+namespace {
+android::status_t analyzeIOldName(uint32_t _aidl_code, const android::Parcel& _aidl_data, const android::Parcel& _aidl_reply) {
+  android::status_t _aidl_ret_status;
+  switch(_aidl_code) {
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 0:
+    {
+      std::cout << "IOldName.RealName()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.IOldName")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::String16 _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readString16(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    default:
+    {
+      std::cout << "  Transaction code " << _aidl_code << " not known." << std::endl;
+    _aidl_ret_status = android::UNKNOWN_TRANSACTION;
+    }
+  }
+  return _aidl_ret_status;
+  // To prevent unused variable warnings
+  (void)_aidl_ret_status; (void)_aidl_data; (void)_aidl_reply;
+}
+
+} // namespace
+
+#include <Analyzer.h>
+using android::aidl::Analyzer;
+__attribute__((constructor)) static void addAnalyzer() {
+  Analyzer::installAnalyzer(std::make_unique<Analyzer>("android.aidl.tests.IOldName", "IOldName", &analyzeIOldName));
+}
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IOldName.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IOldName.cpp.d
new file mode 100644
index 0000000..d09b11f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IOldName.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IOldName.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ITestService.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ITestService.cpp
new file mode 100644
index 0000000..ce2a4b3
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ITestService.cpp
@@ -0,0 +1,2688 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#include <iostream>
+#include <binder/Parcel.h>
+#include <android/binder_to_string.h>
+#include <android/aidl/tests/ITestService.h>
+namespace {
+android::status_t analyzeITestService(uint32_t _aidl_code, const android::Parcel& _aidl_data, const android::Parcel& _aidl_reply) {
+  android::status_t _aidl_ret_status;
+  switch(_aidl_code) {
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 0:
+    {
+      std::cout << "ITestService.UnimplementedMethod()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      int32_t in_arg;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      int32_t _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readInt32(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt32(&in_arg);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument arg from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    arg: " << ::android::internal::ToString(in_arg) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 1:
+    {
+      std::cout << "ITestService.Deprecated()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 2:
+    {
+      std::cout << "ITestService.TestOneway()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 3:
+    {
+      std::cout << "ITestService.RepeatBoolean()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      bool in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      bool _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readBool(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readBool(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 4:
+    {
+      std::cout << "ITestService.RepeatByte()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      int8_t in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      int8_t _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readByte(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readByte(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 5:
+    {
+      std::cout << "ITestService.RepeatChar()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      char16_t in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      char16_t _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readChar(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readChar(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 6:
+    {
+      std::cout << "ITestService.RepeatInt()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      int32_t in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      int32_t _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readInt32(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt32(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 7:
+    {
+      std::cout << "ITestService.RepeatLong()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      int64_t in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      int64_t _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readInt64(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt64(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 8:
+    {
+      std::cout << "ITestService.RepeatFloat()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      float in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      float _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readFloat(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readFloat(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 9:
+    {
+      std::cout << "ITestService.RepeatDouble()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      double in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      double _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readDouble(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readDouble(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 10:
+    {
+      std::cout << "ITestService.RepeatString()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::String16 in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::String16 _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readString16(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 11:
+    {
+      std::cout << "ITestService.RepeatByteEnum()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::ByteEnum in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::aidl::tests::ByteEnum _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readByte(reinterpret_cast<int8_t *>(&_aidl_return));
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_token));
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 12:
+    {
+      std::cout << "ITestService.RepeatIntEnum()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::IntEnum in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::aidl::tests::IntEnum _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readInt32(reinterpret_cast<int32_t *>(&_aidl_return));
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt32(reinterpret_cast<int32_t *>(&in_token));
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 13:
+    {
+      std::cout << "ITestService.RepeatLongEnum()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::LongEnum in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::aidl::tests::LongEnum _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readInt64(reinterpret_cast<int64_t *>(&_aidl_return));
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt64(reinterpret_cast<int64_t *>(&in_token));
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 14:
+    {
+      std::cout << "ITestService.ReverseBoolean()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<bool> in_input;
+      ::std::vector<bool> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<bool> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readBoolVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readBoolVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readBoolVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 15:
+    {
+      std::cout << "ITestService.ReverseByte()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<uint8_t> in_input;
+      ::std::vector<uint8_t> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<uint8_t> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readByteVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readByteVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readByteVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 16:
+    {
+      std::cout << "ITestService.ReverseChar()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<char16_t> in_input;
+      ::std::vector<char16_t> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<char16_t> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readCharVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readCharVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readCharVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 17:
+    {
+      std::cout << "ITestService.ReverseInt()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<int32_t> in_input;
+      ::std::vector<int32_t> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<int32_t> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readInt32Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt32Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readInt32Vector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 18:
+    {
+      std::cout << "ITestService.ReverseLong()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<int64_t> in_input;
+      ::std::vector<int64_t> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<int64_t> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readInt64Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt64Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readInt64Vector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 19:
+    {
+      std::cout << "ITestService.ReverseFloat()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<float> in_input;
+      ::std::vector<float> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<float> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readFloatVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readFloatVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readFloatVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 20:
+    {
+      std::cout << "ITestService.ReverseDouble()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<double> in_input;
+      ::std::vector<double> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<double> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readDoubleVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readDoubleVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readDoubleVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 21:
+    {
+      std::cout << "ITestService.ReverseString()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::String16> in_input;
+      ::std::vector<::android::String16> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::String16> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readString16Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readString16Vector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 22:
+    {
+      std::cout << "ITestService.ReverseByteEnum()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::aidl::tests::ByteEnum> in_input;
+      ::std::vector<::android::aidl::tests::ByteEnum> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::aidl::tests::ByteEnum> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readEnumVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readEnumVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 23:
+    {
+      std::cout << "ITestService.ReverseIntEnum()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::aidl::tests::IntEnum> in_input;
+      ::std::vector<::android::aidl::tests::IntEnum> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::aidl::tests::IntEnum> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readEnumVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readEnumVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 24:
+    {
+      std::cout << "ITestService.ReverseLongEnum()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::aidl::tests::LongEnum> in_input;
+      ::std::vector<::android::aidl::tests::LongEnum> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::aidl::tests::LongEnum> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readEnumVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readEnumVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 25:
+    {
+      std::cout << "ITestService.GetOtherTestService()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::String16 in_name;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::sp<::android::aidl::tests::INamedCallback> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinder(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16(&in_name);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument name from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    name: " << ::android::internal::ToString(in_name) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 26:
+    {
+      std::cout << "ITestService.SetOtherTestService()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::String16 in_name;
+      ::android::sp<::android::aidl::tests::INamedCallback> in_service;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      bool _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readBool(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16(&in_name);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument name from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readStrongBinder(&in_service);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument service from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    name: " << ::android::internal::ToString(in_name) << std::endl;
+      std::cout << "    service: " << ::android::internal::ToString(in_service) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 27:
+    {
+      std::cout << "ITestService.VerifyName()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::sp<::android::aidl::tests::INamedCallback> in_service;
+      ::android::String16 in_name;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      bool _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readBool(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinder(&in_service);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument service from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readString16(&in_name);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument name from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    service: " << ::android::internal::ToString(in_service) << std::endl;
+      std::cout << "    name: " << ::android::internal::ToString(in_name) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 28:
+    {
+      std::cout << "ITestService.GetInterfaceArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::String16> in_names;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinderVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument names from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    names: " << ::android::internal::ToString(in_names) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 29:
+    {
+      std::cout << "ITestService.VerifyNamesWithInterfaceArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>> in_services;
+      ::std::vector<::android::String16> in_names;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      bool _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readBool(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_services);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument services from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument names from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    services: " << ::android::internal::ToString(in_services) << std::endl;
+      std::cout << "    names: " << ::android::internal::ToString(in_names) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 30:
+    {
+      std::cout << "ITestService.GetNullableInterfaceArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::std::optional<::android::String16>>> in_names;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinderVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument names from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    names: " << ::android::internal::ToString(in_names) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 31:
+    {
+      std::cout << "ITestService.VerifyNamesWithNullableInterfaceArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>> in_services;
+      ::std::optional<::std::vector<::std::optional<::android::String16>>> in_names;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      bool _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readBool(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_services);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument services from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument names from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    services: " << ::android::internal::ToString(in_services) << std::endl;
+      std::cout << "    names: " << ::android::internal::ToString(in_names) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 32:
+    {
+      std::cout << "ITestService.GetInterfaceList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::std::optional<::android::String16>>> in_names;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinderVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument names from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    names: " << ::android::internal::ToString(in_names) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 33:
+    {
+      std::cout << "ITestService.VerifyNamesWithInterfaceList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>> in_services;
+      ::std::optional<::std::vector<::std::optional<::android::String16>>> in_names;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      bool _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readBool(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_services);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument services from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument names from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    services: " << ::android::internal::ToString(in_services) << std::endl;
+      std::cout << "    names: " << ::android::internal::ToString(in_names) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 34:
+    {
+      std::cout << "ITestService.ReverseStringList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::String16> in_input;
+      ::std::vector<::android::String16> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::String16> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readString16Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readString16Vector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 35:
+    {
+      std::cout << "ITestService.RepeatParcelFileDescriptor()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::os::ParcelFileDescriptor in_read;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::os::ParcelFileDescriptor _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readParcelable(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelable(&in_read);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument read from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    read: " << ::android::internal::ToString(in_read) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 36:
+    {
+      std::cout << "ITestService.ReverseParcelFileDescriptorArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::os::ParcelFileDescriptor> in_input;
+      ::std::vector<::android::os::ParcelFileDescriptor> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::os::ParcelFileDescriptor> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readParcelableVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelableVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readParcelableVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 37:
+    {
+      std::cout << "ITestService.ThrowServiceException()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      int32_t in_code;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt32(&in_code);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument code from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    code: " << ::android::internal::ToString(in_code) << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 38:
+    {
+      std::cout << "ITestService.RepeatNullableIntArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<int32_t>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<int32_t>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readInt32Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt32Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 39:
+    {
+      std::cout << "ITestService.RepeatNullableByteEnumArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readEnumVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 40:
+    {
+      std::cout << "ITestService.RepeatNullableIntEnumArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::android::aidl::tests::IntEnum>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::android::aidl::tests::IntEnum>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readEnumVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 41:
+    {
+      std::cout << "ITestService.RepeatNullableLongEnumArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::android::aidl::tests::LongEnum>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::android::aidl::tests::LongEnum>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readEnumVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 42:
+    {
+      std::cout << "ITestService.RepeatNullableString()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::android::String16> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::android::String16> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readString16(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 43:
+    {
+      std::cout << "ITestService.RepeatNullableStringList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::std::optional<::android::String16>>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::std::optional<::android::String16>>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readString16Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 44:
+    {
+      std::cout << "ITestService.RepeatNullableParcelable()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::android::aidl::tests::ITestService::Empty> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::android::aidl::tests::ITestService::Empty> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readParcelable(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 45:
+    {
+      std::cout << "ITestService.RepeatNullableParcelableArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readParcelableVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelableVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 46:
+    {
+      std::cout << "ITestService.RepeatNullableParcelableList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readParcelableVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelableVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 47:
+    {
+      std::cout << "ITestService.TakesAnIBinder()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::sp<::android::IBinder> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinder(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 48:
+    {
+      std::cout << "ITestService.TakesANullableIBinder()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::sp<::android::IBinder> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readNullableStrongBinder(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 49:
+    {
+      std::cout << "ITestService.TakesAnIBinderList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::sp<::android::IBinder>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 50:
+    {
+      std::cout << "ITestService.TakesANullableIBinderList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::android::sp<::android::IBinder>>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 51:
+    {
+      std::cout << "ITestService.RepeatUtf8CppString()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::string in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::string _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readUtf8FromUtf16(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readUtf8FromUtf16(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 52:
+    {
+      std::cout << "ITestService.RepeatNullableUtf8CppString()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::string> in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::string> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readUtf8FromUtf16(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readUtf8FromUtf16(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 53:
+    {
+      std::cout << "ITestService.ReverseUtf8CppString()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::std::string> in_input;
+      ::std::vector<::std::string> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::std::string> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 54:
+    {
+      std::cout << "ITestService.ReverseNullableUtf8CppString()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::std::optional<::std::string>>> in_input;
+      ::std::optional<::std::vector<::std::optional<::std::string>>> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::std::optional<::std::string>>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 55:
+    {
+      std::cout << "ITestService.ReverseUtf8CppStringList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::std::optional<::std::string>>> in_input;
+      ::std::optional<::std::vector<::std::optional<::std::string>>> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::std::optional<::std::string>>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 56:
+    {
+      std::cout << "ITestService.GetCallback()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      bool in_return_null;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::sp<::android::aidl::tests::INamedCallback> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readNullableStrongBinder(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readBool(&in_return_null);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument return_null from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    return_null: " << ::android::internal::ToString(in_return_null) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 57:
+    {
+      std::cout << "ITestService.FillOutStructuredParcelable()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::StructuredParcelable in_parcel;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelable(&in_parcel);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument parcel from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    parcel: " << ::android::internal::ToString(in_parcel) << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 58:
+    {
+      std::cout << "ITestService.RepeatExtendableParcelable()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::extension::ExtendableParcelable in_ep;
+      ::android::aidl::tests::extension::ExtendableParcelable out_ep2;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelable(&in_ep);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument ep from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readParcelable(&out_ep2);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument ep2 from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    ep: " << ::android::internal::ToString(in_ep) << std::endl;
+      std::cout << "    ep2: " << ::android::internal::ToString(out_ep2) << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 59:
+    {
+      std::cout << "ITestService.ReverseList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::RecursiveList in_list;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::aidl::tests::RecursiveList _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readParcelable(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelable(&in_list);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument list from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    list: " << ::android::internal::ToString(in_list) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 60:
+    {
+      std::cout << "ITestService.ReverseIBinderArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::sp<::android::IBinder>> in_input;
+      ::std::vector<::android::sp<::android::IBinder>> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::sp<::android::IBinder>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinderVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 61:
+    {
+      std::cout << "ITestService.ReverseNullableIBinderArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::android::sp<::android::IBinder>>> in_input;
+      ::std::optional<::std::vector<::android::sp<::android::IBinder>>> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::android::sp<::android::IBinder>>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinderVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 62:
+    {
+      std::cout << "ITestService.GetOldNameInterface()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::sp<::android::aidl::tests::IOldName> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinder(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 63:
+    {
+      std::cout << "ITestService.GetNewNameInterface()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::sp<::android::aidl::tests::INewName> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinder(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 64:
+    {
+      std::cout << "ITestService.GetUnionTags()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::aidl::tests::Union> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::aidl::tests::Union::Tag> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readEnumVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelableVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 65:
+    {
+      std::cout << "ITestService.GetCppJavaTests()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::sp<::android::IBinder> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readNullableStrongBinder(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 66:
+    {
+      std::cout << "ITestService.getBackendType()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::aidl::tests::BackendType _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readByte(reinterpret_cast<int8_t *>(&_aidl_return));
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 67:
+    {
+      std::cout << "ITestService.GetCircular()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::CircularParcelable out_cp;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::sp<::android::aidl::tests::ICircular> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinder(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelable(&out_cp);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument cp from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    cp: " << ::android::internal::ToString(out_cp) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    default:
+    {
+      std::cout << "  Transaction code " << _aidl_code << " not known." << std::endl;
+    _aidl_ret_status = android::UNKNOWN_TRANSACTION;
+    }
+  }
+  return _aidl_ret_status;
+  // To prevent unused variable warnings
+  (void)_aidl_ret_status; (void)_aidl_data; (void)_aidl_reply;
+}
+
+} // namespace
+
+#include <Analyzer.h>
+using android::aidl::Analyzer;
+__attribute__((constructor)) static void addAnalyzer() {
+  Analyzer::installAnalyzer(std::make_unique<Analyzer>("android.aidl.tests.ITestService", "ITestService", &analyzeITestService));
+}
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ITestService.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ITestService.cpp.d
new file mode 100644
index 0000000..5884077
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ITestService.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ITestService.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IntEnum.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IntEnum.cpp
new file mode 100644
index 0000000..ef5521f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IntEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IntEnum.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IntEnum.cpp.d
new file mode 100644
index 0000000..cd09610
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IntEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IntEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ListOfInterfaces.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ListOfInterfaces.cpp
new file mode 100644
index 0000000..f04a3dd
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ListOfInterfaces.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d
new file mode 100644
index 0000000..09abd96
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ListOfInterfaces.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/LongEnum.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/LongEnum.cpp
new file mode 100644
index 0000000..0fb26c7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/LongEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/LongEnum.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/LongEnum.cpp.d
new file mode 100644
index 0000000..d83d703
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/LongEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/LongEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/OtherParcelableForToString.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/OtherParcelableForToString.cpp
new file mode 100644
index 0000000..452f43f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/OtherParcelableForToString.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d
new file mode 100644
index 0000000..1907745
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/OtherParcelableForToString.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ParcelableForToString.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ParcelableForToString.cpp
new file mode 100644
index 0000000..cb59e7b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ParcelableForToString.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ParcelableForToString.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ParcelableForToString.cpp.d
new file mode 100644
index 0000000..b89b897
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ParcelableForToString.cpp.d
@@ -0,0 +1,10 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ParcelableForToString.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/RecursiveList.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/RecursiveList.cpp
new file mode 100644
index 0000000..1e350ca
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/RecursiveList.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/RecursiveList.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/RecursiveList.cpp.d
new file mode 100644
index 0000000..d4e29f0
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/RecursiveList.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/RecursiveList.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/StructuredParcelable.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/StructuredParcelable.cpp
new file mode 100644
index 0000000..eac1cf4
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/StructuredParcelable.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/StructuredParcelable.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/StructuredParcelable.cpp.d
new file mode 100644
index 0000000..dc83d1a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/StructuredParcelable.cpp.d
@@ -0,0 +1,7 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/StructuredParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/Union.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/Union.cpp
new file mode 100644
index 0000000..611b7e2
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/Union.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/Union.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/Union.cpp.d
new file mode 100644
index 0000000..8a4c078
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/Union.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/Union.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/UnionWithFd.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/UnionWithFd.cpp
new file mode 100644
index 0000000..d76738b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/UnionWithFd.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/UnionWithFd.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/UnionWithFd.cpp.d
new file mode 100644
index 0000000..db9f113
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/UnionWithFd.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/UnionWithFd.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp
new file mode 100644
index 0000000..317b85b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d
new file mode 100644
index 0000000..05a7b8b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt.cpp
new file mode 100644
index 0000000..b98b3a6
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt.cpp.d
new file mode 100644
index 0000000..b408cd5
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt2.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt2.cpp
new file mode 100644
index 0000000..f418142
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt2.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt2.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt2.cpp.d
new file mode 100644
index 0000000..922747c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt2.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt2.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExtLike.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExtLike.cpp
new file mode 100644
index 0000000..e6e17a1
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExtLike.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d
new file mode 100644
index 0000000..86841d0
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExtLike.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/DeeplyNested.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/DeeplyNested.cpp
new file mode 100644
index 0000000..53b4c2a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/DeeplyNested.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d
new file mode 100644
index 0000000..60c4829
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/DeeplyNested.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/INestedService.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/INestedService.cpp
new file mode 100644
index 0000000..ad9a55d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/INestedService.cpp
@@ -0,0 +1,105 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#include <iostream>
+#include <binder/Parcel.h>
+#include <android/binder_to_string.h>
+#include <android/aidl/tests/nested/INestedService.h>
+namespace {
+android::status_t analyzeINestedService(uint32_t _aidl_code, const android::Parcel& _aidl_data, const android::Parcel& _aidl_reply) {
+  android::status_t _aidl_ret_status;
+  switch(_aidl_code) {
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 0:
+    {
+      std::cout << "INestedService.flipStatus()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.nested.INestedService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::nested::ParcelableWithNested in_p;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::aidl::tests::nested::INestedService::Result _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readParcelable(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelable(&in_p);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument p from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    p: " << ::android::internal::ToString(in_p) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 1:
+    {
+      std::cout << "INestedService.flipStatusWithCallback()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.nested.INestedService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::nested::ParcelableWithNested::Status in_status;
+      ::android::sp<::android::aidl::tests::nested::INestedService::ICallback> in_cb;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_status));
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument status from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readStrongBinder(&in_cb);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument cb from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    status: " << ::android::internal::ToString(in_status) << std::endl;
+      std::cout << "    cb: " << ::android::internal::ToString(in_cb) << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    default:
+    {
+      std::cout << "  Transaction code " << _aidl_code << " not known." << std::endl;
+    _aidl_ret_status = android::UNKNOWN_TRANSACTION;
+    }
+  }
+  return _aidl_ret_status;
+  // To prevent unused variable warnings
+  (void)_aidl_ret_status; (void)_aidl_data; (void)_aidl_reply;
+}
+
+} // namespace
+
+#include <Analyzer.h>
+using android::aidl::Analyzer;
+__attribute__((constructor)) static void addAnalyzer() {
+  Analyzer::installAnalyzer(std::make_unique<Analyzer>("android.aidl.tests.nested.INestedService", "INestedService", &analyzeINestedService));
+}
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/INestedService.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/INestedService.cpp.d
new file mode 100644
index 0000000..117662c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/INestedService.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/INestedService.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp
new file mode 100644
index 0000000..dcaf75e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d
new file mode 100644
index 0000000..6e2e015
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/EnumUnion.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/EnumUnion.cpp
new file mode 100644
index 0000000..0b8d592
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/EnumUnion.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d
new file mode 100644
index 0000000..dcebde5
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/EnumUnion.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/UnionInUnion.cpp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/UnionInUnion.cpp
new file mode 100644
index 0000000..6e30c4f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/UnionInUnion.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d
new file mode 100644
index 0000000..dd9c00e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d
@@ -0,0 +1,5 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/UnionInUnion.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/timestamp b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-analyzer-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp
new file mode 100644
index 0000000..164cecc
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp
@@ -0,0 +1,459 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ArrayOfInterfaces::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ArrayOfInterfaces::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ArrayOfInterfaces, EmptyInterface, "android.aidl.tests.ArrayOfInterfaces.IEmptyInterface")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ArrayOfInterfaces::BpEmptyInterface::BpEmptyInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IEmptyInterface>(_aidl_impl){
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ArrayOfInterfaces::BnEmptyInterface::BnEmptyInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ArrayOfInterfaces::BnEmptyInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ArrayOfInterfaces, MyInterface, "android.aidl.tests.ArrayOfInterfaces.IMyInterface")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ArrayOfInterfaces::BpMyInterface::BpMyInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IMyInterface>(_aidl_impl){
+}
+
+::android::binder::Status ArrayOfInterfaces::BpMyInterface::methodWithInterfaces(const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& iface_array_in, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_out, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& nullable_iface_array_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyInterface::methodWithInterfaces::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(nullable_iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(iface_array_in);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*iface_array_out);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(*iface_array_inout);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(nullable_iface_array_in);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*nullable_iface_array_out);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(*nullable_iface_array_inout);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ArrayOfInterfaces::BnMyInterface::TRANSACTION_methodWithInterfaces, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyInterface::getDefaultImpl())) {
+     return IMyInterface::getDefaultImpl()->methodWithInterfaces(iface, nullable_iface, iface_array_in, iface_array_out, iface_array_inout, nullable_iface_array_in, nullable_iface_array_out, nullable_iface_array_inout, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(iface_array_out);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(iface_array_inout);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(nullable_iface_array_out);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(nullable_iface_array_inout);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ArrayOfInterfaces::BnMyInterface::BnMyInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ArrayOfInterfaces::BnMyInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnMyInterface::TRANSACTION_methodWithInterfaces:
+  {
+    ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> in_iface;
+    ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> in_nullable_iface;
+    ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> in_iface_array_in;
+    ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> out_iface_array_out;
+    ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> in_iface_array_inout;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> in_nullable_iface_array_in;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> out_nullable_iface_array_out;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> in_nullable_iface_array_inout;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyInterface::methodWithInterfaces::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinder(&in_iface);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readNullableStrongBinder(&in_nullable_iface);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_iface_array_in);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_iface_array_out);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_iface_array_inout);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_nullable_iface_array_in);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_nullable_iface_array_out);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_nullable_iface_array_inout);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(methodWithInterfaces(in_iface, in_nullable_iface, in_iface_array_in, &out_iface_array_out, &in_iface_array_inout, in_nullable_iface_array_in, &out_nullable_iface_array_out, &in_nullable_iface_array_inout, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(out_iface_array_out);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(in_iface_array_inout);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(out_nullable_iface_array_out);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(in_nullable_iface_array_inout);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ArrayOfInterfaces::MyParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinder(&iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readNullableStrongBinder(&nullable_iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinderVector(&iface_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinderVector(&nullable_iface_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ArrayOfInterfaces::MyParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeStrongBinder(iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinder(nullable_iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinderVector(iface_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinderVector(nullable_iface_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ArrayOfInterfaces::MyUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case iface: {
+    ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readStrongBinder(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>) {
+      set<iface>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<iface>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case nullable_iface: {
+    ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readNullableStrongBinder(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>) {
+      set<nullable_iface>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<nullable_iface>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case iface_array: {
+    ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readStrongBinderVector(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>) {
+      set<iface_array>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<iface_array>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case nullable_iface_array: {
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readStrongBinderVector(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>>) {
+      set<nullable_iface_array>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<nullable_iface_array>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t ArrayOfInterfaces::MyUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case iface: return _aidl_parcel->writeStrongBinder(get<iface>());
+  case nullable_iface: return _aidl_parcel->writeStrongBinder(get<nullable_iface>());
+  case iface_array: return _aidl_parcel->writeStrongBinderVector(get<iface_array>());
+  case nullable_iface_array: return _aidl_parcel->writeStrongBinderVector(get<nullable_iface_array>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d
new file mode 100644
index 0000000..7aaca7f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/BackendType.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/BackendType.cpp
new file mode 100644
index 0000000..f0abfd9
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/BackendType.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/BackendType.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/BackendType.cpp.d
new file mode 100644
index 0000000..776a1ea
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/BackendType.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/BackendType.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ByteEnum.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ByteEnum.cpp
new file mode 100644
index 0000000..258e734
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ByteEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ByteEnum.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ByteEnum.cpp.d
new file mode 100644
index 0000000..6ed9138
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ByteEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/ByteEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/CircularParcelable.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/CircularParcelable.cpp
new file mode 100644
index 0000000..0b9483f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/CircularParcelable.cpp
@@ -0,0 +1,48 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#include <android/aidl/tests/CircularParcelable.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t CircularParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readNullableStrongBinder(&testService);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t CircularParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeStrongBinder(testService);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/CircularParcelable.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/CircularParcelable.cpp.d
new file mode 100644
index 0000000..1606b92
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/CircularParcelable.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/CircularParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp
new file mode 100644
index 0000000..5f7b4d9
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d
new file mode 100644
index 0000000..c8de960
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp
new file mode 100644
index 0000000..f3365ca
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d
new file mode 100644
index 0000000..6f9c39b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp
new file mode 100644
index 0000000..0d9362b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp
@@ -0,0 +1,36 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#include <android/aidl/tests/DeprecatedParcelable.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t DeprecatedParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t DeprecatedParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d
new file mode 100644
index 0000000..f11d82f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/FixedSize.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/FixedSize.cpp
new file mode 100644
index 0000000..40daab7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/FixedSize.cpp
@@ -0,0 +1,287 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#include <android/aidl/tests/FixedSize.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t FixedSize::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t FixedSize::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/FixedSize.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t FixedSize::FixedParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readBool(&booleanValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(&byteValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readChar(&charValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&intValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64(&longValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFloat(&floatValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readDouble(&doubleValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64(reinterpret_cast<int64_t *>(&enumValue));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&parcelableValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t FixedSize::FixedParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeBool(booleanValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeByte(byteValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeChar(charValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(intValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64(longValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFloat(floatValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeDouble(doubleValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64(static_cast<int64_t>(enumValue));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(parcelableValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/FixedSize.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t FixedSize::FixedUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case booleanValue: {
+    bool _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readBool(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<bool>) {
+      set<booleanValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<booleanValue>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case byteValue: {
+    int8_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readByte(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int8_t>) {
+      set<byteValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<byteValue>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case charValue: {
+    char16_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readChar(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<char16_t>) {
+      set<charValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<charValue>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case intValue: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<intValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intValue>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case longValue: {
+    int64_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt64(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int64_t>) {
+      set<longValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<longValue>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case floatValue: {
+    float _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readFloat(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<float>) {
+      set<floatValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<floatValue>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case doubleValue: {
+    double _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readDouble(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<double>) {
+      set<doubleValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<doubleValue>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case enumValue: {
+    ::android::aidl::tests::LongEnum _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt64(reinterpret_cast<int64_t *>(&_aidl_value))) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::aidl::tests::LongEnum>) {
+      set<enumValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<enumValue>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t FixedSize::FixedUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case booleanValue: return _aidl_parcel->writeBool(get<booleanValue>());
+  case byteValue: return _aidl_parcel->writeByte(get<byteValue>());
+  case charValue: return _aidl_parcel->writeChar(get<charValue>());
+  case intValue: return _aidl_parcel->writeInt32(get<intValue>());
+  case longValue: return _aidl_parcel->writeInt64(get<longValue>());
+  case floatValue: return _aidl_parcel->writeFloat(get<floatValue>());
+  case doubleValue: return _aidl_parcel->writeDouble(get<doubleValue>());
+  case enumValue: return _aidl_parcel->writeInt64(static_cast<int64_t>(get<enumValue>()));
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/FixedSize.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/FixedSize.cpp.d
new file mode 100644
index 0000000..b564041
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/FixedSize.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/FixedSize.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp
new file mode 100644
index 0000000..1861c85
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d
new file mode 100644
index 0000000..37ac9e0
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ICircular.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ICircular.cpp
new file mode 100644
index 0000000..ca78521
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ICircular.cpp
@@ -0,0 +1,116 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#include <android/aidl/tests/ICircular.h>
+#include <android/aidl/tests/BpCircular.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(Circular, "android.aidl.tests.ICircular")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BpCircular.h>
+#include <android/aidl/tests/BnCircular.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BpCircular::BpCircular(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<ICircular>(_aidl_impl){
+}
+
+::android::binder::Status BpCircular::GetTestService(::android::sp<::android::aidl::tests::ITestService>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ICircular::GetTestService::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnCircular::TRANSACTION_GetTestService, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ICircular::getDefaultImpl())) {
+     return ICircular::getDefaultImpl()->GetTestService(_aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readNullableStrongBinder(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BnCircular.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BnCircular::BnCircular()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnCircular::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnCircular::TRANSACTION_GetTestService:
+  {
+    ::android::sp<::android::aidl::tests::ITestService> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ICircular::GetTestService::cppServer");
+    ::android::binder::Status _aidl_status(GetTestService(&_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinder(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ICircular.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ICircular.cpp.d
new file mode 100644
index 0000000..eb56011
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ICircular.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/ICircular.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp
new file mode 100644
index 0000000..3e1e24f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp
@@ -0,0 +1,65 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#include <android/aidl/tests/IDeprecated.h>
+#include <android/aidl/tests/BpDeprecated.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(Deprecated, "android.aidl.tests.IDeprecated")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BpDeprecated.h>
+#include <android/aidl/tests/BnDeprecated.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BpDeprecated::BpDeprecated(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IDeprecated>(_aidl_impl){
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BnDeprecated.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BnDeprecated::BnDeprecated()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated"
+
+::android::status_t BnDeprecated::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+#pragma clang diagnostic pop
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp.d
new file mode 100644
index 0000000..ef80a77
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/INamedCallback.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/INamedCallback.cpp
new file mode 100644
index 0000000..be22cab
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/INamedCallback.cpp
@@ -0,0 +1,116 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#include <android/aidl/tests/INamedCallback.h>
+#include <android/aidl/tests/BpNamedCallback.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(NamedCallback, "android.aidl.tests.INamedCallback")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BpNamedCallback.h>
+#include <android/aidl/tests/BnNamedCallback.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BpNamedCallback::BpNamedCallback(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<INamedCallback>(_aidl_impl){
+}
+
+::android::binder::Status BpNamedCallback::GetName(::android::String16* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::INamedCallback::GetName::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnNamedCallback::TRANSACTION_GetName, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && INamedCallback::getDefaultImpl())) {
+     return INamedCallback::getDefaultImpl()->GetName(_aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BnNamedCallback.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BnNamedCallback::BnNamedCallback()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnNamedCallback::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnNamedCallback::TRANSACTION_GetName:
+  {
+    ::android::String16 _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::INamedCallback::GetName::cppServer");
+    ::android::binder::Status _aidl_status(GetName(&_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/INamedCallback.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/INamedCallback.cpp.d
new file mode 100644
index 0000000..9a61844
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/INamedCallback.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/INamedCallback.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/INewName.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/INewName.cpp
new file mode 100644
index 0000000..60456fe
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/INewName.cpp
@@ -0,0 +1,116 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#include <android/aidl/tests/INewName.h>
+#include <android/aidl/tests/BpNewName.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(NewName, "android.aidl.tests.IOldName")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BpNewName.h>
+#include <android/aidl/tests/BnNewName.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BpNewName::BpNewName(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<INewName>(_aidl_impl){
+}
+
+::android::binder::Status BpNewName::RealName(::android::String16* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::INewName::RealName::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnNewName::TRANSACTION_RealName, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && INewName::getDefaultImpl())) {
+     return INewName::getDefaultImpl()->RealName(_aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BnNewName.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BnNewName::BnNewName()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnNewName::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnNewName::TRANSACTION_RealName:
+  {
+    ::android::String16 _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::INewName::RealName::cppServer");
+    ::android::binder::Status _aidl_status(RealName(&_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/INewName.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/INewName.cpp.d
new file mode 100644
index 0000000..b0f129f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/INewName.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/INewName.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IOldName.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IOldName.cpp
new file mode 100644
index 0000000..0bc6c1f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IOldName.cpp
@@ -0,0 +1,116 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#include <android/aidl/tests/IOldName.h>
+#include <android/aidl/tests/BpOldName.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(OldName, "android.aidl.tests.IOldName")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BpOldName.h>
+#include <android/aidl/tests/BnOldName.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BpOldName::BpOldName(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IOldName>(_aidl_impl){
+}
+
+::android::binder::Status BpOldName::RealName(::android::String16* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IOldName::RealName::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnOldName::TRANSACTION_RealName, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IOldName::getDefaultImpl())) {
+     return IOldName::getDefaultImpl()->RealName(_aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BnOldName.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BnOldName::BnOldName()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnOldName::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnOldName::TRANSACTION_RealName:
+  {
+    ::android::String16 _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IOldName::RealName::cppServer");
+    ::android::binder::Status _aidl_status(RealName(&_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IOldName.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IOldName.cpp.d
new file mode 100644
index 0000000..ed3c327
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IOldName.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/IOldName.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp
new file mode 100644
index 0000000..38f28b8
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp
@@ -0,0 +1,5682 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/BpTestService.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(TestService, "android.aidl.tests.ITestService")
+const ::android::String16& ITestService::STRING_CONSTANT() {
+  static const ::android::String16 value(::android::String16("foo"));
+  return value;
+}
+const ::android::String16& ITestService::STRING_CONSTANT2() {
+  static const ::android::String16 value(::android::String16("bar"));
+  return value;
+}
+const ::std::string& ITestService::STRING_CONSTANT_UTF8() {
+  static const ::std::string value("baz");
+  return value;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BpTestService.h>
+#include <android/aidl/tests/BnTestService.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BpTestService::BpTestService(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<ITestService>(_aidl_impl){
+}
+
+::android::binder::Status BpTestService::UnimplementedMethod(int32_t arg, int32_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::UnimplementedMethod::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(arg);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_UnimplementedMethod, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->UnimplementedMethod(arg, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::Deprecated() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::Deprecated::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_Deprecated, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->Deprecated();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::TestOneway() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TestOneway::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_TestOneway, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_ONEWAY | ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->TestOneway();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatBoolean(bool token, bool* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatBoolean::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeBool(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatBoolean, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatBoolean(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readBool(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatByte(int8_t token, int8_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatByte::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatByte, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatByte(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readByte(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatChar(char16_t token, char16_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatChar::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeChar(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatChar, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatChar(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readChar(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatInt(int32_t token, int32_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatInt::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatInt, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatInt(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatLong(int64_t token, int64_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatLong::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt64(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatLong, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatLong(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt64(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatFloat(float token, float* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatFloat::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFloat(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatFloat, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatFloat(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFloat(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatDouble(double token, double* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatDouble::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeDouble(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatDouble, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatDouble(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readDouble(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatString(const ::android::String16& token, ::android::String16* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatString, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatString(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatByteEnum(::android::aidl::tests::ByteEnum token, ::android::aidl::tests::ByteEnum* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatByteEnum::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(static_cast<int8_t>(token));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatByteEnum, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatByteEnum(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readByte(reinterpret_cast<int8_t *>(_aidl_return));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatIntEnum(::android::aidl::tests::IntEnum token, ::android::aidl::tests::IntEnum* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatIntEnum::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(static_cast<int32_t>(token));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatIntEnum, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatIntEnum(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(reinterpret_cast<int32_t *>(_aidl_return));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatLongEnum(::android::aidl::tests::LongEnum token, ::android::aidl::tests::LongEnum* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatLongEnum::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt64(static_cast<int64_t>(token));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatLongEnum, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatLongEnum(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt64(reinterpret_cast<int64_t *>(_aidl_return));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseBoolean(const ::std::vector<bool>& input, ::std::vector<bool>* repeated, ::std::vector<bool>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseBoolean::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeBoolVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseBoolean, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseBoolean(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readBoolVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readBoolVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseByte(const ::std::vector<uint8_t>& input, ::std::vector<uint8_t>* repeated, ::std::vector<uint8_t>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseByte::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByteVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseByte, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseByte(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readByteVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readByteVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseChar(const ::std::vector<char16_t>& input, ::std::vector<char16_t>* repeated, ::std::vector<char16_t>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseChar::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeCharVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseChar, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseChar(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readCharVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readCharVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseInt(const ::std::vector<int32_t>& input, ::std::vector<int32_t>* repeated, ::std::vector<int32_t>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseInt::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseInt, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseInt(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32Vector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseLong(const ::std::vector<int64_t>& input, ::std::vector<int64_t>* repeated, ::std::vector<int64_t>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseLong::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt64Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseLong, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseLong(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt64Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readInt64Vector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseFloat(const ::std::vector<float>& input, ::std::vector<float>* repeated, ::std::vector<float>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseFloat::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFloatVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseFloat, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseFloat(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFloatVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFloatVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseDouble(const ::std::vector<double>& input, ::std::vector<double>* repeated, ::std::vector<double>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseDouble::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeDoubleVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseDouble, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseDouble(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readDoubleVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readDoubleVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseString(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* repeated, ::std::vector<::android::String16>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseString, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseString(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readString16Vector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseByteEnum(const ::std::vector<::android::aidl::tests::ByteEnum>& input, ::std::vector<::android::aidl::tests::ByteEnum>* repeated, ::std::vector<::android::aidl::tests::ByteEnum>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseByteEnum::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeEnumVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseByteEnum, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseByteEnum(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseIntEnum(const ::std::vector<::android::aidl::tests::IntEnum>& input, ::std::vector<::android::aidl::tests::IntEnum>* repeated, ::std::vector<::android::aidl::tests::IntEnum>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseIntEnum::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeEnumVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseIntEnum, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseIntEnum(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseLongEnum(const ::std::vector<::android::aidl::tests::LongEnum>& input, ::std::vector<::android::aidl::tests::LongEnum>* repeated, ::std::vector<::android::aidl::tests::LongEnum>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseLongEnum::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeEnumVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseLongEnum, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseLongEnum(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetOtherTestService(const ::android::String16& name, ::android::sp<::android::aidl::tests::INamedCallback>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetOtherTestService::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16(name);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetOtherTestService, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetOtherTestService(name, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinder(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::SetOtherTestService(const ::android::String16& name, const ::android::sp<::android::aidl::tests::INamedCallback>& service, bool* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::SetOtherTestService::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16(name);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(service);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_SetOtherTestService, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->SetOtherTestService(name, service, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readBool(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::VerifyName(const ::android::sp<::android::aidl::tests::INamedCallback>& service, const ::android::String16& name, bool* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::VerifyName::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(service);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16(name);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_VerifyName, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->VerifyName(service, name, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readBool(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetInterfaceArray(const ::std::vector<::android::String16>& names, ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetInterfaceArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(names);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetInterfaceArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetInterfaceArray(names, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::VerifyNamesWithInterfaceArray(const ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>& services, const ::std::vector<::android::String16>& names, bool* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::VerifyNamesWithInterfaceArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(services);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(names);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_VerifyNamesWithInterfaceArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->VerifyNamesWithInterfaceArray(services, names, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readBool(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetNullableInterfaceArray(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetNullableInterfaceArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(names);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetNullableInterfaceArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetNullableInterfaceArray(names, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::VerifyNamesWithNullableInterfaceArray(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& services, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, bool* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::VerifyNamesWithNullableInterfaceArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(services);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(names);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_VerifyNamesWithNullableInterfaceArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->VerifyNamesWithNullableInterfaceArray(services, names, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readBool(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetInterfaceList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetInterfaceList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(names);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetInterfaceList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetInterfaceList(names, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::VerifyNamesWithInterfaceList(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& services, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, bool* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::VerifyNamesWithInterfaceList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(services);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(names);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_VerifyNamesWithInterfaceList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->VerifyNamesWithInterfaceList(services, names, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readBool(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseStringList(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* repeated, ::std::vector<::android::String16>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseStringList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseStringList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseStringList(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readString16Vector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatParcelFileDescriptor(const ::android::os::ParcelFileDescriptor& read, ::android::os::ParcelFileDescriptor* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatParcelFileDescriptor::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(read);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatParcelFileDescriptor, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatParcelFileDescriptor(read, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseParcelFileDescriptorArray(const ::std::vector<::android::os::ParcelFileDescriptor>& input, ::std::vector<::android::os::ParcelFileDescriptor>* repeated, ::std::vector<::android::os::ParcelFileDescriptor>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseParcelFileDescriptorArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelableVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseParcelFileDescriptorArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseParcelFileDescriptorArray(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelableVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelableVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ThrowServiceException(int32_t code) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ThrowServiceException::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(code);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ThrowServiceException, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ThrowServiceException(code);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableIntArray(const ::std::optional<::std::vector<int32_t>>& input, ::std::optional<::std::vector<int32_t>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableIntArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableIntArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableIntArray(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableByteEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableByteEnumArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeEnumVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableByteEnumArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableByteEnumArray(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableIntEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableIntEnumArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeEnumVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableIntEnumArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableIntEnumArray(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableLongEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableLongEnumArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeEnumVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableLongEnumArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableLongEnumArray(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableString(const ::std::optional<::android::String16>& input, ::std::optional<::android::String16>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableString, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableString(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableStringList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& input, ::std::optional<::std::vector<::std::optional<::android::String16>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableStringList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableStringList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableStringList(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableParcelable(const ::std::optional<::android::aidl::tests::ITestService::Empty>& input, ::std::optional<::android::aidl::tests::ITestService::Empty>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableParcelable::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeNullableParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableParcelable, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableParcelable(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableParcelableArray(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& input, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableParcelableArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelableVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableParcelableArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableParcelableArray(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelableVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableParcelableList(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& input, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableParcelableList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelableVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableParcelableList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableParcelableList(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelableVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::TakesAnIBinder(const ::android::sp<::android::IBinder>& input) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TakesAnIBinder::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_TakesAnIBinder, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->TakesAnIBinder(input);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::TakesANullableIBinder(const ::android::sp<::android::IBinder>& input) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TakesANullableIBinder::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_TakesANullableIBinder, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->TakesANullableIBinder(input);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::TakesAnIBinderList(const ::std::vector<::android::sp<::android::IBinder>>& input) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TakesAnIBinderList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_TakesAnIBinderList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->TakesAnIBinderList(input);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::TakesANullableIBinderList(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& input) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TakesANullableIBinderList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_TakesANullableIBinderList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->TakesANullableIBinderList(input);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatUtf8CppString(const ::std::string& token, ::std::string* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatUtf8CppString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeUtf8AsUtf16(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatUtf8CppString, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatUtf8CppString(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8FromUtf16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableUtf8CppString(const ::std::optional<::std::string>& token, ::std::optional<::std::string>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableUtf8CppString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeUtf8AsUtf16(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableUtf8CppString, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableUtf8CppString(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8FromUtf16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseUtf8CppString(const ::std::vector<::std::string>& input, ::std::vector<::std::string>* repeated, ::std::vector<::std::string>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseUtf8CppString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeUtf8VectorAsUtf16Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseUtf8CppString, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseUtf8CppString(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseNullableUtf8CppString(const ::std::optional<::std::vector<::std::optional<::std::string>>>& input, ::std::optional<::std::vector<::std::optional<::std::string>>>* repeated, ::std::optional<::std::vector<::std::optional<::std::string>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseNullableUtf8CppString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeUtf8VectorAsUtf16Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseNullableUtf8CppString, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseNullableUtf8CppString(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseUtf8CppStringList(const ::std::optional<::std::vector<::std::optional<::std::string>>>& input, ::std::optional<::std::vector<::std::optional<::std::string>>>* repeated, ::std::optional<::std::vector<::std::optional<::std::string>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseUtf8CppStringList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeUtf8VectorAsUtf16Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseUtf8CppStringList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseUtf8CppStringList(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetCallback(bool return_null, ::android::sp<::android::aidl::tests::INamedCallback>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetCallback::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeBool(return_null);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetCallback, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetCallback(return_null, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readNullableStrongBinder(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::FillOutStructuredParcelable(::android::aidl::tests::StructuredParcelable* parcel) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::FillOutStructuredParcelable::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(*parcel);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_FillOutStructuredParcelable, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->FillOutStructuredParcelable(parcel);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(parcel);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatExtendableParcelable(const ::android::aidl::tests::extension::ExtendableParcelable& ep, ::android::aidl::tests::extension::ExtendableParcelable* ep2) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatExtendableParcelable::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(ep);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatExtendableParcelable, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatExtendableParcelable(ep, ep2);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(ep2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseList(const ::android::aidl::tests::RecursiveList& list, ::android::aidl::tests::RecursiveList* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseList(list, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseIBinderArray(const ::std::vector<::android::sp<::android::IBinder>>& input, ::std::vector<::android::sp<::android::IBinder>>* repeated, ::std::vector<::android::sp<::android::IBinder>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseIBinderArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseIBinderArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseIBinderArray(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseNullableIBinderArray(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& input, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* repeated, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseNullableIBinderArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseNullableIBinderArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseNullableIBinderArray(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetOldNameInterface(::android::sp<::android::aidl::tests::IOldName>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetOldNameInterface::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetOldNameInterface, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetOldNameInterface(_aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinder(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetNewNameInterface(::android::sp<::android::aidl::tests::INewName>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetNewNameInterface::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetNewNameInterface, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetNewNameInterface(_aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinder(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetUnionTags(const ::std::vector<::android::aidl::tests::Union>& input, ::std::vector<::android::aidl::tests::Union::Tag>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetUnionTags::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelableVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetUnionTags, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetUnionTags(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetCppJavaTests(::android::sp<::android::IBinder>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetCppJavaTests::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetCppJavaTests, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetCppJavaTests(_aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readNullableStrongBinder(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::getBackendType(::android::aidl::tests::BackendType* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::getBackendType::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_getBackendType, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->getBackendType(_aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readByte(reinterpret_cast<int8_t *>(_aidl_return));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetCircular(::android::aidl::tests::CircularParcelable* cp, ::android::sp<::android::aidl::tests::ICircular>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetCircular::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetCircular, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetCircular(cp, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinder(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(cp);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BnTestService.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BnTestService::BnTestService()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated"
+
+::android::status_t BnTestService::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnTestService::TRANSACTION_UnimplementedMethod:
+  {
+    int32_t in_arg;
+    int32_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::UnimplementedMethod::cppServer");
+    _aidl_ret_status = _aidl_data.readInt32(&in_arg);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(UnimplementedMethod(in_arg, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_Deprecated:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::Deprecated::cppServer");
+    ::android::binder::Status _aidl_status(Deprecated());
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_TestOneway:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TestOneway::cppServer");
+    ::android::binder::Status _aidl_status(TestOneway());
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatBoolean:
+  {
+    bool in_token;
+    bool _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatBoolean::cppServer");
+    _aidl_ret_status = _aidl_data.readBool(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatBoolean(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBool(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatByte:
+  {
+    int8_t in_token;
+    int8_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatByte::cppServer");
+    _aidl_ret_status = _aidl_data.readByte(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatByte(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByte(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatChar:
+  {
+    char16_t in_token;
+    char16_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatChar::cppServer");
+    _aidl_ret_status = _aidl_data.readChar(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatChar(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeChar(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatInt:
+  {
+    int32_t in_token;
+    int32_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatInt::cppServer");
+    _aidl_ret_status = _aidl_data.readInt32(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatInt(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatLong:
+  {
+    int64_t in_token;
+    int64_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatLong::cppServer");
+    _aidl_ret_status = _aidl_data.readInt64(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatLong(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt64(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatFloat:
+  {
+    float in_token;
+    float _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatFloat::cppServer");
+    _aidl_ret_status = _aidl_data.readFloat(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatFloat(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFloat(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatDouble:
+  {
+    double in_token;
+    double _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatDouble::cppServer");
+    _aidl_ret_status = _aidl_data.readDouble(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatDouble(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeDouble(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatString:
+  {
+    ::android::String16 in_token;
+    ::android::String16 _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatString::cppServer");
+    _aidl_ret_status = _aidl_data.readString16(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatString(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatByteEnum:
+  {
+    ::android::aidl::tests::ByteEnum in_token;
+    ::android::aidl::tests::ByteEnum _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatByteEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_token));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatByteEnum(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByte(static_cast<int8_t>(_aidl_return));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatIntEnum:
+  {
+    ::android::aidl::tests::IntEnum in_token;
+    ::android::aidl::tests::IntEnum _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatIntEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readInt32(reinterpret_cast<int32_t *>(&in_token));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatIntEnum(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(static_cast<int32_t>(_aidl_return));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatLongEnum:
+  {
+    ::android::aidl::tests::LongEnum in_token;
+    ::android::aidl::tests::LongEnum _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatLongEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readInt64(reinterpret_cast<int64_t *>(&in_token));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatLongEnum(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt64(static_cast<int64_t>(_aidl_return));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseBoolean:
+  {
+    ::std::vector<bool> in_input;
+    ::std::vector<bool> out_repeated;
+    ::std::vector<bool> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseBoolean::cppServer");
+    _aidl_ret_status = _aidl_data.readBoolVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseBoolean(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBoolVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBoolVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseByte:
+  {
+    ::std::vector<uint8_t> in_input;
+    ::std::vector<uint8_t> out_repeated;
+    ::std::vector<uint8_t> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseByte::cppServer");
+    _aidl_ret_status = _aidl_data.readByteVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseByte(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByteVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByteVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseChar:
+  {
+    ::std::vector<char16_t> in_input;
+    ::std::vector<char16_t> out_repeated;
+    ::std::vector<char16_t> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseChar::cppServer");
+    _aidl_ret_status = _aidl_data.readCharVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseChar(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeCharVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeCharVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseInt:
+  {
+    ::std::vector<int32_t> in_input;
+    ::std::vector<int32_t> out_repeated;
+    ::std::vector<int32_t> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseInt::cppServer");
+    _aidl_ret_status = _aidl_data.readInt32Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseInt(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32Vector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseLong:
+  {
+    ::std::vector<int64_t> in_input;
+    ::std::vector<int64_t> out_repeated;
+    ::std::vector<int64_t> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseLong::cppServer");
+    _aidl_ret_status = _aidl_data.readInt64Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseLong(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt64Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt64Vector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseFloat:
+  {
+    ::std::vector<float> in_input;
+    ::std::vector<float> out_repeated;
+    ::std::vector<float> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseFloat::cppServer");
+    _aidl_ret_status = _aidl_data.readFloatVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseFloat(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFloatVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFloatVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseDouble:
+  {
+    ::std::vector<double> in_input;
+    ::std::vector<double> out_repeated;
+    ::std::vector<double> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseDouble::cppServer");
+    _aidl_ret_status = _aidl_data.readDoubleVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseDouble(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeDoubleVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeDoubleVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseString:
+  {
+    ::std::vector<::android::String16> in_input;
+    ::std::vector<::android::String16> out_repeated;
+    ::std::vector<::android::String16> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseString::cppServer");
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseString(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16Vector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseByteEnum:
+  {
+    ::std::vector<::android::aidl::tests::ByteEnum> in_input;
+    ::std::vector<::android::aidl::tests::ByteEnum> out_repeated;
+    ::std::vector<::android::aidl::tests::ByteEnum> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseByteEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseByteEnum(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseIntEnum:
+  {
+    ::std::vector<::android::aidl::tests::IntEnum> in_input;
+    ::std::vector<::android::aidl::tests::IntEnum> out_repeated;
+    ::std::vector<::android::aidl::tests::IntEnum> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseIntEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseIntEnum(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseLongEnum:
+  {
+    ::std::vector<::android::aidl::tests::LongEnum> in_input;
+    ::std::vector<::android::aidl::tests::LongEnum> out_repeated;
+    ::std::vector<::android::aidl::tests::LongEnum> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseLongEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseLongEnum(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetOtherTestService:
+  {
+    ::android::String16 in_name;
+    ::android::sp<::android::aidl::tests::INamedCallback> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetOtherTestService::cppServer");
+    _aidl_ret_status = _aidl_data.readString16(&in_name);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(GetOtherTestService(in_name, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinder(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_SetOtherTestService:
+  {
+    ::android::String16 in_name;
+    ::android::sp<::android::aidl::tests::INamedCallback> in_service;
+    bool _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::SetOtherTestService::cppServer");
+    _aidl_ret_status = _aidl_data.readString16(&in_name);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinder(&in_service);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(SetOtherTestService(in_name, in_service, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBool(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_VerifyName:
+  {
+    ::android::sp<::android::aidl::tests::INamedCallback> in_service;
+    ::android::String16 in_name;
+    bool _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::VerifyName::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinder(&in_service);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readString16(&in_name);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(VerifyName(in_service, in_name, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBool(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetInterfaceArray:
+  {
+    ::std::vector<::android::String16> in_names;
+    ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetInterfaceArray::cppServer");
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(GetInterfaceArray(in_names, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_VerifyNamesWithInterfaceArray:
+  {
+    ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>> in_services;
+    ::std::vector<::android::String16> in_names;
+    bool _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::VerifyNamesWithInterfaceArray::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_services);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(VerifyNamesWithInterfaceArray(in_services, in_names, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBool(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetNullableInterfaceArray:
+  {
+    ::std::optional<::std::vector<::std::optional<::android::String16>>> in_names;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetNullableInterfaceArray::cppServer");
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(GetNullableInterfaceArray(in_names, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_VerifyNamesWithNullableInterfaceArray:
+  {
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>> in_services;
+    ::std::optional<::std::vector<::std::optional<::android::String16>>> in_names;
+    bool _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::VerifyNamesWithNullableInterfaceArray::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_services);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(VerifyNamesWithNullableInterfaceArray(in_services, in_names, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBool(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetInterfaceList:
+  {
+    ::std::optional<::std::vector<::std::optional<::android::String16>>> in_names;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetInterfaceList::cppServer");
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(GetInterfaceList(in_names, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_VerifyNamesWithInterfaceList:
+  {
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>> in_services;
+    ::std::optional<::std::vector<::std::optional<::android::String16>>> in_names;
+    bool _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::VerifyNamesWithInterfaceList::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_services);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(VerifyNamesWithInterfaceList(in_services, in_names, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBool(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseStringList:
+  {
+    ::std::vector<::android::String16> in_input;
+    ::std::vector<::android::String16> out_repeated;
+    ::std::vector<::android::String16> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseStringList::cppServer");
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseStringList(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16Vector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatParcelFileDescriptor:
+  {
+    ::android::os::ParcelFileDescriptor in_read;
+    ::android::os::ParcelFileDescriptor _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatParcelFileDescriptor::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_read);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatParcelFileDescriptor(in_read, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseParcelFileDescriptorArray:
+  {
+    ::std::vector<::android::os::ParcelFileDescriptor> in_input;
+    ::std::vector<::android::os::ParcelFileDescriptor> out_repeated;
+    ::std::vector<::android::os::ParcelFileDescriptor> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseParcelFileDescriptorArray::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelableVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseParcelFileDescriptorArray(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelableVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelableVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ThrowServiceException:
+  {
+    int32_t in_code;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ThrowServiceException::cppServer");
+    _aidl_ret_status = _aidl_data.readInt32(&in_code);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ThrowServiceException(in_code));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableIntArray:
+  {
+    ::std::optional<::std::vector<int32_t>> in_input;
+    ::std::optional<::std::vector<int32_t>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableIntArray::cppServer");
+    _aidl_ret_status = _aidl_data.readInt32Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableIntArray(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableByteEnumArray:
+  {
+    ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>> in_input;
+    ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableByteEnumArray::cppServer");
+    _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableByteEnumArray(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableIntEnumArray:
+  {
+    ::std::optional<::std::vector<::android::aidl::tests::IntEnum>> in_input;
+    ::std::optional<::std::vector<::android::aidl::tests::IntEnum>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableIntEnumArray::cppServer");
+    _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableIntEnumArray(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableLongEnumArray:
+  {
+    ::std::optional<::std::vector<::android::aidl::tests::LongEnum>> in_input;
+    ::std::optional<::std::vector<::android::aidl::tests::LongEnum>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableLongEnumArray::cppServer");
+    _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableLongEnumArray(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableString:
+  {
+    ::std::optional<::android::String16> in_input;
+    ::std::optional<::android::String16> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableString::cppServer");
+    _aidl_ret_status = _aidl_data.readString16(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableString(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableStringList:
+  {
+    ::std::optional<::std::vector<::std::optional<::android::String16>>> in_input;
+    ::std::optional<::std::vector<::std::optional<::android::String16>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableStringList::cppServer");
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableStringList(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableParcelable:
+  {
+    ::std::optional<::android::aidl::tests::ITestService::Empty> in_input;
+    ::std::optional<::android::aidl::tests::ITestService::Empty> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableParcelable(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeNullableParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableParcelableArray:
+  {
+    ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> in_input;
+    ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableParcelableArray::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelableVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableParcelableArray(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelableVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableParcelableList:
+  {
+    ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> in_input;
+    ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableParcelableList::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelableVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableParcelableList(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelableVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_TakesAnIBinder:
+  {
+    ::android::sp<::android::IBinder> in_input;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TakesAnIBinder::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinder(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(TakesAnIBinder(in_input));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_TakesANullableIBinder:
+  {
+    ::android::sp<::android::IBinder> in_input;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TakesANullableIBinder::cppServer");
+    _aidl_ret_status = _aidl_data.readNullableStrongBinder(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(TakesANullableIBinder(in_input));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_TakesAnIBinderList:
+  {
+    ::std::vector<::android::sp<::android::IBinder>> in_input;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TakesAnIBinderList::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(TakesAnIBinderList(in_input));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_TakesANullableIBinderList:
+  {
+    ::std::optional<::std::vector<::android::sp<::android::IBinder>>> in_input;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TakesANullableIBinderList::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(TakesANullableIBinderList(in_input));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatUtf8CppString:
+  {
+    ::std::string in_token;
+    ::std::string _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatUtf8CppString::cppServer");
+    _aidl_ret_status = _aidl_data.readUtf8FromUtf16(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatUtf8CppString(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8AsUtf16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableUtf8CppString:
+  {
+    ::std::optional<::std::string> in_token;
+    ::std::optional<::std::string> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableUtf8CppString::cppServer");
+    _aidl_ret_status = _aidl_data.readUtf8FromUtf16(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableUtf8CppString(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8AsUtf16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseUtf8CppString:
+  {
+    ::std::vector<::std::string> in_input;
+    ::std::vector<::std::string> out_repeated;
+    ::std::vector<::std::string> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseUtf8CppString::cppServer");
+    _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseUtf8CppString(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8VectorAsUtf16Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8VectorAsUtf16Vector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseNullableUtf8CppString:
+  {
+    ::std::optional<::std::vector<::std::optional<::std::string>>> in_input;
+    ::std::optional<::std::vector<::std::optional<::std::string>>> out_repeated;
+    ::std::optional<::std::vector<::std::optional<::std::string>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseNullableUtf8CppString::cppServer");
+    _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseNullableUtf8CppString(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8VectorAsUtf16Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8VectorAsUtf16Vector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseUtf8CppStringList:
+  {
+    ::std::optional<::std::vector<::std::optional<::std::string>>> in_input;
+    ::std::optional<::std::vector<::std::optional<::std::string>>> out_repeated;
+    ::std::optional<::std::vector<::std::optional<::std::string>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseUtf8CppStringList::cppServer");
+    _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseUtf8CppStringList(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8VectorAsUtf16Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8VectorAsUtf16Vector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetCallback:
+  {
+    bool in_return_null;
+    ::android::sp<::android::aidl::tests::INamedCallback> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetCallback::cppServer");
+    _aidl_ret_status = _aidl_data.readBool(&in_return_null);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(GetCallback(in_return_null, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinder(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_FillOutStructuredParcelable:
+  {
+    ::android::aidl::tests::StructuredParcelable in_parcel;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::FillOutStructuredParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_parcel);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(FillOutStructuredParcelable(&in_parcel));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(in_parcel);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatExtendableParcelable:
+  {
+    ::android::aidl::tests::extension::ExtendableParcelable in_ep;
+    ::android::aidl::tests::extension::ExtendableParcelable out_ep2;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatExtendableParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_ep);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatExtendableParcelable(in_ep, &out_ep2));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(out_ep2);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseList:
+  {
+    ::android::aidl::tests::RecursiveList in_list;
+    ::android::aidl::tests::RecursiveList _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseList::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_list);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseList(in_list, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseIBinderArray:
+  {
+    ::std::vector<::android::sp<::android::IBinder>> in_input;
+    ::std::vector<::android::sp<::android::IBinder>> out_repeated;
+    ::std::vector<::android::sp<::android::IBinder>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseIBinderArray::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseIBinderArray(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseNullableIBinderArray:
+  {
+    ::std::optional<::std::vector<::android::sp<::android::IBinder>>> in_input;
+    ::std::optional<::std::vector<::android::sp<::android::IBinder>>> out_repeated;
+    ::std::optional<::std::vector<::android::sp<::android::IBinder>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseNullableIBinderArray::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseNullableIBinderArray(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetOldNameInterface:
+  {
+    ::android::sp<::android::aidl::tests::IOldName> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetOldNameInterface::cppServer");
+    ::android::binder::Status _aidl_status(GetOldNameInterface(&_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinder(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetNewNameInterface:
+  {
+    ::android::sp<::android::aidl::tests::INewName> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetNewNameInterface::cppServer");
+    ::android::binder::Status _aidl_status(GetNewNameInterface(&_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinder(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetUnionTags:
+  {
+    ::std::vector<::android::aidl::tests::Union> in_input;
+    ::std::vector<::android::aidl::tests::Union::Tag> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetUnionTags::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelableVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(GetUnionTags(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetCppJavaTests:
+  {
+    ::android::sp<::android::IBinder> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetCppJavaTests::cppServer");
+    ::android::binder::Status _aidl_status(GetCppJavaTests(&_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinder(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_getBackendType:
+  {
+    ::android::aidl::tests::BackendType _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::getBackendType::cppServer");
+    ::android::binder::Status _aidl_status(getBackendType(&_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByte(static_cast<int8_t>(_aidl_return));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetCircular:
+  {
+    ::android::aidl::tests::CircularParcelable out_cp;
+    ::android::sp<::android::aidl::tests::ICircular> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetCircular::cppServer");
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(GetCircular(&out_cp, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinder(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(out_cp);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+#pragma clang diagnostic pop
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ITestService::Empty::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ITestService::Empty::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ITestService::CompilerChecks::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinder(&binder);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readNullableStrongBinder(&nullable_binder);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinderVector(&binder_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinderVector(&nullable_binder_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinderVector(&binder_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinderVector(&nullable_binder_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&pfd);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&nullable_pfd);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&pfd_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&nullable_pfd_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&pfd_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&nullable_pfd_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&parcel);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&nullable_parcel);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&parcel_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&nullable_parcel_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&parcel_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&nullable_parcel_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ITestService::CompilerChecks::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeStrongBinder(binder);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinder(nullable_binder);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinderVector(binder_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinderVector(nullable_binder_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinderVector(binder_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinderVector(nullable_binder_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(pfd);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeNullableParcelable(nullable_pfd);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(pfd_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(nullable_pfd_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(pfd_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(nullable_pfd_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(parcel);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeNullableParcelable(nullable_parcel);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(parcel_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(nullable_parcel_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(parcel_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(nullable_parcel_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/ITestService.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ITestService::CompilerChecks, Foo, "android.aidl.tests.ITestService.CompilerChecks.Foo")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/ITestService.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ITestService::CompilerChecks::BpFoo::BpFoo(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IFoo>(_aidl_impl){
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ITestService::CompilerChecks::BnFoo::BnFoo()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ITestService::CompilerChecks::BnFoo::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+::android::status_t ITestService::CompilerChecks::HasDeprecated::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&deprecated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ITestService::CompilerChecks::HasDeprecated::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(deprecated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+#pragma clang diagnostic pop
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ITestService::CompilerChecks::UsingHasDeprecated::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case n: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<n>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<n>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case m: {
+    ::android::aidl::tests::ITestService::CompilerChecks::HasDeprecated _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readParcelable(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::aidl::tests::ITestService::CompilerChecks::HasDeprecated>) {
+      set<m>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<m>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t ITestService::CompilerChecks::UsingHasDeprecated::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case n: return _aidl_parcel->writeInt32(get<n>());
+  case m: return _aidl_parcel->writeParcelable(get<m>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/ITestService.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ITestService::CompilerChecks, NoPrefixInterface, "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/ITestService.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ITestService::CompilerChecks::BpNoPrefixInterface::BpNoPrefixInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<INoPrefixInterface>(_aidl_impl){
+}
+
+::android::binder::Status ITestService::CompilerChecks::BpNoPrefixInterface::foo() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::NoPrefixInterface::foo::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ITestService::CompilerChecks::BnNoPrefixInterface::TRANSACTION_foo, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && INoPrefixInterface::getDefaultImpl())) {
+     return INoPrefixInterface::getDefaultImpl()->foo();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ITestService::CompilerChecks::BnNoPrefixInterface::BnNoPrefixInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ITestService::CompilerChecks::BnNoPrefixInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnNoPrefixInterface::TRANSACTION_foo:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::NoPrefixInterface::foo::cppServer");
+    ::android::binder::Status _aidl_status(foo());
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ITestService::CompilerChecks::INoPrefixInterface::Nested::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ITestService::CompilerChecks::INoPrefixInterface::Nested::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/ITestService.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ITestService::CompilerChecks::INoPrefixInterface, NestedNoPrefixInterface, "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/ITestService.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ITestService::CompilerChecks::INoPrefixInterface::BpNestedNoPrefixInterface::BpNestedNoPrefixInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<INestedNoPrefixInterface>(_aidl_impl){
+}
+
+::android::binder::Status ITestService::CompilerChecks::INoPrefixInterface::BpNestedNoPrefixInterface::foo() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::NestedNoPrefixInterface::foo::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ITestService::CompilerChecks::INoPrefixInterface::BnNestedNoPrefixInterface::TRANSACTION_foo, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && INestedNoPrefixInterface::getDefaultImpl())) {
+     return INestedNoPrefixInterface::getDefaultImpl()->foo();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ITestService::CompilerChecks::INoPrefixInterface::BnNestedNoPrefixInterface::BnNestedNoPrefixInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ITestService::CompilerChecks::INoPrefixInterface::BnNestedNoPrefixInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnNestedNoPrefixInterface::TRANSACTION_foo:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::NestedNoPrefixInterface::foo::cppServer");
+    ::android::binder::Status _aidl_status(foo());
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp.d
new file mode 100644
index 0000000..89d3a1d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IntEnum.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IntEnum.cpp
new file mode 100644
index 0000000..54de736
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IntEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IntEnum.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IntEnum.cpp.d
new file mode 100644
index 0000000..5cb6ac6
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IntEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/IntEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ListOfInterfaces.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ListOfInterfaces.cpp
new file mode 100644
index 0000000..a962482
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ListOfInterfaces.cpp
@@ -0,0 +1,443 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#include <android/aidl/tests/ListOfInterfaces.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ListOfInterfaces::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ListOfInterfaces::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <android/aidl/tests/ListOfInterfaces.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ListOfInterfaces, EmptyInterface, "android.aidl.tests.ListOfInterfaces.IEmptyInterface")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ListOfInterfaces::BpEmptyInterface::BpEmptyInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IEmptyInterface>(_aidl_impl){
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ListOfInterfaces::BnEmptyInterface::BnEmptyInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ListOfInterfaces::BnEmptyInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <android/aidl/tests/ListOfInterfaces.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ListOfInterfaces, MyInterface, "android.aidl.tests.ListOfInterfaces.IMyInterface")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ListOfInterfaces::BpMyInterface::BpMyInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IMyInterface>(_aidl_impl){
+}
+
+::android::binder::Status ListOfInterfaces::BpMyInterface::methodWithInterfaces(const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& iface_list_in, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* iface_list_out, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* iface_list_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& nullable_iface_list_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* nullable_iface_list_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* nullable_iface_list_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyInterface::methodWithInterfaces::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(nullable_iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(iface_list_in);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(*iface_list_inout);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(nullable_iface_list_in);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(*nullable_iface_list_inout);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ListOfInterfaces::BnMyInterface::TRANSACTION_methodWithInterfaces, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyInterface::getDefaultImpl())) {
+     return IMyInterface::getDefaultImpl()->methodWithInterfaces(iface, nullable_iface, iface_list_in, iface_list_out, iface_list_inout, nullable_iface_list_in, nullable_iface_list_out, nullable_iface_list_inout, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(iface_list_out);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(iface_list_inout);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(nullable_iface_list_out);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(nullable_iface_list_inout);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ListOfInterfaces::BnMyInterface::BnMyInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ListOfInterfaces::BnMyInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnMyInterface::TRANSACTION_methodWithInterfaces:
+  {
+    ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface> in_iface;
+    ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface> in_nullable_iface;
+    ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> in_iface_list_in;
+    ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> out_iface_list_out;
+    ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> in_iface_list_inout;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> in_nullable_iface_list_in;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> out_nullable_iface_list_out;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> in_nullable_iface_list_inout;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyInterface::methodWithInterfaces::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinder(&in_iface);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readNullableStrongBinder(&in_nullable_iface);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_iface_list_in);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_iface_list_inout);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_nullable_iface_list_in);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_nullable_iface_list_inout);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(methodWithInterfaces(in_iface, in_nullable_iface, in_iface_list_in, &out_iface_list_out, &in_iface_list_inout, in_nullable_iface_list_in, &out_nullable_iface_list_out, &in_nullable_iface_list_inout, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(out_iface_list_out);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(in_iface_list_inout);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(out_nullable_iface_list_out);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(in_nullable_iface_list_inout);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ListOfInterfaces.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ListOfInterfaces::MyParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinder(&iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readNullableStrongBinder(&nullable_iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinderVector(&iface_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinderVector(&nullable_iface_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ListOfInterfaces::MyParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeStrongBinder(iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinder(nullable_iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinderVector(iface_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinderVector(nullable_iface_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ListOfInterfaces.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ListOfInterfaces::MyUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case iface: {
+    ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readStrongBinder(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>) {
+      set<iface>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<iface>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case nullable_iface: {
+    ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readNullableStrongBinder(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>) {
+      set<nullable_iface>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<nullable_iface>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case iface_list: {
+    ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readStrongBinderVector(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>) {
+      set<iface_list>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<iface_list>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case nullable_iface_list: {
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readStrongBinderVector(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>>) {
+      set<nullable_iface_list>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<nullable_iface_list>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t ListOfInterfaces::MyUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case iface: return _aidl_parcel->writeStrongBinder(get<iface>());
+  case nullable_iface: return _aidl_parcel->writeStrongBinder(get<nullable_iface>());
+  case iface_list: return _aidl_parcel->writeStrongBinderVector(get<iface_list>());
+  case nullable_iface_list: return _aidl_parcel->writeStrongBinderVector(get<nullable_iface_list>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d
new file mode 100644
index 0000000..9d79d56
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/ListOfInterfaces.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/LongEnum.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/LongEnum.cpp
new file mode 100644
index 0000000..b5cfb1c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/LongEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/LongEnum.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/LongEnum.cpp.d
new file mode 100644
index 0000000..881dfcf
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/LongEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/LongEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/OtherParcelableForToString.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/OtherParcelableForToString.cpp
new file mode 100644
index 0000000..1efd1eb
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/OtherParcelableForToString.cpp
@@ -0,0 +1,48 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#include <android/aidl/tests/OtherParcelableForToString.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t OtherParcelableForToString::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16(&field);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t OtherParcelableForToString::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeString16(field);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d
new file mode 100644
index 0000000..3d6fc45
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/OtherParcelableForToString.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ParcelableForToString.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ParcelableForToString.cpp
new file mode 100644
index 0000000..a0eacda
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ParcelableForToString.cpp
@@ -0,0 +1,312 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#include <android/aidl/tests/ParcelableForToString.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ParcelableForToString::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&intValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32Vector(&intArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64(&longValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64Vector(&longArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readDouble(&doubleValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readDoubleVector(&doubleArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFloat(&floatValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFloatVector(&floatArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(&byteValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByteVector(&byteArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readBool(&booleanValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readBoolVector(&booleanArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16(&stringValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16Vector(&stringArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16Vector(&stringList);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&parcelableValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&parcelableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&enumValue));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readEnumVector(&enumArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16Vector(&nullArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16Vector(&nullList);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&parcelableGeneric);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&unionValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ParcelableForToString::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(intValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32Vector(intArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64(longValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64Vector(longArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeDouble(doubleValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeDoubleVector(doubleArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFloat(floatValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFloatVector(floatArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeByte(byteValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeByteVector(byteArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeBool(booleanValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeBoolVector(booleanArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeString16(stringValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeString16Vector(stringArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeString16Vector(stringList);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(parcelableValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(parcelableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(enumValue));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeEnumVector(enumArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeString16Vector(nullArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeString16Vector(nullList);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(parcelableGeneric);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(unionValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ParcelableForToString.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ParcelableForToString.cpp.d
new file mode 100644
index 0000000..4043fd1
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ParcelableForToString.cpp.d
@@ -0,0 +1,10 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/ParcelableForToString.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/RecursiveList.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/RecursiveList.cpp
new file mode 100644
index 0000000..0284cb9
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/RecursiveList.cpp
@@ -0,0 +1,60 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#include <android/aidl/tests/RecursiveList.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t RecursiveList::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&value);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&next);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t RecursiveList::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(value);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeNullableParcelable(next);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/RecursiveList.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/RecursiveList.cpp.d
new file mode 100644
index 0000000..a0d1ffd
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/RecursiveList.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/RecursiveList.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/StructuredParcelable.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/StructuredParcelable.cpp
new file mode 100644
index 0000000..67e3a69
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/StructuredParcelable.cpp
@@ -0,0 +1,728 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#include <android/aidl/tests/StructuredParcelable.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t StructuredParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32Vector(&shouldContainThreeFs);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&f);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&shouldBeJerry);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(reinterpret_cast<int8_t *>(&shouldBeByteBar));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&shouldBeIntBar));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64(reinterpret_cast<int64_t *>(&shouldBeLongBar));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readEnumVector(&shouldContainTwoByteFoos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readEnumVector(&shouldContainTwoIntFoos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readEnumVector(&shouldContainTwoLongFoos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16(&stringDefaultsToFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(&byteDefaultsToFour);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&intDefaultsToFive);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64(&longDefaultsToNegativeSeven);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readBool(&booleanDefaultsToTrue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readChar(&charDefaultsToC);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFloat(&floatDefaultsToPi);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readDouble(&doubleWithDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32Vector(&arrayDefaultsTo123);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32Vector(&arrayDefaultsToEmpty);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readBool(&boolDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(&byteDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&intDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64(&longDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFloat(&floatDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readDouble(&doubleDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readDouble(&checkDoubleFromFloat);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16Vector(&checkStringArray1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readUtf8VectorFromUtf16Vector(&checkStringArray2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&int32_min);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&int32_max);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64(&int64_max);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&hexInt32_neg_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readNullableStrongBinder(&ibinder);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&empty);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByteVector(&int8_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32Vector(&int32_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64Vector(&int64_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&hexInt32_pos_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&hexInt64_pos_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_1));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_2));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_3));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_4));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_5));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_6));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_7));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_8));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_9));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_10));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&addString1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&addString2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&shouldSetBit0AndBit2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&u);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&shouldBeConstS1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&defaultWithFoo));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t StructuredParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32Vector(shouldContainThreeFs);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(f);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeUtf8AsUtf16(shouldBeJerry);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeByte(static_cast<int8_t>(shouldBeByteBar));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(shouldBeIntBar));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64(static_cast<int64_t>(shouldBeLongBar));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeEnumVector(shouldContainTwoByteFoos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeEnumVector(shouldContainTwoIntFoos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeEnumVector(shouldContainTwoLongFoos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeString16(stringDefaultsToFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeByte(byteDefaultsToFour);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(intDefaultsToFive);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64(longDefaultsToNegativeSeven);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeBool(booleanDefaultsToTrue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeChar(charDefaultsToC);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFloat(floatDefaultsToPi);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeDouble(doubleWithDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32Vector(arrayDefaultsTo123);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32Vector(arrayDefaultsToEmpty);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeBool(boolDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeByte(byteDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(intDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64(longDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFloat(floatDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeDouble(doubleDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeDouble(checkDoubleFromFloat);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeString16Vector(checkStringArray1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeUtf8VectorAsUtf16Vector(checkStringArray2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(int32_min);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(int32_max);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64(int64_max);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(hexInt32_neg_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinder(ibinder);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(empty);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeByteVector(int8_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32Vector(int32_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64Vector(int64_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(hexInt32_pos_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(hexInt64_pos_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_1));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_2));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_3));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_4));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_5));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_6));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_7));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_8));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_9));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_10));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeUtf8AsUtf16(addString1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeUtf8AsUtf16(addString2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(shouldSetBit0AndBit2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeNullableParcelable(u);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeNullableParcelable(shouldBeConstS1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(defaultWithFoo));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/StructuredParcelable.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t StructuredParcelable::Empty::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t StructuredParcelable::Empty::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/StructuredParcelable.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/StructuredParcelable.cpp.d
new file mode 100644
index 0000000..8d72a81
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/StructuredParcelable.cpp.d
@@ -0,0 +1,7 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/StructuredParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/Union.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/Union.cpp
new file mode 100644
index 0000000..d08d48a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/Union.cpp
@@ -0,0 +1,108 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#include <android/aidl/tests/Union.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+const ::std::string& Union::S1() {
+  static const ::std::string value("a string constant in union");
+  return value;
+}
+::android::status_t Union::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case ns: {
+    ::std::vector<int32_t> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32Vector(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::std::vector<int32_t>>) {
+      set<ns>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<ns>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case n: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<n>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<n>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case m: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<m>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<m>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case s: {
+    ::std::string _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::std::string>) {
+      set<s>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<s>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case ibinder: {
+    ::android::sp<::android::IBinder> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readNullableStrongBinder(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::sp<::android::IBinder>>) {
+      set<ibinder>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<ibinder>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case ss: {
+    ::std::vector<::std::string> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readUtf8VectorFromUtf16Vector(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::std::vector<::std::string>>) {
+      set<ss>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<ss>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case be: {
+    ::android::aidl::tests::ByteEnum _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readByte(reinterpret_cast<int8_t *>(&_aidl_value))) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::aidl::tests::ByteEnum>) {
+      set<be>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<be>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t Union::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case ns: return _aidl_parcel->writeInt32Vector(get<ns>());
+  case n: return _aidl_parcel->writeInt32(get<n>());
+  case m: return _aidl_parcel->writeInt32(get<m>());
+  case s: return _aidl_parcel->writeUtf8AsUtf16(get<s>());
+  case ibinder: return _aidl_parcel->writeStrongBinder(get<ibinder>());
+  case ss: return _aidl_parcel->writeUtf8VectorAsUtf16Vector(get<ss>());
+  case be: return _aidl_parcel->writeByte(static_cast<int8_t>(get<be>()));
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/Union.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/Union.cpp.d
new file mode 100644
index 0000000..69ddafa
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/Union.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/Union.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/UnionWithFd.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/UnionWithFd.cpp
new file mode 100644
index 0000000..35c0db8
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/UnionWithFd.cpp
@@ -0,0 +1,49 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#include <android/aidl/tests/UnionWithFd.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t UnionWithFd::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case num: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<num>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<num>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case pfd: {
+    ::android::os::ParcelFileDescriptor _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readParcelable(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::os::ParcelFileDescriptor>) {
+      set<pfd>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<pfd>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t UnionWithFd::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case num: return _aidl_parcel->writeInt32(get<num>());
+  case pfd: return _aidl_parcel->writeParcelable(get<pfd>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/UnionWithFd.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/UnionWithFd.cpp.d
new file mode 100644
index 0000000..0ac1ec4
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/UnionWithFd.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/UnionWithFd.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp
new file mode 100644
index 0000000..11ab286
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp
@@ -0,0 +1,98 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#include <android/aidl/tests/extension/ExtendableParcelable.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+::android::status_t ExtendableParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&ext);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64(&c);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&ext2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ExtendableParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeUtf8AsUtf16(b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(ext);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64(c);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(ext2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d
new file mode 100644
index 0000000..1fce902
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt.cpp
new file mode 100644
index 0000000..c1c5021
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt.cpp
@@ -0,0 +1,62 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#include <android/aidl/tests/extension/MyExt.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+::android::status_t MyExt::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t MyExt::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeUtf8AsUtf16(b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt.cpp.d
new file mode 100644
index 0000000..37e34d3
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt2.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt2.cpp
new file mode 100644
index 0000000..c08ecb1
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt2.cpp
@@ -0,0 +1,74 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#include <android/aidl/tests/extension/MyExt2.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+::android::status_t MyExt2::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&c);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t MyExt2::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeUtf8AsUtf16(c);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt2.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt2.cpp.d
new file mode 100644
index 0000000..1c9e164
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt2.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt2.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExtLike.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExtLike.cpp
new file mode 100644
index 0000000..9d3ba35
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExtLike.cpp
@@ -0,0 +1,62 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#include <android/aidl/tests/extension/MyExtLike.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+::android::status_t MyExtLike::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16(&b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t MyExtLike::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeString16(b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d
new file mode 100644
index 0000000..3181128
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExtLike.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/DeeplyNested.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/DeeplyNested.cpp
new file mode 100644
index 0000000..2b68d26
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/DeeplyNested.cpp
@@ -0,0 +1,186 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#include <android/aidl/tests/nested/DeeplyNested.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+::android::status_t DeeplyNested::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t DeeplyNested::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/DeeplyNested.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+::android::status_t DeeplyNested::A::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(reinterpret_cast<int8_t *>(&e));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t DeeplyNested::A::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeByte(static_cast<int8_t>(e));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/DeeplyNested.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+::android::status_t DeeplyNested::B::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t DeeplyNested::B::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/DeeplyNested.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+::android::status_t DeeplyNested::B::C::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t DeeplyNested::B::C::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/DeeplyNested.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+::android::status_t DeeplyNested::B::C::D::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t DeeplyNested::B::C::D::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d
new file mode 100644
index 0000000..2b84190
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/DeeplyNested.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/INestedService.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/INestedService.cpp
new file mode 100644
index 0000000..e00951b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/INestedService.cpp
@@ -0,0 +1,372 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#include <android/aidl/tests/nested/INestedService.h>
+#include <android/aidl/tests/nested/BpNestedService.h>
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(NestedService, "android.aidl.tests.nested.INestedService")
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/BpNestedService.h>
+#include <android/aidl/tests/nested/BnNestedService.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+
+BpNestedService::BpNestedService(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<INestedService>(_aidl_impl){
+}
+
+::android::binder::Status BpNestedService::flipStatus(const ::android::aidl::tests::nested::ParcelableWithNested& p, ::android::aidl::tests::nested::INestedService::Result* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::INestedService::flipStatus::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(p);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnNestedService::TRANSACTION_flipStatus, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && INestedService::getDefaultImpl())) {
+     return INestedService::getDefaultImpl()->flipStatus(p, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpNestedService::flipStatusWithCallback(::android::aidl::tests::nested::ParcelableWithNested::Status status, const ::android::sp<::android::aidl::tests::nested::INestedService::ICallback>& cb) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::INestedService::flipStatusWithCallback::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(static_cast<int8_t>(status));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(cb);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnNestedService::TRANSACTION_flipStatusWithCallback, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && INestedService::getDefaultImpl())) {
+     return INestedService::getDefaultImpl()->flipStatusWithCallback(status, cb);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/BnNestedService.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+
+BnNestedService::BnNestedService()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnNestedService::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnNestedService::TRANSACTION_flipStatus:
+  {
+    ::android::aidl::tests::nested::ParcelableWithNested in_p;
+    ::android::aidl::tests::nested::INestedService::Result _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::INestedService::flipStatus::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_p);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(flipStatus(in_p, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnNestedService::TRANSACTION_flipStatusWithCallback:
+  {
+    ::android::aidl::tests::nested::ParcelableWithNested::Status in_status;
+    ::android::sp<::android::aidl::tests::nested::INestedService::ICallback> in_cb;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::INestedService::flipStatusWithCallback::cppServer");
+    _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_status));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinder(&in_cb);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(flipStatusWithCallback(in_status, in_cb));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/INestedService.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+::android::status_t INestedService::Result::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(reinterpret_cast<int8_t *>(&status));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t INestedService::Result::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeByte(static_cast<int8_t>(status));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/INestedService.h>
+#include <android/aidl/tests/nested/INestedService.h>
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(INestedService, Callback, "android.aidl.tests.nested.INestedService.ICallback")
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/INestedService.h>
+#include <android/aidl/tests/nested/INestedService.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+
+INestedService::BpCallback::BpCallback(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<ICallback>(_aidl_impl){
+}
+
+::android::binder::Status INestedService::BpCallback::done(::android::aidl::tests::nested::ParcelableWithNested::Status status) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ICallback::done::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(static_cast<int8_t>(status));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(INestedService::BnCallback::TRANSACTION_done, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ICallback::getDefaultImpl())) {
+     return ICallback::getDefaultImpl()->done(status);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/INestedService.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+
+INestedService::BnCallback::BnCallback()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t INestedService::BnCallback::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnCallback::TRANSACTION_done:
+  {
+    ::android::aidl::tests::nested::ParcelableWithNested::Status in_status;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ICallback::done::cppServer");
+    _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_status));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(done(in_status));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/INestedService.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/INestedService.cpp.d
new file mode 100644
index 0000000..54177d3
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/INestedService.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/INestedService.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp
new file mode 100644
index 0000000..6c426e7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp
@@ -0,0 +1,50 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#include <android/aidl/tests/nested/ParcelableWithNested.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+::android::status_t ParcelableWithNested::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(reinterpret_cast<int8_t *>(&status));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ParcelableWithNested::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeByte(static_cast<int8_t>(status));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d
new file mode 100644
index 0000000..44c21f5
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/EnumUnion.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/EnumUnion.cpp
new file mode 100644
index 0000000..f10b547
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/EnumUnion.cpp
@@ -0,0 +1,68 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#include <android/aidl/tests/unions/EnumUnion.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+::android::status_t EnumUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case intEnum: {
+    ::android::aidl::tests::IntEnum _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&_aidl_value))) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::aidl::tests::IntEnum>) {
+      set<intEnum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intEnum>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case longEnum: {
+    ::android::aidl::tests::LongEnum _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt64(reinterpret_cast<int64_t *>(&_aidl_value))) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::aidl::tests::LongEnum>) {
+      set<longEnum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<longEnum>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case deprecatedField: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<deprecatedField>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<deprecatedField>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t EnumUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case intEnum: return _aidl_parcel->writeInt32(static_cast<int32_t>(get<intEnum>()));
+  case longEnum: return _aidl_parcel->writeInt64(static_cast<int64_t>(get<longEnum>()));
+  #pragma clang diagnostic push
+  #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+  case deprecatedField: return _aidl_parcel->writeInt32(get<deprecatedField>());
+  #pragma clang diagnostic pop
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+#pragma clang diagnostic pop
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d
new file mode 100644
index 0000000..b8e1647
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/EnumUnion.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/UnionInUnion.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/UnionInUnion.cpp
new file mode 100644
index 0000000..7fc66ce
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/UnionInUnion.cpp
@@ -0,0 +1,51 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#include <android/aidl/tests/unions/UnionInUnion.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+::android::status_t UnionInUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case first: {
+    ::android::aidl::tests::unions::EnumUnion _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readParcelable(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::aidl::tests::unions::EnumUnion>) {
+      set<first>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<first>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case second: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<second>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<second>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t UnionInUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case first: return _aidl_parcel->writeParcelable(get<first>());
+  case second: return _aidl_parcel->writeInt32(get<second>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d
new file mode 100644
index 0000000..470d9ea
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d
@@ -0,0 +1,5 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/UnionInUnion.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ArrayOfInterfaces.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ArrayOfInterfaces.h
new file mode 100644
index 0000000..2dc7afa
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ArrayOfInterfaces.h
@@ -0,0 +1,330 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Delegate.h>
+#include <binder/Enums.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cassert>
+#include <cstdint>
+#include <optional>
+#include <string>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <variant>
+#include <vector>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace tests {
+class ArrayOfInterfaces : public ::android::Parcelable {
+public:
+  class IEmptyInterfaceDelegator;
+
+  class IEmptyInterface : public ::android::IInterface {
+  public:
+    typedef IEmptyInterfaceDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(EmptyInterface)
+  };  // class IEmptyInterface
+
+  class IEmptyInterfaceDefault : public IEmptyInterface {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+  };  // class IEmptyInterfaceDefault
+  class BpEmptyInterface : public ::android::BpInterface<IEmptyInterface> {
+  public:
+    explicit BpEmptyInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpEmptyInterface() = default;
+  };  // class BpEmptyInterface
+  class BnEmptyInterface : public ::android::BnInterface<IEmptyInterface> {
+  public:
+    explicit BnEmptyInterface();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  };  // class BnEmptyInterface
+
+  class IEmptyInterfaceDelegator : public BnEmptyInterface {
+  public:
+    explicit IEmptyInterfaceDelegator(const ::android::sp<IEmptyInterface> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<IEmptyInterface> getImpl() { return _aidl_delegate; }
+  private:
+    ::android::sp<IEmptyInterface> _aidl_delegate;
+  };  // class IEmptyInterfaceDelegator
+  class IMyInterfaceDelegator;
+
+  class IMyInterface : public ::android::IInterface {
+  public:
+    typedef IMyInterfaceDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(MyInterface)
+    virtual ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& iface_array_in, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_out, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& nullable_iface_array_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) = 0;
+  };  // class IMyInterface
+
+  class IMyInterfaceDefault : public IMyInterface {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+    ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& /*iface*/, const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& /*nullable_iface*/, const ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& /*iface_array_in*/, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* /*iface_array_out*/, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* /*iface_array_inout*/, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& /*nullable_iface_array_in*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* /*nullable_iface_array_out*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* /*nullable_iface_array_inout*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+  };  // class IMyInterfaceDefault
+  class BpMyInterface : public ::android::BpInterface<IMyInterface> {
+  public:
+    explicit BpMyInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpMyInterface() = default;
+    ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& iface_array_in, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_out, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& nullable_iface_array_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) override;
+  };  // class BpMyInterface
+  class BnMyInterface : public ::android::BnInterface<IMyInterface> {
+  public:
+    static constexpr uint32_t TRANSACTION_methodWithInterfaces = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+    explicit BnMyInterface();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  };  // class BnMyInterface
+
+  class IMyInterfaceDelegator : public BnMyInterface {
+  public:
+    explicit IMyInterfaceDelegator(const ::android::sp<IMyInterface> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<IMyInterface> getImpl() { return _aidl_delegate; }
+    ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& iface_array_in, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_out, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& nullable_iface_array_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) override {
+      ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterfaceDelegator> _iface;
+      if (iface) {
+        _iface = ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterfaceDelegator>::cast(delegate(iface));
+      }
+      ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterfaceDelegator> _nullable_iface;
+      if (nullable_iface) {
+        _nullable_iface = ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterfaceDelegator>::cast(delegate(nullable_iface));
+      }
+      return _aidl_delegate->methodWithInterfaces(_iface, _nullable_iface, iface_array_in, iface_array_out, iface_array_inout, nullable_iface_array_in, nullable_iface_array_out, nullable_iface_array_inout, _aidl_return);
+    }
+  private:
+    ::android::sp<IMyInterface> _aidl_delegate;
+  };  // class IMyInterfaceDelegator
+  class MyParcelable : public ::android::Parcelable {
+  public:
+    ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> iface;
+    ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> nullable_iface;
+    ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> iface_array;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> nullable_iface_array;
+    inline bool operator!=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) != std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator<(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) < std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator<=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) <= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator==(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) == std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator>(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) > std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator>=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) >= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ArrayOfInterfaces.MyParcelable");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyParcelable{";
+      os << "iface: " << ::android::internal::ToString(iface);
+      os << ", nullable_iface: " << ::android::internal::ToString(nullable_iface);
+      os << ", iface_array: " << ::android::internal::ToString(iface_array);
+      os << ", nullable_iface_array: " << ::android::internal::ToString(nullable_iface_array);
+      os << "}";
+      return os.str();
+    }
+  };  // class MyParcelable
+  class MyUnion : public ::android::Parcelable {
+  public:
+    enum class Tag : int32_t {
+      iface = 0,
+      nullable_iface = 1,
+      iface_array = 2,
+      nullable_iface_array = 3,
+    };
+    // Expose tag symbols for legacy code
+    static const inline Tag iface = Tag::iface;
+    static const inline Tag nullable_iface = Tag::nullable_iface;
+    static const inline Tag iface_array = Tag::iface_array;
+    static const inline Tag nullable_iface_array = Tag::nullable_iface_array;
+
+    template<typename _Tp>
+    static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, MyUnion>;
+
+    MyUnion() : _value(std::in_place_index<static_cast<size_t>(iface)>, ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>()) { }
+
+    template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+    // NOLINTNEXTLINE(google-explicit-constructor)
+    constexpr MyUnion(_Tp&& _arg)
+        : _value(std::forward<_Tp>(_arg)) {}
+
+    template <size_t _Np, typename... _Tp>
+    constexpr explicit MyUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+        : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+    template <Tag _tag, typename... _Tp>
+    static MyUnion make(_Tp&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+    }
+
+    template <Tag _tag, typename _Tp, typename... _Up>
+    static MyUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+    }
+
+    Tag getTag() const {
+      return static_cast<Tag>(_value.index());
+    }
+
+    template <Tag _tag>
+    const auto& get() const {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag>
+    auto& get() {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag, typename... _Tp>
+    void set(_Tp&&... _args) {
+      _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+    }
+
+    inline bool operator!=(const MyUnion& rhs) const {
+      return _value != rhs._value;
+    }
+    inline bool operator<(const MyUnion& rhs) const {
+      return _value < rhs._value;
+    }
+    inline bool operator<=(const MyUnion& rhs) const {
+      return _value <= rhs._value;
+    }
+    inline bool operator==(const MyUnion& rhs) const {
+      return _value == rhs._value;
+    }
+    inline bool operator>(const MyUnion& rhs) const {
+      return _value > rhs._value;
+    }
+    inline bool operator>=(const MyUnion& rhs) const {
+      return _value >= rhs._value;
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ArrayOfInterfaces.MyUnion");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyUnion{";
+      switch (getTag()) {
+      case iface: os << "iface: " << ::android::internal::ToString(get<iface>()); break;
+      case nullable_iface: os << "nullable_iface: " << ::android::internal::ToString(get<nullable_iface>()); break;
+      case iface_array: os << "iface_array: " << ::android::internal::ToString(get<iface_array>()); break;
+      case nullable_iface_array: os << "nullable_iface_array: " << ::android::internal::ToString(get<nullable_iface_array>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    std::variant<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>, ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>> _value;
+  };  // class MyUnion
+  inline bool operator!=(const ArrayOfInterfaces&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const ArrayOfInterfaces&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const ArrayOfInterfaces&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const ArrayOfInterfaces&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const ArrayOfInterfaces&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const ArrayOfInterfaces&) const {
+    return std::tie() >= std::tie();
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ArrayOfInterfaces");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ArrayOfInterfaces{";
+    os << "}";
+    return os.str();
+  }
+};  // class ArrayOfInterfaces
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ArrayOfInterfaces::MyUnion::Tag val) {
+  switch(val) {
+  case ArrayOfInterfaces::MyUnion::Tag::iface:
+    return "iface";
+  case ArrayOfInterfaces::MyUnion::Tag::nullable_iface:
+    return "nullable_iface";
+  case ArrayOfInterfaces::MyUnion::Tag::iface_array:
+    return "iface_array";
+  case ArrayOfInterfaces::MyUnion::Tag::nullable_iface_array:
+    return "nullable_iface_array";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag, 4> enum_values<::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag> = {
+  ::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::iface,
+  ::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::nullable_iface,
+  ::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::iface_array,
+  ::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::nullable_iface_array,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BackendType.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BackendType.h
new file mode 100644
index 0000000..bf9ca3a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BackendType.h
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+#pragma once
+
+#include <array>
+#include <binder/Enums.h>
+#include <cstdint>
+#include <string>
+
+namespace android {
+namespace aidl {
+namespace tests {
+enum class BackendType : int8_t {
+  CPP = 0,
+  JAVA = 1,
+  NDK = 2,
+  RUST = 3,
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(BackendType val) {
+  switch(val) {
+  case BackendType::CPP:
+    return "CPP";
+  case BackendType::JAVA:
+    return "JAVA";
+  case BackendType::NDK:
+    return "NDK";
+  case BackendType::RUST:
+    return "RUST";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::BackendType, 4> enum_values<::android::aidl::tests::BackendType> = {
+  ::android::aidl::tests::BackendType::CPP,
+  ::android::aidl::tests::BackendType::JAVA,
+  ::android::aidl::tests::BackendType::NDK,
+  ::android::aidl::tests::BackendType::RUST,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnArrayOfInterfaces.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnArrayOfInterfaces.h
new file mode 100644
index 0000000..3fcd18b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnArrayOfInterfaces.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnBackendType.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnBackendType.h
new file mode 100644
index 0000000..4c978cc
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnBackendType.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnByteEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnByteEnum.h
new file mode 100644
index 0000000..051e053
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnByteEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnCircular.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnCircular.h
new file mode 100644
index 0000000..6c7a2a8
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnCircular.h
@@ -0,0 +1,41 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/tests/ICircular.h>
+#include <android/aidl/tests/BnCircular.h>
+#include <android/aidl/tests/BnTestService.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BnCircular : public ::android::BnInterface<ICircular> {
+public:
+  static constexpr uint32_t TRANSACTION_GetTestService = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  explicit BnCircular();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+};  // class BnCircular
+
+class ICircularDelegator : public BnCircular {
+public:
+  explicit ICircularDelegator(const ::android::sp<ICircular> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<ICircular> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status GetTestService(::android::sp<::android::aidl::tests::ITestService>* _aidl_return) override {
+    auto _status = _aidl_delegate->GetTestService(_aidl_return);
+    if (*_aidl_return) {
+      *_aidl_return = ::android::sp<::android::aidl::tests::ITestServiceDelegator>::cast(delegate(*_aidl_return));
+    }
+    return _status;
+  }
+private:
+  ::android::sp<ICircular> _aidl_delegate;
+};  // class ICircularDelegator
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnCircularParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnCircularParcelable.h
new file mode 100644
index 0000000..2750327
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnCircularParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnConstantExpressionEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnConstantExpressionEnum.h
new file mode 100644
index 0000000..2defd16
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnConstantExpressionEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecated.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecated.h
new file mode 100644
index 0000000..9effe3d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecated.h
@@ -0,0 +1,32 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/tests/IDeprecated.h>
+#include <android/aidl/tests/BnDeprecated.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace tests {
+class __attribute__((deprecated("test"))) BnDeprecated : public ::android::BnInterface<IDeprecated> {
+public:
+  explicit BnDeprecated();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+};  // class BnDeprecated
+
+class __attribute__((deprecated("test"))) IDeprecatedDelegator : public BnDeprecated {
+public:
+  explicit IDeprecatedDelegator(const ::android::sp<IDeprecated> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<IDeprecated> getImpl() { return _aidl_delegate; }
+private:
+  ::android::sp<IDeprecated> _aidl_delegate;
+};  // class IDeprecatedDelegator
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedEnum.h
new file mode 100644
index 0000000..42a29ed
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedParcelable.h
new file mode 100644
index 0000000..a3cd9d3
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnFixedSize.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnFixedSize.h
new file mode 100644
index 0000000..cc77fb7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnFixedSize.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnGenericStructuredParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnGenericStructuredParcelable.h
new file mode 100644
index 0000000..3c59ef7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnGenericStructuredParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnIntEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnIntEnum.h
new file mode 100644
index 0000000..4d09a2b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnIntEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnListOfInterfaces.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnListOfInterfaces.h
new file mode 100644
index 0000000..ccf9ce9
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnListOfInterfaces.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnLongEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnLongEnum.h
new file mode 100644
index 0000000..682ddaf
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnLongEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnNamedCallback.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnNamedCallback.h
new file mode 100644
index 0000000..fee8d2f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnNamedCallback.h
@@ -0,0 +1,36 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/tests/INamedCallback.h>
+#include <android/aidl/tests/BnNamedCallback.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BnNamedCallback : public ::android::BnInterface<INamedCallback> {
+public:
+  static constexpr uint32_t TRANSACTION_GetName = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  explicit BnNamedCallback();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+};  // class BnNamedCallback
+
+class INamedCallbackDelegator : public BnNamedCallback {
+public:
+  explicit INamedCallbackDelegator(const ::android::sp<INamedCallback> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<INamedCallback> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status GetName(::android::String16* _aidl_return) override {
+    return _aidl_delegate->GetName(_aidl_return);
+  }
+private:
+  ::android::sp<INamedCallback> _aidl_delegate;
+};  // class INamedCallbackDelegator
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnNewName.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnNewName.h
new file mode 100644
index 0000000..7eb7214
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnNewName.h
@@ -0,0 +1,36 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/tests/INewName.h>
+#include <android/aidl/tests/BnNewName.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BnNewName : public ::android::BnInterface<INewName> {
+public:
+  static constexpr uint32_t TRANSACTION_RealName = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  explicit BnNewName();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+};  // class BnNewName
+
+class INewNameDelegator : public BnNewName {
+public:
+  explicit INewNameDelegator(const ::android::sp<INewName> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<INewName> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status RealName(::android::String16* _aidl_return) override {
+    return _aidl_delegate->RealName(_aidl_return);
+  }
+private:
+  ::android::sp<INewName> _aidl_delegate;
+};  // class INewNameDelegator
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnOldName.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnOldName.h
new file mode 100644
index 0000000..986a674
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnOldName.h
@@ -0,0 +1,36 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/tests/IOldName.h>
+#include <android/aidl/tests/BnOldName.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BnOldName : public ::android::BnInterface<IOldName> {
+public:
+  static constexpr uint32_t TRANSACTION_RealName = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  explicit BnOldName();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+};  // class BnOldName
+
+class IOldNameDelegator : public BnOldName {
+public:
+  explicit IOldNameDelegator(const ::android::sp<IOldName> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<IOldName> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status RealName(::android::String16* _aidl_return) override {
+    return _aidl_delegate->RealName(_aidl_return);
+  }
+private:
+  ::android::sp<IOldName> _aidl_delegate;
+};  // class IOldNameDelegator
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnOtherParcelableForToString.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnOtherParcelableForToString.h
new file mode 100644
index 0000000..a9755b8
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnOtherParcelableForToString.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnParcelableForToString.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnParcelableForToString.h
new file mode 100644
index 0000000..8f3485f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnParcelableForToString.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnRecursiveList.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnRecursiveList.h
new file mode 100644
index 0000000..c1100e1
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnRecursiveList.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnStructuredParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnStructuredParcelable.h
new file mode 100644
index 0000000..c4f5984
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnStructuredParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnTestService.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnTestService.h
new file mode 100644
index 0000000..4ad6393
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnTestService.h
@@ -0,0 +1,337 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/BnCircular.h>
+#include <android/aidl/tests/BnNamedCallback.h>
+#include <android/aidl/tests/BnNewName.h>
+#include <android/aidl/tests/BnOldName.h>
+#include <android/aidl/tests/BnTestService.h>
+#include <android/aidl/tests/ITestService.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BnTestService : public ::android::BnInterface<ITestService> {
+public:
+  static constexpr uint32_t TRANSACTION_UnimplementedMethod = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_Deprecated = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_TestOneway = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_RepeatBoolean = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_RepeatByte = ::android::IBinder::FIRST_CALL_TRANSACTION + 4;
+  static constexpr uint32_t TRANSACTION_RepeatChar = ::android::IBinder::FIRST_CALL_TRANSACTION + 5;
+  static constexpr uint32_t TRANSACTION_RepeatInt = ::android::IBinder::FIRST_CALL_TRANSACTION + 6;
+  static constexpr uint32_t TRANSACTION_RepeatLong = ::android::IBinder::FIRST_CALL_TRANSACTION + 7;
+  static constexpr uint32_t TRANSACTION_RepeatFloat = ::android::IBinder::FIRST_CALL_TRANSACTION + 8;
+  static constexpr uint32_t TRANSACTION_RepeatDouble = ::android::IBinder::FIRST_CALL_TRANSACTION + 9;
+  static constexpr uint32_t TRANSACTION_RepeatString = ::android::IBinder::FIRST_CALL_TRANSACTION + 10;
+  static constexpr uint32_t TRANSACTION_RepeatByteEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 11;
+  static constexpr uint32_t TRANSACTION_RepeatIntEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 12;
+  static constexpr uint32_t TRANSACTION_RepeatLongEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 13;
+  static constexpr uint32_t TRANSACTION_ReverseBoolean = ::android::IBinder::FIRST_CALL_TRANSACTION + 14;
+  static constexpr uint32_t TRANSACTION_ReverseByte = ::android::IBinder::FIRST_CALL_TRANSACTION + 15;
+  static constexpr uint32_t TRANSACTION_ReverseChar = ::android::IBinder::FIRST_CALL_TRANSACTION + 16;
+  static constexpr uint32_t TRANSACTION_ReverseInt = ::android::IBinder::FIRST_CALL_TRANSACTION + 17;
+  static constexpr uint32_t TRANSACTION_ReverseLong = ::android::IBinder::FIRST_CALL_TRANSACTION + 18;
+  static constexpr uint32_t TRANSACTION_ReverseFloat = ::android::IBinder::FIRST_CALL_TRANSACTION + 19;
+  static constexpr uint32_t TRANSACTION_ReverseDouble = ::android::IBinder::FIRST_CALL_TRANSACTION + 20;
+  static constexpr uint32_t TRANSACTION_ReverseString = ::android::IBinder::FIRST_CALL_TRANSACTION + 21;
+  static constexpr uint32_t TRANSACTION_ReverseByteEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 22;
+  static constexpr uint32_t TRANSACTION_ReverseIntEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 23;
+  static constexpr uint32_t TRANSACTION_ReverseLongEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 24;
+  static constexpr uint32_t TRANSACTION_GetOtherTestService = ::android::IBinder::FIRST_CALL_TRANSACTION + 25;
+  static constexpr uint32_t TRANSACTION_SetOtherTestService = ::android::IBinder::FIRST_CALL_TRANSACTION + 26;
+  static constexpr uint32_t TRANSACTION_VerifyName = ::android::IBinder::FIRST_CALL_TRANSACTION + 27;
+  static constexpr uint32_t TRANSACTION_GetInterfaceArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 28;
+  static constexpr uint32_t TRANSACTION_VerifyNamesWithInterfaceArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 29;
+  static constexpr uint32_t TRANSACTION_GetNullableInterfaceArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 30;
+  static constexpr uint32_t TRANSACTION_VerifyNamesWithNullableInterfaceArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 31;
+  static constexpr uint32_t TRANSACTION_GetInterfaceList = ::android::IBinder::FIRST_CALL_TRANSACTION + 32;
+  static constexpr uint32_t TRANSACTION_VerifyNamesWithInterfaceList = ::android::IBinder::FIRST_CALL_TRANSACTION + 33;
+  static constexpr uint32_t TRANSACTION_ReverseStringList = ::android::IBinder::FIRST_CALL_TRANSACTION + 34;
+  static constexpr uint32_t TRANSACTION_RepeatParcelFileDescriptor = ::android::IBinder::FIRST_CALL_TRANSACTION + 35;
+  static constexpr uint32_t TRANSACTION_ReverseParcelFileDescriptorArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 36;
+  static constexpr uint32_t TRANSACTION_ThrowServiceException = ::android::IBinder::FIRST_CALL_TRANSACTION + 37;
+  static constexpr uint32_t TRANSACTION_RepeatNullableIntArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 38;
+  static constexpr uint32_t TRANSACTION_RepeatNullableByteEnumArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 39;
+  static constexpr uint32_t TRANSACTION_RepeatNullableIntEnumArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 40;
+  static constexpr uint32_t TRANSACTION_RepeatNullableLongEnumArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 41;
+  static constexpr uint32_t TRANSACTION_RepeatNullableString = ::android::IBinder::FIRST_CALL_TRANSACTION + 42;
+  static constexpr uint32_t TRANSACTION_RepeatNullableStringList = ::android::IBinder::FIRST_CALL_TRANSACTION + 43;
+  static constexpr uint32_t TRANSACTION_RepeatNullableParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 44;
+  static constexpr uint32_t TRANSACTION_RepeatNullableParcelableArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 45;
+  static constexpr uint32_t TRANSACTION_RepeatNullableParcelableList = ::android::IBinder::FIRST_CALL_TRANSACTION + 46;
+  static constexpr uint32_t TRANSACTION_TakesAnIBinder = ::android::IBinder::FIRST_CALL_TRANSACTION + 47;
+  static constexpr uint32_t TRANSACTION_TakesANullableIBinder = ::android::IBinder::FIRST_CALL_TRANSACTION + 48;
+  static constexpr uint32_t TRANSACTION_TakesAnIBinderList = ::android::IBinder::FIRST_CALL_TRANSACTION + 49;
+  static constexpr uint32_t TRANSACTION_TakesANullableIBinderList = ::android::IBinder::FIRST_CALL_TRANSACTION + 50;
+  static constexpr uint32_t TRANSACTION_RepeatUtf8CppString = ::android::IBinder::FIRST_CALL_TRANSACTION + 51;
+  static constexpr uint32_t TRANSACTION_RepeatNullableUtf8CppString = ::android::IBinder::FIRST_CALL_TRANSACTION + 52;
+  static constexpr uint32_t TRANSACTION_ReverseUtf8CppString = ::android::IBinder::FIRST_CALL_TRANSACTION + 53;
+  static constexpr uint32_t TRANSACTION_ReverseNullableUtf8CppString = ::android::IBinder::FIRST_CALL_TRANSACTION + 54;
+  static constexpr uint32_t TRANSACTION_ReverseUtf8CppStringList = ::android::IBinder::FIRST_CALL_TRANSACTION + 55;
+  static constexpr uint32_t TRANSACTION_GetCallback = ::android::IBinder::FIRST_CALL_TRANSACTION + 56;
+  static constexpr uint32_t TRANSACTION_FillOutStructuredParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 57;
+  static constexpr uint32_t TRANSACTION_RepeatExtendableParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 58;
+  static constexpr uint32_t TRANSACTION_ReverseList = ::android::IBinder::FIRST_CALL_TRANSACTION + 59;
+  static constexpr uint32_t TRANSACTION_ReverseIBinderArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 60;
+  static constexpr uint32_t TRANSACTION_ReverseNullableIBinderArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 61;
+  static constexpr uint32_t TRANSACTION_GetOldNameInterface = ::android::IBinder::FIRST_CALL_TRANSACTION + 62;
+  static constexpr uint32_t TRANSACTION_GetNewNameInterface = ::android::IBinder::FIRST_CALL_TRANSACTION + 63;
+  static constexpr uint32_t TRANSACTION_GetUnionTags = ::android::IBinder::FIRST_CALL_TRANSACTION + 64;
+  static constexpr uint32_t TRANSACTION_GetCppJavaTests = ::android::IBinder::FIRST_CALL_TRANSACTION + 65;
+  static constexpr uint32_t TRANSACTION_getBackendType = ::android::IBinder::FIRST_CALL_TRANSACTION + 66;
+  static constexpr uint32_t TRANSACTION_GetCircular = ::android::IBinder::FIRST_CALL_TRANSACTION + 67;
+  explicit BnTestService();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+};  // class BnTestService
+
+class ITestServiceDelegator : public BnTestService {
+public:
+  explicit ITestServiceDelegator(const ::android::sp<ITestService> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<ITestService> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status UnimplementedMethod(int32_t arg, int32_t* _aidl_return) override {
+    return _aidl_delegate->UnimplementedMethod(arg, _aidl_return);
+  }
+  ::android::binder::Status Deprecated() override __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"))) {
+    return _aidl_delegate->Deprecated();
+  }
+  ::android::binder::Status TestOneway() override {
+    return _aidl_delegate->TestOneway();
+  }
+  ::android::binder::Status RepeatBoolean(bool token, bool* _aidl_return) override {
+    return _aidl_delegate->RepeatBoolean(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatByte(int8_t token, int8_t* _aidl_return) override {
+    return _aidl_delegate->RepeatByte(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatChar(char16_t token, char16_t* _aidl_return) override {
+    return _aidl_delegate->RepeatChar(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatInt(int32_t token, int32_t* _aidl_return) override {
+    return _aidl_delegate->RepeatInt(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatLong(int64_t token, int64_t* _aidl_return) override {
+    return _aidl_delegate->RepeatLong(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatFloat(float token, float* _aidl_return) override {
+    return _aidl_delegate->RepeatFloat(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatDouble(double token, double* _aidl_return) override {
+    return _aidl_delegate->RepeatDouble(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatString(const ::android::String16& token, ::android::String16* _aidl_return) override {
+    return _aidl_delegate->RepeatString(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatByteEnum(::android::aidl::tests::ByteEnum token, ::android::aidl::tests::ByteEnum* _aidl_return) override {
+    return _aidl_delegate->RepeatByteEnum(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatIntEnum(::android::aidl::tests::IntEnum token, ::android::aidl::tests::IntEnum* _aidl_return) override {
+    return _aidl_delegate->RepeatIntEnum(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatLongEnum(::android::aidl::tests::LongEnum token, ::android::aidl::tests::LongEnum* _aidl_return) override {
+    return _aidl_delegate->RepeatLongEnum(token, _aidl_return);
+  }
+  ::android::binder::Status ReverseBoolean(const ::std::vector<bool>& input, ::std::vector<bool>* repeated, ::std::vector<bool>* _aidl_return) override {
+    return _aidl_delegate->ReverseBoolean(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseByte(const ::std::vector<uint8_t>& input, ::std::vector<uint8_t>* repeated, ::std::vector<uint8_t>* _aidl_return) override {
+    return _aidl_delegate->ReverseByte(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseChar(const ::std::vector<char16_t>& input, ::std::vector<char16_t>* repeated, ::std::vector<char16_t>* _aidl_return) override {
+    return _aidl_delegate->ReverseChar(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseInt(const ::std::vector<int32_t>& input, ::std::vector<int32_t>* repeated, ::std::vector<int32_t>* _aidl_return) override {
+    return _aidl_delegate->ReverseInt(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseLong(const ::std::vector<int64_t>& input, ::std::vector<int64_t>* repeated, ::std::vector<int64_t>* _aidl_return) override {
+    return _aidl_delegate->ReverseLong(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseFloat(const ::std::vector<float>& input, ::std::vector<float>* repeated, ::std::vector<float>* _aidl_return) override {
+    return _aidl_delegate->ReverseFloat(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseDouble(const ::std::vector<double>& input, ::std::vector<double>* repeated, ::std::vector<double>* _aidl_return) override {
+    return _aidl_delegate->ReverseDouble(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseString(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* repeated, ::std::vector<::android::String16>* _aidl_return) override {
+    return _aidl_delegate->ReverseString(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseByteEnum(const ::std::vector<::android::aidl::tests::ByteEnum>& input, ::std::vector<::android::aidl::tests::ByteEnum>* repeated, ::std::vector<::android::aidl::tests::ByteEnum>* _aidl_return) override {
+    return _aidl_delegate->ReverseByteEnum(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseIntEnum(const ::std::vector<::android::aidl::tests::IntEnum>& input, ::std::vector<::android::aidl::tests::IntEnum>* repeated, ::std::vector<::android::aidl::tests::IntEnum>* _aidl_return) override {
+    return _aidl_delegate->ReverseIntEnum(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseLongEnum(const ::std::vector<::android::aidl::tests::LongEnum>& input, ::std::vector<::android::aidl::tests::LongEnum>* repeated, ::std::vector<::android::aidl::tests::LongEnum>* _aidl_return) override {
+    return _aidl_delegate->ReverseLongEnum(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status GetOtherTestService(const ::android::String16& name, ::android::sp<::android::aidl::tests::INamedCallback>* _aidl_return) override {
+    auto _status = _aidl_delegate->GetOtherTestService(name, _aidl_return);
+    if (*_aidl_return) {
+      *_aidl_return = ::android::sp<::android::aidl::tests::INamedCallbackDelegator>::cast(delegate(*_aidl_return));
+    }
+    return _status;
+  }
+  ::android::binder::Status SetOtherTestService(const ::android::String16& name, const ::android::sp<::android::aidl::tests::INamedCallback>& service, bool* _aidl_return) override {
+    ::android::sp<::android::aidl::tests::INamedCallbackDelegator> _service;
+    if (service) {
+      _service = ::android::sp<::android::aidl::tests::INamedCallbackDelegator>::cast(delegate(service));
+    }
+    return _aidl_delegate->SetOtherTestService(name, _service, _aidl_return);
+  }
+  ::android::binder::Status VerifyName(const ::android::sp<::android::aidl::tests::INamedCallback>& service, const ::android::String16& name, bool* _aidl_return) override {
+    ::android::sp<::android::aidl::tests::INamedCallbackDelegator> _service;
+    if (service) {
+      _service = ::android::sp<::android::aidl::tests::INamedCallbackDelegator>::cast(delegate(service));
+    }
+    return _aidl_delegate->VerifyName(_service, name, _aidl_return);
+  }
+  ::android::binder::Status GetInterfaceArray(const ::std::vector<::android::String16>& names, ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>* _aidl_return) override {
+    return _aidl_delegate->GetInterfaceArray(names, _aidl_return);
+  }
+  ::android::binder::Status VerifyNamesWithInterfaceArray(const ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>& services, const ::std::vector<::android::String16>& names, bool* _aidl_return) override {
+    return _aidl_delegate->VerifyNamesWithInterfaceArray(services, names, _aidl_return);
+  }
+  ::android::binder::Status GetNullableInterfaceArray(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* _aidl_return) override {
+    return _aidl_delegate->GetNullableInterfaceArray(names, _aidl_return);
+  }
+  ::android::binder::Status VerifyNamesWithNullableInterfaceArray(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& services, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, bool* _aidl_return) override {
+    return _aidl_delegate->VerifyNamesWithNullableInterfaceArray(services, names, _aidl_return);
+  }
+  ::android::binder::Status GetInterfaceList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* _aidl_return) override {
+    return _aidl_delegate->GetInterfaceList(names, _aidl_return);
+  }
+  ::android::binder::Status VerifyNamesWithInterfaceList(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& services, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, bool* _aidl_return) override {
+    return _aidl_delegate->VerifyNamesWithInterfaceList(services, names, _aidl_return);
+  }
+  ::android::binder::Status ReverseStringList(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* repeated, ::std::vector<::android::String16>* _aidl_return) override {
+    return _aidl_delegate->ReverseStringList(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status RepeatParcelFileDescriptor(const ::android::os::ParcelFileDescriptor& read, ::android::os::ParcelFileDescriptor* _aidl_return) override {
+    return _aidl_delegate->RepeatParcelFileDescriptor(read, _aidl_return);
+  }
+  ::android::binder::Status ReverseParcelFileDescriptorArray(const ::std::vector<::android::os::ParcelFileDescriptor>& input, ::std::vector<::android::os::ParcelFileDescriptor>* repeated, ::std::vector<::android::os::ParcelFileDescriptor>* _aidl_return) override {
+    return _aidl_delegate->ReverseParcelFileDescriptorArray(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ThrowServiceException(int32_t code) override {
+    return _aidl_delegate->ThrowServiceException(code);
+  }
+  ::android::binder::Status RepeatNullableIntArray(const ::std::optional<::std::vector<int32_t>>& input, ::std::optional<::std::vector<int32_t>>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableIntArray(input, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableByteEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableByteEnumArray(input, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableIntEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableIntEnumArray(input, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableLongEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableLongEnumArray(input, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableString(const ::std::optional<::android::String16>& input, ::std::optional<::android::String16>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableString(input, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableStringList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& input, ::std::optional<::std::vector<::std::optional<::android::String16>>>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableStringList(input, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableParcelable(const ::std::optional<::android::aidl::tests::ITestService::Empty>& input, ::std::optional<::android::aidl::tests::ITestService::Empty>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableParcelable(input, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableParcelableArray(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& input, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableParcelableArray(input, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableParcelableList(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& input, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableParcelableList(input, _aidl_return);
+  }
+  ::android::binder::Status TakesAnIBinder(const ::android::sp<::android::IBinder>& input) override {
+    return _aidl_delegate->TakesAnIBinder(input);
+  }
+  ::android::binder::Status TakesANullableIBinder(const ::android::sp<::android::IBinder>& input) override {
+    return _aidl_delegate->TakesANullableIBinder(input);
+  }
+  ::android::binder::Status TakesAnIBinderList(const ::std::vector<::android::sp<::android::IBinder>>& input) override {
+    return _aidl_delegate->TakesAnIBinderList(input);
+  }
+  ::android::binder::Status TakesANullableIBinderList(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& input) override {
+    return _aidl_delegate->TakesANullableIBinderList(input);
+  }
+  ::android::binder::Status RepeatUtf8CppString(const ::std::string& token, ::std::string* _aidl_return) override {
+    return _aidl_delegate->RepeatUtf8CppString(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableUtf8CppString(const ::std::optional<::std::string>& token, ::std::optional<::std::string>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableUtf8CppString(token, _aidl_return);
+  }
+  ::android::binder::Status ReverseUtf8CppString(const ::std::vector<::std::string>& input, ::std::vector<::std::string>* repeated, ::std::vector<::std::string>* _aidl_return) override {
+    return _aidl_delegate->ReverseUtf8CppString(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseNullableUtf8CppString(const ::std::optional<::std::vector<::std::optional<::std::string>>>& input, ::std::optional<::std::vector<::std::optional<::std::string>>>* repeated, ::std::optional<::std::vector<::std::optional<::std::string>>>* _aidl_return) override {
+    return _aidl_delegate->ReverseNullableUtf8CppString(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseUtf8CppStringList(const ::std::optional<::std::vector<::std::optional<::std::string>>>& input, ::std::optional<::std::vector<::std::optional<::std::string>>>* repeated, ::std::optional<::std::vector<::std::optional<::std::string>>>* _aidl_return) override {
+    return _aidl_delegate->ReverseUtf8CppStringList(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status GetCallback(bool return_null, ::android::sp<::android::aidl::tests::INamedCallback>* _aidl_return) override {
+    auto _status = _aidl_delegate->GetCallback(return_null, _aidl_return);
+    if (*_aidl_return) {
+      *_aidl_return = ::android::sp<::android::aidl::tests::INamedCallbackDelegator>::cast(delegate(*_aidl_return));
+    }
+    return _status;
+  }
+  ::android::binder::Status FillOutStructuredParcelable(::android::aidl::tests::StructuredParcelable* parcel) override {
+    return _aidl_delegate->FillOutStructuredParcelable(parcel);
+  }
+  ::android::binder::Status RepeatExtendableParcelable(const ::android::aidl::tests::extension::ExtendableParcelable& ep, ::android::aidl::tests::extension::ExtendableParcelable* ep2) override {
+    return _aidl_delegate->RepeatExtendableParcelable(ep, ep2);
+  }
+  ::android::binder::Status ReverseList(const ::android::aidl::tests::RecursiveList& list, ::android::aidl::tests::RecursiveList* _aidl_return) override {
+    return _aidl_delegate->ReverseList(list, _aidl_return);
+  }
+  ::android::binder::Status ReverseIBinderArray(const ::std::vector<::android::sp<::android::IBinder>>& input, ::std::vector<::android::sp<::android::IBinder>>* repeated, ::std::vector<::android::sp<::android::IBinder>>* _aidl_return) override {
+    return _aidl_delegate->ReverseIBinderArray(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseNullableIBinderArray(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& input, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* repeated, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* _aidl_return) override {
+    return _aidl_delegate->ReverseNullableIBinderArray(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status GetOldNameInterface(::android::sp<::android::aidl::tests::IOldName>* _aidl_return) override {
+    auto _status = _aidl_delegate->GetOldNameInterface(_aidl_return);
+    if (*_aidl_return) {
+      *_aidl_return = ::android::sp<::android::aidl::tests::IOldNameDelegator>::cast(delegate(*_aidl_return));
+    }
+    return _status;
+  }
+  ::android::binder::Status GetNewNameInterface(::android::sp<::android::aidl::tests::INewName>* _aidl_return) override {
+    auto _status = _aidl_delegate->GetNewNameInterface(_aidl_return);
+    if (*_aidl_return) {
+      *_aidl_return = ::android::sp<::android::aidl::tests::INewNameDelegator>::cast(delegate(*_aidl_return));
+    }
+    return _status;
+  }
+  ::android::binder::Status GetUnionTags(const ::std::vector<::android::aidl::tests::Union>& input, ::std::vector<::android::aidl::tests::Union::Tag>* _aidl_return) override {
+    return _aidl_delegate->GetUnionTags(input, _aidl_return);
+  }
+  ::android::binder::Status GetCppJavaTests(::android::sp<::android::IBinder>* _aidl_return) override {
+    return _aidl_delegate->GetCppJavaTests(_aidl_return);
+  }
+  ::android::binder::Status getBackendType(::android::aidl::tests::BackendType* _aidl_return) override {
+    return _aidl_delegate->getBackendType(_aidl_return);
+  }
+  ::android::binder::Status GetCircular(::android::aidl::tests::CircularParcelable* cp, ::android::sp<::android::aidl::tests::ICircular>* _aidl_return) override {
+    auto _status = _aidl_delegate->GetCircular(cp, _aidl_return);
+    if (*_aidl_return) {
+      *_aidl_return = ::android::sp<::android::aidl::tests::ICircularDelegator>::cast(delegate(*_aidl_return));
+    }
+    return _status;
+  }
+private:
+  ::android::sp<ITestService> _aidl_delegate;
+};  // class ITestServiceDelegator
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnUnion.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnUnion.h
new file mode 100644
index 0000000..8cd705d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnUnionWithFd.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnUnionWithFd.h
new file mode 100644
index 0000000..6e564bf
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnUnionWithFd.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpArrayOfInterfaces.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpArrayOfInterfaces.h
new file mode 100644
index 0000000..3a27562
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpArrayOfInterfaces.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpBackendType.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpBackendType.h
new file mode 100644
index 0000000..9263c71
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpBackendType.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpByteEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpByteEnum.h
new file mode 100644
index 0000000..3924c9e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpByteEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpCircular.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpCircular.h
new file mode 100644
index 0000000..53aa76e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpCircular.h
@@ -0,0 +1,23 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/tests/ICircular.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BpCircular : public ::android::BpInterface<ICircular> {
+public:
+  explicit BpCircular(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpCircular() = default;
+  ::android::binder::Status GetTestService(::android::sp<::android::aidl::tests::ITestService>* _aidl_return) override;
+};  // class BpCircular
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpCircularParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpCircularParcelable.h
new file mode 100644
index 0000000..d822d8c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpCircularParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpConstantExpressionEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpConstantExpressionEnum.h
new file mode 100644
index 0000000..fa5329a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpConstantExpressionEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecated.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecated.h
new file mode 100644
index 0000000..ff4ef51
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecated.h
@@ -0,0 +1,22 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/tests/IDeprecated.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class __attribute__((deprecated("test"))) BpDeprecated : public ::android::BpInterface<IDeprecated> {
+public:
+  explicit BpDeprecated(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpDeprecated() = default;
+};  // class BpDeprecated
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedEnum.h
new file mode 100644
index 0000000..e31a839
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedParcelable.h
new file mode 100644
index 0000000..cad927a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpFixedSize.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpFixedSize.h
new file mode 100644
index 0000000..7280aa6
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpFixedSize.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpGenericStructuredParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpGenericStructuredParcelable.h
new file mode 100644
index 0000000..2b0bbae
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpGenericStructuredParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpIntEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpIntEnum.h
new file mode 100644
index 0000000..d474db5
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpIntEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpListOfInterfaces.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpListOfInterfaces.h
new file mode 100644
index 0000000..fbbc804
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpListOfInterfaces.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpLongEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpLongEnum.h
new file mode 100644
index 0000000..c8356c2
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpLongEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpNamedCallback.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpNamedCallback.h
new file mode 100644
index 0000000..4d333ef
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpNamedCallback.h
@@ -0,0 +1,23 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/tests/INamedCallback.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BpNamedCallback : public ::android::BpInterface<INamedCallback> {
+public:
+  explicit BpNamedCallback(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpNamedCallback() = default;
+  ::android::binder::Status GetName(::android::String16* _aidl_return) override;
+};  // class BpNamedCallback
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpNewName.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpNewName.h
new file mode 100644
index 0000000..4be360b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpNewName.h
@@ -0,0 +1,23 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/tests/INewName.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BpNewName : public ::android::BpInterface<INewName> {
+public:
+  explicit BpNewName(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpNewName() = default;
+  ::android::binder::Status RealName(::android::String16* _aidl_return) override;
+};  // class BpNewName
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpOldName.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpOldName.h
new file mode 100644
index 0000000..c8b87dd
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpOldName.h
@@ -0,0 +1,23 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/tests/IOldName.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BpOldName : public ::android::BpInterface<IOldName> {
+public:
+  explicit BpOldName(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpOldName() = default;
+  ::android::binder::Status RealName(::android::String16* _aidl_return) override;
+};  // class BpOldName
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpOtherParcelableForToString.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpOtherParcelableForToString.h
new file mode 100644
index 0000000..fb82c81
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpOtherParcelableForToString.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpParcelableForToString.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpParcelableForToString.h
new file mode 100644
index 0000000..10e7376
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpParcelableForToString.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpRecursiveList.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpRecursiveList.h
new file mode 100644
index 0000000..4f1758c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpRecursiveList.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpStructuredParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpStructuredParcelable.h
new file mode 100644
index 0000000..b1f6ef8
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpStructuredParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpTestService.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpTestService.h
new file mode 100644
index 0000000..450ffe1
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpTestService.h
@@ -0,0 +1,90 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/tests/ITestService.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BpTestService : public ::android::BpInterface<ITestService> {
+public:
+  explicit BpTestService(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpTestService() = default;
+  ::android::binder::Status UnimplementedMethod(int32_t arg, int32_t* _aidl_return) override;
+  ::android::binder::Status Deprecated() override __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens")));
+  ::android::binder::Status TestOneway() override;
+  ::android::binder::Status RepeatBoolean(bool token, bool* _aidl_return) override;
+  ::android::binder::Status RepeatByte(int8_t token, int8_t* _aidl_return) override;
+  ::android::binder::Status RepeatChar(char16_t token, char16_t* _aidl_return) override;
+  ::android::binder::Status RepeatInt(int32_t token, int32_t* _aidl_return) override;
+  ::android::binder::Status RepeatLong(int64_t token, int64_t* _aidl_return) override;
+  ::android::binder::Status RepeatFloat(float token, float* _aidl_return) override;
+  ::android::binder::Status RepeatDouble(double token, double* _aidl_return) override;
+  ::android::binder::Status RepeatString(const ::android::String16& token, ::android::String16* _aidl_return) override;
+  ::android::binder::Status RepeatByteEnum(::android::aidl::tests::ByteEnum token, ::android::aidl::tests::ByteEnum* _aidl_return) override;
+  ::android::binder::Status RepeatIntEnum(::android::aidl::tests::IntEnum token, ::android::aidl::tests::IntEnum* _aidl_return) override;
+  ::android::binder::Status RepeatLongEnum(::android::aidl::tests::LongEnum token, ::android::aidl::tests::LongEnum* _aidl_return) override;
+  ::android::binder::Status ReverseBoolean(const ::std::vector<bool>& input, ::std::vector<bool>* repeated, ::std::vector<bool>* _aidl_return) override;
+  ::android::binder::Status ReverseByte(const ::std::vector<uint8_t>& input, ::std::vector<uint8_t>* repeated, ::std::vector<uint8_t>* _aidl_return) override;
+  ::android::binder::Status ReverseChar(const ::std::vector<char16_t>& input, ::std::vector<char16_t>* repeated, ::std::vector<char16_t>* _aidl_return) override;
+  ::android::binder::Status ReverseInt(const ::std::vector<int32_t>& input, ::std::vector<int32_t>* repeated, ::std::vector<int32_t>* _aidl_return) override;
+  ::android::binder::Status ReverseLong(const ::std::vector<int64_t>& input, ::std::vector<int64_t>* repeated, ::std::vector<int64_t>* _aidl_return) override;
+  ::android::binder::Status ReverseFloat(const ::std::vector<float>& input, ::std::vector<float>* repeated, ::std::vector<float>* _aidl_return) override;
+  ::android::binder::Status ReverseDouble(const ::std::vector<double>& input, ::std::vector<double>* repeated, ::std::vector<double>* _aidl_return) override;
+  ::android::binder::Status ReverseString(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* repeated, ::std::vector<::android::String16>* _aidl_return) override;
+  ::android::binder::Status ReverseByteEnum(const ::std::vector<::android::aidl::tests::ByteEnum>& input, ::std::vector<::android::aidl::tests::ByteEnum>* repeated, ::std::vector<::android::aidl::tests::ByteEnum>* _aidl_return) override;
+  ::android::binder::Status ReverseIntEnum(const ::std::vector<::android::aidl::tests::IntEnum>& input, ::std::vector<::android::aidl::tests::IntEnum>* repeated, ::std::vector<::android::aidl::tests::IntEnum>* _aidl_return) override;
+  ::android::binder::Status ReverseLongEnum(const ::std::vector<::android::aidl::tests::LongEnum>& input, ::std::vector<::android::aidl::tests::LongEnum>* repeated, ::std::vector<::android::aidl::tests::LongEnum>* _aidl_return) override;
+  ::android::binder::Status GetOtherTestService(const ::android::String16& name, ::android::sp<::android::aidl::tests::INamedCallback>* _aidl_return) override;
+  ::android::binder::Status SetOtherTestService(const ::android::String16& name, const ::android::sp<::android::aidl::tests::INamedCallback>& service, bool* _aidl_return) override;
+  ::android::binder::Status VerifyName(const ::android::sp<::android::aidl::tests::INamedCallback>& service, const ::android::String16& name, bool* _aidl_return) override;
+  ::android::binder::Status GetInterfaceArray(const ::std::vector<::android::String16>& names, ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>* _aidl_return) override;
+  ::android::binder::Status VerifyNamesWithInterfaceArray(const ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>& services, const ::std::vector<::android::String16>& names, bool* _aidl_return) override;
+  ::android::binder::Status GetNullableInterfaceArray(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* _aidl_return) override;
+  ::android::binder::Status VerifyNamesWithNullableInterfaceArray(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& services, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, bool* _aidl_return) override;
+  ::android::binder::Status GetInterfaceList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* _aidl_return) override;
+  ::android::binder::Status VerifyNamesWithInterfaceList(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& services, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, bool* _aidl_return) override;
+  ::android::binder::Status ReverseStringList(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* repeated, ::std::vector<::android::String16>* _aidl_return) override;
+  ::android::binder::Status RepeatParcelFileDescriptor(const ::android::os::ParcelFileDescriptor& read, ::android::os::ParcelFileDescriptor* _aidl_return) override;
+  ::android::binder::Status ReverseParcelFileDescriptorArray(const ::std::vector<::android::os::ParcelFileDescriptor>& input, ::std::vector<::android::os::ParcelFileDescriptor>* repeated, ::std::vector<::android::os::ParcelFileDescriptor>* _aidl_return) override;
+  ::android::binder::Status ThrowServiceException(int32_t code) override;
+  ::android::binder::Status RepeatNullableIntArray(const ::std::optional<::std::vector<int32_t>>& input, ::std::optional<::std::vector<int32_t>>* _aidl_return) override;
+  ::android::binder::Status RepeatNullableByteEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>* _aidl_return) override;
+  ::android::binder::Status RepeatNullableIntEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>* _aidl_return) override;
+  ::android::binder::Status RepeatNullableLongEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>* _aidl_return) override;
+  ::android::binder::Status RepeatNullableString(const ::std::optional<::android::String16>& input, ::std::optional<::android::String16>* _aidl_return) override;
+  ::android::binder::Status RepeatNullableStringList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& input, ::std::optional<::std::vector<::std::optional<::android::String16>>>* _aidl_return) override;
+  ::android::binder::Status RepeatNullableParcelable(const ::std::optional<::android::aidl::tests::ITestService::Empty>& input, ::std::optional<::android::aidl::tests::ITestService::Empty>* _aidl_return) override;
+  ::android::binder::Status RepeatNullableParcelableArray(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& input, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override;
+  ::android::binder::Status RepeatNullableParcelableList(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& input, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override;
+  ::android::binder::Status TakesAnIBinder(const ::android::sp<::android::IBinder>& input) override;
+  ::android::binder::Status TakesANullableIBinder(const ::android::sp<::android::IBinder>& input) override;
+  ::android::binder::Status TakesAnIBinderList(const ::std::vector<::android::sp<::android::IBinder>>& input) override;
+  ::android::binder::Status TakesANullableIBinderList(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& input) override;
+  ::android::binder::Status RepeatUtf8CppString(const ::std::string& token, ::std::string* _aidl_return) override;
+  ::android::binder::Status RepeatNullableUtf8CppString(const ::std::optional<::std::string>& token, ::std::optional<::std::string>* _aidl_return) override;
+  ::android::binder::Status ReverseUtf8CppString(const ::std::vector<::std::string>& input, ::std::vector<::std::string>* repeated, ::std::vector<::std::string>* _aidl_return) override;
+  ::android::binder::Status ReverseNullableUtf8CppString(const ::std::optional<::std::vector<::std::optional<::std::string>>>& input, ::std::optional<::std::vector<::std::optional<::std::string>>>* repeated, ::std::optional<::std::vector<::std::optional<::std::string>>>* _aidl_return) override;
+  ::android::binder::Status ReverseUtf8CppStringList(const ::std::optional<::std::vector<::std::optional<::std::string>>>& input, ::std::optional<::std::vector<::std::optional<::std::string>>>* repeated, ::std::optional<::std::vector<::std::optional<::std::string>>>* _aidl_return) override;
+  ::android::binder::Status GetCallback(bool return_null, ::android::sp<::android::aidl::tests::INamedCallback>* _aidl_return) override;
+  ::android::binder::Status FillOutStructuredParcelable(::android::aidl::tests::StructuredParcelable* parcel) override;
+  ::android::binder::Status RepeatExtendableParcelable(const ::android::aidl::tests::extension::ExtendableParcelable& ep, ::android::aidl::tests::extension::ExtendableParcelable* ep2) override;
+  ::android::binder::Status ReverseList(const ::android::aidl::tests::RecursiveList& list, ::android::aidl::tests::RecursiveList* _aidl_return) override;
+  ::android::binder::Status ReverseIBinderArray(const ::std::vector<::android::sp<::android::IBinder>>& input, ::std::vector<::android::sp<::android::IBinder>>* repeated, ::std::vector<::android::sp<::android::IBinder>>* _aidl_return) override;
+  ::android::binder::Status ReverseNullableIBinderArray(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& input, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* repeated, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* _aidl_return) override;
+  ::android::binder::Status GetOldNameInterface(::android::sp<::android::aidl::tests::IOldName>* _aidl_return) override;
+  ::android::binder::Status GetNewNameInterface(::android::sp<::android::aidl::tests::INewName>* _aidl_return) override;
+  ::android::binder::Status GetUnionTags(const ::std::vector<::android::aidl::tests::Union>& input, ::std::vector<::android::aidl::tests::Union::Tag>* _aidl_return) override;
+  ::android::binder::Status GetCppJavaTests(::android::sp<::android::IBinder>* _aidl_return) override;
+  ::android::binder::Status getBackendType(::android::aidl::tests::BackendType* _aidl_return) override;
+  ::android::binder::Status GetCircular(::android::aidl::tests::CircularParcelable* cp, ::android::sp<::android::aidl::tests::ICircular>* _aidl_return) override;
+};  // class BpTestService
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpUnion.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpUnion.h
new file mode 100644
index 0000000..ed2ea18
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpUnionWithFd.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpUnionWithFd.h
new file mode 100644
index 0000000..b040027
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpUnionWithFd.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ByteEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ByteEnum.h
new file mode 100644
index 0000000..c6d544f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ByteEnum.h
@@ -0,0 +1,53 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <binder/Enums.h>
+#include <cstdint>
+#include <string>
+
+namespace android {
+namespace aidl {
+namespace tests {
+enum class ByteEnum : int8_t {
+  FOO = 1,
+  BAR = 2,
+  BAZ = 3,
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ByteEnum val) {
+  switch(val) {
+  case ByteEnum::FOO:
+    return "FOO";
+  case ByteEnum::BAR:
+    return "BAR";
+  case ByteEnum::BAZ:
+    return "BAZ";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::ByteEnum, 3> enum_values<::android::aidl::tests::ByteEnum> = {
+  ::android::aidl::tests::ByteEnum::FOO,
+  ::android::aidl::tests::ByteEnum::BAR,
+  ::android::aidl::tests::ByteEnum::BAZ,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/CircularParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/CircularParcelable.h
new file mode 100644
index 0000000..6388a93
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/CircularParcelable.h
@@ -0,0 +1,59 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/ITestService.h>
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <optional>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android::aidl::tests {
+class ITestService;
+}  // namespace android::aidl::tests
+namespace android {
+namespace aidl {
+namespace tests {
+class CircularParcelable : public ::android::Parcelable {
+public:
+  ::android::sp<::android::aidl::tests::ITestService> testService;
+  inline bool operator!=(const CircularParcelable& rhs) const {
+    return std::tie(testService) != std::tie(rhs.testService);
+  }
+  inline bool operator<(const CircularParcelable& rhs) const {
+    return std::tie(testService) < std::tie(rhs.testService);
+  }
+  inline bool operator<=(const CircularParcelable& rhs) const {
+    return std::tie(testService) <= std::tie(rhs.testService);
+  }
+  inline bool operator==(const CircularParcelable& rhs) const {
+    return std::tie(testService) == std::tie(rhs.testService);
+  }
+  inline bool operator>(const CircularParcelable& rhs) const {
+    return std::tie(testService) > std::tie(rhs.testService);
+  }
+  inline bool operator>=(const CircularParcelable& rhs) const {
+    return std::tie(testService) >= std::tie(rhs.testService);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.CircularParcelable");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "CircularParcelable{";
+    os << "testService: " << ::android::internal::ToString(testService);
+    os << "}";
+    return os.str();
+  }
+};  // class CircularParcelable
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ConstantExpressionEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ConstantExpressionEnum.h
new file mode 100644
index 0000000..ca25ca8
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ConstantExpressionEnum.h
@@ -0,0 +1,63 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <binder/Enums.h>
+#include <cstdint>
+#include <string>
+
+namespace android {
+namespace aidl {
+namespace tests {
+enum class ConstantExpressionEnum : int32_t {
+  decInt32_1 = 1,
+  decInt32_2 = 1,
+  decInt64_1 = 1,
+  decInt64_2 = 1,
+  decInt64_3 = 1,
+  decInt64_4 = 1,
+  hexInt32_1 = 1,
+  hexInt32_2 = 1,
+  hexInt32_3 = 1,
+  hexInt64_1 = 1,
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ConstantExpressionEnum val) {
+  switch(val) {
+  case ConstantExpressionEnum::decInt32_1:
+    return "decInt32_1";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::ConstantExpressionEnum, 10> enum_values<::android::aidl::tests::ConstantExpressionEnum> = {
+  ::android::aidl::tests::ConstantExpressionEnum::decInt32_1,
+  ::android::aidl::tests::ConstantExpressionEnum::decInt32_2,
+  ::android::aidl::tests::ConstantExpressionEnum::decInt64_1,
+  ::android::aidl::tests::ConstantExpressionEnum::decInt64_2,
+  ::android::aidl::tests::ConstantExpressionEnum::decInt64_3,
+  ::android::aidl::tests::ConstantExpressionEnum::decInt64_4,
+  ::android::aidl::tests::ConstantExpressionEnum::hexInt32_1,
+  ::android::aidl::tests::ConstantExpressionEnum::hexInt32_2,
+  ::android::aidl::tests::ConstantExpressionEnum::hexInt32_3,
+  ::android::aidl::tests::ConstantExpressionEnum::hexInt64_1,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedEnum.h
new file mode 100644
index 0000000..886231f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedEnum.h
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <binder/Enums.h>
+#include <cstdint>
+#include <string>
+
+namespace android {
+namespace aidl {
+namespace tests {
+enum class __attribute__((deprecated("test"))) DeprecatedEnum : int32_t {
+  A = 0,
+  B = 1,
+  C = 2,
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+[[nodiscard]] static inline std::string toString(DeprecatedEnum val) {
+  switch(val) {
+  case DeprecatedEnum::A:
+    return "A";
+  case DeprecatedEnum::B:
+    return "B";
+  case DeprecatedEnum::C:
+    return "C";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+#pragma clang diagnostic pop
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+template <>
+constexpr inline std::array<::android::aidl::tests::DeprecatedEnum, 3> enum_values<::android::aidl::tests::DeprecatedEnum> = {
+  ::android::aidl::tests::DeprecatedEnum::A,
+  ::android::aidl::tests::DeprecatedEnum::B,
+  ::android::aidl::tests::DeprecatedEnum::C,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedParcelable.h
new file mode 100644
index 0000000..d7165a7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedParcelable.h
@@ -0,0 +1,52 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class __attribute__((deprecated("test"))) DeprecatedParcelable : public ::android::Parcelable {
+public:
+  inline bool operator!=(const DeprecatedParcelable&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const DeprecatedParcelable&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const DeprecatedParcelable&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const DeprecatedParcelable&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const DeprecatedParcelable&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const DeprecatedParcelable&) const {
+    return std::tie() >= std::tie();
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.DeprecatedParcelable");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "DeprecatedParcelable{";
+    os << "}";
+    return os.str();
+  }
+};  // class DeprecatedParcelable
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/FixedSize.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/FixedSize.h
new file mode 100644
index 0000000..8e93fdd
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/FixedSize.h
@@ -0,0 +1,284 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/FixedSize.h>
+#include <android/aidl/tests/LongEnum.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace tests {
+class FixedSize : public ::android::Parcelable {
+public:
+  class FixedUnion : public ::android::Parcelable {
+  public:
+    enum class Tag : int8_t {
+      booleanValue = 0,
+      byteValue = 1,
+      charValue = 2,
+      intValue = 3,
+      longValue = 4,
+      floatValue = 5,
+      doubleValue = 6,
+      enumValue = 7,
+    };
+    // Expose tag symbols for legacy code
+    static const inline Tag booleanValue = Tag::booleanValue;
+    static const inline Tag byteValue = Tag::byteValue;
+    static const inline Tag charValue = Tag::charValue;
+    static const inline Tag intValue = Tag::intValue;
+    static const inline Tag longValue = Tag::longValue;
+    static const inline Tag floatValue = Tag::floatValue;
+    static const inline Tag doubleValue = Tag::doubleValue;
+    static const inline Tag enumValue = Tag::enumValue;
+
+    template <Tag _Tag>
+    using _at = typename std::tuple_element<static_cast<size_t>(_Tag), std::tuple<bool, int8_t, char16_t, int32_t, int64_t, float, double, ::android::aidl::tests::LongEnum>>::type;
+    template <Tag _Tag, typename _Type>
+    static FixedUnion make(_Type&& _arg) {
+      FixedUnion _inst;
+      _inst.set<_Tag>(std::forward<_Type>(_arg));
+      return _inst;
+    }
+    constexpr Tag getTag() const {
+      return _tag;
+    }
+    template <Tag _Tag>
+    const _at<_Tag>& get() const {
+      if (_Tag != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return *(_at<_Tag>*)(&_value);
+    }
+    template <Tag _Tag>
+    _at<_Tag>& get() {
+      if (_Tag != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return *(_at<_Tag>*)(&_value);
+    }
+    template <Tag _Tag, typename _Type>
+    void set(_Type&& _arg) {
+      _tag = _Tag;
+      get<_Tag>() = std::forward<_Type>(_arg);
+    }
+    static int _cmp(const FixedUnion& _lhs, const FixedUnion& _rhs) {
+      return _cmp_value(_lhs.getTag(), _rhs.getTag()) || _cmp_value_at<enumValue>(_lhs, _rhs);
+    }
+    template <Tag _Tag>
+    static int _cmp_value_at(const FixedUnion& _lhs, const FixedUnion& _rhs) {
+      if constexpr (_Tag == booleanValue) {
+        return _cmp_value(_lhs.get<_Tag>(), _rhs.get<_Tag>());
+      } else {
+        return (_lhs.getTag() == _Tag)
+          ? _cmp_value(_lhs.get<_Tag>(), _rhs.get<_Tag>())
+          : _cmp_value_at<static_cast<Tag>(static_cast<size_t>(_Tag)-1)>(_lhs, _rhs);
+      }
+    }
+    template <typename _Type>
+    static int _cmp_value(const _Type& _lhs, const _Type& _rhs) {
+      return (_lhs == _rhs) ? 0 : (_lhs < _rhs) ? -1 : 1;
+    }
+    inline bool operator!=(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) != 0;
+    }
+    inline bool operator<(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) < 0;
+    }
+    inline bool operator<=(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) <= 0;
+    }
+    inline bool operator==(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) == 0;
+    }
+    inline bool operator>(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) > 0;
+    }
+    inline bool operator>=(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) >= 0;
+    }
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.FixedSize.FixedUnion");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "FixedUnion{";
+      switch (getTag()) {
+      case booleanValue: os << "booleanValue: " << ::android::internal::ToString(get<booleanValue>()); break;
+      case byteValue: os << "byteValue: " << ::android::internal::ToString(get<byteValue>()); break;
+      case charValue: os << "charValue: " << ::android::internal::ToString(get<charValue>()); break;
+      case intValue: os << "intValue: " << ::android::internal::ToString(get<intValue>()); break;
+      case longValue: os << "longValue: " << ::android::internal::ToString(get<longValue>()); break;
+      case floatValue: os << "floatValue: " << ::android::internal::ToString(get<floatValue>()); break;
+      case doubleValue: os << "doubleValue: " << ::android::internal::ToString(get<doubleValue>()); break;
+      case enumValue: os << "enumValue: " << ::android::internal::ToString(get<enumValue>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    Tag _tag = booleanValue;
+    union _value_t {
+      _value_t() {}
+      ~_value_t() {}
+      bool booleanValue __attribute__((aligned (1))) = bool(false);
+      int8_t byteValue __attribute__((aligned (1)));
+      char16_t charValue __attribute__((aligned (2)));
+      int32_t intValue __attribute__((aligned (4)));
+      int64_t longValue __attribute__((aligned (8)));
+      float floatValue __attribute__((aligned (4)));
+      double doubleValue __attribute__((aligned (8)));
+      ::android::aidl::tests::LongEnum enumValue __attribute__((aligned (8)));
+    } _value;
+  };  // class FixedUnion
+  class FixedParcelable : public ::android::Parcelable {
+  public:
+    bool booleanValue = false;
+    int8_t byteValue = 0;
+    char16_t charValue = '\0';
+    int32_t intValue = 0;
+    int64_t longValue = 0L;
+    float floatValue = 0.000000f;
+    double doubleValue = 0.000000;
+    ::android::aidl::tests::LongEnum enumValue = ::android::aidl::tests::LongEnum::FOO;
+    ::android::aidl::tests::FixedSize::FixedUnion parcelableValue;
+    inline bool operator!=(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) != std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator<(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) < std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator<=(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) <= std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator==(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) == std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator>(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) > std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator>=(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) >= std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.FixedSize.FixedParcelable");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "FixedParcelable{";
+      os << "booleanValue: " << ::android::internal::ToString(booleanValue);
+      os << ", byteValue: " << ::android::internal::ToString(byteValue);
+      os << ", charValue: " << ::android::internal::ToString(charValue);
+      os << ", intValue: " << ::android::internal::ToString(intValue);
+      os << ", longValue: " << ::android::internal::ToString(longValue);
+      os << ", floatValue: " << ::android::internal::ToString(floatValue);
+      os << ", doubleValue: " << ::android::internal::ToString(doubleValue);
+      os << ", enumValue: " << ::android::internal::ToString(enumValue);
+      os << ", parcelableValue: " << ::android::internal::ToString(parcelableValue);
+      os << "}";
+      return os.str();
+    }
+  };  // class FixedParcelable
+  inline bool operator!=(const FixedSize&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const FixedSize&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const FixedSize&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const FixedSize&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const FixedSize&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const FixedSize&) const {
+    return std::tie() >= std::tie();
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.FixedSize");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "FixedSize{";
+    os << "}";
+    return os.str();
+  }
+};  // class FixedSize
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(FixedSize::FixedUnion::Tag val) {
+  switch(val) {
+  case FixedSize::FixedUnion::Tag::booleanValue:
+    return "booleanValue";
+  case FixedSize::FixedUnion::Tag::byteValue:
+    return "byteValue";
+  case FixedSize::FixedUnion::Tag::charValue:
+    return "charValue";
+  case FixedSize::FixedUnion::Tag::intValue:
+    return "intValue";
+  case FixedSize::FixedUnion::Tag::longValue:
+    return "longValue";
+  case FixedSize::FixedUnion::Tag::floatValue:
+    return "floatValue";
+  case FixedSize::FixedUnion::Tag::doubleValue:
+    return "doubleValue";
+  case FixedSize::FixedUnion::Tag::enumValue:
+    return "enumValue";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::FixedSize::FixedUnion::Tag, 8> enum_values<::android::aidl::tests::FixedSize::FixedUnion::Tag> = {
+  ::android::aidl::tests::FixedSize::FixedUnion::Tag::booleanValue,
+  ::android::aidl::tests::FixedSize::FixedUnion::Tag::byteValue,
+  ::android::aidl::tests::FixedSize::FixedUnion::Tag::charValue,
+  ::android::aidl::tests::FixedSize::FixedUnion::Tag::intValue,
+  ::android::aidl::tests::FixedSize::FixedUnion::Tag::longValue,
+  ::android::aidl::tests::FixedSize::FixedUnion::Tag::floatValue,
+  ::android::aidl::tests::FixedSize::FixedUnion::Tag::doubleValue,
+  ::android::aidl::tests::FixedSize::FixedUnion::Tag::enumValue,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/GenericStructuredParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/GenericStructuredParcelable.h
new file mode 100644
index 0000000..a7d0afd
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/GenericStructuredParcelable.h
@@ -0,0 +1,116 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+template <typename T, typename U, typename B>
+class GenericStructuredParcelable : public ::android::Parcelable {
+public:
+  int32_t a = 0;
+  int32_t b = 0;
+  inline bool operator!=(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<=(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator==(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>=(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.GenericStructuredParcelable");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "GenericStructuredParcelable{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << "}";
+    return os.str();
+  }
+};  // class GenericStructuredParcelable
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/GenericStructuredParcelable.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+template <typename T, typename U, typename B>
+::android::status_t GenericStructuredParcelable<T,U,B>::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+template <typename T, typename U, typename B>
+::android::status_t GenericStructuredParcelable<T,U,B>::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ICircular.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ICircular.h
new file mode 100644
index 0000000..2260451
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ICircular.h
@@ -0,0 +1,41 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/ITestService.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <optional>
+#include <utils/StrongPointer.h>
+
+namespace android::aidl::tests {
+class ITestService;
+}  // namespace android::aidl::tests
+namespace android {
+namespace aidl {
+namespace tests {
+class ICircularDelegator;
+
+class ICircular : public ::android::IInterface {
+public:
+  typedef ICircularDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(Circular)
+  virtual ::android::binder::Status GetTestService(::android::sp<::android::aidl::tests::ITestService>* _aidl_return) = 0;
+};  // class ICircular
+
+class ICircularDefault : public ICircular {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status GetTestService(::android::sp<::android::aidl::tests::ITestService>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+};  // class ICircularDefault
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IDeprecated.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IDeprecated.h
new file mode 100644
index 0000000..8ea891d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IDeprecated.h
@@ -0,0 +1,32 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <utils/StrongPointer.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class IDeprecatedDelegator;
+
+class __attribute__((deprecated("test"))) IDeprecated : public ::android::IInterface {
+public:
+  typedef IDeprecatedDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(Deprecated)
+};  // class IDeprecated
+
+class __attribute__((deprecated("test"))) IDeprecatedDefault : public IDeprecated {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+};  // class IDeprecatedDefault
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/INamedCallback.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/INamedCallback.h
new file mode 100644
index 0000000..ad9110f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/INamedCallback.h
@@ -0,0 +1,37 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class INamedCallbackDelegator;
+
+class INamedCallback : public ::android::IInterface {
+public:
+  typedef INamedCallbackDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(NamedCallback)
+  virtual ::android::binder::Status GetName(::android::String16* _aidl_return) = 0;
+};  // class INamedCallback
+
+class INamedCallbackDefault : public INamedCallback {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status GetName(::android::String16* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+};  // class INamedCallbackDefault
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/INewName.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/INewName.h
new file mode 100644
index 0000000..b2b0d5f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/INewName.h
@@ -0,0 +1,37 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class INewNameDelegator;
+
+class INewName : public ::android::IInterface {
+public:
+  typedef INewNameDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(NewName)
+  virtual ::android::binder::Status RealName(::android::String16* _aidl_return) = 0;
+};  // class INewName
+
+class INewNameDefault : public INewName {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status RealName(::android::String16* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+};  // class INewNameDefault
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IOldName.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IOldName.h
new file mode 100644
index 0000000..d4c4e82
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IOldName.h
@@ -0,0 +1,37 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class IOldNameDelegator;
+
+class IOldName : public ::android::IInterface {
+public:
+  typedef IOldNameDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(OldName)
+  virtual ::android::binder::Status RealName(::android::String16* _aidl_return) = 0;
+};  // class IOldName
+
+class IOldNameDefault : public IOldName {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status RealName(::android::String16* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+};  // class IOldNameDefault
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ITestService.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ITestService.h
new file mode 100644
index 0000000..3ab273d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ITestService.h
@@ -0,0 +1,855 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/BackendType.h>
+#include <android/aidl/tests/ByteEnum.h>
+#include <android/aidl/tests/CircularParcelable.h>
+#include <android/aidl/tests/ICircular.h>
+#include <android/aidl/tests/INamedCallback.h>
+#include <android/aidl/tests/INewName.h>
+#include <android/aidl/tests/IOldName.h>
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/IntEnum.h>
+#include <android/aidl/tests/LongEnum.h>
+#include <android/aidl/tests/RecursiveList.h>
+#include <android/aidl/tests/StructuredParcelable.h>
+#include <android/aidl/tests/Union.h>
+#include <android/aidl/tests/extension/ExtendableParcelable.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Delegate.h>
+#include <binder/Enums.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Parcel.h>
+#include <binder/ParcelFileDescriptor.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cassert>
+#include <cstdint>
+#include <optional>
+#include <string>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <variant>
+#include <vector>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android::aidl::tests {
+class CircularParcelable;
+class ICircular;
+class INamedCallback;
+class INewName;
+class IOldName;
+class RecursiveList;
+class StructuredParcelable;
+}  // namespace android::aidl::tests
+namespace android::aidl::tests::extension {
+class ExtendableParcelable;
+}  // namespace android::aidl::tests::extension
+namespace android {
+namespace aidl {
+namespace tests {
+class ITestServiceDelegator;
+
+class ITestService : public ::android::IInterface {
+public:
+  typedef ITestServiceDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(TestService)
+  class Empty : public ::android::Parcelable {
+  public:
+    inline bool operator!=(const Empty&) const {
+      return std::tie() != std::tie();
+    }
+    inline bool operator<(const Empty&) const {
+      return std::tie() < std::tie();
+    }
+    inline bool operator<=(const Empty&) const {
+      return std::tie() <= std::tie();
+    }
+    inline bool operator==(const Empty&) const {
+      return std::tie() == std::tie();
+    }
+    inline bool operator>(const Empty&) const {
+      return std::tie() > std::tie();
+    }
+    inline bool operator>=(const Empty&) const {
+      return std::tie() >= std::tie();
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ITestService.Empty");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "Empty{";
+      os << "}";
+      return os.str();
+    }
+  };  // class Empty
+  class CompilerChecks : public ::android::Parcelable {
+  public:
+    class IFooDelegator;
+
+    class IFoo : public ::android::IInterface {
+    public:
+      typedef IFooDelegator DefaultDelegator;
+      DECLARE_META_INTERFACE(Foo)
+    };  // class IFoo
+
+    class IFooDefault : public IFoo {
+    public:
+      ::android::IBinder* onAsBinder() override {
+        return nullptr;
+      }
+    };  // class IFooDefault
+    class BpFoo : public ::android::BpInterface<IFoo> {
+    public:
+      explicit BpFoo(const ::android::sp<::android::IBinder>& _aidl_impl);
+      virtual ~BpFoo() = default;
+    };  // class BpFoo
+    class BnFoo : public ::android::BnInterface<IFoo> {
+    public:
+      explicit BnFoo();
+      ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+    };  // class BnFoo
+
+    class IFooDelegator : public BnFoo {
+    public:
+      explicit IFooDelegator(const ::android::sp<IFoo> &impl) : _aidl_delegate(impl) {}
+
+      ::android::sp<IFoo> getImpl() { return _aidl_delegate; }
+    private:
+      ::android::sp<IFoo> _aidl_delegate;
+    };  // class IFooDelegator
+    #pragma clang diagnostic push
+    #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+    class HasDeprecated : public ::android::Parcelable {
+    public:
+      int32_t __attribute__((deprecated("field"))) deprecated = 0;
+      inline bool operator!=(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) != std::tie(rhs.deprecated);
+      }
+      inline bool operator<(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) < std::tie(rhs.deprecated);
+      }
+      inline bool operator<=(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) <= std::tie(rhs.deprecated);
+      }
+      inline bool operator==(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) == std::tie(rhs.deprecated);
+      }
+      inline bool operator>(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) > std::tie(rhs.deprecated);
+      }
+      inline bool operator>=(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) >= std::tie(rhs.deprecated);
+      }
+
+      ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+      ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+      static const ::android::String16& getParcelableDescriptor() {
+        static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ITestService.CompilerChecks.HasDeprecated");
+        return DESCRIPTOR;
+      }
+      inline std::string toString() const {
+        std::ostringstream os;
+        os << "HasDeprecated{";
+        os << "deprecated: " << ::android::internal::ToString(deprecated);
+        os << "}";
+        return os.str();
+      }
+    };  // class HasDeprecated
+    #pragma clang diagnostic pop
+    class UsingHasDeprecated : public ::android::Parcelable {
+    public:
+      enum class Tag : int32_t {
+        n = 0,
+        m = 1,
+      };
+      // Expose tag symbols for legacy code
+      static const inline Tag n = Tag::n;
+      static const inline Tag m = Tag::m;
+
+      template<typename _Tp>
+      static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, UsingHasDeprecated>;
+
+      UsingHasDeprecated() : _value(std::in_place_index<static_cast<size_t>(n)>, int32_t(0)) { }
+
+      template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+      // NOLINTNEXTLINE(google-explicit-constructor)
+      constexpr UsingHasDeprecated(_Tp&& _arg)
+          : _value(std::forward<_Tp>(_arg)) {}
+
+      template <size_t _Np, typename... _Tp>
+      constexpr explicit UsingHasDeprecated(std::in_place_index_t<_Np>, _Tp&&... _args)
+          : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+      template <Tag _tag, typename... _Tp>
+      static UsingHasDeprecated make(_Tp&&... _args) {
+        return UsingHasDeprecated(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+      }
+
+      template <Tag _tag, typename _Tp, typename... _Up>
+      static UsingHasDeprecated make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+        return UsingHasDeprecated(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+      }
+
+      Tag getTag() const {
+        return static_cast<Tag>(_value.index());
+      }
+
+      template <Tag _tag>
+      const auto& get() const {
+        if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+        return std::get<static_cast<size_t>(_tag)>(_value);
+      }
+
+      template <Tag _tag>
+      auto& get() {
+        if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+        return std::get<static_cast<size_t>(_tag)>(_value);
+      }
+
+      template <Tag _tag, typename... _Tp>
+      void set(_Tp&&... _args) {
+        _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+      }
+
+      inline bool operator!=(const UsingHasDeprecated& rhs) const {
+        return _value != rhs._value;
+      }
+      inline bool operator<(const UsingHasDeprecated& rhs) const {
+        return _value < rhs._value;
+      }
+      inline bool operator<=(const UsingHasDeprecated& rhs) const {
+        return _value <= rhs._value;
+      }
+      inline bool operator==(const UsingHasDeprecated& rhs) const {
+        return _value == rhs._value;
+      }
+      inline bool operator>(const UsingHasDeprecated& rhs) const {
+        return _value > rhs._value;
+      }
+      inline bool operator>=(const UsingHasDeprecated& rhs) const {
+        return _value >= rhs._value;
+      }
+
+      ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+      ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+      static const ::android::String16& getParcelableDescriptor() {
+        static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ITestService.CompilerChecks.UsingHasDeprecated");
+        return DESCRIPTOR;
+      }
+      inline std::string toString() const {
+        std::ostringstream os;
+        os << "UsingHasDeprecated{";
+        switch (getTag()) {
+        case n: os << "n: " << ::android::internal::ToString(get<n>()); break;
+        case m: os << "m: " << ::android::internal::ToString(get<m>()); break;
+        }
+        os << "}";
+        return os.str();
+      }
+    private:
+      std::variant<int32_t, ::android::aidl::tests::ITestService::CompilerChecks::HasDeprecated> _value;
+    };  // class UsingHasDeprecated
+    class INoPrefixInterfaceDelegator;
+
+    class INoPrefixInterface : public ::android::IInterface {
+    public:
+      typedef INoPrefixInterfaceDelegator DefaultDelegator;
+      DECLARE_META_INTERFACE(NoPrefixInterface)
+      class Nested : public ::android::Parcelable {
+      public:
+        inline bool operator!=(const Nested&) const {
+          return std::tie() != std::tie();
+        }
+        inline bool operator<(const Nested&) const {
+          return std::tie() < std::tie();
+        }
+        inline bool operator<=(const Nested&) const {
+          return std::tie() <= std::tie();
+        }
+        inline bool operator==(const Nested&) const {
+          return std::tie() == std::tie();
+        }
+        inline bool operator>(const Nested&) const {
+          return std::tie() > std::tie();
+        }
+        inline bool operator>=(const Nested&) const {
+          return std::tie() >= std::tie();
+        }
+
+        ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+        ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+        static const ::android::String16& getParcelableDescriptor() {
+          static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.Nested");
+          return DESCRIPTOR;
+        }
+        inline std::string toString() const {
+          std::ostringstream os;
+          os << "Nested{";
+          os << "}";
+          return os.str();
+        }
+      };  // class Nested
+      class INestedNoPrefixInterfaceDelegator;
+
+      class INestedNoPrefixInterface : public ::android::IInterface {
+      public:
+        typedef INestedNoPrefixInterfaceDelegator DefaultDelegator;
+        DECLARE_META_INTERFACE(NestedNoPrefixInterface)
+        virtual ::android::binder::Status foo() = 0;
+      };  // class INestedNoPrefixInterface
+
+      class INestedNoPrefixInterfaceDefault : public INestedNoPrefixInterface {
+      public:
+        ::android::IBinder* onAsBinder() override {
+          return nullptr;
+        }
+        ::android::binder::Status foo() override {
+          return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+        }
+      };  // class INestedNoPrefixInterfaceDefault
+      class BpNestedNoPrefixInterface : public ::android::BpInterface<INestedNoPrefixInterface> {
+      public:
+        explicit BpNestedNoPrefixInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+        virtual ~BpNestedNoPrefixInterface() = default;
+        ::android::binder::Status foo() override;
+      };  // class BpNestedNoPrefixInterface
+      class BnNestedNoPrefixInterface : public ::android::BnInterface<INestedNoPrefixInterface> {
+      public:
+        static constexpr uint32_t TRANSACTION_foo = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+        explicit BnNestedNoPrefixInterface();
+        ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+      };  // class BnNestedNoPrefixInterface
+
+      class INestedNoPrefixInterfaceDelegator : public BnNestedNoPrefixInterface {
+      public:
+        explicit INestedNoPrefixInterfaceDelegator(const ::android::sp<INestedNoPrefixInterface> &impl) : _aidl_delegate(impl) {}
+
+        ::android::sp<INestedNoPrefixInterface> getImpl() { return _aidl_delegate; }
+        ::android::binder::Status foo() override {
+          return _aidl_delegate->foo();
+        }
+      private:
+        ::android::sp<INestedNoPrefixInterface> _aidl_delegate;
+      };  // class INestedNoPrefixInterfaceDelegator
+      virtual ::android::binder::Status foo() = 0;
+    };  // class INoPrefixInterface
+
+    class INoPrefixInterfaceDefault : public INoPrefixInterface {
+    public:
+      ::android::IBinder* onAsBinder() override {
+        return nullptr;
+      }
+      ::android::binder::Status foo() override {
+        return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+      }
+    };  // class INoPrefixInterfaceDefault
+    class BpNoPrefixInterface : public ::android::BpInterface<INoPrefixInterface> {
+    public:
+      explicit BpNoPrefixInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+      virtual ~BpNoPrefixInterface() = default;
+      ::android::binder::Status foo() override;
+    };  // class BpNoPrefixInterface
+    class BnNoPrefixInterface : public ::android::BnInterface<INoPrefixInterface> {
+    public:
+      static constexpr uint32_t TRANSACTION_foo = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+      explicit BnNoPrefixInterface();
+      ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+    };  // class BnNoPrefixInterface
+
+    class INoPrefixInterfaceDelegator : public BnNoPrefixInterface {
+    public:
+      explicit INoPrefixInterfaceDelegator(const ::android::sp<INoPrefixInterface> &impl) : _aidl_delegate(impl) {}
+
+      ::android::sp<INoPrefixInterface> getImpl() { return _aidl_delegate; }
+      ::android::binder::Status foo() override {
+        return _aidl_delegate->foo();
+      }
+    private:
+      ::android::sp<INoPrefixInterface> _aidl_delegate;
+    };  // class INoPrefixInterfaceDelegator
+    ::android::sp<::android::IBinder> binder;
+    ::android::sp<::android::IBinder> nullable_binder;
+    ::std::vector<::android::sp<::android::IBinder>> binder_array;
+    ::std::optional<::std::vector<::android::sp<::android::IBinder>>> nullable_binder_array;
+    ::std::vector<::android::sp<::android::IBinder>> binder_list;
+    ::std::optional<::std::vector<::android::sp<::android::IBinder>>> nullable_binder_list;
+    ::android::os::ParcelFileDescriptor pfd;
+    ::std::optional<::android::os::ParcelFileDescriptor> nullable_pfd;
+    ::std::vector<::android::os::ParcelFileDescriptor> pfd_array;
+    ::std::optional<::std::vector<::std::optional<::android::os::ParcelFileDescriptor>>> nullable_pfd_array;
+    ::std::vector<::android::os::ParcelFileDescriptor> pfd_list;
+    ::std::optional<::std::vector<::std::optional<::android::os::ParcelFileDescriptor>>> nullable_pfd_list;
+    ::android::aidl::tests::ITestService::Empty parcel;
+    ::std::optional<::android::aidl::tests::ITestService::Empty> nullable_parcel;
+    ::std::vector<::android::aidl::tests::ITestService::Empty> parcel_array;
+    ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> nullable_parcel_array;
+    ::std::vector<::android::aidl::tests::ITestService::Empty> parcel_list;
+    ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> nullable_parcel_list;
+    inline bool operator!=(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) != std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator<(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) < std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator<=(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) <= std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator==(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) == std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator>(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) > std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator>=(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) >= std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ITestService.CompilerChecks");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "CompilerChecks{";
+      os << "binder: " << ::android::internal::ToString(binder);
+      os << ", nullable_binder: " << ::android::internal::ToString(nullable_binder);
+      os << ", binder_array: " << ::android::internal::ToString(binder_array);
+      os << ", nullable_binder_array: " << ::android::internal::ToString(nullable_binder_array);
+      os << ", binder_list: " << ::android::internal::ToString(binder_list);
+      os << ", nullable_binder_list: " << ::android::internal::ToString(nullable_binder_list);
+      os << ", pfd: " << ::android::internal::ToString(pfd);
+      os << ", nullable_pfd: " << ::android::internal::ToString(nullable_pfd);
+      os << ", pfd_array: " << ::android::internal::ToString(pfd_array);
+      os << ", nullable_pfd_array: " << ::android::internal::ToString(nullable_pfd_array);
+      os << ", pfd_list: " << ::android::internal::ToString(pfd_list);
+      os << ", nullable_pfd_list: " << ::android::internal::ToString(nullable_pfd_list);
+      os << ", parcel: " << ::android::internal::ToString(parcel);
+      os << ", nullable_parcel: " << ::android::internal::ToString(nullable_parcel);
+      os << ", parcel_array: " << ::android::internal::ToString(parcel_array);
+      os << ", nullable_parcel_array: " << ::android::internal::ToString(nullable_parcel_array);
+      os << ", parcel_list: " << ::android::internal::ToString(parcel_list);
+      os << ", nullable_parcel_list: " << ::android::internal::ToString(nullable_parcel_list);
+      os << "}";
+      return os.str();
+    }
+  };  // class CompilerChecks
+  enum : int32_t { CONSTANT = 42 };
+  enum : int32_t { CONSTANT2 = -42 };
+  enum : int32_t { CONSTANT3 = 42 };
+  enum : int32_t { CONSTANT4 = 4 };
+  enum : int32_t { CONSTANT5 = -4 };
+  enum : int32_t { CONSTANT6 = 0 };
+  enum : int32_t { CONSTANT7 = 0 };
+  enum : int32_t { CONSTANT8 = 0 };
+  enum : int32_t { CONSTANT9 = 86 };
+  enum : int32_t { CONSTANT10 = 165 };
+  enum : int32_t { CONSTANT11 = 250 };
+  enum : int32_t { CONSTANT12 = -1 };
+  enum : int8_t { BYTE_CONSTANT = 17 };
+  enum : int64_t { LONG_CONSTANT = 1099511627776L };
+  static const ::android::String16& STRING_CONSTANT();
+  static const ::android::String16& STRING_CONSTANT2();
+  static constexpr float FLOAT_CONSTANT = 1.000000f;
+  static constexpr float FLOAT_CONSTANT2 = -1.000000f;
+  static constexpr float FLOAT_CONSTANT3 = 1.000000f;
+  static constexpr float FLOAT_CONSTANT4 = 2.200000f;
+  static constexpr float FLOAT_CONSTANT5 = -2.200000f;
+  static constexpr float FLOAT_CONSTANT6 = -0.000000f;
+  static constexpr float FLOAT_CONSTANT7 = 0.000000f;
+  static constexpr double DOUBLE_CONSTANT = 1.000000;
+  static constexpr double DOUBLE_CONSTANT2 = -1.000000;
+  static constexpr double DOUBLE_CONSTANT3 = 1.000000;
+  static constexpr double DOUBLE_CONSTANT4 = 2.200000;
+  static constexpr double DOUBLE_CONSTANT5 = -2.200000;
+  static constexpr double DOUBLE_CONSTANT6 = -0.000000;
+  static constexpr double DOUBLE_CONSTANT7 = 0.000000;
+  static constexpr double DOUBLE_CONSTANT8 = 1.100000;
+  static constexpr double DOUBLE_CONSTANT9 = -1.100000;
+  static const ::std::string& STRING_CONSTANT_UTF8();
+  enum : int32_t { A1 = 1 };
+  enum : int32_t { A2 = 1 };
+  enum : int32_t { A3 = 1 };
+  enum : int32_t { A4 = 1 };
+  enum : int32_t { A5 = 1 };
+  enum : int32_t { A6 = 1 };
+  enum : int32_t { A7 = 1 };
+  enum : int32_t { A8 = 1 };
+  enum : int32_t { A9 = 1 };
+  enum : int32_t { A10 = 1 };
+  enum : int32_t { A11 = 1 };
+  enum : int32_t { A12 = 1 };
+  enum : int32_t { A13 = 1 };
+  enum : int32_t { A14 = 1 };
+  enum : int32_t { A15 = 1 };
+  enum : int32_t { A16 = 1 };
+  enum : int32_t { A17 = 1 };
+  enum : int32_t { A18 = 1 };
+  enum : int32_t { A19 = 1 };
+  enum : int32_t { A20 = 1 };
+  enum : int32_t { A21 = 1 };
+  enum : int32_t { A22 = 1 };
+  enum : int32_t { A23 = 1 };
+  enum : int32_t { A24 = 1 };
+  enum : int32_t { A25 = 1 };
+  enum : int32_t { A26 = 1 };
+  enum : int32_t { A27 = 1 };
+  enum : int32_t { A28 = 1 };
+  enum : int32_t { A29 = 1 };
+  enum : int32_t { A30 = 1 };
+  enum : int32_t { A31 = 1 };
+  enum : int32_t { A32 = 1 };
+  enum : int32_t { A33 = 1 };
+  enum : int32_t { A34 = 1 };
+  enum : int32_t { A35 = 1 };
+  enum : int32_t { A36 = 1 };
+  enum : int32_t { A37 = 1 };
+  enum : int32_t { A38 = 1 };
+  enum : int32_t { A39 = 1 };
+  enum : int32_t { A40 = 1 };
+  enum : int32_t { A41 = 1 };
+  enum : int32_t { A42 = 1 };
+  enum : int32_t { A43 = 1 };
+  enum : int32_t { A44 = 1 };
+  enum : int32_t { A45 = 1 };
+  enum : int32_t { A46 = 1 };
+  enum : int32_t { A47 = 1 };
+  enum : int32_t { A48 = 1 };
+  enum : int32_t { A49 = 1 };
+  enum : int32_t { A50 = 1 };
+  enum : int32_t { A51 = 1 };
+  enum : int32_t { A52 = 1 };
+  enum : int32_t { A53 = 1 };
+  enum : int32_t { A54 = 1 };
+  enum : int32_t { A55 = 1 };
+  enum : int32_t { A56 = 1 };
+  enum : int32_t { A57 = 1 };
+  virtual ::android::binder::Status UnimplementedMethod(int32_t arg, int32_t* _aidl_return) = 0;
+  virtual ::android::binder::Status Deprecated() __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"))) = 0;
+  virtual ::android::binder::Status TestOneway() = 0;
+  virtual ::android::binder::Status RepeatBoolean(bool token, bool* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatByte(int8_t token, int8_t* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatChar(char16_t token, char16_t* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatInt(int32_t token, int32_t* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatLong(int64_t token, int64_t* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatFloat(float token, float* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatDouble(double token, double* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatString(const ::android::String16& token, ::android::String16* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatByteEnum(::android::aidl::tests::ByteEnum token, ::android::aidl::tests::ByteEnum* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatIntEnum(::android::aidl::tests::IntEnum token, ::android::aidl::tests::IntEnum* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatLongEnum(::android::aidl::tests::LongEnum token, ::android::aidl::tests::LongEnum* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseBoolean(const ::std::vector<bool>& input, ::std::vector<bool>* repeated, ::std::vector<bool>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseByte(const ::std::vector<uint8_t>& input, ::std::vector<uint8_t>* repeated, ::std::vector<uint8_t>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseChar(const ::std::vector<char16_t>& input, ::std::vector<char16_t>* repeated, ::std::vector<char16_t>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseInt(const ::std::vector<int32_t>& input, ::std::vector<int32_t>* repeated, ::std::vector<int32_t>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseLong(const ::std::vector<int64_t>& input, ::std::vector<int64_t>* repeated, ::std::vector<int64_t>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseFloat(const ::std::vector<float>& input, ::std::vector<float>* repeated, ::std::vector<float>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseDouble(const ::std::vector<double>& input, ::std::vector<double>* repeated, ::std::vector<double>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseString(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* repeated, ::std::vector<::android::String16>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseByteEnum(const ::std::vector<::android::aidl::tests::ByteEnum>& input, ::std::vector<::android::aidl::tests::ByteEnum>* repeated, ::std::vector<::android::aidl::tests::ByteEnum>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseIntEnum(const ::std::vector<::android::aidl::tests::IntEnum>& input, ::std::vector<::android::aidl::tests::IntEnum>* repeated, ::std::vector<::android::aidl::tests::IntEnum>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseLongEnum(const ::std::vector<::android::aidl::tests::LongEnum>& input, ::std::vector<::android::aidl::tests::LongEnum>* repeated, ::std::vector<::android::aidl::tests::LongEnum>* _aidl_return) = 0;
+  virtual ::android::binder::Status GetOtherTestService(const ::android::String16& name, ::android::sp<::android::aidl::tests::INamedCallback>* _aidl_return) = 0;
+  virtual ::android::binder::Status SetOtherTestService(const ::android::String16& name, const ::android::sp<::android::aidl::tests::INamedCallback>& service, bool* _aidl_return) = 0;
+  virtual ::android::binder::Status VerifyName(const ::android::sp<::android::aidl::tests::INamedCallback>& service, const ::android::String16& name, bool* _aidl_return) = 0;
+  virtual ::android::binder::Status GetInterfaceArray(const ::std::vector<::android::String16>& names, ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>* _aidl_return) = 0;
+  virtual ::android::binder::Status VerifyNamesWithInterfaceArray(const ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>& services, const ::std::vector<::android::String16>& names, bool* _aidl_return) = 0;
+  virtual ::android::binder::Status GetNullableInterfaceArray(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* _aidl_return) = 0;
+  virtual ::android::binder::Status VerifyNamesWithNullableInterfaceArray(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& services, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, bool* _aidl_return) = 0;
+  virtual ::android::binder::Status GetInterfaceList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* _aidl_return) = 0;
+  virtual ::android::binder::Status VerifyNamesWithInterfaceList(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& services, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, bool* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseStringList(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* repeated, ::std::vector<::android::String16>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatParcelFileDescriptor(const ::android::os::ParcelFileDescriptor& read, ::android::os::ParcelFileDescriptor* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseParcelFileDescriptorArray(const ::std::vector<::android::os::ParcelFileDescriptor>& input, ::std::vector<::android::os::ParcelFileDescriptor>* repeated, ::std::vector<::android::os::ParcelFileDescriptor>* _aidl_return) = 0;
+  virtual ::android::binder::Status ThrowServiceException(int32_t code) = 0;
+  virtual ::android::binder::Status RepeatNullableIntArray(const ::std::optional<::std::vector<int32_t>>& input, ::std::optional<::std::vector<int32_t>>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableByteEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableIntEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableLongEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableString(const ::std::optional<::android::String16>& input, ::std::optional<::android::String16>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableStringList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& input, ::std::optional<::std::vector<::std::optional<::android::String16>>>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableParcelable(const ::std::optional<::android::aidl::tests::ITestService::Empty>& input, ::std::optional<::android::aidl::tests::ITestService::Empty>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableParcelableArray(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& input, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableParcelableList(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& input, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* _aidl_return) = 0;
+  virtual ::android::binder::Status TakesAnIBinder(const ::android::sp<::android::IBinder>& input) = 0;
+  virtual ::android::binder::Status TakesANullableIBinder(const ::android::sp<::android::IBinder>& input) = 0;
+  virtual ::android::binder::Status TakesAnIBinderList(const ::std::vector<::android::sp<::android::IBinder>>& input) = 0;
+  virtual ::android::binder::Status TakesANullableIBinderList(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& input) = 0;
+  virtual ::android::binder::Status RepeatUtf8CppString(const ::std::string& token, ::std::string* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableUtf8CppString(const ::std::optional<::std::string>& token, ::std::optional<::std::string>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseUtf8CppString(const ::std::vector<::std::string>& input, ::std::vector<::std::string>* repeated, ::std::vector<::std::string>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseNullableUtf8CppString(const ::std::optional<::std::vector<::std::optional<::std::string>>>& input, ::std::optional<::std::vector<::std::optional<::std::string>>>* repeated, ::std::optional<::std::vector<::std::optional<::std::string>>>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseUtf8CppStringList(const ::std::optional<::std::vector<::std::optional<::std::string>>>& input, ::std::optional<::std::vector<::std::optional<::std::string>>>* repeated, ::std::optional<::std::vector<::std::optional<::std::string>>>* _aidl_return) = 0;
+  virtual ::android::binder::Status GetCallback(bool return_null, ::android::sp<::android::aidl::tests::INamedCallback>* _aidl_return) = 0;
+  virtual ::android::binder::Status FillOutStructuredParcelable(::android::aidl::tests::StructuredParcelable* parcel) = 0;
+  virtual ::android::binder::Status RepeatExtendableParcelable(const ::android::aidl::tests::extension::ExtendableParcelable& ep, ::android::aidl::tests::extension::ExtendableParcelable* ep2) = 0;
+  virtual ::android::binder::Status ReverseList(const ::android::aidl::tests::RecursiveList& list, ::android::aidl::tests::RecursiveList* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseIBinderArray(const ::std::vector<::android::sp<::android::IBinder>>& input, ::std::vector<::android::sp<::android::IBinder>>* repeated, ::std::vector<::android::sp<::android::IBinder>>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseNullableIBinderArray(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& input, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* repeated, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* _aidl_return) = 0;
+  virtual ::android::binder::Status GetOldNameInterface(::android::sp<::android::aidl::tests::IOldName>* _aidl_return) = 0;
+  virtual ::android::binder::Status GetNewNameInterface(::android::sp<::android::aidl::tests::INewName>* _aidl_return) = 0;
+  virtual ::android::binder::Status GetUnionTags(const ::std::vector<::android::aidl::tests::Union>& input, ::std::vector<::android::aidl::tests::Union::Tag>* _aidl_return) = 0;
+  virtual ::android::binder::Status GetCppJavaTests(::android::sp<::android::IBinder>* _aidl_return) = 0;
+  virtual ::android::binder::Status getBackendType(::android::aidl::tests::BackendType* _aidl_return) = 0;
+  virtual ::android::binder::Status GetCircular(::android::aidl::tests::CircularParcelable* cp, ::android::sp<::android::aidl::tests::ICircular>* _aidl_return) = 0;
+};  // class ITestService
+
+class ITestServiceDefault : public ITestService {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status UnimplementedMethod(int32_t /*arg*/, int32_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status Deprecated() override __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"))) {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status TestOneway() override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatBoolean(bool /*token*/, bool* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatByte(int8_t /*token*/, int8_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatChar(char16_t /*token*/, char16_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatInt(int32_t /*token*/, int32_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatLong(int64_t /*token*/, int64_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatFloat(float /*token*/, float* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatDouble(double /*token*/, double* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatString(const ::android::String16& /*token*/, ::android::String16* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatByteEnum(::android::aidl::tests::ByteEnum /*token*/, ::android::aidl::tests::ByteEnum* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatIntEnum(::android::aidl::tests::IntEnum /*token*/, ::android::aidl::tests::IntEnum* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatLongEnum(::android::aidl::tests::LongEnum /*token*/, ::android::aidl::tests::LongEnum* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseBoolean(const ::std::vector<bool>& /*input*/, ::std::vector<bool>* /*repeated*/, ::std::vector<bool>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseByte(const ::std::vector<uint8_t>& /*input*/, ::std::vector<uint8_t>* /*repeated*/, ::std::vector<uint8_t>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseChar(const ::std::vector<char16_t>& /*input*/, ::std::vector<char16_t>* /*repeated*/, ::std::vector<char16_t>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseInt(const ::std::vector<int32_t>& /*input*/, ::std::vector<int32_t>* /*repeated*/, ::std::vector<int32_t>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseLong(const ::std::vector<int64_t>& /*input*/, ::std::vector<int64_t>* /*repeated*/, ::std::vector<int64_t>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseFloat(const ::std::vector<float>& /*input*/, ::std::vector<float>* /*repeated*/, ::std::vector<float>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseDouble(const ::std::vector<double>& /*input*/, ::std::vector<double>* /*repeated*/, ::std::vector<double>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseString(const ::std::vector<::android::String16>& /*input*/, ::std::vector<::android::String16>* /*repeated*/, ::std::vector<::android::String16>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseByteEnum(const ::std::vector<::android::aidl::tests::ByteEnum>& /*input*/, ::std::vector<::android::aidl::tests::ByteEnum>* /*repeated*/, ::std::vector<::android::aidl::tests::ByteEnum>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseIntEnum(const ::std::vector<::android::aidl::tests::IntEnum>& /*input*/, ::std::vector<::android::aidl::tests::IntEnum>* /*repeated*/, ::std::vector<::android::aidl::tests::IntEnum>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseLongEnum(const ::std::vector<::android::aidl::tests::LongEnum>& /*input*/, ::std::vector<::android::aidl::tests::LongEnum>* /*repeated*/, ::std::vector<::android::aidl::tests::LongEnum>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetOtherTestService(const ::android::String16& /*name*/, ::android::sp<::android::aidl::tests::INamedCallback>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status SetOtherTestService(const ::android::String16& /*name*/, const ::android::sp<::android::aidl::tests::INamedCallback>& /*service*/, bool* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status VerifyName(const ::android::sp<::android::aidl::tests::INamedCallback>& /*service*/, const ::android::String16& /*name*/, bool* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetInterfaceArray(const ::std::vector<::android::String16>& /*names*/, ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status VerifyNamesWithInterfaceArray(const ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>& /*services*/, const ::std::vector<::android::String16>& /*names*/, bool* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetNullableInterfaceArray(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& /*names*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status VerifyNamesWithNullableInterfaceArray(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& /*services*/, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& /*names*/, bool* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetInterfaceList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& /*names*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status VerifyNamesWithInterfaceList(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& /*services*/, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& /*names*/, bool* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseStringList(const ::std::vector<::android::String16>& /*input*/, ::std::vector<::android::String16>* /*repeated*/, ::std::vector<::android::String16>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatParcelFileDescriptor(const ::android::os::ParcelFileDescriptor& /*read*/, ::android::os::ParcelFileDescriptor* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseParcelFileDescriptorArray(const ::std::vector<::android::os::ParcelFileDescriptor>& /*input*/, ::std::vector<::android::os::ParcelFileDescriptor>* /*repeated*/, ::std::vector<::android::os::ParcelFileDescriptor>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ThrowServiceException(int32_t /*code*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableIntArray(const ::std::optional<::std::vector<int32_t>>& /*input*/, ::std::optional<::std::vector<int32_t>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableByteEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>& /*input*/, ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableIntEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>& /*input*/, ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableLongEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>& /*input*/, ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableString(const ::std::optional<::android::String16>& /*input*/, ::std::optional<::android::String16>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableStringList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& /*input*/, ::std::optional<::std::vector<::std::optional<::android::String16>>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableParcelable(const ::std::optional<::android::aidl::tests::ITestService::Empty>& /*input*/, ::std::optional<::android::aidl::tests::ITestService::Empty>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableParcelableArray(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& /*input*/, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableParcelableList(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& /*input*/, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status TakesAnIBinder(const ::android::sp<::android::IBinder>& /*input*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status TakesANullableIBinder(const ::android::sp<::android::IBinder>& /*input*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status TakesAnIBinderList(const ::std::vector<::android::sp<::android::IBinder>>& /*input*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status TakesANullableIBinderList(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& /*input*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatUtf8CppString(const ::std::string& /*token*/, ::std::string* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableUtf8CppString(const ::std::optional<::std::string>& /*token*/, ::std::optional<::std::string>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseUtf8CppString(const ::std::vector<::std::string>& /*input*/, ::std::vector<::std::string>* /*repeated*/, ::std::vector<::std::string>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseNullableUtf8CppString(const ::std::optional<::std::vector<::std::optional<::std::string>>>& /*input*/, ::std::optional<::std::vector<::std::optional<::std::string>>>* /*repeated*/, ::std::optional<::std::vector<::std::optional<::std::string>>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseUtf8CppStringList(const ::std::optional<::std::vector<::std::optional<::std::string>>>& /*input*/, ::std::optional<::std::vector<::std::optional<::std::string>>>* /*repeated*/, ::std::optional<::std::vector<::std::optional<::std::string>>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetCallback(bool /*return_null*/, ::android::sp<::android::aidl::tests::INamedCallback>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status FillOutStructuredParcelable(::android::aidl::tests::StructuredParcelable* /*parcel*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatExtendableParcelable(const ::android::aidl::tests::extension::ExtendableParcelable& /*ep*/, ::android::aidl::tests::extension::ExtendableParcelable* /*ep2*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseList(const ::android::aidl::tests::RecursiveList& /*list*/, ::android::aidl::tests::RecursiveList* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseIBinderArray(const ::std::vector<::android::sp<::android::IBinder>>& /*input*/, ::std::vector<::android::sp<::android::IBinder>>* /*repeated*/, ::std::vector<::android::sp<::android::IBinder>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseNullableIBinderArray(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& /*input*/, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* /*repeated*/, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetOldNameInterface(::android::sp<::android::aidl::tests::IOldName>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetNewNameInterface(::android::sp<::android::aidl::tests::INewName>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetUnionTags(const ::std::vector<::android::aidl::tests::Union>& /*input*/, ::std::vector<::android::aidl::tests::Union::Tag>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetCppJavaTests(::android::sp<::android::IBinder>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status getBackendType(::android::aidl::tests::BackendType* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetCircular(::android::aidl::tests::CircularParcelable* /*cp*/, ::android::sp<::android::aidl::tests::ICircular>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+};  // class ITestServiceDefault
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ITestService::CompilerChecks::UsingHasDeprecated::Tag val) {
+  switch(val) {
+  case ITestService::CompilerChecks::UsingHasDeprecated::Tag::n:
+    return "n";
+  case ITestService::CompilerChecks::UsingHasDeprecated::Tag::m:
+    return "m";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::ITestService::CompilerChecks::UsingHasDeprecated::Tag, 2> enum_values<::android::aidl::tests::ITestService::CompilerChecks::UsingHasDeprecated::Tag> = {
+  ::android::aidl::tests::ITestService::CompilerChecks::UsingHasDeprecated::Tag::n,
+  ::android::aidl::tests::ITestService::CompilerChecks::UsingHasDeprecated::Tag::m,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IntEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IntEnum.h
new file mode 100644
index 0000000..4f59149
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IntEnum.h
@@ -0,0 +1,61 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <binder/Enums.h>
+#include <cstdint>
+#include <string>
+
+namespace android {
+namespace aidl {
+namespace tests {
+enum class IntEnum : int32_t {
+  FOO = 1000,
+  BAR = 2000,
+  BAZ = 2001,
+  QUX __attribute__((deprecated("do not use this"))) = 2002,
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+[[nodiscard]] static inline std::string toString(IntEnum val) {
+  switch(val) {
+  case IntEnum::FOO:
+    return "FOO";
+  case IntEnum::BAR:
+    return "BAR";
+  case IntEnum::BAZ:
+    return "BAZ";
+  case IntEnum::QUX:
+    return "QUX";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+#pragma clang diagnostic pop
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+template <>
+constexpr inline std::array<::android::aidl::tests::IntEnum, 4> enum_values<::android::aidl::tests::IntEnum> = {
+  ::android::aidl::tests::IntEnum::FOO,
+  ::android::aidl::tests::IntEnum::BAR,
+  ::android::aidl::tests::IntEnum::BAZ,
+  ::android::aidl::tests::IntEnum::QUX,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ListOfInterfaces.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ListOfInterfaces.h
new file mode 100644
index 0000000..79dd417
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ListOfInterfaces.h
@@ -0,0 +1,330 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Delegate.h>
+#include <binder/Enums.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cassert>
+#include <cstdint>
+#include <optional>
+#include <string>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <variant>
+#include <vector>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace tests {
+class ListOfInterfaces : public ::android::Parcelable {
+public:
+  class IEmptyInterfaceDelegator;
+
+  class IEmptyInterface : public ::android::IInterface {
+  public:
+    typedef IEmptyInterfaceDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(EmptyInterface)
+  };  // class IEmptyInterface
+
+  class IEmptyInterfaceDefault : public IEmptyInterface {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+  };  // class IEmptyInterfaceDefault
+  class BpEmptyInterface : public ::android::BpInterface<IEmptyInterface> {
+  public:
+    explicit BpEmptyInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpEmptyInterface() = default;
+  };  // class BpEmptyInterface
+  class BnEmptyInterface : public ::android::BnInterface<IEmptyInterface> {
+  public:
+    explicit BnEmptyInterface();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  };  // class BnEmptyInterface
+
+  class IEmptyInterfaceDelegator : public BnEmptyInterface {
+  public:
+    explicit IEmptyInterfaceDelegator(const ::android::sp<IEmptyInterface> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<IEmptyInterface> getImpl() { return _aidl_delegate; }
+  private:
+    ::android::sp<IEmptyInterface> _aidl_delegate;
+  };  // class IEmptyInterfaceDelegator
+  class IMyInterfaceDelegator;
+
+  class IMyInterface : public ::android::IInterface {
+  public:
+    typedef IMyInterfaceDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(MyInterface)
+    virtual ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& iface_list_in, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* iface_list_out, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* iface_list_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& nullable_iface_list_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* nullable_iface_list_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* nullable_iface_list_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* _aidl_return) = 0;
+  };  // class IMyInterface
+
+  class IMyInterfaceDefault : public IMyInterface {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+    ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& /*iface*/, const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& /*nullable_iface*/, const ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& /*iface_list_in*/, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* /*iface_list_out*/, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* /*iface_list_inout*/, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& /*nullable_iface_list_in*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* /*nullable_iface_list_out*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* /*nullable_iface_list_inout*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+  };  // class IMyInterfaceDefault
+  class BpMyInterface : public ::android::BpInterface<IMyInterface> {
+  public:
+    explicit BpMyInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpMyInterface() = default;
+    ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& iface_list_in, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* iface_list_out, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* iface_list_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& nullable_iface_list_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* nullable_iface_list_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* nullable_iface_list_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* _aidl_return) override;
+  };  // class BpMyInterface
+  class BnMyInterface : public ::android::BnInterface<IMyInterface> {
+  public:
+    static constexpr uint32_t TRANSACTION_methodWithInterfaces = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+    explicit BnMyInterface();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  };  // class BnMyInterface
+
+  class IMyInterfaceDelegator : public BnMyInterface {
+  public:
+    explicit IMyInterfaceDelegator(const ::android::sp<IMyInterface> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<IMyInterface> getImpl() { return _aidl_delegate; }
+    ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& iface_list_in, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* iface_list_out, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* iface_list_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& nullable_iface_list_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* nullable_iface_list_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* nullable_iface_list_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* _aidl_return) override {
+      ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterfaceDelegator> _iface;
+      if (iface) {
+        _iface = ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterfaceDelegator>::cast(delegate(iface));
+      }
+      ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterfaceDelegator> _nullable_iface;
+      if (nullable_iface) {
+        _nullable_iface = ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterfaceDelegator>::cast(delegate(nullable_iface));
+      }
+      return _aidl_delegate->methodWithInterfaces(_iface, _nullable_iface, iface_list_in, iface_list_out, iface_list_inout, nullable_iface_list_in, nullable_iface_list_out, nullable_iface_list_inout, _aidl_return);
+    }
+  private:
+    ::android::sp<IMyInterface> _aidl_delegate;
+  };  // class IMyInterfaceDelegator
+  class MyParcelable : public ::android::Parcelable {
+  public:
+    ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface> iface;
+    ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface> nullable_iface;
+    ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> iface_list;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> nullable_iface_list;
+    inline bool operator!=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) != std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator<(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) < std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator<=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) <= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator==(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) == std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator>(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) > std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator>=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) >= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ListOfInterfaces.MyParcelable");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyParcelable{";
+      os << "iface: " << ::android::internal::ToString(iface);
+      os << ", nullable_iface: " << ::android::internal::ToString(nullable_iface);
+      os << ", iface_list: " << ::android::internal::ToString(iface_list);
+      os << ", nullable_iface_list: " << ::android::internal::ToString(nullable_iface_list);
+      os << "}";
+      return os.str();
+    }
+  };  // class MyParcelable
+  class MyUnion : public ::android::Parcelable {
+  public:
+    enum class Tag : int32_t {
+      iface = 0,
+      nullable_iface = 1,
+      iface_list = 2,
+      nullable_iface_list = 3,
+    };
+    // Expose tag symbols for legacy code
+    static const inline Tag iface = Tag::iface;
+    static const inline Tag nullable_iface = Tag::nullable_iface;
+    static const inline Tag iface_list = Tag::iface_list;
+    static const inline Tag nullable_iface_list = Tag::nullable_iface_list;
+
+    template<typename _Tp>
+    static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, MyUnion>;
+
+    MyUnion() : _value(std::in_place_index<static_cast<size_t>(iface)>, ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>()) { }
+
+    template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+    // NOLINTNEXTLINE(google-explicit-constructor)
+    constexpr MyUnion(_Tp&& _arg)
+        : _value(std::forward<_Tp>(_arg)) {}
+
+    template <size_t _Np, typename... _Tp>
+    constexpr explicit MyUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+        : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+    template <Tag _tag, typename... _Tp>
+    static MyUnion make(_Tp&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+    }
+
+    template <Tag _tag, typename _Tp, typename... _Up>
+    static MyUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+    }
+
+    Tag getTag() const {
+      return static_cast<Tag>(_value.index());
+    }
+
+    template <Tag _tag>
+    const auto& get() const {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag>
+    auto& get() {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag, typename... _Tp>
+    void set(_Tp&&... _args) {
+      _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+    }
+
+    inline bool operator!=(const MyUnion& rhs) const {
+      return _value != rhs._value;
+    }
+    inline bool operator<(const MyUnion& rhs) const {
+      return _value < rhs._value;
+    }
+    inline bool operator<=(const MyUnion& rhs) const {
+      return _value <= rhs._value;
+    }
+    inline bool operator==(const MyUnion& rhs) const {
+      return _value == rhs._value;
+    }
+    inline bool operator>(const MyUnion& rhs) const {
+      return _value > rhs._value;
+    }
+    inline bool operator>=(const MyUnion& rhs) const {
+      return _value >= rhs._value;
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ListOfInterfaces.MyUnion");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyUnion{";
+      switch (getTag()) {
+      case iface: os << "iface: " << ::android::internal::ToString(get<iface>()); break;
+      case nullable_iface: os << "nullable_iface: " << ::android::internal::ToString(get<nullable_iface>()); break;
+      case iface_list: os << "iface_list: " << ::android::internal::ToString(get<iface_list>()); break;
+      case nullable_iface_list: os << "nullable_iface_list: " << ::android::internal::ToString(get<nullable_iface_list>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    std::variant<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>, ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>> _value;
+  };  // class MyUnion
+  inline bool operator!=(const ListOfInterfaces&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const ListOfInterfaces&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const ListOfInterfaces&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const ListOfInterfaces&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const ListOfInterfaces&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const ListOfInterfaces&) const {
+    return std::tie() >= std::tie();
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ListOfInterfaces");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ListOfInterfaces{";
+    os << "}";
+    return os.str();
+  }
+};  // class ListOfInterfaces
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ListOfInterfaces::MyUnion::Tag val) {
+  switch(val) {
+  case ListOfInterfaces::MyUnion::Tag::iface:
+    return "iface";
+  case ListOfInterfaces::MyUnion::Tag::nullable_iface:
+    return "nullable_iface";
+  case ListOfInterfaces::MyUnion::Tag::iface_list:
+    return "iface_list";
+  case ListOfInterfaces::MyUnion::Tag::nullable_iface_list:
+    return "nullable_iface_list";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::ListOfInterfaces::MyUnion::Tag, 4> enum_values<::android::aidl::tests::ListOfInterfaces::MyUnion::Tag> = {
+  ::android::aidl::tests::ListOfInterfaces::MyUnion::Tag::iface,
+  ::android::aidl::tests::ListOfInterfaces::MyUnion::Tag::nullable_iface,
+  ::android::aidl::tests::ListOfInterfaces::MyUnion::Tag::iface_list,
+  ::android::aidl::tests::ListOfInterfaces::MyUnion::Tag::nullable_iface_list,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/LongEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/LongEnum.h
new file mode 100644
index 0000000..c96234f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/LongEnum.h
@@ -0,0 +1,53 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <binder/Enums.h>
+#include <cstdint>
+#include <string>
+
+namespace android {
+namespace aidl {
+namespace tests {
+enum class LongEnum : int64_t {
+  FOO = 100000000000L,
+  BAR = 200000000000L,
+  BAZ = 200000000001L,
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(LongEnum val) {
+  switch(val) {
+  case LongEnum::FOO:
+    return "FOO";
+  case LongEnum::BAR:
+    return "BAR";
+  case LongEnum::BAZ:
+    return "BAZ";
+  default:
+    return std::to_string(static_cast<int64_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::LongEnum, 3> enum_values<::android::aidl::tests::LongEnum> = {
+  ::android::aidl::tests::LongEnum::FOO,
+  ::android::aidl::tests::LongEnum::BAR,
+  ::android::aidl::tests::LongEnum::BAZ,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/OtherParcelableForToString.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/OtherParcelableForToString.h
new file mode 100644
index 0000000..c1fec62
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/OtherParcelableForToString.h
@@ -0,0 +1,54 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class OtherParcelableForToString : public ::android::Parcelable {
+public:
+  ::android::String16 field;
+  inline bool operator!=(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) != std::tie(rhs.field);
+  }
+  inline bool operator<(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) < std::tie(rhs.field);
+  }
+  inline bool operator<=(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) <= std::tie(rhs.field);
+  }
+  inline bool operator==(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) == std::tie(rhs.field);
+  }
+  inline bool operator>(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) > std::tie(rhs.field);
+  }
+  inline bool operator>=(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) >= std::tie(rhs.field);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.OtherParcelableForToString");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "OtherParcelableForToString{";
+    os << "field: " << ::android::internal::ToString(field);
+    os << "}";
+    return os.str();
+  }
+};  // class OtherParcelableForToString
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ParcelableForToString.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ParcelableForToString.h
new file mode 100644
index 0000000..28b1c6a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ParcelableForToString.h
@@ -0,0 +1,111 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/GenericStructuredParcelable.h>
+#include <android/aidl/tests/IntEnum.h>
+#include <android/aidl/tests/OtherParcelableForToString.h>
+#include <android/aidl/tests/StructuredParcelable.h>
+#include <android/aidl/tests/Union.h>
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <tuple>
+#include <utils/String16.h>
+#include <vector>
+
+namespace android::aidl::tests {
+template <typename T, typename U, typename B>
+class GenericStructuredParcelable;
+class OtherParcelableForToString;
+class StructuredParcelable;
+}  // namespace android::aidl::tests
+namespace android {
+namespace aidl {
+namespace tests {
+class ParcelableForToString : public ::android::Parcelable {
+public:
+  int32_t intValue = 0;
+  ::std::vector<int32_t> intArray;
+  int64_t longValue = 0L;
+  ::std::vector<int64_t> longArray;
+  double doubleValue = 0.000000;
+  ::std::vector<double> doubleArray;
+  float floatValue = 0.000000f;
+  ::std::vector<float> floatArray;
+  int8_t byteValue = 0;
+  ::std::vector<uint8_t> byteArray;
+  bool booleanValue = false;
+  ::std::vector<bool> booleanArray;
+  ::android::String16 stringValue;
+  ::std::vector<::android::String16> stringArray;
+  ::std::vector<::android::String16> stringList;
+  ::android::aidl::tests::OtherParcelableForToString parcelableValue;
+  ::std::vector<::android::aidl::tests::OtherParcelableForToString> parcelableArray;
+  ::android::aidl::tests::IntEnum enumValue = ::android::aidl::tests::IntEnum::FOO;
+  ::std::vector<::android::aidl::tests::IntEnum> enumArray;
+  ::std::vector<::android::String16> nullArray;
+  ::std::vector<::android::String16> nullList;
+  ::android::aidl::tests::GenericStructuredParcelable<int32_t, ::android::aidl::tests::StructuredParcelable, ::android::aidl::tests::IntEnum> parcelableGeneric;
+  ::android::aidl::tests::Union unionValue;
+  inline bool operator!=(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) != std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator<(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) < std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator<=(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) <= std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator==(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) == std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator>(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) > std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator>=(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) >= std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ParcelableForToString");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ParcelableForToString{";
+    os << "intValue: " << ::android::internal::ToString(intValue);
+    os << ", intArray: " << ::android::internal::ToString(intArray);
+    os << ", longValue: " << ::android::internal::ToString(longValue);
+    os << ", longArray: " << ::android::internal::ToString(longArray);
+    os << ", doubleValue: " << ::android::internal::ToString(doubleValue);
+    os << ", doubleArray: " << ::android::internal::ToString(doubleArray);
+    os << ", floatValue: " << ::android::internal::ToString(floatValue);
+    os << ", floatArray: " << ::android::internal::ToString(floatArray);
+    os << ", byteValue: " << ::android::internal::ToString(byteValue);
+    os << ", byteArray: " << ::android::internal::ToString(byteArray);
+    os << ", booleanValue: " << ::android::internal::ToString(booleanValue);
+    os << ", booleanArray: " << ::android::internal::ToString(booleanArray);
+    os << ", stringValue: " << ::android::internal::ToString(stringValue);
+    os << ", stringArray: " << ::android::internal::ToString(stringArray);
+    os << ", stringList: " << ::android::internal::ToString(stringList);
+    os << ", parcelableValue: " << ::android::internal::ToString(parcelableValue);
+    os << ", parcelableArray: " << ::android::internal::ToString(parcelableArray);
+    os << ", enumValue: " << ::android::internal::ToString(enumValue);
+    os << ", enumArray: " << ::android::internal::ToString(enumArray);
+    os << ", nullArray: " << ::android::internal::ToString(nullArray);
+    os << ", nullList: " << ::android::internal::ToString(nullList);
+    os << ", parcelableGeneric: " << ::android::internal::ToString(parcelableGeneric);
+    os << ", unionValue: " << ::android::internal::ToString(unionValue);
+    os << "}";
+    return os.str();
+  }
+};  // class ParcelableForToString
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/RecursiveList.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/RecursiveList.h
new file mode 100644
index 0000000..95888f8
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/RecursiveList.h
@@ -0,0 +1,62 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/RecursiveList.h>
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <optional>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android::aidl::tests {
+class RecursiveList;
+}  // namespace android::aidl::tests
+namespace android {
+namespace aidl {
+namespace tests {
+class RecursiveList : public ::android::Parcelable {
+public:
+  int32_t value = 0;
+  ::std::unique_ptr<::android::aidl::tests::RecursiveList> next;
+  inline bool operator!=(const RecursiveList& rhs) const {
+    return std::tie(value, next) != std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator<(const RecursiveList& rhs) const {
+    return std::tie(value, next) < std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator<=(const RecursiveList& rhs) const {
+    return std::tie(value, next) <= std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator==(const RecursiveList& rhs) const {
+    return std::tie(value, next) == std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator>(const RecursiveList& rhs) const {
+    return std::tie(value, next) > std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator>=(const RecursiveList& rhs) const {
+    return std::tie(value, next) >= std::tie(rhs.value, rhs.next);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.RecursiveList");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "RecursiveList{";
+    os << "value: " << ::android::internal::ToString(value);
+    os << ", next: " << ::android::internal::ToString(next);
+    os << "}";
+    return os.str();
+  }
+};  // class RecursiveList
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/StructuredParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/StructuredParcelable.h
new file mode 100644
index 0000000..3e2288b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/StructuredParcelable.h
@@ -0,0 +1,210 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/ByteEnum.h>
+#include <android/aidl/tests/ConstantExpressionEnum.h>
+#include <android/aidl/tests/IntEnum.h>
+#include <android/aidl/tests/LongEnum.h>
+#include <android/aidl/tests/StructuredParcelable.h>
+#include <android/aidl/tests/Union.h>
+#include <android/binder_to_string.h>
+#include <binder/IBinder.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <optional>
+#include <string>
+#include <tuple>
+#include <utils/String16.h>
+#include <vector>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class StructuredParcelable : public ::android::Parcelable {
+public:
+  class Empty : public ::android::Parcelable {
+  public:
+    inline bool operator!=(const Empty&) const {
+      return std::tie() != std::tie();
+    }
+    inline bool operator<(const Empty&) const {
+      return std::tie() < std::tie();
+    }
+    inline bool operator<=(const Empty&) const {
+      return std::tie() <= std::tie();
+    }
+    inline bool operator==(const Empty&) const {
+      return std::tie() == std::tie();
+    }
+    inline bool operator>(const Empty&) const {
+      return std::tie() > std::tie();
+    }
+    inline bool operator>=(const Empty&) const {
+      return std::tie() >= std::tie();
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.StructuredParcelable.Empty");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "Empty{";
+      os << "}";
+      return os.str();
+    }
+  };  // class Empty
+  ::std::vector<int32_t> shouldContainThreeFs;
+  int32_t f = 0;
+  ::std::string shouldBeJerry;
+  ::android::aidl::tests::ByteEnum shouldBeByteBar = ::android::aidl::tests::ByteEnum(0);
+  ::android::aidl::tests::IntEnum shouldBeIntBar = ::android::aidl::tests::IntEnum(0);
+  ::android::aidl::tests::LongEnum shouldBeLongBar = ::android::aidl::tests::LongEnum(0);
+  ::std::vector<::android::aidl::tests::ByteEnum> shouldContainTwoByteFoos;
+  ::std::vector<::android::aidl::tests::IntEnum> shouldContainTwoIntFoos;
+  ::std::vector<::android::aidl::tests::LongEnum> shouldContainTwoLongFoos;
+  ::android::String16 stringDefaultsToFoo = ::android::String16("foo");
+  int8_t byteDefaultsToFour = 4;
+  int32_t intDefaultsToFive = 5;
+  int64_t longDefaultsToNegativeSeven = -7L;
+  bool booleanDefaultsToTrue = true;
+  char16_t charDefaultsToC = 'C';
+  float floatDefaultsToPi = 3.140000f;
+  double doubleWithDefault = -314000000000000000.000000;
+  ::std::vector<int32_t> arrayDefaultsTo123 = {1, 2, 3};
+  ::std::vector<int32_t> arrayDefaultsToEmpty = {};
+  bool boolDefault = false;
+  int8_t byteDefault = 0;
+  int32_t intDefault = 0;
+  int64_t longDefault = 0L;
+  float floatDefault = 0.000000f;
+  double doubleDefault = 0.000000;
+  double checkDoubleFromFloat = 3.140000;
+  ::std::vector<::android::String16> checkStringArray1 = {::android::String16("a"), ::android::String16("b")};
+  ::std::vector<::std::string> checkStringArray2 = {"a", "b"};
+  int32_t int32_min = -2147483648;
+  int32_t int32_max = 2147483647;
+  int64_t int64_max = 9223372036854775807L;
+  int32_t hexInt32_neg_1 = -1;
+  ::android::sp<::android::IBinder> ibinder;
+  ::android::aidl::tests::StructuredParcelable::Empty empty;
+  ::std::vector<uint8_t> int8_1 = {1, 1, 1, 1, 1};
+  ::std::vector<int32_t> int32_1 = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
+  ::std::vector<int64_t> int64_1 = {1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L};
+  int32_t hexInt32_pos_1 = 1;
+  int32_t hexInt64_pos_1 = 1;
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_1 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_2 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_3 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_4 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_5 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_6 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_7 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_8 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_9 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_10 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::std::string addString1 = "hello world!";
+  ::std::string addString2 = "The quick brown fox jumps over the lazy dog.";
+  int32_t shouldSetBit0AndBit2 = 0;
+  ::std::optional<::android::aidl::tests::Union> u;
+  ::std::optional<::android::aidl::tests::Union> shouldBeConstS1;
+  ::android::aidl::tests::IntEnum defaultWithFoo = ::android::aidl::tests::IntEnum::FOO;
+  inline bool operator!=(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) != std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator<(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) < std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator<=(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) <= std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator==(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) == std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator>(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) > std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator>=(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) >= std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+
+  enum : int32_t { BIT0 = 1 };
+  enum : int32_t { BIT1 = 2 };
+  enum : int32_t { BIT2 = 4 };
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.StructuredParcelable");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "StructuredParcelable{";
+    os << "shouldContainThreeFs: " << ::android::internal::ToString(shouldContainThreeFs);
+    os << ", f: " << ::android::internal::ToString(f);
+    os << ", shouldBeJerry: " << ::android::internal::ToString(shouldBeJerry);
+    os << ", shouldBeByteBar: " << ::android::internal::ToString(shouldBeByteBar);
+    os << ", shouldBeIntBar: " << ::android::internal::ToString(shouldBeIntBar);
+    os << ", shouldBeLongBar: " << ::android::internal::ToString(shouldBeLongBar);
+    os << ", shouldContainTwoByteFoos: " << ::android::internal::ToString(shouldContainTwoByteFoos);
+    os << ", shouldContainTwoIntFoos: " << ::android::internal::ToString(shouldContainTwoIntFoos);
+    os << ", shouldContainTwoLongFoos: " << ::android::internal::ToString(shouldContainTwoLongFoos);
+    os << ", stringDefaultsToFoo: " << ::android::internal::ToString(stringDefaultsToFoo);
+    os << ", byteDefaultsToFour: " << ::android::internal::ToString(byteDefaultsToFour);
+    os << ", intDefaultsToFive: " << ::android::internal::ToString(intDefaultsToFive);
+    os << ", longDefaultsToNegativeSeven: " << ::android::internal::ToString(longDefaultsToNegativeSeven);
+    os << ", booleanDefaultsToTrue: " << ::android::internal::ToString(booleanDefaultsToTrue);
+    os << ", charDefaultsToC: " << ::android::internal::ToString(charDefaultsToC);
+    os << ", floatDefaultsToPi: " << ::android::internal::ToString(floatDefaultsToPi);
+    os << ", doubleWithDefault: " << ::android::internal::ToString(doubleWithDefault);
+    os << ", arrayDefaultsTo123: " << ::android::internal::ToString(arrayDefaultsTo123);
+    os << ", arrayDefaultsToEmpty: " << ::android::internal::ToString(arrayDefaultsToEmpty);
+    os << ", boolDefault: " << ::android::internal::ToString(boolDefault);
+    os << ", byteDefault: " << ::android::internal::ToString(byteDefault);
+    os << ", intDefault: " << ::android::internal::ToString(intDefault);
+    os << ", longDefault: " << ::android::internal::ToString(longDefault);
+    os << ", floatDefault: " << ::android::internal::ToString(floatDefault);
+    os << ", doubleDefault: " << ::android::internal::ToString(doubleDefault);
+    os << ", checkDoubleFromFloat: " << ::android::internal::ToString(checkDoubleFromFloat);
+    os << ", checkStringArray1: " << ::android::internal::ToString(checkStringArray1);
+    os << ", checkStringArray2: " << ::android::internal::ToString(checkStringArray2);
+    os << ", int32_min: " << ::android::internal::ToString(int32_min);
+    os << ", int32_max: " << ::android::internal::ToString(int32_max);
+    os << ", int64_max: " << ::android::internal::ToString(int64_max);
+    os << ", hexInt32_neg_1: " << ::android::internal::ToString(hexInt32_neg_1);
+    os << ", ibinder: " << ::android::internal::ToString(ibinder);
+    os << ", empty: " << ::android::internal::ToString(empty);
+    os << ", int8_1: " << ::android::internal::ToString(int8_1);
+    os << ", int32_1: " << ::android::internal::ToString(int32_1);
+    os << ", int64_1: " << ::android::internal::ToString(int64_1);
+    os << ", hexInt32_pos_1: " << ::android::internal::ToString(hexInt32_pos_1);
+    os << ", hexInt64_pos_1: " << ::android::internal::ToString(hexInt64_pos_1);
+    os << ", const_exprs_1: " << ::android::internal::ToString(const_exprs_1);
+    os << ", const_exprs_2: " << ::android::internal::ToString(const_exprs_2);
+    os << ", const_exprs_3: " << ::android::internal::ToString(const_exprs_3);
+    os << ", const_exprs_4: " << ::android::internal::ToString(const_exprs_4);
+    os << ", const_exprs_5: " << ::android::internal::ToString(const_exprs_5);
+    os << ", const_exprs_6: " << ::android::internal::ToString(const_exprs_6);
+    os << ", const_exprs_7: " << ::android::internal::ToString(const_exprs_7);
+    os << ", const_exprs_8: " << ::android::internal::ToString(const_exprs_8);
+    os << ", const_exprs_9: " << ::android::internal::ToString(const_exprs_9);
+    os << ", const_exprs_10: " << ::android::internal::ToString(const_exprs_10);
+    os << ", addString1: " << ::android::internal::ToString(addString1);
+    os << ", addString2: " << ::android::internal::ToString(addString2);
+    os << ", shouldSetBit0AndBit2: " << ::android::internal::ToString(shouldSetBit0AndBit2);
+    os << ", u: " << ::android::internal::ToString(u);
+    os << ", shouldBeConstS1: " << ::android::internal::ToString(shouldBeConstS1);
+    os << ", defaultWithFoo: " << ::android::internal::ToString(defaultWithFoo);
+    os << "}";
+    return os.str();
+  }
+};  // class StructuredParcelable
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/Union.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/Union.h
new file mode 100644
index 0000000..7497b68
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/Union.h
@@ -0,0 +1,184 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/ByteEnum.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/IBinder.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+#include <vector>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace tests {
+class Union : public ::android::Parcelable {
+public:
+  enum class Tag : int32_t {
+    ns = 0,
+    n = 1,
+    m = 2,
+    s = 3,
+    ibinder = 4,
+    ss = 5,
+    be = 6,
+  };
+  // Expose tag symbols for legacy code
+  static const inline Tag ns = Tag::ns;
+  static const inline Tag n = Tag::n;
+  static const inline Tag m = Tag::m;
+  static const inline Tag s = Tag::s;
+  static const inline Tag ibinder = Tag::ibinder;
+  static const inline Tag ss = Tag::ss;
+  static const inline Tag be = Tag::be;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, Union>;
+
+  Union() : _value(std::in_place_index<static_cast<size_t>(ns)>, ::std::vector<int32_t>({})) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr Union(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit Union(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static Union make(_Tp&&... _args) {
+    return Union(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static Union make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return Union(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  inline bool operator!=(const Union& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const Union& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const Union& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const Union& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const Union& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const Union& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::std::string& S1();
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.Union");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Union{";
+    switch (getTag()) {
+    case ns: os << "ns: " << ::android::internal::ToString(get<ns>()); break;
+    case n: os << "n: " << ::android::internal::ToString(get<n>()); break;
+    case m: os << "m: " << ::android::internal::ToString(get<m>()); break;
+    case s: os << "s: " << ::android::internal::ToString(get<s>()); break;
+    case ibinder: os << "ibinder: " << ::android::internal::ToString(get<ibinder>()); break;
+    case ss: os << "ss: " << ::android::internal::ToString(get<ss>()); break;
+    case be: os << "be: " << ::android::internal::ToString(get<be>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<::std::vector<int32_t>, int32_t, int32_t, ::std::string, ::android::sp<::android::IBinder>, ::std::vector<::std::string>, ::android::aidl::tests::ByteEnum> _value;
+};  // class Union
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(Union::Tag val) {
+  switch(val) {
+  case Union::Tag::ns:
+    return "ns";
+  case Union::Tag::n:
+    return "n";
+  case Union::Tag::m:
+    return "m";
+  case Union::Tag::s:
+    return "s";
+  case Union::Tag::ibinder:
+    return "ibinder";
+  case Union::Tag::ss:
+    return "ss";
+  case Union::Tag::be:
+    return "be";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::Union::Tag, 7> enum_values<::android::aidl::tests::Union::Tag> = {
+  ::android::aidl::tests::Union::Tag::ns,
+  ::android::aidl::tests::Union::Tag::n,
+  ::android::aidl::tests::Union::Tag::m,
+  ::android::aidl::tests::Union::Tag::s,
+  ::android::aidl::tests::Union::Tag::ibinder,
+  ::android::aidl::tests::Union::Tag::ss,
+  ::android::aidl::tests::Union::Tag::be,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/UnionWithFd.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/UnionWithFd.h
new file mode 100644
index 0000000..4ffbf39
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/UnionWithFd.h
@@ -0,0 +1,151 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/ParcelFileDescriptor.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace tests {
+class UnionWithFd : public ::android::Parcelable {
+public:
+  enum class Tag : int32_t {
+    num = 0,
+    pfd = 1,
+  };
+  // Expose tag symbols for legacy code
+  static const inline Tag num = Tag::num;
+  static const inline Tag pfd = Tag::pfd;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, UnionWithFd>;
+
+  UnionWithFd() : _value(std::in_place_index<static_cast<size_t>(num)>, int32_t(0)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr UnionWithFd(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit UnionWithFd(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static UnionWithFd make(_Tp&&... _args) {
+    return UnionWithFd(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static UnionWithFd make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return UnionWithFd(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  inline bool operator!=(const UnionWithFd& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const UnionWithFd& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const UnionWithFd& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const UnionWithFd& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const UnionWithFd& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const UnionWithFd& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.UnionWithFd");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "UnionWithFd{";
+    switch (getTag()) {
+    case num: os << "num: " << ::android::internal::ToString(get<num>()); break;
+    case pfd: os << "pfd: " << ::android::internal::ToString(get<pfd>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t, ::android::os::ParcelFileDescriptor> _value;
+};  // class UnionWithFd
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(UnionWithFd::Tag val) {
+  switch(val) {
+  case UnionWithFd::Tag::num:
+    return "num";
+  case UnionWithFd::Tag::pfd:
+    return "pfd";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::UnionWithFd::Tag, 2> enum_values<::android::aidl::tests::UnionWithFd::Tag> = {
+  ::android::aidl::tests::UnionWithFd::Tag::num,
+  ::android::aidl::tests::UnionWithFd::Tag::pfd,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnExtendableParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnExtendableParcelable.h
new file mode 100644
index 0000000..95963f7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnExtendableParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExt.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExt.h
new file mode 100644
index 0000000..d141417
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExt.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExt2.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExt2.h
new file mode 100644
index 0000000..c00f8fd
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExt2.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExtLike.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExtLike.h
new file mode 100644
index 0000000..96fe4f0
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExtLike.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpExtendableParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpExtendableParcelable.h
new file mode 100644
index 0000000..05a5498
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpExtendableParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExt.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExt.h
new file mode 100644
index 0000000..ba81982
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExt.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExt2.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExt2.h
new file mode 100644
index 0000000..f2ed71f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExt2.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExtLike.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExtLike.h
new file mode 100644
index 0000000..4357484
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExtLike.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/ExtendableParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/ExtendableParcelable.h
new file mode 100644
index 0000000..8e24660
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/ExtendableParcelable.h
@@ -0,0 +1,67 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/ParcelableHolder.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <string>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+class ExtendableParcelable : public ::android::Parcelable {
+public:
+  int32_t a = 0;
+  ::std::string b;
+  ::android::os::ParcelableHolder ext { ::android::Parcelable::Stability::STABILITY_LOCAL };
+  int64_t c = 0L;
+  ::android::os::ParcelableHolder ext2 { ::android::Parcelable::Stability::STABILITY_LOCAL };
+  inline bool operator!=(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) != std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator<(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) < std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator<=(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) <= std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator==(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) == std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator>(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) > std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator>=(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) >= std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.extension.ExtendableParcelable");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ExtendableParcelable{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << ", ext: " << ::android::internal::ToString(ext);
+    os << ", c: " << ::android::internal::ToString(c);
+    os << ", ext2: " << ::android::internal::ToString(ext2);
+    os << "}";
+    return os.str();
+  }
+};  // class ExtendableParcelable
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExt.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExt.h
new file mode 100644
index 0000000..345ae53
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExt.h
@@ -0,0 +1,60 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <string>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+class MyExt : public ::android::Parcelable {
+public:
+  int32_t a = 0;
+  ::std::string b;
+  inline bool operator!=(const MyExt& rhs) const {
+    return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<(const MyExt& rhs) const {
+    return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<=(const MyExt& rhs) const {
+    return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator==(const MyExt& rhs) const {
+    return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>(const MyExt& rhs) const {
+    return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>=(const MyExt& rhs) const {
+    return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.extension.MyExt");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "MyExt{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << "}";
+    return os.str();
+  }
+};  // class MyExt
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExt2.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExt2.h
new file mode 100644
index 0000000..4c7d8a3
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExt2.h
@@ -0,0 +1,66 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/extension/MyExt.h>
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <string>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android::aidl::tests::extension {
+class MyExt;
+}  // namespace android::aidl::tests::extension
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+class MyExt2 : public ::android::Parcelable {
+public:
+  int32_t a = 0;
+  ::android::aidl::tests::extension::MyExt b;
+  ::std::string c;
+  inline bool operator!=(const MyExt2& rhs) const {
+    return std::tie(a, b, c) != std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator<(const MyExt2& rhs) const {
+    return std::tie(a, b, c) < std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator<=(const MyExt2& rhs) const {
+    return std::tie(a, b, c) <= std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator==(const MyExt2& rhs) const {
+    return std::tie(a, b, c) == std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator>(const MyExt2& rhs) const {
+    return std::tie(a, b, c) > std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator>=(const MyExt2& rhs) const {
+    return std::tie(a, b, c) >= std::tie(rhs.a, rhs.b, rhs.c);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.extension.MyExt2");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "MyExt2{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << ", c: " << ::android::internal::ToString(c);
+    os << "}";
+    return os.str();
+  }
+};  // class MyExt2
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExtLike.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExtLike.h
new file mode 100644
index 0000000..4647ecb
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExtLike.h
@@ -0,0 +1,59 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+class MyExtLike : public ::android::Parcelable {
+public:
+  int32_t a = 0;
+  ::android::String16 b;
+  inline bool operator!=(const MyExtLike& rhs) const {
+    return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<(const MyExtLike& rhs) const {
+    return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<=(const MyExtLike& rhs) const {
+    return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator==(const MyExtLike& rhs) const {
+    return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>(const MyExtLike& rhs) const {
+    return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>=(const MyExtLike& rhs) const {
+    return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.extension.MyExtLike");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "MyExtLike{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << "}";
+    return os.str();
+  }
+};  // class MyExtLike
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnDeeplyNested.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnDeeplyNested.h
new file mode 100644
index 0000000..2ad450a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnDeeplyNested.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnNestedService.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnNestedService.h
new file mode 100644
index 0000000..c676cca
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnNestedService.h
@@ -0,0 +1,47 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/tests/nested/INestedService.h>
+#include <android/aidl/tests/nested/BnNestedService.h>
+#include <android/aidl/tests/nested/INestedService.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class BnNestedService : public ::android::BnInterface<INestedService> {
+public:
+  static constexpr uint32_t TRANSACTION_flipStatus = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_flipStatusWithCallback = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+  explicit BnNestedService();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+};  // class BnNestedService
+
+class INestedServiceDelegator : public BnNestedService {
+public:
+  explicit INestedServiceDelegator(const ::android::sp<INestedService> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<INestedService> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status flipStatus(const ::android::aidl::tests::nested::ParcelableWithNested& p, ::android::aidl::tests::nested::INestedService::Result* _aidl_return) override {
+    return _aidl_delegate->flipStatus(p, _aidl_return);
+  }
+  ::android::binder::Status flipStatusWithCallback(::android::aidl::tests::nested::ParcelableWithNested::Status status, const ::android::sp<::android::aidl::tests::nested::INestedService::ICallback>& cb) override {
+    ::android::sp<::android::aidl::tests::nested::INestedService::ICallbackDelegator> _cb;
+    if (cb) {
+      _cb = ::android::sp<::android::aidl::tests::nested::INestedService::ICallbackDelegator>::cast(delegate(cb));
+    }
+    return _aidl_delegate->flipStatusWithCallback(status, _cb);
+  }
+private:
+  ::android::sp<INestedService> _aidl_delegate;
+};  // class INestedServiceDelegator
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnParcelableWithNested.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnParcelableWithNested.h
new file mode 100644
index 0000000..6345a15
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnParcelableWithNested.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpDeeplyNested.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpDeeplyNested.h
new file mode 100644
index 0000000..9cb9be5
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpDeeplyNested.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpNestedService.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpNestedService.h
new file mode 100644
index 0000000..640fa53
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpNestedService.h
@@ -0,0 +1,26 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/tests/nested/INestedService.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class BpNestedService : public ::android::BpInterface<INestedService> {
+public:
+  explicit BpNestedService(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpNestedService() = default;
+  ::android::binder::Status flipStatus(const ::android::aidl::tests::nested::ParcelableWithNested& p, ::android::aidl::tests::nested::INestedService::Result* _aidl_return) override;
+  ::android::binder::Status flipStatusWithCallback(::android::aidl::tests::nested::ParcelableWithNested::Status status, const ::android::sp<::android::aidl::tests::nested::INestedService::ICallback>& cb) override;
+};  // class BpNestedService
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpParcelableWithNested.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpParcelableWithNested.h
new file mode 100644
index 0000000..b7b14dc
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpParcelableWithNested.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/DeeplyNested.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/DeeplyNested.h
new file mode 100644
index 0000000..3a66499
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/DeeplyNested.h
@@ -0,0 +1,227 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/nested/DeeplyNested.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <string>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class DeeplyNested : public ::android::Parcelable {
+public:
+  class B : public ::android::Parcelable {
+  public:
+    class C : public ::android::Parcelable {
+    public:
+      class D : public ::android::Parcelable {
+      public:
+        enum class E : int8_t {
+          OK = 0,
+        };
+        inline bool operator!=(const D&) const {
+          return std::tie() != std::tie();
+        }
+        inline bool operator<(const D&) const {
+          return std::tie() < std::tie();
+        }
+        inline bool operator<=(const D&) const {
+          return std::tie() <= std::tie();
+        }
+        inline bool operator==(const D&) const {
+          return std::tie() == std::tie();
+        }
+        inline bool operator>(const D&) const {
+          return std::tie() > std::tie();
+        }
+        inline bool operator>=(const D&) const {
+          return std::tie() >= std::tie();
+        }
+
+        ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+        ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+        static const ::android::String16& getParcelableDescriptor() {
+          static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.nested.DeeplyNested.B.C.D");
+          return DESCRIPTOR;
+        }
+        inline std::string toString() const {
+          std::ostringstream os;
+          os << "D{";
+          os << "}";
+          return os.str();
+        }
+      };  // class D
+      inline bool operator!=(const C&) const {
+        return std::tie() != std::tie();
+      }
+      inline bool operator<(const C&) const {
+        return std::tie() < std::tie();
+      }
+      inline bool operator<=(const C&) const {
+        return std::tie() <= std::tie();
+      }
+      inline bool operator==(const C&) const {
+        return std::tie() == std::tie();
+      }
+      inline bool operator>(const C&) const {
+        return std::tie() > std::tie();
+      }
+      inline bool operator>=(const C&) const {
+        return std::tie() >= std::tie();
+      }
+
+      ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+      ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+      static const ::android::String16& getParcelableDescriptor() {
+        static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.nested.DeeplyNested.B.C");
+        return DESCRIPTOR;
+      }
+      inline std::string toString() const {
+        std::ostringstream os;
+        os << "C{";
+        os << "}";
+        return os.str();
+      }
+    };  // class C
+    inline bool operator!=(const B&) const {
+      return std::tie() != std::tie();
+    }
+    inline bool operator<(const B&) const {
+      return std::tie() < std::tie();
+    }
+    inline bool operator<=(const B&) const {
+      return std::tie() <= std::tie();
+    }
+    inline bool operator==(const B&) const {
+      return std::tie() == std::tie();
+    }
+    inline bool operator>(const B&) const {
+      return std::tie() > std::tie();
+    }
+    inline bool operator>=(const B&) const {
+      return std::tie() >= std::tie();
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.nested.DeeplyNested.B");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "B{";
+      os << "}";
+      return os.str();
+    }
+  };  // class B
+  class A : public ::android::Parcelable {
+  public:
+    ::android::aidl::tests::nested::DeeplyNested::B::C::D::E e = ::android::aidl::tests::nested::DeeplyNested::B::C::D::E::OK;
+    inline bool operator!=(const A& rhs) const {
+      return std::tie(e) != std::tie(rhs.e);
+    }
+    inline bool operator<(const A& rhs) const {
+      return std::tie(e) < std::tie(rhs.e);
+    }
+    inline bool operator<=(const A& rhs) const {
+      return std::tie(e) <= std::tie(rhs.e);
+    }
+    inline bool operator==(const A& rhs) const {
+      return std::tie(e) == std::tie(rhs.e);
+    }
+    inline bool operator>(const A& rhs) const {
+      return std::tie(e) > std::tie(rhs.e);
+    }
+    inline bool operator>=(const A& rhs) const {
+      return std::tie(e) >= std::tie(rhs.e);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.nested.DeeplyNested.A");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "A{";
+      os << "e: " << ::android::internal::ToString(e);
+      os << "}";
+      return os.str();
+    }
+  };  // class A
+  inline bool operator!=(const DeeplyNested&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const DeeplyNested&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const DeeplyNested&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const DeeplyNested&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const DeeplyNested&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const DeeplyNested&) const {
+    return std::tie() >= std::tie();
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.nested.DeeplyNested");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "DeeplyNested{";
+    os << "}";
+    return os.str();
+  }
+};  // class DeeplyNested
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+[[nodiscard]] static inline std::string toString(DeeplyNested::B::C::D::E val) {
+  switch(val) {
+  case DeeplyNested::B::C::D::E::OK:
+    return "OK";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::nested::DeeplyNested::B::C::D::E, 1> enum_values<::android::aidl::tests::nested::DeeplyNested::B::C::D::E> = {
+  ::android::aidl::tests::nested::DeeplyNested::B::C::D::E::OK,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/INestedService.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/INestedService.h
new file mode 100644
index 0000000..c9fd99f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/INestedService.h
@@ -0,0 +1,130 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/nested/INestedService.h>
+#include <android/aidl/tests/nested/ParcelableWithNested.h>
+#include <android/binder_to_string.h>
+#include <binder/Delegate.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <tuple>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+
+namespace android::aidl::tests::nested {
+class ParcelableWithNested;
+}  // namespace android::aidl::tests::nested
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class INestedServiceDelegator;
+
+class INestedService : public ::android::IInterface {
+public:
+  typedef INestedServiceDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(NestedService)
+  class Result : public ::android::Parcelable {
+  public:
+    ::android::aidl::tests::nested::ParcelableWithNested::Status status = ::android::aidl::tests::nested::ParcelableWithNested::Status::OK;
+    inline bool operator!=(const Result& rhs) const {
+      return std::tie(status) != std::tie(rhs.status);
+    }
+    inline bool operator<(const Result& rhs) const {
+      return std::tie(status) < std::tie(rhs.status);
+    }
+    inline bool operator<=(const Result& rhs) const {
+      return std::tie(status) <= std::tie(rhs.status);
+    }
+    inline bool operator==(const Result& rhs) const {
+      return std::tie(status) == std::tie(rhs.status);
+    }
+    inline bool operator>(const Result& rhs) const {
+      return std::tie(status) > std::tie(rhs.status);
+    }
+    inline bool operator>=(const Result& rhs) const {
+      return std::tie(status) >= std::tie(rhs.status);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.nested.INestedService.Result");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "Result{";
+      os << "status: " << ::android::internal::ToString(status);
+      os << "}";
+      return os.str();
+    }
+  };  // class Result
+  class ICallbackDelegator;
+
+  class ICallback : public ::android::IInterface {
+  public:
+    typedef ICallbackDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(Callback)
+    virtual ::android::binder::Status done(::android::aidl::tests::nested::ParcelableWithNested::Status status) = 0;
+  };  // class ICallback
+
+  class ICallbackDefault : public ICallback {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+    ::android::binder::Status done(::android::aidl::tests::nested::ParcelableWithNested::Status /*status*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+  };  // class ICallbackDefault
+  class BpCallback : public ::android::BpInterface<ICallback> {
+  public:
+    explicit BpCallback(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpCallback() = default;
+    ::android::binder::Status done(::android::aidl::tests::nested::ParcelableWithNested::Status status) override;
+  };  // class BpCallback
+  class BnCallback : public ::android::BnInterface<ICallback> {
+  public:
+    static constexpr uint32_t TRANSACTION_done = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+    explicit BnCallback();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  };  // class BnCallback
+
+  class ICallbackDelegator : public BnCallback {
+  public:
+    explicit ICallbackDelegator(const ::android::sp<ICallback> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<ICallback> getImpl() { return _aidl_delegate; }
+    ::android::binder::Status done(::android::aidl::tests::nested::ParcelableWithNested::Status status) override {
+      return _aidl_delegate->done(status);
+    }
+  private:
+    ::android::sp<ICallback> _aidl_delegate;
+  };  // class ICallbackDelegator
+  virtual ::android::binder::Status flipStatus(const ::android::aidl::tests::nested::ParcelableWithNested& p, ::android::aidl::tests::nested::INestedService::Result* _aidl_return) = 0;
+  virtual ::android::binder::Status flipStatusWithCallback(::android::aidl::tests::nested::ParcelableWithNested::Status status, const ::android::sp<::android::aidl::tests::nested::INestedService::ICallback>& cb) = 0;
+};  // class INestedService
+
+class INestedServiceDefault : public INestedService {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status flipStatus(const ::android::aidl::tests::nested::ParcelableWithNested& /*p*/, ::android::aidl::tests::nested::INestedService::Result* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status flipStatusWithCallback(::android::aidl::tests::nested::ParcelableWithNested::Status /*status*/, const ::android::sp<::android::aidl::tests::nested::INestedService::ICallback>& /*cb*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+};  // class INestedServiceDefault
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/ParcelableWithNested.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/ParcelableWithNested.h
new file mode 100644
index 0000000..662c1fd
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/ParcelableWithNested.h
@@ -0,0 +1,95 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/nested/ParcelableWithNested.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <string>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class ParcelableWithNested : public ::android::Parcelable {
+public:
+  enum class Status : int8_t {
+    OK = 0,
+    NOT_OK = 1,
+  };
+  ::android::aidl::tests::nested::ParcelableWithNested::Status status = ::android::aidl::tests::nested::ParcelableWithNested::Status::OK;
+  inline bool operator!=(const ParcelableWithNested& rhs) const {
+    return std::tie(status) != std::tie(rhs.status);
+  }
+  inline bool operator<(const ParcelableWithNested& rhs) const {
+    return std::tie(status) < std::tie(rhs.status);
+  }
+  inline bool operator<=(const ParcelableWithNested& rhs) const {
+    return std::tie(status) <= std::tie(rhs.status);
+  }
+  inline bool operator==(const ParcelableWithNested& rhs) const {
+    return std::tie(status) == std::tie(rhs.status);
+  }
+  inline bool operator>(const ParcelableWithNested& rhs) const {
+    return std::tie(status) > std::tie(rhs.status);
+  }
+  inline bool operator>=(const ParcelableWithNested& rhs) const {
+    return std::tie(status) >= std::tie(rhs.status);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.nested.ParcelableWithNested");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ParcelableWithNested{";
+    os << "status: " << ::android::internal::ToString(status);
+    os << "}";
+    return os.str();
+  }
+};  // class ParcelableWithNested
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+[[nodiscard]] static inline std::string toString(ParcelableWithNested::Status val) {
+  switch(val) {
+  case ParcelableWithNested::Status::OK:
+    return "OK";
+  case ParcelableWithNested::Status::NOT_OK:
+    return "NOT_OK";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::nested::ParcelableWithNested::Status, 2> enum_values<::android::aidl::tests::nested::ParcelableWithNested::Status> = {
+  ::android::aidl::tests::nested::ParcelableWithNested::Status::OK,
+  ::android::aidl::tests::nested::ParcelableWithNested::Status::NOT_OK,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BnEnumUnion.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BnEnumUnion.h
new file mode 100644
index 0000000..9f3edec
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BnEnumUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BnUnionInUnion.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BnUnionInUnion.h
new file mode 100644
index 0000000..3390730
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BnUnionInUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BpEnumUnion.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BpEnumUnion.h
new file mode 100644
index 0000000..a42e75b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BpEnumUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BpUnionInUnion.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BpUnionInUnion.h
new file mode 100644
index 0000000..2fac940
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BpUnionInUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/EnumUnion.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/EnumUnion.h
new file mode 100644
index 0000000..eeb88c8
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/EnumUnion.h
@@ -0,0 +1,169 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/IntEnum.h>
+#include <android/aidl/tests/LongEnum.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+class EnumUnion : public ::android::Parcelable {
+public:
+  enum class Tag : int32_t {
+    intEnum = 0,
+    longEnum = 1,
+    deprecatedField __attribute__((deprecated("do not use this"))) = 2,
+  };
+  // Expose tag symbols for legacy code
+  static const inline Tag intEnum = Tag::intEnum;
+  static const inline Tag longEnum = Tag::longEnum;
+  static const inline Tag __attribute__((deprecated("do not use this"))) deprecatedField = Tag::deprecatedField;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, EnumUnion>;
+
+  EnumUnion() : _value(std::in_place_index<static_cast<size_t>(intEnum)>, ::android::aidl::tests::IntEnum(::android::aidl::tests::IntEnum::FOO)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr EnumUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit EnumUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static EnumUnion make(_Tp&&... _args) {
+    return EnumUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static EnumUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return EnumUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  inline bool operator!=(const EnumUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const EnumUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const EnumUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const EnumUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const EnumUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const EnumUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.unions.EnumUnion");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "EnumUnion{";
+    switch (getTag()) {
+    case intEnum: os << "intEnum: " << ::android::internal::ToString(get<intEnum>()); break;
+    case longEnum: os << "longEnum: " << ::android::internal::ToString(get<longEnum>()); break;
+    case deprecatedField: os << "deprecatedField: " << ::android::internal::ToString(get<deprecatedField>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<::android::aidl::tests::IntEnum, ::android::aidl::tests::LongEnum, int32_t> _value;
+};  // class EnumUnion
+#pragma clang diagnostic pop
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+[[nodiscard]] static inline std::string toString(EnumUnion::Tag val) {
+  switch(val) {
+  case EnumUnion::Tag::intEnum:
+    return "intEnum";
+  case EnumUnion::Tag::longEnum:
+    return "longEnum";
+  case EnumUnion::Tag::deprecatedField:
+    return "deprecatedField";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+#pragma clang diagnostic pop
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+template <>
+constexpr inline std::array<::android::aidl::tests::unions::EnumUnion::Tag, 3> enum_values<::android::aidl::tests::unions::EnumUnion::Tag> = {
+  ::android::aidl::tests::unions::EnumUnion::Tag::intEnum,
+  ::android::aidl::tests::unions::EnumUnion::Tag::longEnum,
+  ::android::aidl::tests::unions::EnumUnion::Tag::deprecatedField,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/UnionInUnion.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/UnionInUnion.h
new file mode 100644
index 0000000..2b28831
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/UnionInUnion.h
@@ -0,0 +1,155 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/unions/EnumUnion.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+class UnionInUnion : public ::android::Parcelable {
+public:
+  enum class Tag : int32_t {
+    first = 0,
+    second = 1,
+  };
+  // Expose tag symbols for legacy code
+  static const inline Tag first = Tag::first;
+  static const inline Tag second = Tag::second;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, UnionInUnion>;
+
+  UnionInUnion() : _value(std::in_place_index<static_cast<size_t>(first)>, ::android::aidl::tests::unions::EnumUnion()) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr UnionInUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit UnionInUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static UnionInUnion make(_Tp&&... _args) {
+    return UnionInUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static UnionInUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return UnionInUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  inline bool operator!=(const UnionInUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const UnionInUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const UnionInUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const UnionInUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const UnionInUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const UnionInUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.unions.UnionInUnion");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "UnionInUnion{";
+    switch (getTag()) {
+    case first: os << "first: " << ::android::internal::ToString(get<first>()); break;
+    case second: os << "second: " << ::android::internal::ToString(get<second>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<::android::aidl::tests::unions::EnumUnion, int32_t> _value;
+};  // class UnionInUnion
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+[[nodiscard]] static inline std::string toString(UnionInUnion::Tag val) {
+  switch(val) {
+  case UnionInUnion::Tag::first:
+    return "first";
+  case UnionInUnion::Tag::second:
+    return "second";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::unions::UnionInUnion::Tag, 2> enum_values<::android::aidl::tests::unions::UnionInUnion::Tag> = {
+  ::android::aidl::tests::unions::UnionInUnion::Tag::first,
+  ::android::aidl::tests::unions::UnionInUnion::Tag::second,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/timestamp b/tests/golden_output/aidl-test-interface-cpp-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ArrayOfInterfaces.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ArrayOfInterfaces.java
new file mode 100644
index 0000000..ba904b8
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ArrayOfInterfaces.java
@@ -0,0 +1,604 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ArrayOfInterfaces.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+package android.aidl.tests;
+public class ArrayOfInterfaces implements android.os.Parcelable
+{
+  public static final android.os.Parcelable.Creator<ArrayOfInterfaces> CREATOR = new android.os.Parcelable.Creator<ArrayOfInterfaces>() {
+    @Override
+    public ArrayOfInterfaces createFromParcel(android.os.Parcel _aidl_source) {
+      ArrayOfInterfaces _aidl_out = new ArrayOfInterfaces();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public ArrayOfInterfaces[] newArray(int _aidl_size) {
+      return new ArrayOfInterfaces[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+  public interface IEmptyInterface extends android.os.IInterface
+  {
+    /** Default implementation for IEmptyInterface. */
+    public static class Default implements android.aidl.tests.ArrayOfInterfaces.IEmptyInterface
+    {
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ArrayOfInterfaces.IEmptyInterface
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.tests.ArrayOfInterfaces.IEmptyInterface interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.tests.ArrayOfInterfaces.IEmptyInterface asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.tests.ArrayOfInterfaces.IEmptyInterface))) {
+          return ((android.aidl.tests.ArrayOfInterfaces.IEmptyInterface)iin);
+        }
+        return new android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      /** @hide */
+      public static java.lang.String getDefaultTransactionName(int transactionCode)
+      {
+        switch (transactionCode)
+        {
+          default:
+          {
+            return null;
+          }
+        }
+      }
+      /** @hide */
+      public java.lang.String getTransactionName(int transactionCode)
+      {
+        return this.getDefaultTransactionName(transactionCode);
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        switch (code)
+        {
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+      }
+      private static class Proxy implements android.aidl.tests.ArrayOfInterfaces.IEmptyInterface
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+      }
+      /** @hide */
+      public int getMaxTransactionId()
+      {
+        return 0;
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ArrayOfInterfaces.IEmptyInterface";
+  }
+  public interface IMyInterface extends android.os.IInterface
+  {
+    /** Default implementation for IMyInterface. */
+    public static class Default implements android.aidl.tests.ArrayOfInterfaces.IMyInterface
+    {
+      @Override public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] methodWithInterfaces(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface iface, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface nullable_iface, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_in, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_out, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_inout, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_in, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_out, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_inout) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ArrayOfInterfaces.IMyInterface
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.tests.ArrayOfInterfaces.IMyInterface interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.tests.ArrayOfInterfaces.IMyInterface asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.tests.ArrayOfInterfaces.IMyInterface))) {
+          return ((android.aidl.tests.ArrayOfInterfaces.IMyInterface)iin);
+        }
+        return new android.aidl.tests.ArrayOfInterfaces.IMyInterface.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      /** @hide */
+      public static java.lang.String getDefaultTransactionName(int transactionCode)
+      {
+        switch (transactionCode)
+        {
+          case TRANSACTION_methodWithInterfaces:
+          {
+            return "methodWithInterfaces";
+          }
+          default:
+          {
+            return null;
+          }
+        }
+      }
+      /** @hide */
+      public java.lang.String getTransactionName(int transactionCode)
+      {
+        return this.getDefaultTransactionName(transactionCode);
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+          data.enforceInterface(descriptor);
+        }
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        switch (code)
+        {
+          case TRANSACTION_methodWithInterfaces:
+          {
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _arg0;
+            _arg0 = android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub.asInterface(data.readStrongBinder());
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _arg1;
+            _arg1 = android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub.asInterface(data.readStrongBinder());
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _arg2;
+            _arg2 = data.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _arg3;
+            int _arg3_length = data.readInt();
+            if (_arg3_length < 0) {
+              _arg3 = null;
+            } else {
+              _arg3 = new android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[_arg3_length];
+            }
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _arg4;
+            _arg4 = data.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _arg5;
+            _arg5 = data.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _arg6;
+            int _arg6_length = data.readInt();
+            if (_arg6_length < 0) {
+              _arg6 = null;
+            } else {
+              _arg6 = new android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[_arg6_length];
+            }
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _arg7;
+            _arg7 = data.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+            data.enforceNoDataAvail();
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _result = this.methodWithInterfaces(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
+            reply.writeNoException();
+            reply.writeInterfaceArray(_result);
+            reply.writeInterfaceArray(_arg3);
+            reply.writeInterfaceArray(_arg4);
+            reply.writeInterfaceArray(_arg6);
+            reply.writeInterfaceArray(_arg7);
+            break;
+          }
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+        return true;
+      }
+      private static class Proxy implements android.aidl.tests.ArrayOfInterfaces.IMyInterface
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+        @Override public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] methodWithInterfaces(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface iface, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface nullable_iface, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_in, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_out, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_inout, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_in, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_out, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_inout) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeStrongInterface(iface);
+            _data.writeStrongInterface(nullable_iface);
+            _data.writeInterfaceArray(iface_array_in);
+            _data.writeInt(iface_array_out.length);
+            _data.writeInterfaceArray(iface_array_inout);
+            _data.writeInterfaceArray(nullable_iface_array_in);
+            _data.writeInt(nullable_iface_array_out.length);
+            _data.writeInterfaceArray(nullable_iface_array_inout);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_methodWithInterfaces, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+            _reply.readInterfaceArray(iface_array_out, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+            _reply.readInterfaceArray(iface_array_inout, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+            _reply.readInterfaceArray(nullable_iface_array_out, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+            _reply.readInterfaceArray(nullable_iface_array_inout, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+      }
+      static final int TRANSACTION_methodWithInterfaces = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+      /** @hide */
+      public int getMaxTransactionId()
+      {
+        return 0;
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ArrayOfInterfaces.IMyInterface";
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] methodWithInterfaces(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface iface, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface nullable_iface, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_in, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_out, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_inout, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_in, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_out, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_inout) throws android.os.RemoteException;
+  }
+  public static class MyParcelable implements android.os.Parcelable
+  {
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface iface;
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface nullable_iface;
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array;
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array;
+    public static final android.os.Parcelable.Creator<MyParcelable> CREATOR = new android.os.Parcelable.Creator<MyParcelable>() {
+      @Override
+      public MyParcelable createFromParcel(android.os.Parcel _aidl_source) {
+        MyParcelable _aidl_out = new MyParcelable();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public MyParcelable[] newArray(int _aidl_size) {
+        return new MyParcelable[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeStrongInterface(iface);
+      _aidl_parcel.writeStrongInterface(nullable_iface);
+      _aidl_parcel.writeInterfaceArray(iface_array);
+      _aidl_parcel.writeInterfaceArray(nullable_iface_array);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        iface = android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_iface = android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        iface_array = _aidl_parcel.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_iface_array = _aidl_parcel.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public String toString() {
+      java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "{", "}");
+      _aidl_sj.add("iface: " + (java.util.Objects.toString(iface)));
+      _aidl_sj.add("nullable_iface: " + (java.util.Objects.toString(nullable_iface)));
+      _aidl_sj.add("iface_array: " + (java.util.Arrays.toString(iface_array)));
+      _aidl_sj.add("nullable_iface_array: " + (java.util.Arrays.toString(nullable_iface_array)));
+      return "MyParcelable" + _aidl_sj.toString()  ;
+    }
+    @Override
+    public boolean equals(Object other) {
+      if (this == other) return true;
+      if (other == null) return false;
+      if (!(other instanceof MyParcelable)) return false;
+      MyParcelable that = (MyParcelable)other;
+      if (!java.util.Objects.deepEquals(iface, that.iface)) return false;
+      if (!java.util.Objects.deepEquals(nullable_iface, that.nullable_iface)) return false;
+      if (!java.util.Objects.deepEquals(iface_array, that.iface_array)) return false;
+      if (!java.util.Objects.deepEquals(nullable_iface_array, that.nullable_iface_array)) return false;
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return java.util.Arrays.deepHashCode(java.util.Arrays.asList(iface, nullable_iface, iface_array, nullable_iface_array).toArray());
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+  public static final class MyUnion implements android.os.Parcelable {
+    // tags for union fields
+    public final static int iface = 0;  // android.aidl.tests.ArrayOfInterfaces.IEmptyInterface iface;
+    public final static int nullable_iface = 1;  // android.aidl.tests.ArrayOfInterfaces.IEmptyInterface nullable_iface;
+    public final static int iface_array = 2;  // android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array;
+    public final static int nullable_iface_array = 3;  // android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array;
+
+    private int _tag;
+    private Object _value;
+
+    public MyUnion() {
+      android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _value = null;
+      this._tag = iface;
+      this._value = _value;
+    }
+
+    private MyUnion(android.os.Parcel _aidl_parcel) {
+      readFromParcel(_aidl_parcel);
+    }
+
+    private MyUnion(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+
+    public int getTag() {
+      return _tag;
+    }
+
+    // android.aidl.tests.ArrayOfInterfaces.IEmptyInterface iface;
+
+    public static MyUnion iface(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _value) {
+      return new MyUnion(iface, _value);
+    }
+
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface getIface() {
+      _assertTag(iface);
+      return (android.aidl.tests.ArrayOfInterfaces.IEmptyInterface) _value;
+    }
+
+    public void setIface(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _value) {
+      _set(iface, _value);
+    }
+
+    // android.aidl.tests.ArrayOfInterfaces.IEmptyInterface nullable_iface;
+
+    public static MyUnion nullable_iface(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _value) {
+      return new MyUnion(nullable_iface, _value);
+    }
+
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface getNullable_iface() {
+      _assertTag(nullable_iface);
+      return (android.aidl.tests.ArrayOfInterfaces.IEmptyInterface) _value;
+    }
+
+    public void setNullable_iface(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _value) {
+      _set(nullable_iface, _value);
+    }
+
+    // android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array;
+
+    public static MyUnion iface_array(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _value) {
+      return new MyUnion(iface_array, _value);
+    }
+
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] getIface_array() {
+      _assertTag(iface_array);
+      return (android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]) _value;
+    }
+
+    public void setIface_array(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _value) {
+      _set(iface_array, _value);
+    }
+
+    // android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array;
+
+    public static MyUnion nullable_iface_array(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _value) {
+      return new MyUnion(nullable_iface_array, _value);
+    }
+
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] getNullable_iface_array() {
+      _assertTag(nullable_iface_array);
+      return (android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]) _value;
+    }
+
+    public void setNullable_iface_array(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _value) {
+      _set(nullable_iface_array, _value);
+    }
+
+    public static final android.os.Parcelable.Creator<MyUnion> CREATOR = new android.os.Parcelable.Creator<MyUnion>() {
+      @Override
+      public MyUnion createFromParcel(android.os.Parcel _aidl_source) {
+        return new MyUnion(_aidl_source);
+      }
+      @Override
+      public MyUnion[] newArray(int _aidl_size) {
+        return new MyUnion[_aidl_size];
+      }
+    };
+
+    @Override
+    public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+      _aidl_parcel.writeInt(_tag);
+      switch (_tag) {
+      case iface:
+        _aidl_parcel.writeStrongInterface(getIface());
+        break;
+      case nullable_iface:
+        _aidl_parcel.writeStrongInterface(getNullable_iface());
+        break;
+      case iface_array:
+        _aidl_parcel.writeInterfaceArray(getIface_array());
+        break;
+      case nullable_iface_array:
+        _aidl_parcel.writeInterfaceArray(getNullable_iface_array());
+        break;
+      }
+    }
+
+    public void readFromParcel(android.os.Parcel _aidl_parcel) {
+      int _aidl_tag;
+      _aidl_tag = _aidl_parcel.readInt();
+      switch (_aidl_tag) {
+      case iface: {
+        android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _aidl_value;
+        _aidl_value = android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case nullable_iface: {
+        android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _aidl_value;
+        _aidl_value = android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case iface_array: {
+        android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _aidl_value;
+        _aidl_value = _aidl_parcel.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case nullable_iface_array: {
+        android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _aidl_value;
+        _aidl_value = _aidl_parcel.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      }
+      throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+    }
+
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      switch (getTag()) {
+      }
+      return _mask;
+    }
+
+    @Override
+    public String toString() {
+      switch (_tag) {
+      case iface: return "MyUnion.iface(" + (java.util.Objects.toString(getIface())) + ")";
+      case nullable_iface: return "MyUnion.nullable_iface(" + (java.util.Objects.toString(getNullable_iface())) + ")";
+      case iface_array: return "MyUnion.iface_array(" + (java.util.Arrays.toString(getIface_array())) + ")";
+      case nullable_iface_array: return "MyUnion.nullable_iface_array(" + (java.util.Arrays.toString(getNullable_iface_array())) + ")";
+      }
+      throw new IllegalStateException("unknown field: " + _tag);
+    }
+    @Override
+    public boolean equals(Object other) {
+      if (this == other) return true;
+      if (other == null) return false;
+      if (!(other instanceof MyUnion)) return false;
+      MyUnion that = (MyUnion)other;
+      if (_tag != that._tag) return false;
+      if (!java.util.Objects.deepEquals(_value, that._value)) return false;
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return java.util.Arrays.deepHashCode(java.util.Arrays.asList(_tag, _value).toArray());
+    }
+
+    private void _assertTag(int tag) {
+      if (getTag() != tag) {
+        throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+      }
+    }
+
+    private String _tagString(int _tag) {
+      switch (_tag) {
+      case iface: return "iface";
+      case nullable_iface: return "nullable_iface";
+      case iface_array: return "iface_array";
+      case nullable_iface_array: return "nullable_iface_array";
+      }
+      throw new IllegalStateException("unknown field: " + _tag);
+    }
+
+    private void _set(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+    public static @interface Tag {
+      public static final int iface = 0;
+      public static final int nullable_iface = 1;
+      public static final int iface_array = 2;
+      public static final int nullable_iface_array = 3;
+    }
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ArrayOfInterfaces.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ArrayOfInterfaces.java.d
new file mode 100644
index 0000000..7605fbe
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ArrayOfInterfaces.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ArrayOfInterfaces.java : \
+  system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/BackendType.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/BackendType.java
new file mode 100644
index 0000000..0e72394
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/BackendType.java
@@ -0,0 +1,11 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/BackendType.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+package android.aidl.tests;
+public @interface BackendType {
+  public static final byte CPP = 0;
+  public static final byte JAVA = 1;
+  public static final byte NDK = 2;
+  public static final byte RUST = 3;
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/BackendType.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/BackendType.java.d
new file mode 100644
index 0000000..bd69a28
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/BackendType.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/BackendType.java : \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ByteEnum.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ByteEnum.java
new file mode 100644
index 0000000..124d24a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ByteEnum.java
@@ -0,0 +1,12 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ByteEnum.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+package android.aidl.tests;
+/** Hello, world! */
+public @interface ByteEnum {
+  // Comment about FOO.
+  public static final byte FOO = 1;
+  public static final byte BAR = 2;
+  public static final byte BAZ = 3;
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ByteEnum.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ByteEnum.java.d
new file mode 100644
index 0000000..cf9a22f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ByteEnum.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ByteEnum.java : \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/CircularParcelable.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/CircularParcelable.java
new file mode 100644
index 0000000..a91dddc
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/CircularParcelable.java
@@ -0,0 +1,51 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/CircularParcelable.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+package android.aidl.tests;
+public class CircularParcelable implements android.os.Parcelable
+{
+  public android.aidl.tests.ITestService testService;
+  public static final android.os.Parcelable.Creator<CircularParcelable> CREATOR = new android.os.Parcelable.Creator<CircularParcelable>() {
+    @Override
+    public CircularParcelable createFromParcel(android.os.Parcel _aidl_source) {
+      CircularParcelable _aidl_out = new CircularParcelable();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public CircularParcelable[] newArray(int _aidl_size) {
+      return new CircularParcelable[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeStrongInterface(testService);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      testService = android.aidl.tests.ITestService.Stub.asInterface(_aidl_parcel.readStrongBinder());
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/CircularParcelable.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/CircularParcelable.java.d
new file mode 100644
index 0000000..bf6f8ca
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/CircularParcelable.java.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/CircularParcelable.java : \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ConstantExpressionEnum.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ConstantExpressionEnum.java
new file mode 100644
index 0000000..0e86ef9
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ConstantExpressionEnum.java
@@ -0,0 +1,24 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ConstantExpressionEnum.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+package android.aidl.tests;
+public @interface ConstantExpressionEnum {
+  // Should be all true / ones.
+  // dec literals are either int or long
+  public static final int decInt32_1 = 1;
+  public static final int decInt32_2 = 1;
+  public static final int decInt64_1 = 1;
+  public static final int decInt64_2 = 1;
+  public static final int decInt64_3 = 1;
+  public static final int decInt64_4 = 1;
+  // hex literals could be int or long
+  // 0x7fffffff is int, hence can be negated
+  public static final int hexInt32_1 = 1;
+  // 0x80000000 is int32_t max + 1
+  public static final int hexInt32_2 = 1;
+  // 0xFFFFFFFF is int32_t, not long; if it were long then ~(long)0xFFFFFFFF != 0
+  public static final int hexInt32_3 = 1;
+  // 0x7FFFFFFFFFFFFFFF is long, hence can be negated
+  public static final int hexInt64_1 = 1;
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ConstantExpressionEnum.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ConstantExpressionEnum.java.d
new file mode 100644
index 0000000..deebbb2
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ConstantExpressionEnum.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ConstantExpressionEnum.java : \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java
new file mode 100644
index 0000000..4daec2b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java
@@ -0,0 +1,12 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+package android.aidl.tests;
+/** @deprecated test */
+@Deprecated
+public @interface DeprecatedEnum {
+  public static final int A = 0;
+  public static final int B = 1;
+  public static final int C = 2;
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java.d
new file mode 100644
index 0000000..e471625
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java
new file mode 100644
index 0000000..7c1935a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java
@@ -0,0 +1,49 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+package android.aidl.tests;
+/** @deprecated test */
+@Deprecated
+public class DeprecatedParcelable implements android.os.Parcelable
+{
+  public static final android.os.Parcelable.Creator<DeprecatedParcelable> CREATOR = new android.os.Parcelable.Creator<DeprecatedParcelable>() {
+    @Override
+    public DeprecatedParcelable createFromParcel(android.os.Parcel _aidl_source) {
+      DeprecatedParcelable _aidl_out = new DeprecatedParcelable();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public DeprecatedParcelable[] newArray(int _aidl_size) {
+      return new DeprecatedParcelable[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java.d
new file mode 100644
index 0000000..94f6de2
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/FixedSize.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/FixedSize.java
new file mode 100644
index 0000000..0e13b1a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/FixedSize.java
@@ -0,0 +1,419 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/FixedSize.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+package android.aidl.tests;
+public class FixedSize implements android.os.Parcelable
+{
+  public static final android.os.Parcelable.Creator<FixedSize> CREATOR = new android.os.Parcelable.Creator<FixedSize>() {
+    @Override
+    public FixedSize createFromParcel(android.os.Parcel _aidl_source) {
+      FixedSize _aidl_out = new FixedSize();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public FixedSize[] newArray(int _aidl_size) {
+      return new FixedSize[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+  public static class FixedParcelable implements android.os.Parcelable
+  {
+    public boolean booleanValue = false;
+    public byte byteValue = 0;
+    public char charValue = '\0';
+    public int intValue = 0;
+    public long longValue = 0L;
+    public float floatValue = 0.000000f;
+    public double doubleValue = 0.000000;
+    public long enumValue = android.aidl.tests.LongEnum.FOO;
+    public android.aidl.tests.FixedSize.FixedUnion parcelableValue;
+    public static final android.os.Parcelable.Creator<FixedParcelable> CREATOR = new android.os.Parcelable.Creator<FixedParcelable>() {
+      @Override
+      public FixedParcelable createFromParcel(android.os.Parcel _aidl_source) {
+        FixedParcelable _aidl_out = new FixedParcelable();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public FixedParcelable[] newArray(int _aidl_size) {
+        return new FixedParcelable[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeBoolean(booleanValue);
+      _aidl_parcel.writeByte(byteValue);
+      _aidl_parcel.writeInt(((int)charValue));
+      _aidl_parcel.writeInt(intValue);
+      _aidl_parcel.writeLong(longValue);
+      _aidl_parcel.writeFloat(floatValue);
+      _aidl_parcel.writeDouble(doubleValue);
+      _aidl_parcel.writeLong(enumValue);
+      _aidl_parcel.writeTypedObject(parcelableValue, _aidl_flag);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        booleanValue = _aidl_parcel.readBoolean();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        byteValue = _aidl_parcel.readByte();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        charValue = (char)_aidl_parcel.readInt();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        intValue = _aidl_parcel.readInt();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        longValue = _aidl_parcel.readLong();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        floatValue = _aidl_parcel.readFloat();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        doubleValue = _aidl_parcel.readDouble();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        enumValue = _aidl_parcel.readLong();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        parcelableValue = _aidl_parcel.readTypedObject(android.aidl.tests.FixedSize.FixedUnion.CREATOR);
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      _mask |= describeContents(parcelableValue);
+      return _mask;
+    }
+    private int describeContents(Object _v) {
+      if (_v == null) return 0;
+      if (_v instanceof android.os.Parcelable) {
+        return ((android.os.Parcelable) _v).describeContents();
+      }
+      return 0;
+    }
+  }
+  public static final class FixedUnion implements android.os.Parcelable {
+    // tags for union fields
+    public final static int booleanValue = 0;  // boolean booleanValue;
+    public final static int byteValue = 1;  // byte byteValue;
+    public final static int charValue = 2;  // char charValue;
+    public final static int intValue = 3;  // int intValue;
+    public final static int longValue = 4;  // long longValue;
+    public final static int floatValue = 5;  // float floatValue;
+    public final static int doubleValue = 6;  // double doubleValue;
+    public final static int enumValue = 7;  // android.aidl.tests.LongEnum enumValue;
+
+    private int _tag;
+    private Object _value;
+
+    public FixedUnion() {
+      boolean _value = false;
+      this._tag = booleanValue;
+      this._value = _value;
+    }
+
+    private FixedUnion(android.os.Parcel _aidl_parcel) {
+      readFromParcel(_aidl_parcel);
+    }
+
+    private FixedUnion(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+
+    public int getTag() {
+      return _tag;
+    }
+
+    // boolean booleanValue;
+
+    public static FixedUnion booleanValue(boolean _value) {
+      return new FixedUnion(booleanValue, _value);
+    }
+
+    public boolean getBooleanValue() {
+      _assertTag(booleanValue);
+      return (boolean) _value;
+    }
+
+    public void setBooleanValue(boolean _value) {
+      _set(booleanValue, _value);
+    }
+
+    // byte byteValue;
+
+    public static FixedUnion byteValue(byte _value) {
+      return new FixedUnion(byteValue, _value);
+    }
+
+    public byte getByteValue() {
+      _assertTag(byteValue);
+      return (byte) _value;
+    }
+
+    public void setByteValue(byte _value) {
+      _set(byteValue, _value);
+    }
+
+    // char charValue;
+
+    public static FixedUnion charValue(char _value) {
+      return new FixedUnion(charValue, _value);
+    }
+
+    public char getCharValue() {
+      _assertTag(charValue);
+      return (char) _value;
+    }
+
+    public void setCharValue(char _value) {
+      _set(charValue, _value);
+    }
+
+    // int intValue;
+
+    public static FixedUnion intValue(int _value) {
+      return new FixedUnion(intValue, _value);
+    }
+
+    public int getIntValue() {
+      _assertTag(intValue);
+      return (int) _value;
+    }
+
+    public void setIntValue(int _value) {
+      _set(intValue, _value);
+    }
+
+    // long longValue;
+
+    public static FixedUnion longValue(long _value) {
+      return new FixedUnion(longValue, _value);
+    }
+
+    public long getLongValue() {
+      _assertTag(longValue);
+      return (long) _value;
+    }
+
+    public void setLongValue(long _value) {
+      _set(longValue, _value);
+    }
+
+    // float floatValue;
+
+    public static FixedUnion floatValue(float _value) {
+      return new FixedUnion(floatValue, _value);
+    }
+
+    public float getFloatValue() {
+      _assertTag(floatValue);
+      return (float) _value;
+    }
+
+    public void setFloatValue(float _value) {
+      _set(floatValue, _value);
+    }
+
+    // double doubleValue;
+
+    public static FixedUnion doubleValue(double _value) {
+      return new FixedUnion(doubleValue, _value);
+    }
+
+    public double getDoubleValue() {
+      _assertTag(doubleValue);
+      return (double) _value;
+    }
+
+    public void setDoubleValue(double _value) {
+      _set(doubleValue, _value);
+    }
+
+    // android.aidl.tests.LongEnum enumValue;
+
+    public static FixedUnion enumValue(long _value) {
+      return new FixedUnion(enumValue, _value);
+    }
+
+    public long getEnumValue() {
+      _assertTag(enumValue);
+      return (long) _value;
+    }
+
+    public void setEnumValue(long _value) {
+      _set(enumValue, _value);
+    }
+
+    public static final android.os.Parcelable.Creator<FixedUnion> CREATOR = new android.os.Parcelable.Creator<FixedUnion>() {
+      @Override
+      public FixedUnion createFromParcel(android.os.Parcel _aidl_source) {
+        return new FixedUnion(_aidl_source);
+      }
+      @Override
+      public FixedUnion[] newArray(int _aidl_size) {
+        return new FixedUnion[_aidl_size];
+      }
+    };
+
+    @Override
+    public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+      _aidl_parcel.writeInt(_tag);
+      switch (_tag) {
+      case booleanValue:
+        _aidl_parcel.writeBoolean(getBooleanValue());
+        break;
+      case byteValue:
+        _aidl_parcel.writeByte(getByteValue());
+        break;
+      case charValue:
+        _aidl_parcel.writeInt(((int)getCharValue()));
+        break;
+      case intValue:
+        _aidl_parcel.writeInt(getIntValue());
+        break;
+      case longValue:
+        _aidl_parcel.writeLong(getLongValue());
+        break;
+      case floatValue:
+        _aidl_parcel.writeFloat(getFloatValue());
+        break;
+      case doubleValue:
+        _aidl_parcel.writeDouble(getDoubleValue());
+        break;
+      case enumValue:
+        _aidl_parcel.writeLong(getEnumValue());
+        break;
+      }
+    }
+
+    public void readFromParcel(android.os.Parcel _aidl_parcel) {
+      int _aidl_tag;
+      _aidl_tag = _aidl_parcel.readInt();
+      switch (_aidl_tag) {
+      case booleanValue: {
+        boolean _aidl_value;
+        _aidl_value = _aidl_parcel.readBoolean();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case byteValue: {
+        byte _aidl_value;
+        _aidl_value = _aidl_parcel.readByte();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case charValue: {
+        char _aidl_value;
+        _aidl_value = (char)_aidl_parcel.readInt();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case intValue: {
+        int _aidl_value;
+        _aidl_value = _aidl_parcel.readInt();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case longValue: {
+        long _aidl_value;
+        _aidl_value = _aidl_parcel.readLong();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case floatValue: {
+        float _aidl_value;
+        _aidl_value = _aidl_parcel.readFloat();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case doubleValue: {
+        double _aidl_value;
+        _aidl_value = _aidl_parcel.readDouble();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case enumValue: {
+        long _aidl_value;
+        _aidl_value = _aidl_parcel.readLong();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      }
+      throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+    }
+
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      switch (getTag()) {
+      }
+      return _mask;
+    }
+
+    private void _assertTag(int tag) {
+      if (getTag() != tag) {
+        throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+      }
+    }
+
+    private String _tagString(int _tag) {
+      switch (_tag) {
+      case booleanValue: return "booleanValue";
+      case byteValue: return "byteValue";
+      case charValue: return "charValue";
+      case intValue: return "intValue";
+      case longValue: return "longValue";
+      case floatValue: return "floatValue";
+      case doubleValue: return "doubleValue";
+      case enumValue: return "enumValue";
+      }
+      throw new IllegalStateException("unknown field: " + _tag);
+    }
+
+    private void _set(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+    public static @interface Tag {
+      public static final byte booleanValue = 0;
+      public static final byte byteValue = 1;
+      public static final byte charValue = 2;
+      public static final byte intValue = 3;
+      public static final byte longValue = 4;
+      public static final byte floatValue = 5;
+      public static final byte doubleValue = 6;
+      public static final byte enumValue = 7;
+    }
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/FixedSize.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/FixedSize.java.d
new file mode 100644
index 0000000..74b092c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/FixedSize.java.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/FixedSize.java : \
+  system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/GenericStructuredParcelable.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/GenericStructuredParcelable.java
new file mode 100644
index 0000000..f29a82f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/GenericStructuredParcelable.java
@@ -0,0 +1,62 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/GenericStructuredParcelable.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+package android.aidl.tests;
+public class GenericStructuredParcelable<T,U,B> implements android.os.Parcelable
+{
+  public int a = 0;
+  public int b = 0;
+  public static final android.os.Parcelable.Creator<GenericStructuredParcelable> CREATOR = new android.os.Parcelable.Creator<GenericStructuredParcelable>() {
+    @Override
+    public GenericStructuredParcelable createFromParcel(android.os.Parcel _aidl_source) {
+      GenericStructuredParcelable _aidl_out = new GenericStructuredParcelable();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public GenericStructuredParcelable[] newArray(int _aidl_size) {
+      return new GenericStructuredParcelable[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(a);
+    _aidl_parcel.writeInt(b);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      a = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      b = _aidl_parcel.readInt();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public String toString() {
+    java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "{", "}");
+    _aidl_sj.add("a: " + (a));
+    _aidl_sj.add("b: " + (b));
+    return "GenericStructuredParcelable" + _aidl_sj.toString()  ;
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/GenericStructuredParcelable.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/GenericStructuredParcelable.java.d
new file mode 100644
index 0000000..a78038d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/GenericStructuredParcelable.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/GenericStructuredParcelable.java : \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ICircular.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ICircular.java
new file mode 100644
index 0000000..3211f00
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ICircular.java
@@ -0,0 +1,135 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ICircular.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+package android.aidl.tests;
+public interface ICircular extends android.os.IInterface
+{
+  /** Default implementation for ICircular. */
+  public static class Default implements android.aidl.tests.ICircular
+  {
+    @Override public android.aidl.tests.ITestService GetTestService() throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ICircular
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.ICircular interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.ICircular asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.ICircular))) {
+        return ((android.aidl.tests.ICircular)iin);
+      }
+      return new android.aidl.tests.ICircular.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_GetTestService:
+        {
+          return "GetTestService";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_GetTestService:
+        {
+          android.aidl.tests.ITestService _result = this.GetTestService();
+          reply.writeNoException();
+          reply.writeStrongInterface(_result);
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.ICircular
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public android.aidl.tests.ITestService GetTestService() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.ITestService _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetTestService, _data, _reply, 0);
+          _reply.readException();
+          _result = android.aidl.tests.ITestService.Stub.asInterface(_reply.readStrongBinder());
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+    }
+    static final int TRANSACTION_GetTestService = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 0;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ICircular";
+  public android.aidl.tests.ITestService GetTestService() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ICircular.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ICircular.java.d
new file mode 100644
index 0000000..1add0dd
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ICircular.java.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ICircular.java : \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java
new file mode 100644
index 0000000..a17e304
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java
@@ -0,0 +1,99 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+package android.aidl.tests;
+/** @deprecated test */
+@Deprecated
+public interface IDeprecated extends android.os.IInterface
+{
+  /** Default implementation for IDeprecated. */
+  public static class Default implements android.aidl.tests.IDeprecated
+  {
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.IDeprecated
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.IDeprecated interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.IDeprecated asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.IDeprecated))) {
+        return ((android.aidl.tests.IDeprecated)iin);
+      }
+      return new android.aidl.tests.IDeprecated.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+    }
+    private static class Proxy implements android.aidl.tests.IDeprecated
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+    }
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 0;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.IDeprecated";
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java.d
new file mode 100644
index 0000000..f97a90c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java : \
+  system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/INamedCallback.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/INamedCallback.java
new file mode 100644
index 0000000..0a11b72
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/INamedCallback.java
@@ -0,0 +1,135 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/INamedCallback.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+package android.aidl.tests;
+public interface INamedCallback extends android.os.IInterface
+{
+  /** Default implementation for INamedCallback. */
+  public static class Default implements android.aidl.tests.INamedCallback
+  {
+    @Override public java.lang.String GetName() throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.INamedCallback
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.INamedCallback interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.INamedCallback asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.INamedCallback))) {
+        return ((android.aidl.tests.INamedCallback)iin);
+      }
+      return new android.aidl.tests.INamedCallback.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_GetName:
+        {
+          return "GetName";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_GetName:
+        {
+          java.lang.String _result = this.GetName();
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.INamedCallback
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public java.lang.String GetName() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetName, _data, _reply, 0);
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+    }
+    static final int TRANSACTION_GetName = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 0;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.INamedCallback";
+  public java.lang.String GetName() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/INamedCallback.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/INamedCallback.java.d
new file mode 100644
index 0000000..c262450
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/INamedCallback.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/INamedCallback.java : \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/INewName.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/INewName.java
new file mode 100644
index 0000000..b668bf6
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/INewName.java
@@ -0,0 +1,135 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/INewName.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+package android.aidl.tests;
+public interface INewName extends android.os.IInterface
+{
+  /** Default implementation for INewName. */
+  public static class Default implements android.aidl.tests.INewName
+  {
+    @Override public java.lang.String RealName() throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.INewName
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.INewName interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.INewName asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.INewName))) {
+        return ((android.aidl.tests.INewName)iin);
+      }
+      return new android.aidl.tests.INewName.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_RealName:
+        {
+          return "RealName";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_RealName:
+        {
+          java.lang.String _result = this.RealName();
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.INewName
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public java.lang.String RealName() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RealName, _data, _reply, 0);
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+    }
+    static final int TRANSACTION_RealName = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 0;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.IOldName";
+  public java.lang.String RealName() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/INewName.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/INewName.java.d
new file mode 100644
index 0000000..431e219
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/INewName.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/INewName.java : \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IOldName.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IOldName.java
new file mode 100644
index 0000000..5f21edc
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IOldName.java
@@ -0,0 +1,135 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/IOldName.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+package android.aidl.tests;
+public interface IOldName extends android.os.IInterface
+{
+  /** Default implementation for IOldName. */
+  public static class Default implements android.aidl.tests.IOldName
+  {
+    @Override public java.lang.String RealName() throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.IOldName
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.IOldName interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.IOldName asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.IOldName))) {
+        return ((android.aidl.tests.IOldName)iin);
+      }
+      return new android.aidl.tests.IOldName.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_RealName:
+        {
+          return "RealName";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_RealName:
+        {
+          java.lang.String _result = this.RealName();
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.IOldName
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public java.lang.String RealName() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RealName, _data, _reply, 0);
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+    }
+    static final int TRANSACTION_RealName = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 0;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.IOldName";
+  public java.lang.String RealName() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IOldName.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IOldName.java.d
new file mode 100644
index 0000000..9bc46ea
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IOldName.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/IOldName.java : \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java
new file mode 100644
index 0000000..b4ed7bc
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java
@@ -0,0 +1,4510 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+package android.aidl.tests;
+/** interface comment */
+public interface ITestService extends android.os.IInterface
+{
+  /** Default implementation for ITestService. */
+  public static class Default implements android.aidl.tests.ITestService
+  {
+    // This is to emulate a method that is added after the service is implemented.
+    // So the client cannot assume that a call to this method will be successful
+    // or not. However, inside the test environment, we can't build client and
+    // the server with different version of this AIDL file. So, we let the server
+    // actually implement this and intercept the dispatch to the method
+    // inside onTransact().
+    // WARNING: Must be first method.
+    // This requires hard coding the transaction number. As long as this method is
+    // the first in this interface, it can keep the
+    // "::android::IBinder::FIRST_CALL_TRANSACTION + 0" value and allow
+    // methods to be added and removed.
+    @Override public int UnimplementedMethod(int arg) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    /**
+     * @deprecated to make sure we have something in system/tools/aidl which does a compile check
+     *     of deprecated and make sure this is reflected in goldens
+     */
+    @Override public void Deprecated() throws android.os.RemoteException
+    {
+    }
+    @Override public void TestOneway() throws android.os.RemoteException
+    {
+    }
+    // Test that primitives work as parameters and return types.
+    @Override public boolean RepeatBoolean(boolean token) throws android.os.RemoteException
+    {
+      return false;
+    }
+    @Override public byte RepeatByte(byte token) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public char RepeatChar(char token) throws android.os.RemoteException
+    {
+      return '\u0000';
+    }
+    @Override public int RepeatInt(int token) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public long RepeatLong(long token) throws android.os.RemoteException
+    {
+      return 0L;
+    }
+    @Override public float RepeatFloat(float token) throws android.os.RemoteException
+    {
+      return 0.0f;
+    }
+    @Override public double RepeatDouble(double token) throws android.os.RemoteException
+    {
+      return 0.0d;
+    }
+    @Override public java.lang.String RepeatString(java.lang.String token) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public byte RepeatByteEnum(byte token) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public int RepeatIntEnum(int token) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public long RepeatLongEnum(long token) throws android.os.RemoteException
+    {
+      return 0L;
+    }
+    // Test that arrays work as parameters and return types.
+    @Override public boolean[] ReverseBoolean(boolean[] input, boolean[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public byte[] ReverseByte(byte[] input, byte[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public char[] ReverseChar(char[] input, char[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public int[] ReverseInt(int[] input, int[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public long[] ReverseLong(long[] input, long[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public float[] ReverseFloat(float[] input, float[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public double[] ReverseDouble(double[] input, double[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public java.lang.String[] ReverseString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public byte[] ReverseByteEnum(byte[] input, byte[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public int[] ReverseIntEnum(int[] input, int[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public long[] ReverseLongEnum(long[] input, long[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    // Test that clients can send and receive Binders.
+    @Override public android.aidl.tests.INamedCallback GetOtherTestService(java.lang.String name) throws android.os.RemoteException
+    {
+      return null;
+    }
+    // returns true if the same service is already registered with the same name
+    @Override public boolean SetOtherTestService(java.lang.String name, android.aidl.tests.INamedCallback service) throws android.os.RemoteException
+    {
+      return false;
+    }
+    @Override public boolean VerifyName(android.aidl.tests.INamedCallback service, java.lang.String name) throws android.os.RemoteException
+    {
+      return false;
+    }
+    @Override public android.aidl.tests.INamedCallback[] GetInterfaceArray(java.lang.String[] names) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public boolean VerifyNamesWithInterfaceArray(android.aidl.tests.INamedCallback[] services, java.lang.String[] names) throws android.os.RemoteException
+    {
+      return false;
+    }
+    @Override public android.aidl.tests.INamedCallback[] GetNullableInterfaceArray(java.lang.String[] names) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public boolean VerifyNamesWithNullableInterfaceArray(android.aidl.tests.INamedCallback[] services, java.lang.String[] names) throws android.os.RemoteException
+    {
+      return false;
+    }
+    @Override public java.util.List<android.aidl.tests.INamedCallback> GetInterfaceList(java.lang.String[] names) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public boolean VerifyNamesWithInterfaceList(java.util.List<android.aidl.tests.INamedCallback> services, java.lang.String[] names) throws android.os.RemoteException
+    {
+      return false;
+    }
+    // Test that List<T> types work correctly.
+    @Override public java.util.List<java.lang.String> ReverseStringList(java.util.List<java.lang.String> input, java.util.List<java.lang.String> repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public android.os.ParcelFileDescriptor RepeatParcelFileDescriptor(android.os.ParcelFileDescriptor read) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public android.os.ParcelFileDescriptor[] ReverseParcelFileDescriptorArray(android.os.ParcelFileDescriptor[] input, android.os.ParcelFileDescriptor[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    // Test that service specific exceptions work correctly.
+    @Override public void ThrowServiceException(int code) throws android.os.RemoteException
+    {
+    }
+    // Test nullability
+    @Override public int[] RepeatNullableIntArray(int[] input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public byte[] RepeatNullableByteEnumArray(byte[] input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public int[] RepeatNullableIntEnumArray(int[] input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public long[] RepeatNullableLongEnumArray(long[] input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public java.lang.String RepeatNullableString(java.lang.String input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public java.util.List<java.lang.String> RepeatNullableStringList(java.util.List<java.lang.String> input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public android.aidl.tests.ITestService.Empty RepeatNullableParcelable(android.aidl.tests.ITestService.Empty input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public android.aidl.tests.ITestService.Empty[] RepeatNullableParcelableArray(android.aidl.tests.ITestService.Empty[] input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public java.util.List<android.aidl.tests.ITestService.Empty> RepeatNullableParcelableList(java.util.List<android.aidl.tests.ITestService.Empty> input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public void TakesAnIBinder(android.os.IBinder input) throws android.os.RemoteException
+    {
+    }
+    @Override public void TakesANullableIBinder(android.os.IBinder input) throws android.os.RemoteException
+    {
+    }
+    @Override public void TakesAnIBinderList(java.util.List<android.os.IBinder> input) throws android.os.RemoteException
+    {
+    }
+    @Override public void TakesANullableIBinderList(java.util.List<android.os.IBinder> input) throws android.os.RemoteException
+    {
+    }
+    // Test utf8 decoding from utf16 wire format
+    @Override public java.lang.String RepeatUtf8CppString(java.lang.String token) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public java.lang.String RepeatNullableUtf8CppString(java.lang.String token) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public java.lang.String[] ReverseUtf8CppString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public java.lang.String[] ReverseNullableUtf8CppString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public java.util.List<java.lang.String> ReverseUtf8CppStringList(java.util.List<java.lang.String> input, java.util.List<java.lang.String> repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    /** comment before annotation */
+    @Override public android.aidl.tests.INamedCallback GetCallback(boolean return_null) throws android.os.RemoteException
+    {
+      return null;
+    }
+    // Since this paracelable has clearly defined default values, it would be
+    // inefficient to use an IPC to fill it out in practice.
+    @Override public void FillOutStructuredParcelable(android.aidl.tests.StructuredParcelable parcel) throws android.os.RemoteException
+    {
+    }
+    @Override public void RepeatExtendableParcelable(android.aidl.tests.extension.ExtendableParcelable ep, android.aidl.tests.extension.ExtendableParcelable ep2) throws android.os.RemoteException
+    {
+    }
+    @Override public android.aidl.tests.RecursiveList ReverseList(android.aidl.tests.RecursiveList list) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public android.os.IBinder[] ReverseIBinderArray(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public android.os.IBinder[] ReverseNullableIBinderArray(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public android.aidl.tests.IOldName GetOldNameInterface() throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public android.aidl.tests.INewName GetNewNameInterface() throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public int[] GetUnionTags(android.aidl.tests.Union[] input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    // Retrieve the ICppJavaTests if the server supports it
+    @Override public android.os.IBinder GetCppJavaTests() throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public byte getBackendType() throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public android.aidl.tests.ICircular GetCircular(android.aidl.tests.CircularParcelable cp) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Delegator implementation for ITestService. */
+  public static class Delegator extends android.aidl.tests.ITestService.Stub
+  {
+    public Delegator(android.aidl.tests.ITestService impl) {
+      this.mImpl = impl;
+    }
+    // This is to emulate a method that is added after the service is implemented.
+    // So the client cannot assume that a call to this method will be successful
+    // or not. However, inside the test environment, we can't build client and
+    // the server with different version of this AIDL file. So, we let the server
+    // actually implement this and intercept the dispatch to the method
+    // inside onTransact().
+    // WARNING: Must be first method.
+    // This requires hard coding the transaction number. As long as this method is
+    // the first in this interface, it can keep the
+    // "::android::IBinder::FIRST_CALL_TRANSACTION + 0" value and allow
+    // methods to be added and removed.
+    @Override public int UnimplementedMethod(int arg) throws android.os.RemoteException
+    {
+      return mImpl.UnimplementedMethod(arg);
+    }
+    /**
+     * @deprecated to make sure we have something in system/tools/aidl which does a compile check
+     *     of deprecated and make sure this is reflected in goldens
+     */
+    @Override public void Deprecated() throws android.os.RemoteException
+    {
+      mImpl.Deprecated();
+    }
+    @Override public void TestOneway() throws android.os.RemoteException
+    {
+      mImpl.TestOneway();
+    }
+    // Test that primitives work as parameters and return types.
+    @Override public boolean RepeatBoolean(boolean token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatBoolean(token);
+    }
+    @Override public byte RepeatByte(byte token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatByte(token);
+    }
+    @Override public char RepeatChar(char token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatChar(token);
+    }
+    @Override public int RepeatInt(int token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatInt(token);
+    }
+    @Override public long RepeatLong(long token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatLong(token);
+    }
+    @Override public float RepeatFloat(float token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatFloat(token);
+    }
+    @Override public double RepeatDouble(double token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatDouble(token);
+    }
+    @Override public java.lang.String RepeatString(java.lang.String token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatString(token);
+    }
+    @Override public byte RepeatByteEnum(byte token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatByteEnum(token);
+    }
+    @Override public int RepeatIntEnum(int token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatIntEnum(token);
+    }
+    @Override public long RepeatLongEnum(long token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatLongEnum(token);
+    }
+    // Test that arrays work as parameters and return types.
+    @Override public boolean[] ReverseBoolean(boolean[] input, boolean[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseBoolean(input,repeated);
+    }
+    @Override public byte[] ReverseByte(byte[] input, byte[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseByte(input,repeated);
+    }
+    @Override public char[] ReverseChar(char[] input, char[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseChar(input,repeated);
+    }
+    @Override public int[] ReverseInt(int[] input, int[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseInt(input,repeated);
+    }
+    @Override public long[] ReverseLong(long[] input, long[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseLong(input,repeated);
+    }
+    @Override public float[] ReverseFloat(float[] input, float[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseFloat(input,repeated);
+    }
+    @Override public double[] ReverseDouble(double[] input, double[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseDouble(input,repeated);
+    }
+    @Override public java.lang.String[] ReverseString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseString(input,repeated);
+    }
+    @Override public byte[] ReverseByteEnum(byte[] input, byte[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseByteEnum(input,repeated);
+    }
+    @Override public int[] ReverseIntEnum(int[] input, int[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseIntEnum(input,repeated);
+    }
+    @Override public long[] ReverseLongEnum(long[] input, long[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseLongEnum(input,repeated);
+    }
+    // Test that clients can send and receive Binders.
+    @Override public android.aidl.tests.INamedCallback GetOtherTestService(java.lang.String name) throws android.os.RemoteException
+    {
+      return mImpl.GetOtherTestService(name);
+    }
+    // returns true if the same service is already registered with the same name
+    @Override public boolean SetOtherTestService(java.lang.String name, android.aidl.tests.INamedCallback service) throws android.os.RemoteException
+    {
+      return mImpl.SetOtherTestService(name,service);
+    }
+    @Override public boolean VerifyName(android.aidl.tests.INamedCallback service, java.lang.String name) throws android.os.RemoteException
+    {
+      return mImpl.VerifyName(service,name);
+    }
+    @Override public android.aidl.tests.INamedCallback[] GetInterfaceArray(java.lang.String[] names) throws android.os.RemoteException
+    {
+      return mImpl.GetInterfaceArray(names);
+    }
+    @Override public boolean VerifyNamesWithInterfaceArray(android.aidl.tests.INamedCallback[] services, java.lang.String[] names) throws android.os.RemoteException
+    {
+      return mImpl.VerifyNamesWithInterfaceArray(services,names);
+    }
+    @Override public android.aidl.tests.INamedCallback[] GetNullableInterfaceArray(java.lang.String[] names) throws android.os.RemoteException
+    {
+      return mImpl.GetNullableInterfaceArray(names);
+    }
+    @Override public boolean VerifyNamesWithNullableInterfaceArray(android.aidl.tests.INamedCallback[] services, java.lang.String[] names) throws android.os.RemoteException
+    {
+      return mImpl.VerifyNamesWithNullableInterfaceArray(services,names);
+    }
+    @Override public java.util.List<android.aidl.tests.INamedCallback> GetInterfaceList(java.lang.String[] names) throws android.os.RemoteException
+    {
+      return mImpl.GetInterfaceList(names);
+    }
+    @Override public boolean VerifyNamesWithInterfaceList(java.util.List<android.aidl.tests.INamedCallback> services, java.lang.String[] names) throws android.os.RemoteException
+    {
+      return mImpl.VerifyNamesWithInterfaceList(services,names);
+    }
+    // Test that List<T> types work correctly.
+    @Override public java.util.List<java.lang.String> ReverseStringList(java.util.List<java.lang.String> input, java.util.List<java.lang.String> repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseStringList(input,repeated);
+    }
+    @Override public android.os.ParcelFileDescriptor RepeatParcelFileDescriptor(android.os.ParcelFileDescriptor read) throws android.os.RemoteException
+    {
+      return mImpl.RepeatParcelFileDescriptor(read);
+    }
+    @Override public android.os.ParcelFileDescriptor[] ReverseParcelFileDescriptorArray(android.os.ParcelFileDescriptor[] input, android.os.ParcelFileDescriptor[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseParcelFileDescriptorArray(input,repeated);
+    }
+    // Test that service specific exceptions work correctly.
+    @Override public void ThrowServiceException(int code) throws android.os.RemoteException
+    {
+      mImpl.ThrowServiceException(code);
+    }
+    // Test nullability
+    @Override public int[] RepeatNullableIntArray(int[] input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableIntArray(input);
+    }
+    @Override public byte[] RepeatNullableByteEnumArray(byte[] input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableByteEnumArray(input);
+    }
+    @Override public int[] RepeatNullableIntEnumArray(int[] input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableIntEnumArray(input);
+    }
+    @Override public long[] RepeatNullableLongEnumArray(long[] input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableLongEnumArray(input);
+    }
+    @Override public java.lang.String RepeatNullableString(java.lang.String input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableString(input);
+    }
+    @Override public java.util.List<java.lang.String> RepeatNullableStringList(java.util.List<java.lang.String> input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableStringList(input);
+    }
+    @Override public android.aidl.tests.ITestService.Empty RepeatNullableParcelable(android.aidl.tests.ITestService.Empty input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableParcelable(input);
+    }
+    @Override public android.aidl.tests.ITestService.Empty[] RepeatNullableParcelableArray(android.aidl.tests.ITestService.Empty[] input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableParcelableArray(input);
+    }
+    @Override public java.util.List<android.aidl.tests.ITestService.Empty> RepeatNullableParcelableList(java.util.List<android.aidl.tests.ITestService.Empty> input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableParcelableList(input);
+    }
+    @Override public void TakesAnIBinder(android.os.IBinder input) throws android.os.RemoteException
+    {
+      mImpl.TakesAnIBinder(input);
+    }
+    @Override public void TakesANullableIBinder(android.os.IBinder input) throws android.os.RemoteException
+    {
+      mImpl.TakesANullableIBinder(input);
+    }
+    @Override public void TakesAnIBinderList(java.util.List<android.os.IBinder> input) throws android.os.RemoteException
+    {
+      mImpl.TakesAnIBinderList(input);
+    }
+    @Override public void TakesANullableIBinderList(java.util.List<android.os.IBinder> input) throws android.os.RemoteException
+    {
+      mImpl.TakesANullableIBinderList(input);
+    }
+    // Test utf8 decoding from utf16 wire format
+    @Override public java.lang.String RepeatUtf8CppString(java.lang.String token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatUtf8CppString(token);
+    }
+    @Override public java.lang.String RepeatNullableUtf8CppString(java.lang.String token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableUtf8CppString(token);
+    }
+    @Override public java.lang.String[] ReverseUtf8CppString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseUtf8CppString(input,repeated);
+    }
+    @Override public java.lang.String[] ReverseNullableUtf8CppString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseNullableUtf8CppString(input,repeated);
+    }
+    @Override public java.util.List<java.lang.String> ReverseUtf8CppStringList(java.util.List<java.lang.String> input, java.util.List<java.lang.String> repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseUtf8CppStringList(input,repeated);
+    }
+    /** comment before annotation */
+    @Override public android.aidl.tests.INamedCallback GetCallback(boolean return_null) throws android.os.RemoteException
+    {
+      return mImpl.GetCallback(return_null);
+    }
+    // Since this paracelable has clearly defined default values, it would be
+    // inefficient to use an IPC to fill it out in practice.
+    @Override public void FillOutStructuredParcelable(android.aidl.tests.StructuredParcelable parcel) throws android.os.RemoteException
+    {
+      mImpl.FillOutStructuredParcelable(parcel);
+    }
+    @Override public void RepeatExtendableParcelable(android.aidl.tests.extension.ExtendableParcelable ep, android.aidl.tests.extension.ExtendableParcelable ep2) throws android.os.RemoteException
+    {
+      mImpl.RepeatExtendableParcelable(ep,ep2);
+    }
+    @Override public android.aidl.tests.RecursiveList ReverseList(android.aidl.tests.RecursiveList list) throws android.os.RemoteException
+    {
+      return mImpl.ReverseList(list);
+    }
+    @Override public android.os.IBinder[] ReverseIBinderArray(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseIBinderArray(input,repeated);
+    }
+    @Override public android.os.IBinder[] ReverseNullableIBinderArray(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseNullableIBinderArray(input,repeated);
+    }
+    @Override public android.aidl.tests.IOldName GetOldNameInterface() throws android.os.RemoteException
+    {
+      return mImpl.GetOldNameInterface();
+    }
+    @Override public android.aidl.tests.INewName GetNewNameInterface() throws android.os.RemoteException
+    {
+      return mImpl.GetNewNameInterface();
+    }
+    @Override public int[] GetUnionTags(android.aidl.tests.Union[] input) throws android.os.RemoteException
+    {
+      return mImpl.GetUnionTags(input);
+    }
+    // Retrieve the ICppJavaTests if the server supports it
+    @Override public android.os.IBinder GetCppJavaTests() throws android.os.RemoteException
+    {
+      return mImpl.GetCppJavaTests();
+    }
+    @Override public byte getBackendType() throws android.os.RemoteException
+    {
+      return mImpl.getBackendType();
+    }
+    @Override public android.aidl.tests.ICircular GetCircular(android.aidl.tests.CircularParcelable cp) throws android.os.RemoteException
+    {
+      return mImpl.GetCircular(cp);
+    }
+    android.aidl.tests.ITestService mImpl;
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ITestService
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.ITestService interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.ITestService asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.ITestService))) {
+        return ((android.aidl.tests.ITestService)iin);
+      }
+      return new android.aidl.tests.ITestService.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_UnimplementedMethod:
+        {
+          return "UnimplementedMethod";
+        }
+        case TRANSACTION_Deprecated:
+        {
+          return "Deprecated";
+        }
+        case TRANSACTION_TestOneway:
+        {
+          return "TestOneway";
+        }
+        case TRANSACTION_RepeatBoolean:
+        {
+          return "RepeatBoolean";
+        }
+        case TRANSACTION_RepeatByte:
+        {
+          return "RepeatByte";
+        }
+        case TRANSACTION_RepeatChar:
+        {
+          return "RepeatChar";
+        }
+        case TRANSACTION_RepeatInt:
+        {
+          return "RepeatInt";
+        }
+        case TRANSACTION_RepeatLong:
+        {
+          return "RepeatLong";
+        }
+        case TRANSACTION_RepeatFloat:
+        {
+          return "RepeatFloat";
+        }
+        case TRANSACTION_RepeatDouble:
+        {
+          return "RepeatDouble";
+        }
+        case TRANSACTION_RepeatString:
+        {
+          return "RepeatString";
+        }
+        case TRANSACTION_RepeatByteEnum:
+        {
+          return "RepeatByteEnum";
+        }
+        case TRANSACTION_RepeatIntEnum:
+        {
+          return "RepeatIntEnum";
+        }
+        case TRANSACTION_RepeatLongEnum:
+        {
+          return "RepeatLongEnum";
+        }
+        case TRANSACTION_ReverseBoolean:
+        {
+          return "ReverseBoolean";
+        }
+        case TRANSACTION_ReverseByte:
+        {
+          return "ReverseByte";
+        }
+        case TRANSACTION_ReverseChar:
+        {
+          return "ReverseChar";
+        }
+        case TRANSACTION_ReverseInt:
+        {
+          return "ReverseInt";
+        }
+        case TRANSACTION_ReverseLong:
+        {
+          return "ReverseLong";
+        }
+        case TRANSACTION_ReverseFloat:
+        {
+          return "ReverseFloat";
+        }
+        case TRANSACTION_ReverseDouble:
+        {
+          return "ReverseDouble";
+        }
+        case TRANSACTION_ReverseString:
+        {
+          return "ReverseString";
+        }
+        case TRANSACTION_ReverseByteEnum:
+        {
+          return "ReverseByteEnum";
+        }
+        case TRANSACTION_ReverseIntEnum:
+        {
+          return "ReverseIntEnum";
+        }
+        case TRANSACTION_ReverseLongEnum:
+        {
+          return "ReverseLongEnum";
+        }
+        case TRANSACTION_GetOtherTestService:
+        {
+          return "GetOtherTestService";
+        }
+        case TRANSACTION_SetOtherTestService:
+        {
+          return "SetOtherTestService";
+        }
+        case TRANSACTION_VerifyName:
+        {
+          return "VerifyName";
+        }
+        case TRANSACTION_GetInterfaceArray:
+        {
+          return "GetInterfaceArray";
+        }
+        case TRANSACTION_VerifyNamesWithInterfaceArray:
+        {
+          return "VerifyNamesWithInterfaceArray";
+        }
+        case TRANSACTION_GetNullableInterfaceArray:
+        {
+          return "GetNullableInterfaceArray";
+        }
+        case TRANSACTION_VerifyNamesWithNullableInterfaceArray:
+        {
+          return "VerifyNamesWithNullableInterfaceArray";
+        }
+        case TRANSACTION_GetInterfaceList:
+        {
+          return "GetInterfaceList";
+        }
+        case TRANSACTION_VerifyNamesWithInterfaceList:
+        {
+          return "VerifyNamesWithInterfaceList";
+        }
+        case TRANSACTION_ReverseStringList:
+        {
+          return "ReverseStringList";
+        }
+        case TRANSACTION_RepeatParcelFileDescriptor:
+        {
+          return "RepeatParcelFileDescriptor";
+        }
+        case TRANSACTION_ReverseParcelFileDescriptorArray:
+        {
+          return "ReverseParcelFileDescriptorArray";
+        }
+        case TRANSACTION_ThrowServiceException:
+        {
+          return "ThrowServiceException";
+        }
+        case TRANSACTION_RepeatNullableIntArray:
+        {
+          return "RepeatNullableIntArray";
+        }
+        case TRANSACTION_RepeatNullableByteEnumArray:
+        {
+          return "RepeatNullableByteEnumArray";
+        }
+        case TRANSACTION_RepeatNullableIntEnumArray:
+        {
+          return "RepeatNullableIntEnumArray";
+        }
+        case TRANSACTION_RepeatNullableLongEnumArray:
+        {
+          return "RepeatNullableLongEnumArray";
+        }
+        case TRANSACTION_RepeatNullableString:
+        {
+          return "RepeatNullableString";
+        }
+        case TRANSACTION_RepeatNullableStringList:
+        {
+          return "RepeatNullableStringList";
+        }
+        case TRANSACTION_RepeatNullableParcelable:
+        {
+          return "RepeatNullableParcelable";
+        }
+        case TRANSACTION_RepeatNullableParcelableArray:
+        {
+          return "RepeatNullableParcelableArray";
+        }
+        case TRANSACTION_RepeatNullableParcelableList:
+        {
+          return "RepeatNullableParcelableList";
+        }
+        case TRANSACTION_TakesAnIBinder:
+        {
+          return "TakesAnIBinder";
+        }
+        case TRANSACTION_TakesANullableIBinder:
+        {
+          return "TakesANullableIBinder";
+        }
+        case TRANSACTION_TakesAnIBinderList:
+        {
+          return "TakesAnIBinderList";
+        }
+        case TRANSACTION_TakesANullableIBinderList:
+        {
+          return "TakesANullableIBinderList";
+        }
+        case TRANSACTION_RepeatUtf8CppString:
+        {
+          return "RepeatUtf8CppString";
+        }
+        case TRANSACTION_RepeatNullableUtf8CppString:
+        {
+          return "RepeatNullableUtf8CppString";
+        }
+        case TRANSACTION_ReverseUtf8CppString:
+        {
+          return "ReverseUtf8CppString";
+        }
+        case TRANSACTION_ReverseNullableUtf8CppString:
+        {
+          return "ReverseNullableUtf8CppString";
+        }
+        case TRANSACTION_ReverseUtf8CppStringList:
+        {
+          return "ReverseUtf8CppStringList";
+        }
+        case TRANSACTION_GetCallback:
+        {
+          return "GetCallback";
+        }
+        case TRANSACTION_FillOutStructuredParcelable:
+        {
+          return "FillOutStructuredParcelable";
+        }
+        case TRANSACTION_RepeatExtendableParcelable:
+        {
+          return "RepeatExtendableParcelable";
+        }
+        case TRANSACTION_ReverseList:
+        {
+          return "ReverseList";
+        }
+        case TRANSACTION_ReverseIBinderArray:
+        {
+          return "ReverseIBinderArray";
+        }
+        case TRANSACTION_ReverseNullableIBinderArray:
+        {
+          return "ReverseNullableIBinderArray";
+        }
+        case TRANSACTION_GetOldNameInterface:
+        {
+          return "GetOldNameInterface";
+        }
+        case TRANSACTION_GetNewNameInterface:
+        {
+          return "GetNewNameInterface";
+        }
+        case TRANSACTION_GetUnionTags:
+        {
+          return "GetUnionTags";
+        }
+        case TRANSACTION_GetCppJavaTests:
+        {
+          return "GetCppJavaTests";
+        }
+        case TRANSACTION_getBackendType:
+        {
+          return "getBackendType";
+        }
+        case TRANSACTION_GetCircular:
+        {
+          return "GetCircular";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_UnimplementedMethod:
+        {
+          int _arg0;
+          _arg0 = data.readInt();
+          data.enforceNoDataAvail();
+          int _result = this.UnimplementedMethod(_arg0);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          break;
+        }
+        case TRANSACTION_Deprecated:
+        {
+          this.Deprecated();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_TestOneway:
+        {
+          this.TestOneway();
+          break;
+        }
+        case TRANSACTION_RepeatBoolean:
+        {
+          boolean _arg0;
+          _arg0 = data.readBoolean();
+          data.enforceNoDataAvail();
+          boolean _result = this.RepeatBoolean(_arg0);
+          reply.writeNoException();
+          reply.writeBoolean(_result);
+          break;
+        }
+        case TRANSACTION_RepeatByte:
+        {
+          byte _arg0;
+          _arg0 = data.readByte();
+          data.enforceNoDataAvail();
+          byte _result = this.RepeatByte(_arg0);
+          reply.writeNoException();
+          reply.writeByte(_result);
+          break;
+        }
+        case TRANSACTION_RepeatChar:
+        {
+          char _arg0;
+          _arg0 = (char)data.readInt();
+          data.enforceNoDataAvail();
+          char _result = this.RepeatChar(_arg0);
+          reply.writeNoException();
+          reply.writeInt(((int)_result));
+          break;
+        }
+        case TRANSACTION_RepeatInt:
+        {
+          int _arg0;
+          _arg0 = data.readInt();
+          data.enforceNoDataAvail();
+          int _result = this.RepeatInt(_arg0);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          break;
+        }
+        case TRANSACTION_RepeatLong:
+        {
+          long _arg0;
+          _arg0 = data.readLong();
+          data.enforceNoDataAvail();
+          long _result = this.RepeatLong(_arg0);
+          reply.writeNoException();
+          reply.writeLong(_result);
+          break;
+        }
+        case TRANSACTION_RepeatFloat:
+        {
+          float _arg0;
+          _arg0 = data.readFloat();
+          data.enforceNoDataAvail();
+          float _result = this.RepeatFloat(_arg0);
+          reply.writeNoException();
+          reply.writeFloat(_result);
+          break;
+        }
+        case TRANSACTION_RepeatDouble:
+        {
+          double _arg0;
+          _arg0 = data.readDouble();
+          data.enforceNoDataAvail();
+          double _result = this.RepeatDouble(_arg0);
+          reply.writeNoException();
+          reply.writeDouble(_result);
+          break;
+        }
+        case TRANSACTION_RepeatString:
+        {
+          java.lang.String _arg0;
+          _arg0 = data.readString();
+          data.enforceNoDataAvail();
+          java.lang.String _result = this.RepeatString(_arg0);
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        case TRANSACTION_RepeatByteEnum:
+        {
+          byte _arg0;
+          _arg0 = data.readByte();
+          data.enforceNoDataAvail();
+          byte _result = this.RepeatByteEnum(_arg0);
+          reply.writeNoException();
+          reply.writeByte(_result);
+          break;
+        }
+        case TRANSACTION_RepeatIntEnum:
+        {
+          int _arg0;
+          _arg0 = data.readInt();
+          data.enforceNoDataAvail();
+          int _result = this.RepeatIntEnum(_arg0);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          break;
+        }
+        case TRANSACTION_RepeatLongEnum:
+        {
+          long _arg0;
+          _arg0 = data.readLong();
+          data.enforceNoDataAvail();
+          long _result = this.RepeatLongEnum(_arg0);
+          reply.writeNoException();
+          reply.writeLong(_result);
+          break;
+        }
+        case TRANSACTION_ReverseBoolean:
+        {
+          boolean[] _arg0;
+          _arg0 = data.createBooleanArray();
+          boolean[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new boolean[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          boolean[] _result = this.ReverseBoolean(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeBooleanArray(_result);
+          reply.writeBooleanArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseByte:
+        {
+          byte[] _arg0;
+          _arg0 = data.createByteArray();
+          byte[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new byte[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          byte[] _result = this.ReverseByte(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeByteArray(_result);
+          reply.writeByteArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseChar:
+        {
+          char[] _arg0;
+          _arg0 = data.createCharArray();
+          char[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new char[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          char[] _result = this.ReverseChar(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeCharArray(_result);
+          reply.writeCharArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseInt:
+        {
+          int[] _arg0;
+          _arg0 = data.createIntArray();
+          int[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new int[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          int[] _result = this.ReverseInt(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeIntArray(_result);
+          reply.writeIntArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseLong:
+        {
+          long[] _arg0;
+          _arg0 = data.createLongArray();
+          long[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new long[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          long[] _result = this.ReverseLong(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeLongArray(_result);
+          reply.writeLongArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseFloat:
+        {
+          float[] _arg0;
+          _arg0 = data.createFloatArray();
+          float[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new float[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          float[] _result = this.ReverseFloat(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeFloatArray(_result);
+          reply.writeFloatArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseDouble:
+        {
+          double[] _arg0;
+          _arg0 = data.createDoubleArray();
+          double[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new double[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          double[] _result = this.ReverseDouble(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeDoubleArray(_result);
+          reply.writeDoubleArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseString:
+        {
+          java.lang.String[] _arg0;
+          _arg0 = data.createStringArray();
+          java.lang.String[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new java.lang.String[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          java.lang.String[] _result = this.ReverseString(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeStringArray(_result);
+          reply.writeStringArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseByteEnum:
+        {
+          byte[] _arg0;
+          _arg0 = data.createByteArray();
+          byte[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new byte[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          byte[] _result = this.ReverseByteEnum(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeByteArray(_result);
+          reply.writeByteArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseIntEnum:
+        {
+          int[] _arg0;
+          _arg0 = data.createIntArray();
+          int[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new int[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          int[] _result = this.ReverseIntEnum(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeIntArray(_result);
+          reply.writeIntArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseLongEnum:
+        {
+          long[] _arg0;
+          _arg0 = data.createLongArray();
+          long[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new long[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          long[] _result = this.ReverseLongEnum(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeLongArray(_result);
+          reply.writeLongArray(_arg1);
+          break;
+        }
+        case TRANSACTION_GetOtherTestService:
+        {
+          java.lang.String _arg0;
+          _arg0 = data.readString();
+          data.enforceNoDataAvail();
+          android.aidl.tests.INamedCallback _result = this.GetOtherTestService(_arg0);
+          reply.writeNoException();
+          reply.writeStrongInterface(_result);
+          break;
+        }
+        case TRANSACTION_SetOtherTestService:
+        {
+          java.lang.String _arg0;
+          _arg0 = data.readString();
+          android.aidl.tests.INamedCallback _arg1;
+          _arg1 = android.aidl.tests.INamedCallback.Stub.asInterface(data.readStrongBinder());
+          data.enforceNoDataAvail();
+          boolean _result = this.SetOtherTestService(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeBoolean(_result);
+          break;
+        }
+        case TRANSACTION_VerifyName:
+        {
+          android.aidl.tests.INamedCallback _arg0;
+          _arg0 = android.aidl.tests.INamedCallback.Stub.asInterface(data.readStrongBinder());
+          java.lang.String _arg1;
+          _arg1 = data.readString();
+          data.enforceNoDataAvail();
+          boolean _result = this.VerifyName(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeBoolean(_result);
+          break;
+        }
+        case TRANSACTION_GetInterfaceArray:
+        {
+          java.lang.String[] _arg0;
+          _arg0 = data.createStringArray();
+          data.enforceNoDataAvail();
+          android.aidl.tests.INamedCallback[] _result = this.GetInterfaceArray(_arg0);
+          reply.writeNoException();
+          reply.writeInterfaceArray(_result);
+          break;
+        }
+        case TRANSACTION_VerifyNamesWithInterfaceArray:
+        {
+          android.aidl.tests.INamedCallback[] _arg0;
+          _arg0 = data.createInterfaceArray(android.aidl.tests.INamedCallback[]::new, android.aidl.tests.INamedCallback.Stub::asInterface);
+          java.lang.String[] _arg1;
+          _arg1 = data.createStringArray();
+          data.enforceNoDataAvail();
+          boolean _result = this.VerifyNamesWithInterfaceArray(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeBoolean(_result);
+          break;
+        }
+        case TRANSACTION_GetNullableInterfaceArray:
+        {
+          java.lang.String[] _arg0;
+          _arg0 = data.createStringArray();
+          data.enforceNoDataAvail();
+          android.aidl.tests.INamedCallback[] _result = this.GetNullableInterfaceArray(_arg0);
+          reply.writeNoException();
+          reply.writeInterfaceArray(_result);
+          break;
+        }
+        case TRANSACTION_VerifyNamesWithNullableInterfaceArray:
+        {
+          android.aidl.tests.INamedCallback[] _arg0;
+          _arg0 = data.createInterfaceArray(android.aidl.tests.INamedCallback[]::new, android.aidl.tests.INamedCallback.Stub::asInterface);
+          java.lang.String[] _arg1;
+          _arg1 = data.createStringArray();
+          data.enforceNoDataAvail();
+          boolean _result = this.VerifyNamesWithNullableInterfaceArray(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeBoolean(_result);
+          break;
+        }
+        case TRANSACTION_GetInterfaceList:
+        {
+          java.lang.String[] _arg0;
+          _arg0 = data.createStringArray();
+          data.enforceNoDataAvail();
+          java.util.List<android.aidl.tests.INamedCallback> _result = this.GetInterfaceList(_arg0);
+          reply.writeNoException();
+          reply.writeInterfaceList(_result);
+          break;
+        }
+        case TRANSACTION_VerifyNamesWithInterfaceList:
+        {
+          java.util.List<android.aidl.tests.INamedCallback> _arg0;
+          _arg0 = data.createInterfaceArrayList(android.aidl.tests.INamedCallback.Stub::asInterface);
+          java.lang.String[] _arg1;
+          _arg1 = data.createStringArray();
+          data.enforceNoDataAvail();
+          boolean _result = this.VerifyNamesWithInterfaceList(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeBoolean(_result);
+          break;
+        }
+        case TRANSACTION_ReverseStringList:
+        {
+          java.util.List<java.lang.String> _arg0;
+          _arg0 = data.createStringArrayList();
+          java.util.List<java.lang.String> _arg1;
+          _arg1 = new java.util.ArrayList<java.lang.String>();
+          data.enforceNoDataAvail();
+          java.util.List<java.lang.String> _result = this.ReverseStringList(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeStringList(_result);
+          reply.writeStringList(_arg1);
+          break;
+        }
+        case TRANSACTION_RepeatParcelFileDescriptor:
+        {
+          android.os.ParcelFileDescriptor _arg0;
+          _arg0 = data.readTypedObject(android.os.ParcelFileDescriptor.CREATOR);
+          data.enforceNoDataAvail();
+          android.os.ParcelFileDescriptor _result = this.RepeatParcelFileDescriptor(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_ReverseParcelFileDescriptorArray:
+        {
+          android.os.ParcelFileDescriptor[] _arg0;
+          _arg0 = data.createTypedArray(android.os.ParcelFileDescriptor.CREATOR);
+          android.os.ParcelFileDescriptor[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new android.os.ParcelFileDescriptor[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          android.os.ParcelFileDescriptor[] _result = this.ReverseParcelFileDescriptorArray(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          reply.writeTypedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_ThrowServiceException:
+        {
+          int _arg0;
+          _arg0 = data.readInt();
+          data.enforceNoDataAvail();
+          this.ThrowServiceException(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_RepeatNullableIntArray:
+        {
+          int[] _arg0;
+          _arg0 = data.createIntArray();
+          data.enforceNoDataAvail();
+          int[] _result = this.RepeatNullableIntArray(_arg0);
+          reply.writeNoException();
+          reply.writeIntArray(_result);
+          break;
+        }
+        case TRANSACTION_RepeatNullableByteEnumArray:
+        {
+          byte[] _arg0;
+          _arg0 = data.createByteArray();
+          data.enforceNoDataAvail();
+          byte[] _result = this.RepeatNullableByteEnumArray(_arg0);
+          reply.writeNoException();
+          reply.writeByteArray(_result);
+          break;
+        }
+        case TRANSACTION_RepeatNullableIntEnumArray:
+        {
+          int[] _arg0;
+          _arg0 = data.createIntArray();
+          data.enforceNoDataAvail();
+          int[] _result = this.RepeatNullableIntEnumArray(_arg0);
+          reply.writeNoException();
+          reply.writeIntArray(_result);
+          break;
+        }
+        case TRANSACTION_RepeatNullableLongEnumArray:
+        {
+          long[] _arg0;
+          _arg0 = data.createLongArray();
+          data.enforceNoDataAvail();
+          long[] _result = this.RepeatNullableLongEnumArray(_arg0);
+          reply.writeNoException();
+          reply.writeLongArray(_result);
+          break;
+        }
+        case TRANSACTION_RepeatNullableString:
+        {
+          java.lang.String _arg0;
+          _arg0 = data.readString();
+          data.enforceNoDataAvail();
+          java.lang.String _result = this.RepeatNullableString(_arg0);
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        case TRANSACTION_RepeatNullableStringList:
+        {
+          java.util.List<java.lang.String> _arg0;
+          _arg0 = data.createStringArrayList();
+          data.enforceNoDataAvail();
+          java.util.List<java.lang.String> _result = this.RepeatNullableStringList(_arg0);
+          reply.writeNoException();
+          reply.writeStringList(_result);
+          break;
+        }
+        case TRANSACTION_RepeatNullableParcelable:
+        {
+          android.aidl.tests.ITestService.Empty _arg0;
+          _arg0 = data.readTypedObject(android.aidl.tests.ITestService.Empty.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.tests.ITestService.Empty _result = this.RepeatNullableParcelable(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_RepeatNullableParcelableArray:
+        {
+          android.aidl.tests.ITestService.Empty[] _arg0;
+          _arg0 = data.createTypedArray(android.aidl.tests.ITestService.Empty.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.tests.ITestService.Empty[] _result = this.RepeatNullableParcelableArray(_arg0);
+          reply.writeNoException();
+          reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_RepeatNullableParcelableList:
+        {
+          java.util.List<android.aidl.tests.ITestService.Empty> _arg0;
+          _arg0 = data.createTypedArrayList(android.aidl.tests.ITestService.Empty.CREATOR);
+          data.enforceNoDataAvail();
+          java.util.List<android.aidl.tests.ITestService.Empty> _result = this.RepeatNullableParcelableList(_arg0);
+          reply.writeNoException();
+          reply.writeTypedList(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_TakesAnIBinder:
+        {
+          android.os.IBinder _arg0;
+          _arg0 = data.readStrongBinder();
+          data.enforceNoDataAvail();
+          this.TakesAnIBinder(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_TakesANullableIBinder:
+        {
+          android.os.IBinder _arg0;
+          _arg0 = data.readStrongBinder();
+          data.enforceNoDataAvail();
+          this.TakesANullableIBinder(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_TakesAnIBinderList:
+        {
+          java.util.List<android.os.IBinder> _arg0;
+          _arg0 = data.createBinderArrayList();
+          data.enforceNoDataAvail();
+          this.TakesAnIBinderList(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_TakesANullableIBinderList:
+        {
+          java.util.List<android.os.IBinder> _arg0;
+          _arg0 = data.createBinderArrayList();
+          data.enforceNoDataAvail();
+          this.TakesANullableIBinderList(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_RepeatUtf8CppString:
+        {
+          java.lang.String _arg0;
+          _arg0 = data.readString();
+          data.enforceNoDataAvail();
+          java.lang.String _result = this.RepeatUtf8CppString(_arg0);
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        case TRANSACTION_RepeatNullableUtf8CppString:
+        {
+          java.lang.String _arg0;
+          _arg0 = data.readString();
+          data.enforceNoDataAvail();
+          java.lang.String _result = this.RepeatNullableUtf8CppString(_arg0);
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        case TRANSACTION_ReverseUtf8CppString:
+        {
+          java.lang.String[] _arg0;
+          _arg0 = data.createStringArray();
+          java.lang.String[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new java.lang.String[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          java.lang.String[] _result = this.ReverseUtf8CppString(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeStringArray(_result);
+          reply.writeStringArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseNullableUtf8CppString:
+        {
+          java.lang.String[] _arg0;
+          _arg0 = data.createStringArray();
+          java.lang.String[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new java.lang.String[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          java.lang.String[] _result = this.ReverseNullableUtf8CppString(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeStringArray(_result);
+          reply.writeStringArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseUtf8CppStringList:
+        {
+          java.util.List<java.lang.String> _arg0;
+          _arg0 = data.createStringArrayList();
+          java.util.List<java.lang.String> _arg1;
+          _arg1 = new java.util.ArrayList<java.lang.String>();
+          data.enforceNoDataAvail();
+          java.util.List<java.lang.String> _result = this.ReverseUtf8CppStringList(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeStringList(_result);
+          reply.writeStringList(_arg1);
+          break;
+        }
+        case TRANSACTION_GetCallback:
+        {
+          boolean _arg0;
+          _arg0 = data.readBoolean();
+          data.enforceNoDataAvail();
+          android.aidl.tests.INamedCallback _result = this.GetCallback(_arg0);
+          reply.writeNoException();
+          reply.writeStrongInterface(_result);
+          break;
+        }
+        case TRANSACTION_FillOutStructuredParcelable:
+        {
+          android.aidl.tests.StructuredParcelable _arg0;
+          _arg0 = data.readTypedObject(android.aidl.tests.StructuredParcelable.CREATOR);
+          data.enforceNoDataAvail();
+          this.FillOutStructuredParcelable(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_arg0, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_RepeatExtendableParcelable:
+        {
+          android.aidl.tests.extension.ExtendableParcelable _arg0;
+          _arg0 = data.readTypedObject(android.aidl.tests.extension.ExtendableParcelable.CREATOR);
+          android.aidl.tests.extension.ExtendableParcelable _arg1;
+          _arg1 = new android.aidl.tests.extension.ExtendableParcelable();
+          data.enforceNoDataAvail();
+          this.RepeatExtendableParcelable(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeTypedObject(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_ReverseList:
+        {
+          android.aidl.tests.RecursiveList _arg0;
+          _arg0 = data.readTypedObject(android.aidl.tests.RecursiveList.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.tests.RecursiveList _result = this.ReverseList(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_ReverseIBinderArray:
+        {
+          android.os.IBinder[] _arg0;
+          _arg0 = data.createBinderArray();
+          android.os.IBinder[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new android.os.IBinder[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          android.os.IBinder[] _result = this.ReverseIBinderArray(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeBinderArray(_result);
+          reply.writeBinderArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseNullableIBinderArray:
+        {
+          android.os.IBinder[] _arg0;
+          _arg0 = data.createBinderArray();
+          android.os.IBinder[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new android.os.IBinder[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          android.os.IBinder[] _result = this.ReverseNullableIBinderArray(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeBinderArray(_result);
+          reply.writeBinderArray(_arg1);
+          break;
+        }
+        case TRANSACTION_GetOldNameInterface:
+        {
+          android.aidl.tests.IOldName _result = this.GetOldNameInterface();
+          reply.writeNoException();
+          reply.writeStrongInterface(_result);
+          break;
+        }
+        case TRANSACTION_GetNewNameInterface:
+        {
+          android.aidl.tests.INewName _result = this.GetNewNameInterface();
+          reply.writeNoException();
+          reply.writeStrongInterface(_result);
+          break;
+        }
+        case TRANSACTION_GetUnionTags:
+        {
+          android.aidl.tests.Union[] _arg0;
+          _arg0 = data.createTypedArray(android.aidl.tests.Union.CREATOR);
+          data.enforceNoDataAvail();
+          int[] _result = this.GetUnionTags(_arg0);
+          reply.writeNoException();
+          reply.writeIntArray(_result);
+          break;
+        }
+        case TRANSACTION_GetCppJavaTests:
+        {
+          android.os.IBinder _result = this.GetCppJavaTests();
+          reply.writeNoException();
+          reply.writeStrongBinder(_result);
+          break;
+        }
+        case TRANSACTION_getBackendType:
+        {
+          byte _result = this.getBackendType();
+          reply.writeNoException();
+          reply.writeByte(_result);
+          break;
+        }
+        case TRANSACTION_GetCircular:
+        {
+          android.aidl.tests.CircularParcelable _arg0;
+          _arg0 = new android.aidl.tests.CircularParcelable();
+          data.enforceNoDataAvail();
+          android.aidl.tests.ICircular _result = this.GetCircular(_arg0);
+          reply.writeNoException();
+          reply.writeStrongInterface(_result);
+          reply.writeTypedObject(_arg0, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.ITestService
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      // This is to emulate a method that is added after the service is implemented.
+      // So the client cannot assume that a call to this method will be successful
+      // or not. However, inside the test environment, we can't build client and
+      // the server with different version of this AIDL file. So, we let the server
+      // actually implement this and intercept the dispatch to the method
+      // inside onTransact().
+      // WARNING: Must be first method.
+      // This requires hard coding the transaction number. As long as this method is
+      // the first in this interface, it can keep the
+      // "::android::IBinder::FIRST_CALL_TRANSACTION + 0" value and allow
+      // methods to be added and removed.
+      @Override public int UnimplementedMethod(int arg) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeInt(arg);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_UnimplementedMethod, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().UnimplementedMethod(arg);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      /**
+       * @deprecated to make sure we have something in system/tools/aidl which does a compile check
+       *     of deprecated and make sure this is reflected in goldens
+       */
+      @Override public void Deprecated() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_Deprecated, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().Deprecated();
+              return;
+            }
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void TestOneway() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_TestOneway, _data, null, android.os.IBinder.FLAG_ONEWAY | android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().TestOneway();
+              return;
+            }
+          }
+        }
+        finally {
+          _data.recycle();
+        }
+      }
+      // Test that primitives work as parameters and return types.
+      @Override public boolean RepeatBoolean(boolean token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        boolean _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeBoolean(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatBoolean, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatBoolean(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readBoolean();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public byte RepeatByte(byte token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        byte _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeByte(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatByte, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatByte(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readByte();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public char RepeatChar(char token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        char _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeInt(((int)token));
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatChar, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatChar(token);
+            }
+          }
+          _reply.readException();
+          _result = (char)_reply.readInt();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int RepeatInt(int token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeInt(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatInt, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatInt(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public long RepeatLong(long token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        long _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeLong(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatLong, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatLong(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readLong();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public float RepeatFloat(float token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        float _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeFloat(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatFloat, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatFloat(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readFloat();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public double RepeatDouble(double token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        double _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeDouble(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatDouble, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatDouble(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readDouble();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.lang.String RepeatString(java.lang.String token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeString(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatString, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatString(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public byte RepeatByteEnum(byte token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        byte _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeByte(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatByteEnum, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatByteEnum(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readByte();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int RepeatIntEnum(int token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeInt(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatIntEnum, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatIntEnum(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public long RepeatLongEnum(long token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        long _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeLong(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatLongEnum, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatLongEnum(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readLong();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      // Test that arrays work as parameters and return types.
+      @Override public boolean[] ReverseBoolean(boolean[] input, boolean[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        boolean[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeBooleanArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseBoolean, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseBoolean(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createBooleanArray();
+          _reply.readBooleanArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public byte[] ReverseByte(byte[] input, byte[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        byte[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeByteArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseByte, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseByte(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createByteArray();
+          _reply.readByteArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public char[] ReverseChar(char[] input, char[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        char[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeCharArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseChar, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseChar(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createCharArray();
+          _reply.readCharArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int[] ReverseInt(int[] input, int[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeIntArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseInt, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseInt(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createIntArray();
+          _reply.readIntArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public long[] ReverseLong(long[] input, long[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        long[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeLongArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseLong, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseLong(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createLongArray();
+          _reply.readLongArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public float[] ReverseFloat(float[] input, float[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        float[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeFloatArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseFloat, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseFloat(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createFloatArray();
+          _reply.readFloatArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public double[] ReverseDouble(double[] input, double[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        double[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeDoubleArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseDouble, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseDouble(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createDoubleArray();
+          _reply.readDoubleArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.lang.String[] ReverseString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseString, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseString(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createStringArray();
+          _reply.readStringArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public byte[] ReverseByteEnum(byte[] input, byte[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        byte[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeByteArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseByteEnum, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseByteEnum(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createByteArray();
+          _reply.readByteArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int[] ReverseIntEnum(int[] input, int[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeIntArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseIntEnum, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseIntEnum(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createIntArray();
+          _reply.readIntArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public long[] ReverseLongEnum(long[] input, long[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        long[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeLongArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseLongEnum, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseLongEnum(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createLongArray();
+          _reply.readLongArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      // Test that clients can send and receive Binders.
+      @Override public android.aidl.tests.INamedCallback GetOtherTestService(java.lang.String name) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.INamedCallback _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeString(name);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetOtherTestService, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          _reply.setPropagateAllowBlocking();
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetOtherTestService(name);
+            }
+          }
+          _reply.readException();
+          _result = android.aidl.tests.INamedCallback.Stub.asInterface(_reply.readStrongBinder());
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      // returns true if the same service is already registered with the same name
+      @Override public boolean SetOtherTestService(java.lang.String name, android.aidl.tests.INamedCallback service) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        boolean _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeString(name);
+          _data.writeStrongInterface(service);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_SetOtherTestService, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().SetOtherTestService(name, service);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readBoolean();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public boolean VerifyName(android.aidl.tests.INamedCallback service, java.lang.String name) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        boolean _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStrongInterface(service);
+          _data.writeString(name);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_VerifyName, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().VerifyName(service, name);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readBoolean();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.tests.INamedCallback[] GetInterfaceArray(java.lang.String[] names) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.INamedCallback[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringArray(names);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetInterfaceArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetInterfaceArray(names);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createInterfaceArray(android.aidl.tests.INamedCallback[]::new, android.aidl.tests.INamedCallback.Stub::asInterface);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public boolean VerifyNamesWithInterfaceArray(android.aidl.tests.INamedCallback[] services, java.lang.String[] names) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        boolean _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeInterfaceArray(services);
+          _data.writeStringArray(names);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_VerifyNamesWithInterfaceArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().VerifyNamesWithInterfaceArray(services, names);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readBoolean();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.tests.INamedCallback[] GetNullableInterfaceArray(java.lang.String[] names) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.INamedCallback[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringArray(names);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetNullableInterfaceArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetNullableInterfaceArray(names);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createInterfaceArray(android.aidl.tests.INamedCallback[]::new, android.aidl.tests.INamedCallback.Stub::asInterface);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public boolean VerifyNamesWithNullableInterfaceArray(android.aidl.tests.INamedCallback[] services, java.lang.String[] names) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        boolean _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeInterfaceArray(services);
+          _data.writeStringArray(names);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_VerifyNamesWithNullableInterfaceArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().VerifyNamesWithNullableInterfaceArray(services, names);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readBoolean();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.util.List<android.aidl.tests.INamedCallback> GetInterfaceList(java.lang.String[] names) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.util.List<android.aidl.tests.INamedCallback> _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringArray(names);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetInterfaceList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetInterfaceList(names);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createInterfaceArrayList(android.aidl.tests.INamedCallback.Stub::asInterface);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public boolean VerifyNamesWithInterfaceList(java.util.List<android.aidl.tests.INamedCallback> services, java.lang.String[] names) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        boolean _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeInterfaceList(services);
+          _data.writeStringArray(names);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_VerifyNamesWithInterfaceList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().VerifyNamesWithInterfaceList(services, names);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readBoolean();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      // Test that List<T> types work correctly.
+      @Override public java.util.List<java.lang.String> ReverseStringList(java.util.List<java.lang.String> input, java.util.List<java.lang.String> repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.util.List<java.lang.String> _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringList(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseStringList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseStringList(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createStringArrayList();
+          _reply.readStringList(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.os.ParcelFileDescriptor RepeatParcelFileDescriptor(android.os.ParcelFileDescriptor read) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.os.ParcelFileDescriptor _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(read, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatParcelFileDescriptor, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatParcelFileDescriptor(read);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readTypedObject(android.os.ParcelFileDescriptor.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.os.ParcelFileDescriptor[] ReverseParcelFileDescriptorArray(android.os.ParcelFileDescriptor[] input, android.os.ParcelFileDescriptor[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.os.ParcelFileDescriptor[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedArray(input, 0);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseParcelFileDescriptorArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseParcelFileDescriptorArray(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createTypedArray(android.os.ParcelFileDescriptor.CREATOR);
+          _reply.readTypedArray(repeated, android.os.ParcelFileDescriptor.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      // Test that service specific exceptions work correctly.
+      @Override public void ThrowServiceException(int code) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeInt(code);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ThrowServiceException, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().ThrowServiceException(code);
+              return;
+            }
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      // Test nullability
+      @Override public int[] RepeatNullableIntArray(int[] input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeIntArray(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableIntArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableIntArray(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createIntArray();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public byte[] RepeatNullableByteEnumArray(byte[] input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        byte[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeByteArray(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableByteEnumArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableByteEnumArray(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createByteArray();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int[] RepeatNullableIntEnumArray(int[] input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeIntArray(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableIntEnumArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableIntEnumArray(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createIntArray();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public long[] RepeatNullableLongEnumArray(long[] input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        long[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeLongArray(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableLongEnumArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableLongEnumArray(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createLongArray();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.lang.String RepeatNullableString(java.lang.String input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeString(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableString, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableString(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.util.List<java.lang.String> RepeatNullableStringList(java.util.List<java.lang.String> input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.util.List<java.lang.String> _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringList(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableStringList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableStringList(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createStringArrayList();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.tests.ITestService.Empty RepeatNullableParcelable(android.aidl.tests.ITestService.Empty input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.ITestService.Empty _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableParcelable, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableParcelable(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readTypedObject(android.aidl.tests.ITestService.Empty.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.tests.ITestService.Empty[] RepeatNullableParcelableArray(android.aidl.tests.ITestService.Empty[] input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.ITestService.Empty[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedArray(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableParcelableArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableParcelableArray(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createTypedArray(android.aidl.tests.ITestService.Empty.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.util.List<android.aidl.tests.ITestService.Empty> RepeatNullableParcelableList(java.util.List<android.aidl.tests.ITestService.Empty> input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.util.List<android.aidl.tests.ITestService.Empty> _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedList(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableParcelableList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableParcelableList(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createTypedArrayList(android.aidl.tests.ITestService.Empty.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public void TakesAnIBinder(android.os.IBinder input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStrongBinder(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_TakesAnIBinder, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().TakesAnIBinder(input);
+              return;
+            }
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void TakesANullableIBinder(android.os.IBinder input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStrongBinder(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_TakesANullableIBinder, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().TakesANullableIBinder(input);
+              return;
+            }
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void TakesAnIBinderList(java.util.List<android.os.IBinder> input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeBinderList(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_TakesAnIBinderList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().TakesAnIBinderList(input);
+              return;
+            }
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void TakesANullableIBinderList(java.util.List<android.os.IBinder> input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeBinderList(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_TakesANullableIBinderList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().TakesANullableIBinderList(input);
+              return;
+            }
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      // Test utf8 decoding from utf16 wire format
+      @Override public java.lang.String RepeatUtf8CppString(java.lang.String token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeString(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatUtf8CppString, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatUtf8CppString(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.lang.String RepeatNullableUtf8CppString(java.lang.String token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeString(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableUtf8CppString, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableUtf8CppString(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.lang.String[] ReverseUtf8CppString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseUtf8CppString, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseUtf8CppString(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createStringArray();
+          _reply.readStringArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.lang.String[] ReverseNullableUtf8CppString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseNullableUtf8CppString, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseNullableUtf8CppString(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createStringArray();
+          _reply.readStringArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.util.List<java.lang.String> ReverseUtf8CppStringList(java.util.List<java.lang.String> input, java.util.List<java.lang.String> repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.util.List<java.lang.String> _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringList(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseUtf8CppStringList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseUtf8CppStringList(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createStringArrayList();
+          _reply.readStringList(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      /** comment before annotation */
+      @Override public android.aidl.tests.INamedCallback GetCallback(boolean return_null) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.INamedCallback _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeBoolean(return_null);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetCallback, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetCallback(return_null);
+            }
+          }
+          _reply.readException();
+          _result = android.aidl.tests.INamedCallback.Stub.asInterface(_reply.readStrongBinder());
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      // Since this paracelable has clearly defined default values, it would be
+      // inefficient to use an IPC to fill it out in practice.
+      @Override public void FillOutStructuredParcelable(android.aidl.tests.StructuredParcelable parcel) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(parcel, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_FillOutStructuredParcelable, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().FillOutStructuredParcelable(parcel);
+              return;
+            }
+          }
+          _reply.readException();
+          if ((0!=_reply.readInt())) {
+            parcel.readFromParcel(_reply);
+          }
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void RepeatExtendableParcelable(android.aidl.tests.extension.ExtendableParcelable ep, android.aidl.tests.extension.ExtendableParcelable ep2) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(ep, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatExtendableParcelable, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().RepeatExtendableParcelable(ep, ep2);
+              return;
+            }
+          }
+          _reply.readException();
+          if ((0!=_reply.readInt())) {
+            ep2.readFromParcel(_reply);
+          }
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public android.aidl.tests.RecursiveList ReverseList(android.aidl.tests.RecursiveList list) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.RecursiveList _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(list, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseList(list);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readTypedObject(android.aidl.tests.RecursiveList.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.os.IBinder[] ReverseIBinderArray(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.os.IBinder[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeBinderArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseIBinderArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseIBinderArray(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createBinderArray();
+          _reply.readBinderArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.os.IBinder[] ReverseNullableIBinderArray(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.os.IBinder[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeBinderArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseNullableIBinderArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseNullableIBinderArray(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createBinderArray();
+          _reply.readBinderArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.tests.IOldName GetOldNameInterface() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.IOldName _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetOldNameInterface, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetOldNameInterface();
+            }
+          }
+          _reply.readException();
+          _result = android.aidl.tests.IOldName.Stub.asInterface(_reply.readStrongBinder());
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.tests.INewName GetNewNameInterface() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.INewName _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetNewNameInterface, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetNewNameInterface();
+            }
+          }
+          _reply.readException();
+          _result = android.aidl.tests.INewName.Stub.asInterface(_reply.readStrongBinder());
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int[] GetUnionTags(android.aidl.tests.Union[] input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedArray(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetUnionTags, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetUnionTags(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createIntArray();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      // Retrieve the ICppJavaTests if the server supports it
+      @Override public android.os.IBinder GetCppJavaTests() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.os.IBinder _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetCppJavaTests, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetCppJavaTests();
+            }
+          }
+          _reply.readException();
+          _result = _reply.readStrongBinder();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public byte getBackendType() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        byte _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_getBackendType, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().getBackendType();
+            }
+          }
+          _reply.readException();
+          _result = _reply.readByte();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.tests.ICircular GetCircular(android.aidl.tests.CircularParcelable cp) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.ICircular _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetCircular, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetCircular(cp);
+            }
+          }
+          _reply.readException();
+          _result = android.aidl.tests.ICircular.Stub.asInterface(_reply.readStrongBinder());
+          if ((0!=_reply.readInt())) {
+            cp.readFromParcel(_reply);
+          }
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      public static android.aidl.tests.ITestService sDefaultImpl;
+    }
+    static final int TRANSACTION_UnimplementedMethod = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    static final int TRANSACTION_Deprecated = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    static final int TRANSACTION_TestOneway = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+    static final int TRANSACTION_RepeatBoolean = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+    static final int TRANSACTION_RepeatByte = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
+    static final int TRANSACTION_RepeatChar = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5);
+    static final int TRANSACTION_RepeatInt = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6);
+    static final int TRANSACTION_RepeatLong = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7);
+    static final int TRANSACTION_RepeatFloat = (android.os.IBinder.FIRST_CALL_TRANSACTION + 8);
+    static final int TRANSACTION_RepeatDouble = (android.os.IBinder.FIRST_CALL_TRANSACTION + 9);
+    static final int TRANSACTION_RepeatString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 10);
+    static final int TRANSACTION_RepeatByteEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 11);
+    static final int TRANSACTION_RepeatIntEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 12);
+    static final int TRANSACTION_RepeatLongEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 13);
+    static final int TRANSACTION_ReverseBoolean = (android.os.IBinder.FIRST_CALL_TRANSACTION + 14);
+    static final int TRANSACTION_ReverseByte = (android.os.IBinder.FIRST_CALL_TRANSACTION + 15);
+    static final int TRANSACTION_ReverseChar = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16);
+    static final int TRANSACTION_ReverseInt = (android.os.IBinder.FIRST_CALL_TRANSACTION + 17);
+    static final int TRANSACTION_ReverseLong = (android.os.IBinder.FIRST_CALL_TRANSACTION + 18);
+    static final int TRANSACTION_ReverseFloat = (android.os.IBinder.FIRST_CALL_TRANSACTION + 19);
+    static final int TRANSACTION_ReverseDouble = (android.os.IBinder.FIRST_CALL_TRANSACTION + 20);
+    static final int TRANSACTION_ReverseString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 21);
+    static final int TRANSACTION_ReverseByteEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 22);
+    static final int TRANSACTION_ReverseIntEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 23);
+    static final int TRANSACTION_ReverseLongEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 24);
+    static final int TRANSACTION_GetOtherTestService = (android.os.IBinder.FIRST_CALL_TRANSACTION + 25);
+    static final int TRANSACTION_SetOtherTestService = (android.os.IBinder.FIRST_CALL_TRANSACTION + 26);
+    static final int TRANSACTION_VerifyName = (android.os.IBinder.FIRST_CALL_TRANSACTION + 27);
+    static final int TRANSACTION_GetInterfaceArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 28);
+    static final int TRANSACTION_VerifyNamesWithInterfaceArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 29);
+    static final int TRANSACTION_GetNullableInterfaceArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 30);
+    static final int TRANSACTION_VerifyNamesWithNullableInterfaceArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 31);
+    static final int TRANSACTION_GetInterfaceList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 32);
+    static final int TRANSACTION_VerifyNamesWithInterfaceList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 33);
+    static final int TRANSACTION_ReverseStringList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 34);
+    static final int TRANSACTION_RepeatParcelFileDescriptor = (android.os.IBinder.FIRST_CALL_TRANSACTION + 35);
+    static final int TRANSACTION_ReverseParcelFileDescriptorArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 36);
+    static final int TRANSACTION_ThrowServiceException = (android.os.IBinder.FIRST_CALL_TRANSACTION + 37);
+    static final int TRANSACTION_RepeatNullableIntArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 38);
+    static final int TRANSACTION_RepeatNullableByteEnumArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 39);
+    static final int TRANSACTION_RepeatNullableIntEnumArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 40);
+    static final int TRANSACTION_RepeatNullableLongEnumArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 41);
+    static final int TRANSACTION_RepeatNullableString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 42);
+    static final int TRANSACTION_RepeatNullableStringList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 43);
+    static final int TRANSACTION_RepeatNullableParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 44);
+    static final int TRANSACTION_RepeatNullableParcelableArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 45);
+    static final int TRANSACTION_RepeatNullableParcelableList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 46);
+    static final int TRANSACTION_TakesAnIBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 47);
+    static final int TRANSACTION_TakesANullableIBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 48);
+    static final int TRANSACTION_TakesAnIBinderList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 49);
+    static final int TRANSACTION_TakesANullableIBinderList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 50);
+    static final int TRANSACTION_RepeatUtf8CppString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 51);
+    static final int TRANSACTION_RepeatNullableUtf8CppString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 52);
+    static final int TRANSACTION_ReverseUtf8CppString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 53);
+    static final int TRANSACTION_ReverseNullableUtf8CppString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 54);
+    static final int TRANSACTION_ReverseUtf8CppStringList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 55);
+    static final int TRANSACTION_GetCallback = (android.os.IBinder.FIRST_CALL_TRANSACTION + 56);
+    static final int TRANSACTION_FillOutStructuredParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 57);
+    static final int TRANSACTION_RepeatExtendableParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 58);
+    static final int TRANSACTION_ReverseList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 59);
+    static final int TRANSACTION_ReverseIBinderArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 60);
+    static final int TRANSACTION_ReverseNullableIBinderArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 61);
+    static final int TRANSACTION_GetOldNameInterface = (android.os.IBinder.FIRST_CALL_TRANSACTION + 62);
+    static final int TRANSACTION_GetNewNameInterface = (android.os.IBinder.FIRST_CALL_TRANSACTION + 63);
+    static final int TRANSACTION_GetUnionTags = (android.os.IBinder.FIRST_CALL_TRANSACTION + 64);
+    static final int TRANSACTION_GetCppJavaTests = (android.os.IBinder.FIRST_CALL_TRANSACTION + 65);
+    static final int TRANSACTION_getBackendType = (android.os.IBinder.FIRST_CALL_TRANSACTION + 66);
+    static final int TRANSACTION_GetCircular = (android.os.IBinder.FIRST_CALL_TRANSACTION + 67);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 67;
+    }
+    public static boolean setDefaultImpl(android.aidl.tests.ITestService impl) {
+      // Only one user of this interface can use this function
+      // at a time. This is a heuristic to detect if two different
+      // users in the same process use this function.
+      if (Stub.Proxy.sDefaultImpl != null) {
+        throw new IllegalStateException("setDefaultImpl() called twice");
+      }
+      if (impl != null) {
+        Stub.Proxy.sDefaultImpl = impl;
+        return true;
+      }
+      return false;
+    }
+    public static android.aidl.tests.ITestService getDefaultImpl() {
+      return Stub.Proxy.sDefaultImpl;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ITestService";
+  // Test that constants are accessible
+  /** extra doc comment */
+  // extra line comment
+  /* extra regular comment */
+  /** const comment */
+  public static final int CONSTANT = 42;
+  public static final int CONSTANT2 = -42;
+  public static final int CONSTANT3 = 42;
+  public static final int CONSTANT4 = 4;
+  public static final int CONSTANT5 = -4;
+  public static final int CONSTANT6 = 0;
+  public static final int CONSTANT7 = 0;
+  public static final int CONSTANT8 = 0;
+  public static final int CONSTANT9 = 86;
+  public static final int CONSTANT10 = 165;
+  public static final int CONSTANT11 = 250;
+  public static final int CONSTANT12 = -1;
+  public static final byte BYTE_CONSTANT = 17;
+  public static final long LONG_CONSTANT = 1099511627776L;
+  public static final String STRING_CONSTANT = "foo";
+  public static final String STRING_CONSTANT2 = "bar";
+  public static final float FLOAT_CONSTANT = 1.000000f;
+  public static final float FLOAT_CONSTANT2 = -1.000000f;
+  public static final float FLOAT_CONSTANT3 = 1.000000f;
+  public static final float FLOAT_CONSTANT4 = 2.200000f;
+  public static final float FLOAT_CONSTANT5 = -2.200000f;
+  public static final float FLOAT_CONSTANT6 = -0.000000f;
+  public static final float FLOAT_CONSTANT7 = 0.000000f;
+  public static final double DOUBLE_CONSTANT = 1.000000;
+  public static final double DOUBLE_CONSTANT2 = -1.000000;
+  public static final double DOUBLE_CONSTANT3 = 1.000000;
+  public static final double DOUBLE_CONSTANT4 = 2.200000;
+  public static final double DOUBLE_CONSTANT5 = -2.200000;
+  public static final double DOUBLE_CONSTANT6 = -0.000000;
+  public static final double DOUBLE_CONSTANT7 = 0.000000;
+  public static final double DOUBLE_CONSTANT8 = 1.100000;
+  public static final double DOUBLE_CONSTANT9 = -1.100000;
+  public static final String STRING_CONSTANT_UTF8 = "baz";
+  // All these constant expressions should be equal to 1
+  public static final int A1 = 1;
+  public static final int A2 = 1;
+  public static final int A3 = 1;
+  public static final int A4 = 1;
+  public static final int A5 = 1;
+  public static final int A6 = 1;
+  public static final int A7 = 1;
+  public static final int A8 = 1;
+  public static final int A9 = 1;
+  public static final int A10 = 1;
+  public static final int A11 = 1;
+  public static final int A12 = 1;
+  public static final int A13 = 1;
+  public static final int A14 = 1;
+  public static final int A15 = 1;
+  public static final int A16 = 1;
+  public static final int A17 = 1;
+  public static final int A18 = 1;
+  public static final int A19 = 1;
+  public static final int A20 = 1;
+  public static final int A21 = 1;
+  public static final int A22 = 1;
+  public static final int A23 = 1;
+  public static final int A24 = 1;
+  public static final int A25 = 1;
+  public static final int A26 = 1;
+  public static final int A27 = 1;
+  public static final int A28 = 1;
+  public static final int A29 = 1;
+  public static final int A30 = 1;
+  public static final int A31 = 1;
+  public static final int A32 = 1;
+  public static final int A33 = 1;
+  public static final int A34 = 1;
+  public static final int A35 = 1;
+  public static final int A36 = 1;
+  public static final int A37 = 1;
+  public static final int A38 = 1;
+  public static final int A39 = 1;
+  public static final int A40 = 1;
+  public static final int A41 = 1;
+  public static final int A42 = 1;
+  public static final int A43 = 1;
+  public static final int A44 = 1;
+  // && higher than ||
+  public static final int A45 = 1;
+  public static final int A46 = 1;
+  public static final int A47 = 1;
+  public static final int A48 = 1;
+  public static final int A49 = 1;
+  public static final int A50 = 1;
+  public static final int A51 = 1;
+  public static final int A52 = 1;
+  public static final int A53 = 1;
+  // & higher than ^
+  public static final int A54 = 1;
+  public static final int A55 = 1;
+  public static final int A56 = 1;
+  public static final int A57 = 1;
+  // This is to emulate a method that is added after the service is implemented.
+  // So the client cannot assume that a call to this method will be successful
+  // or not. However, inside the test environment, we can't build client and
+  // the server with different version of this AIDL file. So, we let the server
+  // actually implement this and intercept the dispatch to the method
+  // inside onTransact().
+  // WARNING: Must be first method.
+  // This requires hard coding the transaction number. As long as this method is
+  // the first in this interface, it can keep the
+  // "::android::IBinder::FIRST_CALL_TRANSACTION + 0" value and allow
+  // methods to be added and removed.
+  public int UnimplementedMethod(int arg) throws android.os.RemoteException;
+  /**
+   * @deprecated to make sure we have something in system/tools/aidl which does a compile check
+   *     of deprecated and make sure this is reflected in goldens
+   */
+  @Deprecated
+  public void Deprecated() throws android.os.RemoteException;
+  public void TestOneway() throws android.os.RemoteException;
+  // Test that primitives work as parameters and return types.
+  public boolean RepeatBoolean(boolean token) throws android.os.RemoteException;
+  public byte RepeatByte(byte token) throws android.os.RemoteException;
+  public char RepeatChar(char token) throws android.os.RemoteException;
+  public int RepeatInt(int token) throws android.os.RemoteException;
+  public long RepeatLong(long token) throws android.os.RemoteException;
+  public float RepeatFloat(float token) throws android.os.RemoteException;
+  public double RepeatDouble(double token) throws android.os.RemoteException;
+  public java.lang.String RepeatString(java.lang.String token) throws android.os.RemoteException;
+  public byte RepeatByteEnum(byte token) throws android.os.RemoteException;
+  public int RepeatIntEnum(int token) throws android.os.RemoteException;
+  public long RepeatLongEnum(long token) throws android.os.RemoteException;
+  // Test that arrays work as parameters and return types.
+  public boolean[] ReverseBoolean(boolean[] input, boolean[] repeated) throws android.os.RemoteException;
+  public byte[] ReverseByte(byte[] input, byte[] repeated) throws android.os.RemoteException;
+  public char[] ReverseChar(char[] input, char[] repeated) throws android.os.RemoteException;
+  public int[] ReverseInt(int[] input, int[] repeated) throws android.os.RemoteException;
+  public long[] ReverseLong(long[] input, long[] repeated) throws android.os.RemoteException;
+  public float[] ReverseFloat(float[] input, float[] repeated) throws android.os.RemoteException;
+  public double[] ReverseDouble(double[] input, double[] repeated) throws android.os.RemoteException;
+  public java.lang.String[] ReverseString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException;
+  public byte[] ReverseByteEnum(byte[] input, byte[] repeated) throws android.os.RemoteException;
+  public int[] ReverseIntEnum(int[] input, int[] repeated) throws android.os.RemoteException;
+  public long[] ReverseLongEnum(long[] input, long[] repeated) throws android.os.RemoteException;
+  // Test that clients can send and receive Binders.
+  public android.aidl.tests.INamedCallback GetOtherTestService(java.lang.String name) throws android.os.RemoteException;
+  // returns true if the same service is already registered with the same name
+  public boolean SetOtherTestService(java.lang.String name, android.aidl.tests.INamedCallback service) throws android.os.RemoteException;
+  public boolean VerifyName(android.aidl.tests.INamedCallback service, java.lang.String name) throws android.os.RemoteException;
+  public android.aidl.tests.INamedCallback[] GetInterfaceArray(java.lang.String[] names) throws android.os.RemoteException;
+  public boolean VerifyNamesWithInterfaceArray(android.aidl.tests.INamedCallback[] services, java.lang.String[] names) throws android.os.RemoteException;
+  public android.aidl.tests.INamedCallback[] GetNullableInterfaceArray(java.lang.String[] names) throws android.os.RemoteException;
+  public boolean VerifyNamesWithNullableInterfaceArray(android.aidl.tests.INamedCallback[] services, java.lang.String[] names) throws android.os.RemoteException;
+  public java.util.List<android.aidl.tests.INamedCallback> GetInterfaceList(java.lang.String[] names) throws android.os.RemoteException;
+  public boolean VerifyNamesWithInterfaceList(java.util.List<android.aidl.tests.INamedCallback> services, java.lang.String[] names) throws android.os.RemoteException;
+  // Test that List<T> types work correctly.
+  public java.util.List<java.lang.String> ReverseStringList(java.util.List<java.lang.String> input, java.util.List<java.lang.String> repeated) throws android.os.RemoteException;
+  public android.os.ParcelFileDescriptor RepeatParcelFileDescriptor(android.os.ParcelFileDescriptor read) throws android.os.RemoteException;
+  public android.os.ParcelFileDescriptor[] ReverseParcelFileDescriptorArray(android.os.ParcelFileDescriptor[] input, android.os.ParcelFileDescriptor[] repeated) throws android.os.RemoteException;
+  // Test that service specific exceptions work correctly.
+  public void ThrowServiceException(int code) throws android.os.RemoteException;
+  // Test nullability
+  public int[] RepeatNullableIntArray(int[] input) throws android.os.RemoteException;
+  public byte[] RepeatNullableByteEnumArray(byte[] input) throws android.os.RemoteException;
+  public int[] RepeatNullableIntEnumArray(int[] input) throws android.os.RemoteException;
+  public long[] RepeatNullableLongEnumArray(long[] input) throws android.os.RemoteException;
+  public java.lang.String RepeatNullableString(java.lang.String input) throws android.os.RemoteException;
+  public java.util.List<java.lang.String> RepeatNullableStringList(java.util.List<java.lang.String> input) throws android.os.RemoteException;
+  public android.aidl.tests.ITestService.Empty RepeatNullableParcelable(android.aidl.tests.ITestService.Empty input) throws android.os.RemoteException;
+  public android.aidl.tests.ITestService.Empty[] RepeatNullableParcelableArray(android.aidl.tests.ITestService.Empty[] input) throws android.os.RemoteException;
+  public java.util.List<android.aidl.tests.ITestService.Empty> RepeatNullableParcelableList(java.util.List<android.aidl.tests.ITestService.Empty> input) throws android.os.RemoteException;
+  public void TakesAnIBinder(android.os.IBinder input) throws android.os.RemoteException;
+  public void TakesANullableIBinder(android.os.IBinder input) throws android.os.RemoteException;
+  public void TakesAnIBinderList(java.util.List<android.os.IBinder> input) throws android.os.RemoteException;
+  public void TakesANullableIBinderList(java.util.List<android.os.IBinder> input) throws android.os.RemoteException;
+  // Test utf8 decoding from utf16 wire format
+  public java.lang.String RepeatUtf8CppString(java.lang.String token) throws android.os.RemoteException;
+  public java.lang.String RepeatNullableUtf8CppString(java.lang.String token) throws android.os.RemoteException;
+  public java.lang.String[] ReverseUtf8CppString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException;
+  public java.lang.String[] ReverseNullableUtf8CppString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException;
+  public java.util.List<java.lang.String> ReverseUtf8CppStringList(java.util.List<java.lang.String> input, java.util.List<java.lang.String> repeated) throws android.os.RemoteException;
+  /** comment before annotation */
+  public android.aidl.tests.INamedCallback GetCallback(boolean return_null) throws android.os.RemoteException;
+  // Since this paracelable has clearly defined default values, it would be
+  // inefficient to use an IPC to fill it out in practice.
+  public void FillOutStructuredParcelable(android.aidl.tests.StructuredParcelable parcel) throws android.os.RemoteException;
+  public void RepeatExtendableParcelable(android.aidl.tests.extension.ExtendableParcelable ep, android.aidl.tests.extension.ExtendableParcelable ep2) throws android.os.RemoteException;
+  public android.aidl.tests.RecursiveList ReverseList(android.aidl.tests.RecursiveList list) throws android.os.RemoteException;
+  public android.os.IBinder[] ReverseIBinderArray(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException;
+  public android.os.IBinder[] ReverseNullableIBinderArray(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException;
+  public android.aidl.tests.IOldName GetOldNameInterface() throws android.os.RemoteException;
+  public android.aidl.tests.INewName GetNewNameInterface() throws android.os.RemoteException;
+  public int[] GetUnionTags(android.aidl.tests.Union[] input) throws android.os.RemoteException;
+  // Retrieve the ICppJavaTests if the server supports it
+  public android.os.IBinder GetCppJavaTests() throws android.os.RemoteException;
+  public byte getBackendType() throws android.os.RemoteException;
+  public android.aidl.tests.ICircular GetCircular(android.aidl.tests.CircularParcelable cp) throws android.os.RemoteException;
+  // Small empty parcelable for nullability check
+  public static class Empty implements android.os.Parcelable
+  {
+    public static final android.os.Parcelable.Creator<Empty> CREATOR = new android.os.Parcelable.Creator<Empty>() {
+      @Override
+      public Empty createFromParcel(android.os.Parcel _aidl_source) {
+        Empty _aidl_out = new Empty();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public Empty[] newArray(int _aidl_size) {
+        return new Empty[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public boolean equals(Object other) {
+      if (this == other) return true;
+      if (other == null) return false;
+      if (!(other instanceof Empty)) return false;
+      Empty that = (Empty)other;
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return java.util.Arrays.deepHashCode(java.util.Arrays.asList().toArray());
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+  public static class CompilerChecks implements android.os.Parcelable
+  {
+    // IBinder
+    public android.os.IBinder binder;
+    public android.os.IBinder nullable_binder;
+    public android.os.IBinder[] binder_array;
+    public android.os.IBinder[] nullable_binder_array;
+    public java.util.List<android.os.IBinder> binder_list;
+    public java.util.List<android.os.IBinder> nullable_binder_list;
+    // ParcelFileDescriptor
+    public android.os.ParcelFileDescriptor pfd;
+    public android.os.ParcelFileDescriptor nullable_pfd;
+    public android.os.ParcelFileDescriptor[] pfd_array;
+    public android.os.ParcelFileDescriptor[] nullable_pfd_array;
+    public java.util.List<android.os.ParcelFileDescriptor> pfd_list;
+    public java.util.List<android.os.ParcelFileDescriptor> nullable_pfd_list;
+    // parcelable
+    public android.aidl.tests.ITestService.Empty parcel;
+    public android.aidl.tests.ITestService.Empty nullable_parcel;
+    public android.aidl.tests.ITestService.Empty[] parcel_array;
+    public android.aidl.tests.ITestService.Empty[] nullable_parcel_array;
+    public java.util.List<android.aidl.tests.ITestService.Empty> parcel_list;
+    public java.util.List<android.aidl.tests.ITestService.Empty> nullable_parcel_list;
+    public static final android.os.Parcelable.Creator<CompilerChecks> CREATOR = new android.os.Parcelable.Creator<CompilerChecks>() {
+      @Override
+      public CompilerChecks createFromParcel(android.os.Parcel _aidl_source) {
+        CompilerChecks _aidl_out = new CompilerChecks();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public CompilerChecks[] newArray(int _aidl_size) {
+        return new CompilerChecks[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeStrongBinder(binder);
+      _aidl_parcel.writeStrongBinder(nullable_binder);
+      _aidl_parcel.writeBinderArray(binder_array);
+      _aidl_parcel.writeBinderArray(nullable_binder_array);
+      _aidl_parcel.writeBinderList(binder_list);
+      _aidl_parcel.writeBinderList(nullable_binder_list);
+      _aidl_parcel.writeTypedObject(pfd, _aidl_flag);
+      _aidl_parcel.writeTypedObject(nullable_pfd, _aidl_flag);
+      _aidl_parcel.writeTypedArray(pfd_array, _aidl_flag);
+      _aidl_parcel.writeTypedArray(nullable_pfd_array, _aidl_flag);
+      _aidl_parcel.writeTypedList(pfd_list, _aidl_flag);
+      _aidl_parcel.writeTypedList(nullable_pfd_list, _aidl_flag);
+      _aidl_parcel.writeTypedObject(parcel, _aidl_flag);
+      _aidl_parcel.writeTypedObject(nullable_parcel, _aidl_flag);
+      _aidl_parcel.writeTypedArray(parcel_array, _aidl_flag);
+      _aidl_parcel.writeTypedArray(nullable_parcel_array, _aidl_flag);
+      _aidl_parcel.writeTypedList(parcel_list, _aidl_flag);
+      _aidl_parcel.writeTypedList(nullable_parcel_list, _aidl_flag);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        binder = _aidl_parcel.readStrongBinder();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_binder = _aidl_parcel.readStrongBinder();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        binder_array = _aidl_parcel.createBinderArray();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_binder_array = _aidl_parcel.createBinderArray();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        binder_list = _aidl_parcel.createBinderArrayList();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_binder_list = _aidl_parcel.createBinderArrayList();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        pfd = _aidl_parcel.readTypedObject(android.os.ParcelFileDescriptor.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_pfd = _aidl_parcel.readTypedObject(android.os.ParcelFileDescriptor.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        pfd_array = _aidl_parcel.createTypedArray(android.os.ParcelFileDescriptor.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_pfd_array = _aidl_parcel.createTypedArray(android.os.ParcelFileDescriptor.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        pfd_list = _aidl_parcel.createTypedArrayList(android.os.ParcelFileDescriptor.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_pfd_list = _aidl_parcel.createTypedArrayList(android.os.ParcelFileDescriptor.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        parcel = _aidl_parcel.readTypedObject(android.aidl.tests.ITestService.Empty.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_parcel = _aidl_parcel.readTypedObject(android.aidl.tests.ITestService.Empty.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        parcel_array = _aidl_parcel.createTypedArray(android.aidl.tests.ITestService.Empty.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_parcel_array = _aidl_parcel.createTypedArray(android.aidl.tests.ITestService.Empty.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        parcel_list = _aidl_parcel.createTypedArrayList(android.aidl.tests.ITestService.Empty.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_parcel_list = _aidl_parcel.createTypedArrayList(android.aidl.tests.ITestService.Empty.CREATOR);
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      _mask |= describeContents(pfd);
+      _mask |= describeContents(nullable_pfd);
+      _mask |= describeContents(pfd_array);
+      _mask |= describeContents(nullable_pfd_array);
+      _mask |= describeContents(pfd_list);
+      _mask |= describeContents(nullable_pfd_list);
+      _mask |= describeContents(parcel);
+      _mask |= describeContents(nullable_parcel);
+      _mask |= describeContents(parcel_array);
+      _mask |= describeContents(nullable_parcel_array);
+      _mask |= describeContents(parcel_list);
+      _mask |= describeContents(nullable_parcel_list);
+      return _mask;
+    }
+    private int describeContents(Object _v) {
+      if (_v == null) return 0;
+      if (_v instanceof Object[]) {
+        int _mask = 0;
+        for (Object o : (Object[]) _v) {
+          _mask |= describeContents(o);
+        }
+        return _mask;
+      }
+      if (_v instanceof java.util.Collection) {
+        int _mask = 0;
+        for (Object o : (java.util.Collection) _v) {
+          _mask |= describeContents(o);
+        }
+        return _mask;
+      }
+      if (_v instanceof android.os.Parcelable) {
+        return ((android.os.Parcelable) _v).describeContents();
+      }
+      return 0;
+    }
+    // interface without I-
+    public interface Foo extends android.os.IInterface
+    {
+      /** Default implementation for Foo. */
+      public static class Default implements android.aidl.tests.ITestService.CompilerChecks.Foo
+      {
+        @Override
+        public android.os.IBinder asBinder() {
+          return null;
+        }
+      }
+      /** Local-side IPC implementation stub class. */
+      public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ITestService.CompilerChecks.Foo
+      {
+        /** Construct the stub at attach it to the interface. */
+        public Stub()
+        {
+          this.attachInterface(this, DESCRIPTOR);
+        }
+        /**
+         * Cast an IBinder object into an android.aidl.tests.ITestService.CompilerChecks.Foo interface,
+         * generating a proxy if needed.
+         */
+        public static android.aidl.tests.ITestService.CompilerChecks.Foo asInterface(android.os.IBinder obj)
+        {
+          if ((obj==null)) {
+            return null;
+          }
+          android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+          if (((iin!=null)&&(iin instanceof android.aidl.tests.ITestService.CompilerChecks.Foo))) {
+            return ((android.aidl.tests.ITestService.CompilerChecks.Foo)iin);
+          }
+          return new android.aidl.tests.ITestService.CompilerChecks.Foo.Stub.Proxy(obj);
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return this;
+        }
+        /** @hide */
+        public static java.lang.String getDefaultTransactionName(int transactionCode)
+        {
+          switch (transactionCode)
+          {
+            default:
+            {
+              return null;
+            }
+          }
+        }
+        /** @hide */
+        public java.lang.String getTransactionName(int transactionCode)
+        {
+          return this.getDefaultTransactionName(transactionCode);
+        }
+        @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+        {
+          java.lang.String descriptor = DESCRIPTOR;
+          if (code == INTERFACE_TRANSACTION) {
+            reply.writeString(descriptor);
+            return true;
+          }
+          switch (code)
+          {
+            default:
+            {
+              return super.onTransact(code, data, reply, flags);
+            }
+          }
+        }
+        private static class Proxy implements android.aidl.tests.ITestService.CompilerChecks.Foo
+        {
+          private android.os.IBinder mRemote;
+          Proxy(android.os.IBinder remote)
+          {
+            mRemote = remote;
+          }
+          @Override public android.os.IBinder asBinder()
+          {
+            return mRemote;
+          }
+          public java.lang.String getInterfaceDescriptor()
+          {
+            return DESCRIPTOR;
+          }
+        }
+        /** @hide */
+        public int getMaxTransactionId()
+        {
+          return 0;
+        }
+      }
+      public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ITestService.CompilerChecks.Foo";
+    }
+    public static class HasDeprecated implements android.os.Parcelable
+    {
+      /** @deprecated field */
+      @Deprecated
+      public int deprecated = 0;
+      public static final android.os.Parcelable.Creator<HasDeprecated> CREATOR = new android.os.Parcelable.Creator<HasDeprecated>() {
+        @Override
+        public HasDeprecated createFromParcel(android.os.Parcel _aidl_source) {
+          HasDeprecated _aidl_out = new HasDeprecated();
+          _aidl_out.readFromParcel(_aidl_source);
+          return _aidl_out;
+        }
+        @Override
+        public HasDeprecated[] newArray(int _aidl_size) {
+          return new HasDeprecated[_aidl_size];
+        }
+      };
+      @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+      {
+        int _aidl_start_pos = _aidl_parcel.dataPosition();
+        _aidl_parcel.writeInt(0);
+        _aidl_parcel.writeInt(deprecated);
+        int _aidl_end_pos = _aidl_parcel.dataPosition();
+        _aidl_parcel.setDataPosition(_aidl_start_pos);
+        _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+        _aidl_parcel.setDataPosition(_aidl_end_pos);
+      }
+      public final void readFromParcel(android.os.Parcel _aidl_parcel)
+      {
+        int _aidl_start_pos = _aidl_parcel.dataPosition();
+        int _aidl_parcelable_size = _aidl_parcel.readInt();
+        try {
+          if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+          if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+          deprecated = _aidl_parcel.readInt();
+        } finally {
+          if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+            throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+          }
+          _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+        }
+      }
+      @Override
+      public int describeContents() {
+        int _mask = 0;
+        return _mask;
+      }
+    }
+    public static final class UsingHasDeprecated implements android.os.Parcelable {
+      // tags for union fields
+      public final static int n = 0;  // int n;
+      public final static int m = 1;  // android.aidl.tests.ITestService.CompilerChecks.HasDeprecated m;
+
+      private int _tag;
+      private Object _value;
+
+      public UsingHasDeprecated() {
+        int _value = 0;
+        this._tag = n;
+        this._value = _value;
+      }
+
+      private UsingHasDeprecated(android.os.Parcel _aidl_parcel) {
+        readFromParcel(_aidl_parcel);
+      }
+
+      private UsingHasDeprecated(int _tag, Object _value) {
+        this._tag = _tag;
+        this._value = _value;
+      }
+
+      public int getTag() {
+        return _tag;
+      }
+
+      // int n;
+
+      public static UsingHasDeprecated n(int _value) {
+        return new UsingHasDeprecated(n, _value);
+      }
+
+      public int getN() {
+        _assertTag(n);
+        return (int) _value;
+      }
+
+      public void setN(int _value) {
+        _set(n, _value);
+      }
+
+      // android.aidl.tests.ITestService.CompilerChecks.HasDeprecated m;
+
+      public static UsingHasDeprecated m(android.aidl.tests.ITestService.CompilerChecks.HasDeprecated _value) {
+        return new UsingHasDeprecated(m, _value);
+      }
+
+      public android.aidl.tests.ITestService.CompilerChecks.HasDeprecated getM() {
+        _assertTag(m);
+        return (android.aidl.tests.ITestService.CompilerChecks.HasDeprecated) _value;
+      }
+
+      public void setM(android.aidl.tests.ITestService.CompilerChecks.HasDeprecated _value) {
+        _set(m, _value);
+      }
+
+      public static final android.os.Parcelable.Creator<UsingHasDeprecated> CREATOR = new android.os.Parcelable.Creator<UsingHasDeprecated>() {
+        @Override
+        public UsingHasDeprecated createFromParcel(android.os.Parcel _aidl_source) {
+          return new UsingHasDeprecated(_aidl_source);
+        }
+        @Override
+        public UsingHasDeprecated[] newArray(int _aidl_size) {
+          return new UsingHasDeprecated[_aidl_size];
+        }
+      };
+
+      @Override
+      public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+        _aidl_parcel.writeInt(_tag);
+        switch (_tag) {
+        case n:
+          _aidl_parcel.writeInt(getN());
+          break;
+        case m:
+          _aidl_parcel.writeTypedObject(getM(), _aidl_flag);
+          break;
+        }
+      }
+
+      public void readFromParcel(android.os.Parcel _aidl_parcel) {
+        int _aidl_tag;
+        _aidl_tag = _aidl_parcel.readInt();
+        switch (_aidl_tag) {
+        case n: {
+          int _aidl_value;
+          _aidl_value = _aidl_parcel.readInt();
+          _set(_aidl_tag, _aidl_value);
+          return; }
+        case m: {
+          android.aidl.tests.ITestService.CompilerChecks.HasDeprecated _aidl_value;
+          _aidl_value = _aidl_parcel.readTypedObject(android.aidl.tests.ITestService.CompilerChecks.HasDeprecated.CREATOR);
+          _set(_aidl_tag, _aidl_value);
+          return; }
+        }
+        throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+      }
+
+      @Override
+      public int describeContents() {
+        int _mask = 0;
+        switch (getTag()) {
+        case m:
+          _mask |= describeContents(getM());
+          break;
+        }
+        return _mask;
+      }
+      private int describeContents(Object _v) {
+        if (_v == null) return 0;
+        if (_v instanceof android.os.Parcelable) {
+          return ((android.os.Parcelable) _v).describeContents();
+        }
+        return 0;
+      }
+
+      private void _assertTag(int tag) {
+        if (getTag() != tag) {
+          throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+        }
+      }
+
+      private String _tagString(int _tag) {
+        switch (_tag) {
+        case n: return "n";
+        case m: return "m";
+        }
+        throw new IllegalStateException("unknown field: " + _tag);
+      }
+
+      private void _set(int _tag, Object _value) {
+        this._tag = _tag;
+        this._value = _value;
+      }
+      public static @interface Tag {
+        public static final int n = 0;
+        public static final int m = 1;
+      }
+    }
+    public interface NoPrefixInterface extends android.os.IInterface
+    {
+      /** Default implementation for NoPrefixInterface. */
+      public static class Default implements android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface
+      {
+        @Override public void foo() throws android.os.RemoteException
+        {
+        }
+        @Override
+        public android.os.IBinder asBinder() {
+          return null;
+        }
+      }
+      /** Local-side IPC implementation stub class. */
+      public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface
+      {
+        /** Construct the stub at attach it to the interface. */
+        public Stub()
+        {
+          this.attachInterface(this, DESCRIPTOR);
+        }
+        /**
+         * Cast an IBinder object into an android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface interface,
+         * generating a proxy if needed.
+         */
+        public static android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface asInterface(android.os.IBinder obj)
+        {
+          if ((obj==null)) {
+            return null;
+          }
+          android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+          if (((iin!=null)&&(iin instanceof android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface))) {
+            return ((android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface)iin);
+          }
+          return new android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.Stub.Proxy(obj);
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return this;
+        }
+        /** @hide */
+        public static java.lang.String getDefaultTransactionName(int transactionCode)
+        {
+          switch (transactionCode)
+          {
+            case TRANSACTION_foo:
+            {
+              return "foo";
+            }
+            default:
+            {
+              return null;
+            }
+          }
+        }
+        /** @hide */
+        public java.lang.String getTransactionName(int transactionCode)
+        {
+          return this.getDefaultTransactionName(transactionCode);
+        }
+        @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+        {
+          java.lang.String descriptor = DESCRIPTOR;
+          if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+            data.enforceInterface(descriptor);
+          }
+          if (code == INTERFACE_TRANSACTION) {
+            reply.writeString(descriptor);
+            return true;
+          }
+          switch (code)
+          {
+            case TRANSACTION_foo:
+            {
+              this.foo();
+              reply.writeNoException();
+              break;
+            }
+            default:
+            {
+              return super.onTransact(code, data, reply, flags);
+            }
+          }
+          return true;
+        }
+        private static class Proxy implements android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface
+        {
+          private android.os.IBinder mRemote;
+          Proxy(android.os.IBinder remote)
+          {
+            mRemote = remote;
+          }
+          @Override public android.os.IBinder asBinder()
+          {
+            return mRemote;
+          }
+          public java.lang.String getInterfaceDescriptor()
+          {
+            return DESCRIPTOR;
+          }
+          @Override public void foo() throws android.os.RemoteException
+          {
+            android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+            android.os.Parcel _reply = android.os.Parcel.obtain();
+            try {
+              _data.writeInterfaceToken(DESCRIPTOR);
+              boolean _status = mRemote.transact(Stub.TRANSACTION_foo, _data, _reply, 0);
+              _reply.readException();
+            }
+            finally {
+              _reply.recycle();
+              _data.recycle();
+            }
+          }
+        }
+        static final int TRANSACTION_foo = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+        /** @hide */
+        public int getMaxTransactionId()
+        {
+          return 0;
+        }
+      }
+      public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface";
+      public void foo() throws android.os.RemoteException;
+      public static class Nested implements android.os.Parcelable
+      {
+        public static final android.os.Parcelable.Creator<Nested> CREATOR = new android.os.Parcelable.Creator<Nested>() {
+          @Override
+          public Nested createFromParcel(android.os.Parcel _aidl_source) {
+            Nested _aidl_out = new Nested();
+            _aidl_out.readFromParcel(_aidl_source);
+            return _aidl_out;
+          }
+          @Override
+          public Nested[] newArray(int _aidl_size) {
+            return new Nested[_aidl_size];
+          }
+        };
+        @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+        {
+          int _aidl_start_pos = _aidl_parcel.dataPosition();
+          _aidl_parcel.writeInt(0);
+          int _aidl_end_pos = _aidl_parcel.dataPosition();
+          _aidl_parcel.setDataPosition(_aidl_start_pos);
+          _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+          _aidl_parcel.setDataPosition(_aidl_end_pos);
+        }
+        public final void readFromParcel(android.os.Parcel _aidl_parcel)
+        {
+          int _aidl_start_pos = _aidl_parcel.dataPosition();
+          int _aidl_parcelable_size = _aidl_parcel.readInt();
+          try {
+            if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+          } finally {
+            if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+              throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+            }
+            _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+          }
+        }
+        @Override
+        public int describeContents() {
+          int _mask = 0;
+          return _mask;
+        }
+      }
+      public interface NestedNoPrefixInterface extends android.os.IInterface
+      {
+        /** Default implementation for NestedNoPrefixInterface. */
+        public static class Default implements android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface
+        {
+          @Override public void foo() throws android.os.RemoteException
+          {
+          }
+          @Override
+          public android.os.IBinder asBinder() {
+            return null;
+          }
+        }
+        /** Local-side IPC implementation stub class. */
+        public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface
+        {
+          /** Construct the stub at attach it to the interface. */
+          public Stub()
+          {
+            this.attachInterface(this, DESCRIPTOR);
+          }
+          /**
+           * Cast an IBinder object into an android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface interface,
+           * generating a proxy if needed.
+           */
+          public static android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface asInterface(android.os.IBinder obj)
+          {
+            if ((obj==null)) {
+              return null;
+            }
+            android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+            if (((iin!=null)&&(iin instanceof android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface))) {
+              return ((android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface)iin);
+            }
+            return new android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface.Stub.Proxy(obj);
+          }
+          @Override public android.os.IBinder asBinder()
+          {
+            return this;
+          }
+          /** @hide */
+          public static java.lang.String getDefaultTransactionName(int transactionCode)
+          {
+            switch (transactionCode)
+            {
+              case TRANSACTION_foo:
+              {
+                return "foo";
+              }
+              default:
+              {
+                return null;
+              }
+            }
+          }
+          /** @hide */
+          public java.lang.String getTransactionName(int transactionCode)
+          {
+            return this.getDefaultTransactionName(transactionCode);
+          }
+          @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+          {
+            java.lang.String descriptor = DESCRIPTOR;
+            if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+              data.enforceInterface(descriptor);
+            }
+            if (code == INTERFACE_TRANSACTION) {
+              reply.writeString(descriptor);
+              return true;
+            }
+            switch (code)
+            {
+              case TRANSACTION_foo:
+              {
+                this.foo();
+                reply.writeNoException();
+                break;
+              }
+              default:
+              {
+                return super.onTransact(code, data, reply, flags);
+              }
+            }
+            return true;
+          }
+          private static class Proxy implements android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface
+          {
+            private android.os.IBinder mRemote;
+            Proxy(android.os.IBinder remote)
+            {
+              mRemote = remote;
+            }
+            @Override public android.os.IBinder asBinder()
+            {
+              return mRemote;
+            }
+            public java.lang.String getInterfaceDescriptor()
+            {
+              return DESCRIPTOR;
+            }
+            @Override public void foo() throws android.os.RemoteException
+            {
+              android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+              android.os.Parcel _reply = android.os.Parcel.obtain();
+              try {
+                _data.writeInterfaceToken(DESCRIPTOR);
+                boolean _status = mRemote.transact(Stub.TRANSACTION_foo, _data, _reply, 0);
+                _reply.readException();
+              }
+              finally {
+                _reply.recycle();
+                _data.recycle();
+              }
+            }
+          }
+          static final int TRANSACTION_foo = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+          /** @hide */
+          public int getMaxTransactionId()
+          {
+            return 0;
+          }
+        }
+        public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface";
+        public void foo() throws android.os.RemoteException;
+      }
+    }
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java.d
new file mode 100644
index 0000000..34f4255
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java : \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IntEnum.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IntEnum.java
new file mode 100644
index 0000000..8c5b408
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IntEnum.java
@@ -0,0 +1,40 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/IntEnum.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+package android.aidl.tests;
+public @interface IntEnum {
+  public static final int FOO = 1000;
+  public static final int BAR = 2000;
+  public static final int BAZ = 2001;
+  /** @deprecated do not use this */
+  @Deprecated
+  public static final int QUX = 2002;
+  interface $ {
+    static String toString(int _aidl_v) {
+      if (_aidl_v == FOO) return "FOO";
+      if (_aidl_v == BAR) return "BAR";
+      if (_aidl_v == BAZ) return "BAZ";
+      if (_aidl_v == QUX) return "QUX";
+      return Integer.toString(_aidl_v);
+    }
+    static String arrayToString(Object _aidl_v) {
+      if (_aidl_v == null) return "null";
+      Class<?> _aidl_cls = _aidl_v.getClass();
+      if (!_aidl_cls.isArray()) throw new IllegalArgumentException("not an array: " + _aidl_v);
+      Class<?> comp = _aidl_cls.getComponentType();
+      java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "[", "]");
+      if (comp.isArray()) {
+        for (int _aidl_i = 0; _aidl_i < java.lang.reflect.Array.getLength(_aidl_v); _aidl_i++) {
+          _aidl_sj.add(arrayToString(java.lang.reflect.Array.get(_aidl_v, _aidl_i)));
+        }
+      } else {
+        if (_aidl_cls != int[].class) throw new IllegalArgumentException("wrong type: " + _aidl_cls);
+        for (int e : (int[]) _aidl_v) {
+          _aidl_sj.add(toString(e));
+        }
+      }
+      return _aidl_sj.toString();
+    }
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IntEnum.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IntEnum.java.d
new file mode 100644
index 0000000..c3c8c4c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IntEnum.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/IntEnum.java : \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ListOfInterfaces.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ListOfInterfaces.java
new file mode 100644
index 0000000..753aa51
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ListOfInterfaces.java
@@ -0,0 +1,594 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ListOfInterfaces.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+package android.aidl.tests;
+public class ListOfInterfaces implements android.os.Parcelable
+{
+  public static final android.os.Parcelable.Creator<ListOfInterfaces> CREATOR = new android.os.Parcelable.Creator<ListOfInterfaces>() {
+    @Override
+    public ListOfInterfaces createFromParcel(android.os.Parcel _aidl_source) {
+      ListOfInterfaces _aidl_out = new ListOfInterfaces();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public ListOfInterfaces[] newArray(int _aidl_size) {
+      return new ListOfInterfaces[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+  public interface IEmptyInterface extends android.os.IInterface
+  {
+    /** Default implementation for IEmptyInterface. */
+    public static class Default implements android.aidl.tests.ListOfInterfaces.IEmptyInterface
+    {
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ListOfInterfaces.IEmptyInterface
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.tests.ListOfInterfaces.IEmptyInterface interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.tests.ListOfInterfaces.IEmptyInterface asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.tests.ListOfInterfaces.IEmptyInterface))) {
+          return ((android.aidl.tests.ListOfInterfaces.IEmptyInterface)iin);
+        }
+        return new android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      /** @hide */
+      public static java.lang.String getDefaultTransactionName(int transactionCode)
+      {
+        switch (transactionCode)
+        {
+          default:
+          {
+            return null;
+          }
+        }
+      }
+      /** @hide */
+      public java.lang.String getTransactionName(int transactionCode)
+      {
+        return this.getDefaultTransactionName(transactionCode);
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        switch (code)
+        {
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+      }
+      private static class Proxy implements android.aidl.tests.ListOfInterfaces.IEmptyInterface
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+      }
+      /** @hide */
+      public int getMaxTransactionId()
+      {
+        return 0;
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ListOfInterfaces.IEmptyInterface";
+  }
+  public interface IMyInterface extends android.os.IInterface
+  {
+    /** Default implementation for IMyInterface. */
+    public static class Default implements android.aidl.tests.ListOfInterfaces.IMyInterface
+    {
+      @Override public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> methodWithInterfaces(android.aidl.tests.ListOfInterfaces.IEmptyInterface iface, android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_inout, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_inout) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ListOfInterfaces.IMyInterface
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.tests.ListOfInterfaces.IMyInterface interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.tests.ListOfInterfaces.IMyInterface asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.tests.ListOfInterfaces.IMyInterface))) {
+          return ((android.aidl.tests.ListOfInterfaces.IMyInterface)iin);
+        }
+        return new android.aidl.tests.ListOfInterfaces.IMyInterface.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      /** @hide */
+      public static java.lang.String getDefaultTransactionName(int transactionCode)
+      {
+        switch (transactionCode)
+        {
+          case TRANSACTION_methodWithInterfaces:
+          {
+            return "methodWithInterfaces";
+          }
+          default:
+          {
+            return null;
+          }
+        }
+      }
+      /** @hide */
+      public java.lang.String getTransactionName(int transactionCode)
+      {
+        return this.getDefaultTransactionName(transactionCode);
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+          data.enforceInterface(descriptor);
+        }
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        switch (code)
+        {
+          case TRANSACTION_methodWithInterfaces:
+          {
+            android.aidl.tests.ListOfInterfaces.IEmptyInterface _arg0;
+            _arg0 = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(data.readStrongBinder());
+            android.aidl.tests.ListOfInterfaces.IEmptyInterface _arg1;
+            _arg1 = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(data.readStrongBinder());
+            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg2;
+            _arg2 = data.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg3;
+            _arg3 = new java.util.ArrayList<android.aidl.tests.ListOfInterfaces.IEmptyInterface>();
+            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg4;
+            _arg4 = data.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg5;
+            _arg5 = data.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg6;
+            _arg6 = new java.util.ArrayList<android.aidl.tests.ListOfInterfaces.IEmptyInterface>();
+            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg7;
+            _arg7 = data.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+            data.enforceNoDataAvail();
+            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _result = this.methodWithInterfaces(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
+            reply.writeNoException();
+            reply.writeInterfaceList(_result);
+            reply.writeInterfaceList(_arg3);
+            reply.writeInterfaceList(_arg4);
+            reply.writeInterfaceList(_arg6);
+            reply.writeInterfaceList(_arg7);
+            break;
+          }
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+        return true;
+      }
+      private static class Proxy implements android.aidl.tests.ListOfInterfaces.IMyInterface
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+        @Override public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> methodWithInterfaces(android.aidl.tests.ListOfInterfaces.IEmptyInterface iface, android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_inout, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_inout) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeStrongInterface(iface);
+            _data.writeStrongInterface(nullable_iface);
+            _data.writeInterfaceList(iface_list_in);
+            _data.writeInterfaceList(iface_list_inout);
+            _data.writeInterfaceList(nullable_iface_list_in);
+            _data.writeInterfaceList(nullable_iface_list_inout);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_methodWithInterfaces, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+            _reply.readInterfaceList(iface_list_out, android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+            _reply.readInterfaceList(iface_list_inout, android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+            _reply.readInterfaceList(nullable_iface_list_out, android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+            _reply.readInterfaceList(nullable_iface_list_inout, android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+      }
+      static final int TRANSACTION_methodWithInterfaces = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+      /** @hide */
+      public int getMaxTransactionId()
+      {
+        return 0;
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ListOfInterfaces.IMyInterface";
+    public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> methodWithInterfaces(android.aidl.tests.ListOfInterfaces.IEmptyInterface iface, android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_inout, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_inout) throws android.os.RemoteException;
+  }
+  public static class MyParcelable implements android.os.Parcelable
+  {
+    public android.aidl.tests.ListOfInterfaces.IEmptyInterface iface;
+    public android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface;
+    public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list;
+    public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list;
+    public static final android.os.Parcelable.Creator<MyParcelable> CREATOR = new android.os.Parcelable.Creator<MyParcelable>() {
+      @Override
+      public MyParcelable createFromParcel(android.os.Parcel _aidl_source) {
+        MyParcelable _aidl_out = new MyParcelable();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public MyParcelable[] newArray(int _aidl_size) {
+        return new MyParcelable[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeStrongInterface(iface);
+      _aidl_parcel.writeStrongInterface(nullable_iface);
+      _aidl_parcel.writeInterfaceList(iface_list);
+      _aidl_parcel.writeInterfaceList(nullable_iface_list);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        iface = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_iface = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        iface_list = _aidl_parcel.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_iface_list = _aidl_parcel.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public String toString() {
+      java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "{", "}");
+      _aidl_sj.add("iface: " + (java.util.Objects.toString(iface)));
+      _aidl_sj.add("nullable_iface: " + (java.util.Objects.toString(nullable_iface)));
+      _aidl_sj.add("iface_list: " + (java.util.Objects.toString(iface_list)));
+      _aidl_sj.add("nullable_iface_list: " + (java.util.Objects.toString(nullable_iface_list)));
+      return "MyParcelable" + _aidl_sj.toString()  ;
+    }
+    @Override
+    public boolean equals(Object other) {
+      if (this == other) return true;
+      if (other == null) return false;
+      if (!(other instanceof MyParcelable)) return false;
+      MyParcelable that = (MyParcelable)other;
+      if (!java.util.Objects.deepEquals(iface, that.iface)) return false;
+      if (!java.util.Objects.deepEquals(nullable_iface, that.nullable_iface)) return false;
+      if (!java.util.Objects.deepEquals(iface_list, that.iface_list)) return false;
+      if (!java.util.Objects.deepEquals(nullable_iface_list, that.nullable_iface_list)) return false;
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return java.util.Arrays.deepHashCode(java.util.Arrays.asList(iface, nullable_iface, iface_list, nullable_iface_list).toArray());
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+  public static final class MyUnion implements android.os.Parcelable {
+    // tags for union fields
+    public final static int iface = 0;  // android.aidl.tests.ListOfInterfaces.IEmptyInterface iface;
+    public final static int nullable_iface = 1;  // android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface;
+    public final static int iface_list = 2;  // List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list;
+    public final static int nullable_iface_list = 3;  // List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list;
+
+    private int _tag;
+    private Object _value;
+
+    public MyUnion() {
+      android.aidl.tests.ListOfInterfaces.IEmptyInterface _value = null;
+      this._tag = iface;
+      this._value = _value;
+    }
+
+    private MyUnion(android.os.Parcel _aidl_parcel) {
+      readFromParcel(_aidl_parcel);
+    }
+
+    private MyUnion(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+
+    public int getTag() {
+      return _tag;
+    }
+
+    // android.aidl.tests.ListOfInterfaces.IEmptyInterface iface;
+
+    public static MyUnion iface(android.aidl.tests.ListOfInterfaces.IEmptyInterface _value) {
+      return new MyUnion(iface, _value);
+    }
+
+    public android.aidl.tests.ListOfInterfaces.IEmptyInterface getIface() {
+      _assertTag(iface);
+      return (android.aidl.tests.ListOfInterfaces.IEmptyInterface) _value;
+    }
+
+    public void setIface(android.aidl.tests.ListOfInterfaces.IEmptyInterface _value) {
+      _set(iface, _value);
+    }
+
+    // android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface;
+
+    public static MyUnion nullable_iface(android.aidl.tests.ListOfInterfaces.IEmptyInterface _value) {
+      return new MyUnion(nullable_iface, _value);
+    }
+
+    public android.aidl.tests.ListOfInterfaces.IEmptyInterface getNullable_iface() {
+      _assertTag(nullable_iface);
+      return (android.aidl.tests.ListOfInterfaces.IEmptyInterface) _value;
+    }
+
+    public void setNullable_iface(android.aidl.tests.ListOfInterfaces.IEmptyInterface _value) {
+      _set(nullable_iface, _value);
+    }
+
+    // List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list;
+
+    public static MyUnion iface_list(java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _value) {
+      return new MyUnion(iface_list, _value);
+    }
+
+    @SuppressWarnings("unchecked")
+    public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> getIface_list() {
+      _assertTag(iface_list);
+      return (java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface>) _value;
+    }
+
+    public void setIface_list(java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _value) {
+      _set(iface_list, _value);
+    }
+
+    // List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list;
+
+    public static MyUnion nullable_iface_list(java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _value) {
+      return new MyUnion(nullable_iface_list, _value);
+    }
+
+    @SuppressWarnings("unchecked")
+    public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> getNullable_iface_list() {
+      _assertTag(nullable_iface_list);
+      return (java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface>) _value;
+    }
+
+    public void setNullable_iface_list(java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _value) {
+      _set(nullable_iface_list, _value);
+    }
+
+    public static final android.os.Parcelable.Creator<MyUnion> CREATOR = new android.os.Parcelable.Creator<MyUnion>() {
+      @Override
+      public MyUnion createFromParcel(android.os.Parcel _aidl_source) {
+        return new MyUnion(_aidl_source);
+      }
+      @Override
+      public MyUnion[] newArray(int _aidl_size) {
+        return new MyUnion[_aidl_size];
+      }
+    };
+
+    @Override
+    public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+      _aidl_parcel.writeInt(_tag);
+      switch (_tag) {
+      case iface:
+        _aidl_parcel.writeStrongInterface(getIface());
+        break;
+      case nullable_iface:
+        _aidl_parcel.writeStrongInterface(getNullable_iface());
+        break;
+      case iface_list:
+        _aidl_parcel.writeInterfaceList(getIface_list());
+        break;
+      case nullable_iface_list:
+        _aidl_parcel.writeInterfaceList(getNullable_iface_list());
+        break;
+      }
+    }
+
+    public void readFromParcel(android.os.Parcel _aidl_parcel) {
+      int _aidl_tag;
+      _aidl_tag = _aidl_parcel.readInt();
+      switch (_aidl_tag) {
+      case iface: {
+        android.aidl.tests.ListOfInterfaces.IEmptyInterface _aidl_value;
+        _aidl_value = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case nullable_iface: {
+        android.aidl.tests.ListOfInterfaces.IEmptyInterface _aidl_value;
+        _aidl_value = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case iface_list: {
+        java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _aidl_value;
+        _aidl_value = _aidl_parcel.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case nullable_iface_list: {
+        java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _aidl_value;
+        _aidl_value = _aidl_parcel.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      }
+      throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+    }
+
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      switch (getTag()) {
+      }
+      return _mask;
+    }
+
+    @Override
+    public String toString() {
+      switch (_tag) {
+      case iface: return "MyUnion.iface(" + (java.util.Objects.toString(getIface())) + ")";
+      case nullable_iface: return "MyUnion.nullable_iface(" + (java.util.Objects.toString(getNullable_iface())) + ")";
+      case iface_list: return "MyUnion.iface_list(" + (java.util.Objects.toString(getIface_list())) + ")";
+      case nullable_iface_list: return "MyUnion.nullable_iface_list(" + (java.util.Objects.toString(getNullable_iface_list())) + ")";
+      }
+      throw new IllegalStateException("unknown field: " + _tag);
+    }
+    @Override
+    public boolean equals(Object other) {
+      if (this == other) return true;
+      if (other == null) return false;
+      if (!(other instanceof MyUnion)) return false;
+      MyUnion that = (MyUnion)other;
+      if (_tag != that._tag) return false;
+      if (!java.util.Objects.deepEquals(_value, that._value)) return false;
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return java.util.Arrays.deepHashCode(java.util.Arrays.asList(_tag, _value).toArray());
+    }
+
+    private void _assertTag(int tag) {
+      if (getTag() != tag) {
+        throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+      }
+    }
+
+    private String _tagString(int _tag) {
+      switch (_tag) {
+      case iface: return "iface";
+      case nullable_iface: return "nullable_iface";
+      case iface_list: return "iface_list";
+      case nullable_iface_list: return "nullable_iface_list";
+      }
+      throw new IllegalStateException("unknown field: " + _tag);
+    }
+
+    private void _set(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+    public static @interface Tag {
+      public static final int iface = 0;
+      public static final int nullable_iface = 1;
+      public static final int iface_list = 2;
+      public static final int nullable_iface_list = 3;
+    }
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ListOfInterfaces.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ListOfInterfaces.java.d
new file mode 100644
index 0000000..3387036
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ListOfInterfaces.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ListOfInterfaces.java : \
+  system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/LongEnum.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/LongEnum.java
new file mode 100644
index 0000000..741dde7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/LongEnum.java
@@ -0,0 +1,10 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/LongEnum.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+package android.aidl.tests;
+public @interface LongEnum {
+  public static final long FOO = 100000000000L;
+  public static final long BAR = 200000000000L;
+  public static final long BAZ = 200000000001L;
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/LongEnum.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/LongEnum.java.d
new file mode 100644
index 0000000..aae0f69
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/LongEnum.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/LongEnum.java : \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/OtherParcelableForToString.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/OtherParcelableForToString.java
new file mode 100644
index 0000000..f5c7bbb
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/OtherParcelableForToString.java
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/OtherParcelableForToString.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+package android.aidl.tests;
+public class OtherParcelableForToString implements android.os.Parcelable
+{
+  public java.lang.String field;
+  public static final android.os.Parcelable.Creator<OtherParcelableForToString> CREATOR = new android.os.Parcelable.Creator<OtherParcelableForToString>() {
+    @Override
+    public OtherParcelableForToString createFromParcel(android.os.Parcel _aidl_source) {
+      OtherParcelableForToString _aidl_out = new OtherParcelableForToString();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public OtherParcelableForToString[] newArray(int _aidl_size) {
+      return new OtherParcelableForToString[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeString(field);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      field = _aidl_parcel.readString();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public String toString() {
+    java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "{", "}");
+    _aidl_sj.add("field: " + (java.util.Objects.toString(field)));
+    return "OtherParcelableForToString" + _aidl_sj.toString()  ;
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/OtherParcelableForToString.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/OtherParcelableForToString.java.d
new file mode 100644
index 0000000..a5c675b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/OtherParcelableForToString.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/OtherParcelableForToString.java : \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ParcelableForToString.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ParcelableForToString.java
new file mode 100644
index 0000000..a15bb73
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ParcelableForToString.java
@@ -0,0 +1,185 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ParcelableForToString.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+package android.aidl.tests;
+public class ParcelableForToString implements android.os.Parcelable
+{
+  public int intValue = 0;
+  public int[] intArray;
+  public long longValue = 0L;
+  public long[] longArray;
+  public double doubleValue = 0.000000;
+  public double[] doubleArray;
+  public float floatValue = 0.000000f;
+  public float[] floatArray;
+  public byte byteValue = 0;
+  public byte[] byteArray;
+  public boolean booleanValue = false;
+  public boolean[] booleanArray;
+  public java.lang.String stringValue;
+  public java.lang.String[] stringArray;
+  public java.util.List<java.lang.String> stringList;
+  public android.aidl.tests.OtherParcelableForToString parcelableValue;
+  public android.aidl.tests.OtherParcelableForToString[] parcelableArray;
+  public int enumValue = android.aidl.tests.IntEnum.FOO;
+  public int[] enumArray;
+  public java.lang.String[] nullArray;
+  public java.util.List<java.lang.String> nullList;
+  public android.aidl.tests.GenericStructuredParcelable<Integer,android.aidl.tests.StructuredParcelable,Integer> parcelableGeneric;
+  public android.aidl.tests.Union unionValue;
+  public static final android.os.Parcelable.Creator<ParcelableForToString> CREATOR = new android.os.Parcelable.Creator<ParcelableForToString>() {
+    @Override
+    public ParcelableForToString createFromParcel(android.os.Parcel _aidl_source) {
+      ParcelableForToString _aidl_out = new ParcelableForToString();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public ParcelableForToString[] newArray(int _aidl_size) {
+      return new ParcelableForToString[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(intValue);
+    _aidl_parcel.writeIntArray(intArray);
+    _aidl_parcel.writeLong(longValue);
+    _aidl_parcel.writeLongArray(longArray);
+    _aidl_parcel.writeDouble(doubleValue);
+    _aidl_parcel.writeDoubleArray(doubleArray);
+    _aidl_parcel.writeFloat(floatValue);
+    _aidl_parcel.writeFloatArray(floatArray);
+    _aidl_parcel.writeByte(byteValue);
+    _aidl_parcel.writeByteArray(byteArray);
+    _aidl_parcel.writeBoolean(booleanValue);
+    _aidl_parcel.writeBooleanArray(booleanArray);
+    _aidl_parcel.writeString(stringValue);
+    _aidl_parcel.writeStringArray(stringArray);
+    _aidl_parcel.writeStringList(stringList);
+    _aidl_parcel.writeTypedObject(parcelableValue, _aidl_flag);
+    _aidl_parcel.writeTypedArray(parcelableArray, _aidl_flag);
+    _aidl_parcel.writeInt(enumValue);
+    _aidl_parcel.writeIntArray(enumArray);
+    _aidl_parcel.writeStringArray(nullArray);
+    _aidl_parcel.writeStringList(nullList);
+    _aidl_parcel.writeTypedObject(parcelableGeneric, _aidl_flag);
+    _aidl_parcel.writeTypedObject(unionValue, _aidl_flag);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intValue = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intArray = _aidl_parcel.createIntArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longValue = _aidl_parcel.readLong();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longArray = _aidl_parcel.createLongArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      doubleValue = _aidl_parcel.readDouble();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      doubleArray = _aidl_parcel.createDoubleArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      floatValue = _aidl_parcel.readFloat();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      floatArray = _aidl_parcel.createFloatArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteValue = _aidl_parcel.readByte();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteArray = _aidl_parcel.createByteArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      booleanValue = _aidl_parcel.readBoolean();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      booleanArray = _aidl_parcel.createBooleanArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      stringValue = _aidl_parcel.readString();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      stringArray = _aidl_parcel.createStringArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      stringList = _aidl_parcel.createStringArrayList();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      parcelableValue = _aidl_parcel.readTypedObject(android.aidl.tests.OtherParcelableForToString.CREATOR);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      parcelableArray = _aidl_parcel.createTypedArray(android.aidl.tests.OtherParcelableForToString.CREATOR);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      enumValue = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      enumArray = _aidl_parcel.createIntArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      nullArray = _aidl_parcel.createStringArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      nullList = _aidl_parcel.createStringArrayList();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      parcelableGeneric = _aidl_parcel.readTypedObject(android.aidl.tests.GenericStructuredParcelable.CREATOR);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      unionValue = _aidl_parcel.readTypedObject(android.aidl.tests.Union.CREATOR);
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public String toString() {
+    java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "{", "}");
+    _aidl_sj.add("intValue: " + (intValue));
+    _aidl_sj.add("intArray: " + (java.util.Arrays.toString(intArray)));
+    _aidl_sj.add("longValue: " + (longValue));
+    _aidl_sj.add("longArray: " + (java.util.Arrays.toString(longArray)));
+    _aidl_sj.add("doubleValue: " + (doubleValue));
+    _aidl_sj.add("doubleArray: " + (java.util.Arrays.toString(doubleArray)));
+    _aidl_sj.add("floatValue: " + (floatValue));
+    _aidl_sj.add("floatArray: " + (java.util.Arrays.toString(floatArray)));
+    _aidl_sj.add("byteValue: " + (byteValue));
+    _aidl_sj.add("byteArray: " + (java.util.Arrays.toString(byteArray)));
+    _aidl_sj.add("booleanValue: " + (booleanValue));
+    _aidl_sj.add("booleanArray: " + (java.util.Arrays.toString(booleanArray)));
+    _aidl_sj.add("stringValue: " + (java.util.Objects.toString(stringValue)));
+    _aidl_sj.add("stringArray: " + (java.util.Arrays.toString(stringArray)));
+    _aidl_sj.add("stringList: " + (java.util.Objects.toString(stringList)));
+    _aidl_sj.add("parcelableValue: " + (java.util.Objects.toString(parcelableValue)));
+    _aidl_sj.add("parcelableArray: " + (java.util.Arrays.toString(parcelableArray)));
+    _aidl_sj.add("enumValue: " + (android.aidl.tests.IntEnum.$.toString(enumValue)));
+    _aidl_sj.add("enumArray: " + (android.aidl.tests.IntEnum.$.arrayToString(enumArray)));
+    _aidl_sj.add("nullArray: " + (java.util.Arrays.toString(nullArray)));
+    _aidl_sj.add("nullList: " + (java.util.Objects.toString(nullList)));
+    _aidl_sj.add("parcelableGeneric: " + (java.util.Objects.toString(parcelableGeneric)));
+    _aidl_sj.add("unionValue: " + (java.util.Objects.toString(unionValue)));
+    return "ParcelableForToString" + _aidl_sj.toString()  ;
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    _mask |= describeContents(parcelableValue);
+    _mask |= describeContents(parcelableArray);
+    _mask |= describeContents(parcelableGeneric);
+    _mask |= describeContents(unionValue);
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof Object[]) {
+      int _mask = 0;
+      for (Object o : (Object[]) _v) {
+        _mask |= describeContents(o);
+      }
+      return _mask;
+    }
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ParcelableForToString.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ParcelableForToString.java.d
new file mode 100644
index 0000000..013e62c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ParcelableForToString.java.d
@@ -0,0 +1,10 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ParcelableForToString.java : \
+  system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/RecursiveList.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/RecursiveList.java
new file mode 100644
index 0000000..9a023ee
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/RecursiveList.java
@@ -0,0 +1,63 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/RecursiveList.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+package android.aidl.tests;
+public class RecursiveList implements android.os.Parcelable
+{
+  public int value = 0;
+  public android.aidl.tests.RecursiveList next;
+  public static final android.os.Parcelable.Creator<RecursiveList> CREATOR = new android.os.Parcelable.Creator<RecursiveList>() {
+    @Override
+    public RecursiveList createFromParcel(android.os.Parcel _aidl_source) {
+      RecursiveList _aidl_out = new RecursiveList();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public RecursiveList[] newArray(int _aidl_size) {
+      return new RecursiveList[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(value);
+    _aidl_parcel.writeTypedObject(next, _aidl_flag);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      value = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      next = _aidl_parcel.readTypedObject(android.aidl.tests.RecursiveList.CREATOR);
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    _mask |= describeContents(next);
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/RecursiveList.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/RecursiveList.java.d
new file mode 100644
index 0000000..826c4ea
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/RecursiveList.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/RecursiveList.java : \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/StructuredParcelable.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/StructuredParcelable.java
new file mode 100644
index 0000000..797d05c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/StructuredParcelable.java
@@ -0,0 +1,473 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/StructuredParcelable.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+package android.aidl.tests;
+public class StructuredParcelable implements android.os.Parcelable
+{
+  public int[] shouldContainThreeFs;
+  public int f = 0;
+  public java.lang.String shouldBeJerry;
+  public byte shouldBeByteBar;
+  public int shouldBeIntBar;
+  public long shouldBeLongBar;
+  public byte[] shouldContainTwoByteFoos;
+  public int[] shouldContainTwoIntFoos;
+  public long[] shouldContainTwoLongFoos;
+  public java.lang.String stringDefaultsToFoo = "foo";
+  public byte byteDefaultsToFour = 4;
+  public int intDefaultsToFive = 5;
+  public long longDefaultsToNegativeSeven = -7L;
+  public boolean booleanDefaultsToTrue = true;
+  public char charDefaultsToC = 'C';
+  public float floatDefaultsToPi = 3.140000f;
+  public double doubleWithDefault = -314000000000000000.000000;
+  public int[] arrayDefaultsTo123 = {1, 2, 3};
+  public int[] arrayDefaultsToEmpty = {};
+  public boolean boolDefault = false;
+  public byte byteDefault = 0;
+  public int intDefault = 0;
+  public long longDefault = 0L;
+  public float floatDefault = 0.000000f;
+  public double doubleDefault = 0.000000;
+  // parse checks only
+  public double checkDoubleFromFloat = 3.140000;
+  public java.lang.String[] checkStringArray1 = {"a", "b"};
+  public java.lang.String[] checkStringArray2 = {"a", "b"};
+  // Add test to verify corner cases
+  public int int32_min = -2147483648;
+  public int int32_max = 2147483647;
+  public long int64_max = 9223372036854775807L;
+  public int hexInt32_neg_1 = -1;
+  public android.os.IBinder ibinder;
+  public android.aidl.tests.StructuredParcelable.Empty empty;
+  // Constant expressions that evaluate to 1
+  public byte[] int8_1 = {1, 1, 1, 1, 1};
+  public int[] int32_1 = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
+  public long[] int64_1 = {1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L};
+  public int hexInt32_pos_1 = 1;
+  public int hexInt64_pos_1 = 1;
+  public int const_exprs_1;
+  public int const_exprs_2;
+  public int const_exprs_3;
+  public int const_exprs_4;
+  public int const_exprs_5;
+  public int const_exprs_6;
+  public int const_exprs_7;
+  public int const_exprs_8;
+  public int const_exprs_9;
+  public int const_exprs_10;
+  // String expressions
+  public java.lang.String addString1 = "hello world!";
+  public java.lang.String addString2 = "The quick brown fox jumps over the lazy dog.";
+  public int shouldSetBit0AndBit2 = 0;
+  public android.aidl.tests.Union u;
+  public android.aidl.tests.Union shouldBeConstS1;
+  public int defaultWithFoo = android.aidl.tests.IntEnum.FOO;
+  public static final android.os.Parcelable.Creator<StructuredParcelable> CREATOR = new android.os.Parcelable.Creator<StructuredParcelable>() {
+    @Override
+    public StructuredParcelable createFromParcel(android.os.Parcel _aidl_source) {
+      StructuredParcelable _aidl_out = new StructuredParcelable();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public StructuredParcelable[] newArray(int _aidl_size) {
+      return new StructuredParcelable[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeIntArray(shouldContainThreeFs);
+    _aidl_parcel.writeInt(f);
+    _aidl_parcel.writeString(shouldBeJerry);
+    _aidl_parcel.writeByte(shouldBeByteBar);
+    _aidl_parcel.writeInt(shouldBeIntBar);
+    _aidl_parcel.writeLong(shouldBeLongBar);
+    _aidl_parcel.writeByteArray(shouldContainTwoByteFoos);
+    _aidl_parcel.writeIntArray(shouldContainTwoIntFoos);
+    _aidl_parcel.writeLongArray(shouldContainTwoLongFoos);
+    _aidl_parcel.writeString(stringDefaultsToFoo);
+    _aidl_parcel.writeByte(byteDefaultsToFour);
+    _aidl_parcel.writeInt(intDefaultsToFive);
+    _aidl_parcel.writeLong(longDefaultsToNegativeSeven);
+    _aidl_parcel.writeBoolean(booleanDefaultsToTrue);
+    _aidl_parcel.writeInt(((int)charDefaultsToC));
+    _aidl_parcel.writeFloat(floatDefaultsToPi);
+    _aidl_parcel.writeDouble(doubleWithDefault);
+    _aidl_parcel.writeIntArray(arrayDefaultsTo123);
+    _aidl_parcel.writeIntArray(arrayDefaultsToEmpty);
+    _aidl_parcel.writeBoolean(boolDefault);
+    _aidl_parcel.writeByte(byteDefault);
+    _aidl_parcel.writeInt(intDefault);
+    _aidl_parcel.writeLong(longDefault);
+    _aidl_parcel.writeFloat(floatDefault);
+    _aidl_parcel.writeDouble(doubleDefault);
+    _aidl_parcel.writeDouble(checkDoubleFromFloat);
+    _aidl_parcel.writeStringArray(checkStringArray1);
+    _aidl_parcel.writeStringArray(checkStringArray2);
+    _aidl_parcel.writeInt(int32_min);
+    _aidl_parcel.writeInt(int32_max);
+    _aidl_parcel.writeLong(int64_max);
+    _aidl_parcel.writeInt(hexInt32_neg_1);
+    _aidl_parcel.writeStrongBinder(ibinder);
+    _aidl_parcel.writeTypedObject(empty, _aidl_flag);
+    _aidl_parcel.writeByteArray(int8_1);
+    _aidl_parcel.writeIntArray(int32_1);
+    _aidl_parcel.writeLongArray(int64_1);
+    _aidl_parcel.writeInt(hexInt32_pos_1);
+    _aidl_parcel.writeInt(hexInt64_pos_1);
+    _aidl_parcel.writeInt(const_exprs_1);
+    _aidl_parcel.writeInt(const_exprs_2);
+    _aidl_parcel.writeInt(const_exprs_3);
+    _aidl_parcel.writeInt(const_exprs_4);
+    _aidl_parcel.writeInt(const_exprs_5);
+    _aidl_parcel.writeInt(const_exprs_6);
+    _aidl_parcel.writeInt(const_exprs_7);
+    _aidl_parcel.writeInt(const_exprs_8);
+    _aidl_parcel.writeInt(const_exprs_9);
+    _aidl_parcel.writeInt(const_exprs_10);
+    _aidl_parcel.writeString(addString1);
+    _aidl_parcel.writeString(addString2);
+    _aidl_parcel.writeInt(shouldSetBit0AndBit2);
+    _aidl_parcel.writeTypedObject(u, _aidl_flag);
+    _aidl_parcel.writeTypedObject(shouldBeConstS1, _aidl_flag);
+    _aidl_parcel.writeInt(defaultWithFoo);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldContainThreeFs = _aidl_parcel.createIntArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      f = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldBeJerry = _aidl_parcel.readString();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldBeByteBar = _aidl_parcel.readByte();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldBeIntBar = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldBeLongBar = _aidl_parcel.readLong();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldContainTwoByteFoos = _aidl_parcel.createByteArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldContainTwoIntFoos = _aidl_parcel.createIntArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldContainTwoLongFoos = _aidl_parcel.createLongArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      stringDefaultsToFoo = _aidl_parcel.readString();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteDefaultsToFour = _aidl_parcel.readByte();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intDefaultsToFive = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longDefaultsToNegativeSeven = _aidl_parcel.readLong();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      booleanDefaultsToTrue = _aidl_parcel.readBoolean();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      charDefaultsToC = (char)_aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      floatDefaultsToPi = _aidl_parcel.readFloat();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      doubleWithDefault = _aidl_parcel.readDouble();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      arrayDefaultsTo123 = _aidl_parcel.createIntArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      arrayDefaultsToEmpty = _aidl_parcel.createIntArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      boolDefault = _aidl_parcel.readBoolean();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteDefault = _aidl_parcel.readByte();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intDefault = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longDefault = _aidl_parcel.readLong();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      floatDefault = _aidl_parcel.readFloat();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      doubleDefault = _aidl_parcel.readDouble();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      checkDoubleFromFloat = _aidl_parcel.readDouble();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      checkStringArray1 = _aidl_parcel.createStringArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      checkStringArray2 = _aidl_parcel.createStringArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      int32_min = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      int32_max = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      int64_max = _aidl_parcel.readLong();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      hexInt32_neg_1 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      ibinder = _aidl_parcel.readStrongBinder();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      empty = _aidl_parcel.readTypedObject(android.aidl.tests.StructuredParcelable.Empty.CREATOR);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      int8_1 = _aidl_parcel.createByteArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      int32_1 = _aidl_parcel.createIntArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      int64_1 = _aidl_parcel.createLongArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      hexInt32_pos_1 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      hexInt64_pos_1 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_1 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_2 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_3 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_4 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_5 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_6 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_7 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_8 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_9 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_10 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      addString1 = _aidl_parcel.readString();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      addString2 = _aidl_parcel.readString();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldSetBit0AndBit2 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      u = _aidl_parcel.readTypedObject(android.aidl.tests.Union.CREATOR);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldBeConstS1 = _aidl_parcel.readTypedObject(android.aidl.tests.Union.CREATOR);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      defaultWithFoo = _aidl_parcel.readInt();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  public static final int BIT0 = 1;
+  public static final int BIT1 = 2;
+  public static final int BIT2 = 4;
+  @Override
+  public String toString() {
+    java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "{", "}");
+    _aidl_sj.add("shouldContainThreeFs: " + (java.util.Arrays.toString(shouldContainThreeFs)));
+    _aidl_sj.add("f: " + (f));
+    _aidl_sj.add("shouldBeJerry: " + (java.util.Objects.toString(shouldBeJerry)));
+    _aidl_sj.add("shouldBeByteBar: " + (shouldBeByteBar));
+    _aidl_sj.add("shouldBeIntBar: " + (android.aidl.tests.IntEnum.$.toString(shouldBeIntBar)));
+    _aidl_sj.add("shouldBeLongBar: " + (shouldBeLongBar));
+    _aidl_sj.add("shouldContainTwoByteFoos: " + (java.util.Arrays.toString(shouldContainTwoByteFoos)));
+    _aidl_sj.add("shouldContainTwoIntFoos: " + (android.aidl.tests.IntEnum.$.arrayToString(shouldContainTwoIntFoos)));
+    _aidl_sj.add("shouldContainTwoLongFoos: " + (java.util.Arrays.toString(shouldContainTwoLongFoos)));
+    _aidl_sj.add("stringDefaultsToFoo: " + (java.util.Objects.toString(stringDefaultsToFoo)));
+    _aidl_sj.add("byteDefaultsToFour: " + (byteDefaultsToFour));
+    _aidl_sj.add("intDefaultsToFive: " + (intDefaultsToFive));
+    _aidl_sj.add("longDefaultsToNegativeSeven: " + (longDefaultsToNegativeSeven));
+    _aidl_sj.add("booleanDefaultsToTrue: " + (booleanDefaultsToTrue));
+    _aidl_sj.add("charDefaultsToC: " + (charDefaultsToC));
+    _aidl_sj.add("floatDefaultsToPi: " + (floatDefaultsToPi));
+    _aidl_sj.add("doubleWithDefault: " + (doubleWithDefault));
+    _aidl_sj.add("arrayDefaultsTo123: " + (java.util.Arrays.toString(arrayDefaultsTo123)));
+    _aidl_sj.add("arrayDefaultsToEmpty: " + (java.util.Arrays.toString(arrayDefaultsToEmpty)));
+    _aidl_sj.add("boolDefault: " + (boolDefault));
+    _aidl_sj.add("byteDefault: " + (byteDefault));
+    _aidl_sj.add("intDefault: " + (intDefault));
+    _aidl_sj.add("longDefault: " + (longDefault));
+    _aidl_sj.add("floatDefault: " + (floatDefault));
+    _aidl_sj.add("doubleDefault: " + (doubleDefault));
+    _aidl_sj.add("checkDoubleFromFloat: " + (checkDoubleFromFloat));
+    _aidl_sj.add("checkStringArray1: " + (java.util.Arrays.toString(checkStringArray1)));
+    _aidl_sj.add("checkStringArray2: " + (java.util.Arrays.toString(checkStringArray2)));
+    _aidl_sj.add("int32_min: " + (int32_min));
+    _aidl_sj.add("int32_max: " + (int32_max));
+    _aidl_sj.add("int64_max: " + (int64_max));
+    _aidl_sj.add("hexInt32_neg_1: " + (hexInt32_neg_1));
+    _aidl_sj.add("ibinder: " + (java.util.Objects.toString(ibinder)));
+    _aidl_sj.add("empty: " + (java.util.Objects.toString(empty)));
+    _aidl_sj.add("int8_1: " + (java.util.Arrays.toString(int8_1)));
+    _aidl_sj.add("int32_1: " + (java.util.Arrays.toString(int32_1)));
+    _aidl_sj.add("int64_1: " + (java.util.Arrays.toString(int64_1)));
+    _aidl_sj.add("hexInt32_pos_1: " + (hexInt32_pos_1));
+    _aidl_sj.add("hexInt64_pos_1: " + (hexInt64_pos_1));
+    _aidl_sj.add("const_exprs_1: " + (const_exprs_1));
+    _aidl_sj.add("const_exprs_2: " + (const_exprs_2));
+    _aidl_sj.add("const_exprs_3: " + (const_exprs_3));
+    _aidl_sj.add("const_exprs_4: " + (const_exprs_4));
+    _aidl_sj.add("const_exprs_5: " + (const_exprs_5));
+    _aidl_sj.add("const_exprs_6: " + (const_exprs_6));
+    _aidl_sj.add("const_exprs_7: " + (const_exprs_7));
+    _aidl_sj.add("const_exprs_8: " + (const_exprs_8));
+    _aidl_sj.add("const_exprs_9: " + (const_exprs_9));
+    _aidl_sj.add("const_exprs_10: " + (const_exprs_10));
+    _aidl_sj.add("addString1: " + (java.util.Objects.toString(addString1)));
+    _aidl_sj.add("addString2: " + (java.util.Objects.toString(addString2)));
+    _aidl_sj.add("shouldSetBit0AndBit2: " + (shouldSetBit0AndBit2));
+    _aidl_sj.add("u: " + (java.util.Objects.toString(u)));
+    _aidl_sj.add("shouldBeConstS1: " + (java.util.Objects.toString(shouldBeConstS1)));
+    _aidl_sj.add("defaultWithFoo: " + (android.aidl.tests.IntEnum.$.toString(defaultWithFoo)));
+    return "StructuredParcelable" + _aidl_sj.toString()  ;
+  }
+  @Override
+  public boolean equals(Object other) {
+    if (this == other) return true;
+    if (other == null) return false;
+    if (!(other instanceof StructuredParcelable)) return false;
+    StructuredParcelable that = (StructuredParcelable)other;
+    if (!java.util.Objects.deepEquals(shouldContainThreeFs, that.shouldContainThreeFs)) return false;
+    if (!java.util.Objects.deepEquals(f, that.f)) return false;
+    if (!java.util.Objects.deepEquals(shouldBeJerry, that.shouldBeJerry)) return false;
+    if (!java.util.Objects.deepEquals(shouldBeByteBar, that.shouldBeByteBar)) return false;
+    if (!java.util.Objects.deepEquals(shouldBeIntBar, that.shouldBeIntBar)) return false;
+    if (!java.util.Objects.deepEquals(shouldBeLongBar, that.shouldBeLongBar)) return false;
+    if (!java.util.Objects.deepEquals(shouldContainTwoByteFoos, that.shouldContainTwoByteFoos)) return false;
+    if (!java.util.Objects.deepEquals(shouldContainTwoIntFoos, that.shouldContainTwoIntFoos)) return false;
+    if (!java.util.Objects.deepEquals(shouldContainTwoLongFoos, that.shouldContainTwoLongFoos)) return false;
+    if (!java.util.Objects.deepEquals(stringDefaultsToFoo, that.stringDefaultsToFoo)) return false;
+    if (!java.util.Objects.deepEquals(byteDefaultsToFour, that.byteDefaultsToFour)) return false;
+    if (!java.util.Objects.deepEquals(intDefaultsToFive, that.intDefaultsToFive)) return false;
+    if (!java.util.Objects.deepEquals(longDefaultsToNegativeSeven, that.longDefaultsToNegativeSeven)) return false;
+    if (!java.util.Objects.deepEquals(booleanDefaultsToTrue, that.booleanDefaultsToTrue)) return false;
+    if (!java.util.Objects.deepEquals(charDefaultsToC, that.charDefaultsToC)) return false;
+    if (!java.util.Objects.deepEquals(floatDefaultsToPi, that.floatDefaultsToPi)) return false;
+    if (!java.util.Objects.deepEquals(doubleWithDefault, that.doubleWithDefault)) return false;
+    if (!java.util.Objects.deepEquals(arrayDefaultsTo123, that.arrayDefaultsTo123)) return false;
+    if (!java.util.Objects.deepEquals(arrayDefaultsToEmpty, that.arrayDefaultsToEmpty)) return false;
+    if (!java.util.Objects.deepEquals(boolDefault, that.boolDefault)) return false;
+    if (!java.util.Objects.deepEquals(byteDefault, that.byteDefault)) return false;
+    if (!java.util.Objects.deepEquals(intDefault, that.intDefault)) return false;
+    if (!java.util.Objects.deepEquals(longDefault, that.longDefault)) return false;
+    if (!java.util.Objects.deepEquals(floatDefault, that.floatDefault)) return false;
+    if (!java.util.Objects.deepEquals(doubleDefault, that.doubleDefault)) return false;
+    if (!java.util.Objects.deepEquals(checkDoubleFromFloat, that.checkDoubleFromFloat)) return false;
+    if (!java.util.Objects.deepEquals(checkStringArray1, that.checkStringArray1)) return false;
+    if (!java.util.Objects.deepEquals(checkStringArray2, that.checkStringArray2)) return false;
+    if (!java.util.Objects.deepEquals(int32_min, that.int32_min)) return false;
+    if (!java.util.Objects.deepEquals(int32_max, that.int32_max)) return false;
+    if (!java.util.Objects.deepEquals(int64_max, that.int64_max)) return false;
+    if (!java.util.Objects.deepEquals(hexInt32_neg_1, that.hexInt32_neg_1)) return false;
+    if (!java.util.Objects.deepEquals(ibinder, that.ibinder)) return false;
+    if (!java.util.Objects.deepEquals(empty, that.empty)) return false;
+    if (!java.util.Objects.deepEquals(int8_1, that.int8_1)) return false;
+    if (!java.util.Objects.deepEquals(int32_1, that.int32_1)) return false;
+    if (!java.util.Objects.deepEquals(int64_1, that.int64_1)) return false;
+    if (!java.util.Objects.deepEquals(hexInt32_pos_1, that.hexInt32_pos_1)) return false;
+    if (!java.util.Objects.deepEquals(hexInt64_pos_1, that.hexInt64_pos_1)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_1, that.const_exprs_1)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_2, that.const_exprs_2)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_3, that.const_exprs_3)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_4, that.const_exprs_4)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_5, that.const_exprs_5)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_6, that.const_exprs_6)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_7, that.const_exprs_7)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_8, that.const_exprs_8)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_9, that.const_exprs_9)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_10, that.const_exprs_10)) return false;
+    if (!java.util.Objects.deepEquals(addString1, that.addString1)) return false;
+    if (!java.util.Objects.deepEquals(addString2, that.addString2)) return false;
+    if (!java.util.Objects.deepEquals(shouldSetBit0AndBit2, that.shouldSetBit0AndBit2)) return false;
+    if (!java.util.Objects.deepEquals(u, that.u)) return false;
+    if (!java.util.Objects.deepEquals(shouldBeConstS1, that.shouldBeConstS1)) return false;
+    if (!java.util.Objects.deepEquals(defaultWithFoo, that.defaultWithFoo)) return false;
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return java.util.Arrays.deepHashCode(java.util.Arrays.asList(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo).toArray());
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    _mask |= describeContents(empty);
+    _mask |= describeContents(u);
+    _mask |= describeContents(shouldBeConstS1);
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+  // Make sure we can send an empty parcelable
+  public static class Empty implements android.os.Parcelable
+  {
+    public static final android.os.Parcelable.Creator<Empty> CREATOR = new android.os.Parcelable.Creator<Empty>() {
+      @Override
+      public Empty createFromParcel(android.os.Parcel _aidl_source) {
+        Empty _aidl_out = new Empty();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public Empty[] newArray(int _aidl_size) {
+        return new Empty[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public String toString() {
+      java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "{", "}");
+      return "Empty" + _aidl_sj.toString()  ;
+    }
+    @Override
+    public boolean equals(Object other) {
+      if (this == other) return true;
+      if (other == null) return false;
+      if (!(other instanceof Empty)) return false;
+      Empty that = (Empty)other;
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return java.util.Arrays.deepHashCode(java.util.Arrays.asList().toArray());
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/StructuredParcelable.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/StructuredParcelable.java.d
new file mode 100644
index 0000000..5381770
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/StructuredParcelable.java.d
@@ -0,0 +1,7 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/StructuredParcelable.java : \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/Union.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/Union.java
new file mode 100644
index 0000000..0ff6e12
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/Union.java
@@ -0,0 +1,296 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/Union.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+package android.aidl.tests;
+public final class Union implements android.os.Parcelable {
+  // tags for union fields
+  public final static int ns = 0;  // int[] ns;
+  public final static int n = 1;  // int n;
+  public final static int m = 2;  // int m;
+  public final static int s = 3;  // String s;
+  public final static int ibinder = 4;  // IBinder ibinder;
+  public final static int ss = 5;  // List<String> ss;
+  public final static int be = 6;  // android.aidl.tests.ByteEnum be;
+
+  private int _tag;
+  private Object _value;
+
+  public Union() {
+    int[] _value = {};
+    this._tag = ns;
+    this._value = _value;
+  }
+
+  private Union(android.os.Parcel _aidl_parcel) {
+    readFromParcel(_aidl_parcel);
+  }
+
+  private Union(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+
+  public int getTag() {
+    return _tag;
+  }
+
+  // int[] ns;
+
+  public static Union ns(int[] _value) {
+    return new Union(ns, _value);
+  }
+
+  public int[] getNs() {
+    _assertTag(ns);
+    return (int[]) _value;
+  }
+
+  public void setNs(int[] _value) {
+    _set(ns, _value);
+  }
+
+  // int n;
+
+  public static Union n(int _value) {
+    return new Union(n, _value);
+  }
+
+  public int getN() {
+    _assertTag(n);
+    return (int) _value;
+  }
+
+  public void setN(int _value) {
+    _set(n, _value);
+  }
+
+  // int m;
+
+  public static Union m(int _value) {
+    return new Union(m, _value);
+  }
+
+  public int getM() {
+    _assertTag(m);
+    return (int) _value;
+  }
+
+  public void setM(int _value) {
+    _set(m, _value);
+  }
+
+  // String s;
+
+  public static Union s(java.lang.String _value) {
+    return new Union(s, _value);
+  }
+
+  public java.lang.String getS() {
+    _assertTag(s);
+    return (java.lang.String) _value;
+  }
+
+  public void setS(java.lang.String _value) {
+    _set(s, _value);
+  }
+
+  // IBinder ibinder;
+
+  public static Union ibinder(android.os.IBinder _value) {
+    return new Union(ibinder, _value);
+  }
+
+  public android.os.IBinder getIbinder() {
+    _assertTag(ibinder);
+    return (android.os.IBinder) _value;
+  }
+
+  public void setIbinder(android.os.IBinder _value) {
+    _set(ibinder, _value);
+  }
+
+  // List<String> ss;
+
+  public static Union ss(java.util.List<java.lang.String> _value) {
+    return new Union(ss, _value);
+  }
+
+  @SuppressWarnings("unchecked")
+  public java.util.List<java.lang.String> getSs() {
+    _assertTag(ss);
+    return (java.util.List<java.lang.String>) _value;
+  }
+
+  public void setSs(java.util.List<java.lang.String> _value) {
+    _set(ss, _value);
+  }
+
+  // android.aidl.tests.ByteEnum be;
+
+  public static Union be(byte _value) {
+    return new Union(be, _value);
+  }
+
+  public byte getBe() {
+    _assertTag(be);
+    return (byte) _value;
+  }
+
+  public void setBe(byte _value) {
+    _set(be, _value);
+  }
+
+  public static final android.os.Parcelable.Creator<Union> CREATOR = new android.os.Parcelable.Creator<Union>() {
+    @Override
+    public Union createFromParcel(android.os.Parcel _aidl_source) {
+      return new Union(_aidl_source);
+    }
+    @Override
+    public Union[] newArray(int _aidl_size) {
+      return new Union[_aidl_size];
+    }
+  };
+
+  @Override
+  public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+    _aidl_parcel.writeInt(_tag);
+    switch (_tag) {
+    case ns:
+      _aidl_parcel.writeIntArray(getNs());
+      break;
+    case n:
+      _aidl_parcel.writeInt(getN());
+      break;
+    case m:
+      _aidl_parcel.writeInt(getM());
+      break;
+    case s:
+      _aidl_parcel.writeString(getS());
+      break;
+    case ibinder:
+      _aidl_parcel.writeStrongBinder(getIbinder());
+      break;
+    case ss:
+      _aidl_parcel.writeStringList(getSs());
+      break;
+    case be:
+      _aidl_parcel.writeByte(getBe());
+      break;
+    }
+  }
+
+  public void readFromParcel(android.os.Parcel _aidl_parcel) {
+    int _aidl_tag;
+    _aidl_tag = _aidl_parcel.readInt();
+    switch (_aidl_tag) {
+    case ns: {
+      int[] _aidl_value;
+      _aidl_value = _aidl_parcel.createIntArray();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case n: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case m: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case s: {
+      java.lang.String _aidl_value;
+      _aidl_value = _aidl_parcel.readString();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case ibinder: {
+      android.os.IBinder _aidl_value;
+      _aidl_value = _aidl_parcel.readStrongBinder();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case ss: {
+      java.util.List<java.lang.String> _aidl_value;
+      _aidl_value = _aidl_parcel.createStringArrayList();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case be: {
+      byte _aidl_value;
+      _aidl_value = _aidl_parcel.readByte();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    }
+    throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+  }
+
+  public static final String S1 = "a string constant in union";
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    switch (getTag()) {
+    }
+    return _mask;
+  }
+
+  @Override
+  public String toString() {
+    switch (_tag) {
+    case ns: return "Union.ns(" + (java.util.Arrays.toString(getNs())) + ")";
+    case n: return "Union.n(" + (getN()) + ")";
+    case m: return "Union.m(" + (getM()) + ")";
+    case s: return "Union.s(" + (java.util.Objects.toString(getS())) + ")";
+    case ibinder: return "Union.ibinder(" + (java.util.Objects.toString(getIbinder())) + ")";
+    case ss: return "Union.ss(" + (java.util.Objects.toString(getSs())) + ")";
+    case be: return "Union.be(" + (getBe()) + ")";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+  @Override
+  public boolean equals(Object other) {
+    if (this == other) return true;
+    if (other == null) return false;
+    if (!(other instanceof Union)) return false;
+    Union that = (Union)other;
+    if (_tag != that._tag) return false;
+    if (!java.util.Objects.deepEquals(_value, that._value)) return false;
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return java.util.Arrays.deepHashCode(java.util.Arrays.asList(_tag, _value).toArray());
+  }
+
+  private void _assertTag(int tag) {
+    if (getTag() != tag) {
+      throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+    }
+  }
+
+  private String _tagString(int _tag) {
+    switch (_tag) {
+    case ns: return "ns";
+    case n: return "n";
+    case m: return "m";
+    case s: return "s";
+    case ibinder: return "ibinder";
+    case ss: return "ss";
+    case be: return "be";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+
+  private void _set(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+  public static @interface Tag {
+    public static final int ns = 0;
+    public static final int n = 1;
+    public static final int m = 2;
+    public static final int s = 3;
+    public static final int ibinder = 4;
+    public static final int ss = 5;
+    public static final int be = 6;
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/Union.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/Union.java.d
new file mode 100644
index 0000000..58d449e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/Union.java.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/Union.java : \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/UnionWithFd.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/UnionWithFd.java
new file mode 100644
index 0000000..90849d2
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/UnionWithFd.java
@@ -0,0 +1,145 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/UnionWithFd.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+package android.aidl.tests;
+public final class UnionWithFd implements android.os.Parcelable {
+  // tags for union fields
+  public final static int num = 0;  // int num;
+  public final static int pfd = 1;  // ParcelFileDescriptor pfd;
+
+  private int _tag;
+  private Object _value;
+
+  public UnionWithFd() {
+    int _value = 0;
+    this._tag = num;
+    this._value = _value;
+  }
+
+  private UnionWithFd(android.os.Parcel _aidl_parcel) {
+    readFromParcel(_aidl_parcel);
+  }
+
+  private UnionWithFd(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+
+  public int getTag() {
+    return _tag;
+  }
+
+  // int num;
+
+  public static UnionWithFd num(int _value) {
+    return new UnionWithFd(num, _value);
+  }
+
+  public int getNum() {
+    _assertTag(num);
+    return (int) _value;
+  }
+
+  public void setNum(int _value) {
+    _set(num, _value);
+  }
+
+  // ParcelFileDescriptor pfd;
+
+  public static UnionWithFd pfd(android.os.ParcelFileDescriptor _value) {
+    return new UnionWithFd(pfd, _value);
+  }
+
+  public android.os.ParcelFileDescriptor getPfd() {
+    _assertTag(pfd);
+    return (android.os.ParcelFileDescriptor) _value;
+  }
+
+  public void setPfd(android.os.ParcelFileDescriptor _value) {
+    _set(pfd, _value);
+  }
+
+  public static final android.os.Parcelable.Creator<UnionWithFd> CREATOR = new android.os.Parcelable.Creator<UnionWithFd>() {
+    @Override
+    public UnionWithFd createFromParcel(android.os.Parcel _aidl_source) {
+      return new UnionWithFd(_aidl_source);
+    }
+    @Override
+    public UnionWithFd[] newArray(int _aidl_size) {
+      return new UnionWithFd[_aidl_size];
+    }
+  };
+
+  @Override
+  public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+    _aidl_parcel.writeInt(_tag);
+    switch (_tag) {
+    case num:
+      _aidl_parcel.writeInt(getNum());
+      break;
+    case pfd:
+      _aidl_parcel.writeTypedObject(getPfd(), _aidl_flag);
+      break;
+    }
+  }
+
+  public void readFromParcel(android.os.Parcel _aidl_parcel) {
+    int _aidl_tag;
+    _aidl_tag = _aidl_parcel.readInt();
+    switch (_aidl_tag) {
+    case num: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case pfd: {
+      android.os.ParcelFileDescriptor _aidl_value;
+      _aidl_value = _aidl_parcel.readTypedObject(android.os.ParcelFileDescriptor.CREATOR);
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    }
+    throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+  }
+
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    switch (getTag()) {
+    case pfd:
+      _mask |= describeContents(getPfd());
+      break;
+    }
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+
+  private void _assertTag(int tag) {
+    if (getTag() != tag) {
+      throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+    }
+  }
+
+  private String _tagString(int _tag) {
+    switch (_tag) {
+    case num: return "num";
+    case pfd: return "pfd";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+
+  private void _set(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+  public static @interface Tag {
+    public static final int num = 0;
+    public static final int pfd = 1;
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/UnionWithFd.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/UnionWithFd.java.d
new file mode 100644
index 0000000..2b2d668
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/UnionWithFd.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/UnionWithFd.java : \
+  system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/ExtendableParcelable.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/ExtendableParcelable.java
new file mode 100644
index 0000000..78d3563
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/ExtendableParcelable.java
@@ -0,0 +1,80 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/extension/ExtendableParcelable.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+package android.aidl.tests.extension;
+public class ExtendableParcelable implements android.os.Parcelable
+{
+  public int a = 0;
+  public java.lang.String b;
+  public final android.os.ParcelableHolder ext = new android.os.ParcelableHolder(android.os.Parcelable.PARCELABLE_STABILITY_LOCAL);
+  public long c = 0L;
+  public final android.os.ParcelableHolder ext2 = new android.os.ParcelableHolder(android.os.Parcelable.PARCELABLE_STABILITY_LOCAL);
+  public static final android.os.Parcelable.Creator<ExtendableParcelable> CREATOR = new android.os.Parcelable.Creator<ExtendableParcelable>() {
+    @Override
+    public ExtendableParcelable createFromParcel(android.os.Parcel _aidl_source) {
+      ExtendableParcelable _aidl_out = new ExtendableParcelable();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public ExtendableParcelable[] newArray(int _aidl_size) {
+      return new ExtendableParcelable[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(a);
+    _aidl_parcel.writeString(b);
+    _aidl_parcel.writeTypedObject(ext, 0);
+    _aidl_parcel.writeLong(c);
+    _aidl_parcel.writeTypedObject(ext2, 0);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      a = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      b = _aidl_parcel.readString();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      if ((0!=_aidl_parcel.readInt())) {
+        ext.readFromParcel(_aidl_parcel);
+      }
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      c = _aidl_parcel.readLong();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      if ((0!=_aidl_parcel.readInt())) {
+        ext2.readFromParcel(_aidl_parcel);
+      }
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    _mask |= describeContents(ext);
+    _mask |= describeContents(ext2);
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/ExtendableParcelable.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/ExtendableParcelable.java.d
new file mode 100644
index 0000000..18ee116
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/ExtendableParcelable.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/extension/ExtendableParcelable.java : \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt.java
new file mode 100644
index 0000000..cb2600c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt.java
@@ -0,0 +1,55 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+package android.aidl.tests.extension;
+public class MyExt implements android.os.Parcelable
+{
+  public int a = 0;
+  public java.lang.String b;
+  public static final android.os.Parcelable.Creator<MyExt> CREATOR = new android.os.Parcelable.Creator<MyExt>() {
+    @Override
+    public MyExt createFromParcel(android.os.Parcel _aidl_source) {
+      MyExt _aidl_out = new MyExt();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public MyExt[] newArray(int _aidl_size) {
+      return new MyExt[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(a);
+    _aidl_parcel.writeString(b);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      a = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      b = _aidl_parcel.readString();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt.java.d
new file mode 100644
index 0000000..3a1efb9
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt.java : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt2.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt2.java
new file mode 100644
index 0000000..d40d551
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt2.java
@@ -0,0 +1,67 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt2.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+package android.aidl.tests.extension;
+public class MyExt2 implements android.os.Parcelable
+{
+  public int a = 0;
+  public android.aidl.tests.extension.MyExt b;
+  public java.lang.String c;
+  public static final android.os.Parcelable.Creator<MyExt2> CREATOR = new android.os.Parcelable.Creator<MyExt2>() {
+    @Override
+    public MyExt2 createFromParcel(android.os.Parcel _aidl_source) {
+      MyExt2 _aidl_out = new MyExt2();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public MyExt2[] newArray(int _aidl_size) {
+      return new MyExt2[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(a);
+    _aidl_parcel.writeTypedObject(b, _aidl_flag);
+    _aidl_parcel.writeString(c);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      a = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      b = _aidl_parcel.readTypedObject(android.aidl.tests.extension.MyExt.CREATOR);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      c = _aidl_parcel.readString();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    _mask |= describeContents(b);
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt2.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt2.java.d
new file mode 100644
index 0000000..bac99f4
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt2.java.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt2.java : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExtLike.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExtLike.java
new file mode 100644
index 0000000..71b2a7d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExtLike.java
@@ -0,0 +1,55 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExtLike.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+package android.aidl.tests.extension;
+public class MyExtLike implements android.os.Parcelable
+{
+  public int a = 0;
+  public java.lang.String b;
+  public static final android.os.Parcelable.Creator<MyExtLike> CREATOR = new android.os.Parcelable.Creator<MyExtLike>() {
+    @Override
+    public MyExtLike createFromParcel(android.os.Parcel _aidl_source) {
+      MyExtLike _aidl_out = new MyExtLike();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public MyExtLike[] newArray(int _aidl_size) {
+      return new MyExtLike[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(a);
+    _aidl_parcel.writeString(b);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      a = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      b = _aidl_parcel.readString();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExtLike.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExtLike.java.d
new file mode 100644
index 0000000..87f852f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExtLike.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExtLike.java : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/DeeplyNested.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/DeeplyNested.java
new file mode 100644
index 0000000..a377fa4
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/DeeplyNested.java
@@ -0,0 +1,223 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/nested/DeeplyNested.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+package android.aidl.tests.nested;
+public class DeeplyNested implements android.os.Parcelable
+{
+  public static final android.os.Parcelable.Creator<DeeplyNested> CREATOR = new android.os.Parcelable.Creator<DeeplyNested>() {
+    @Override
+    public DeeplyNested createFromParcel(android.os.Parcel _aidl_source) {
+      DeeplyNested _aidl_out = new DeeplyNested();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public DeeplyNested[] newArray(int _aidl_size) {
+      return new DeeplyNested[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+  public static class A implements android.os.Parcelable
+  {
+    // Can reference deeply nested type of a sibling type.
+    public byte e = android.aidl.tests.nested.DeeplyNested.B.C.D.E.OK;
+    public static final android.os.Parcelable.Creator<A> CREATOR = new android.os.Parcelable.Creator<A>() {
+      @Override
+      public A createFromParcel(android.os.Parcel _aidl_source) {
+        A _aidl_out = new A();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public A[] newArray(int _aidl_size) {
+        return new A[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeByte(e);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        e = _aidl_parcel.readByte();
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+  public static class B implements android.os.Parcelable
+  {
+    public static final android.os.Parcelable.Creator<B> CREATOR = new android.os.Parcelable.Creator<B>() {
+      @Override
+      public B createFromParcel(android.os.Parcel _aidl_source) {
+        B _aidl_out = new B();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public B[] newArray(int _aidl_size) {
+        return new B[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+    public static class C implements android.os.Parcelable
+    {
+      public static final android.os.Parcelable.Creator<C> CREATOR = new android.os.Parcelable.Creator<C>() {
+        @Override
+        public C createFromParcel(android.os.Parcel _aidl_source) {
+          C _aidl_out = new C();
+          _aidl_out.readFromParcel(_aidl_source);
+          return _aidl_out;
+        }
+        @Override
+        public C[] newArray(int _aidl_size) {
+          return new C[_aidl_size];
+        }
+      };
+      @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+      {
+        int _aidl_start_pos = _aidl_parcel.dataPosition();
+        _aidl_parcel.writeInt(0);
+        int _aidl_end_pos = _aidl_parcel.dataPosition();
+        _aidl_parcel.setDataPosition(_aidl_start_pos);
+        _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+        _aidl_parcel.setDataPosition(_aidl_end_pos);
+      }
+      public final void readFromParcel(android.os.Parcel _aidl_parcel)
+      {
+        int _aidl_start_pos = _aidl_parcel.dataPosition();
+        int _aidl_parcelable_size = _aidl_parcel.readInt();
+        try {
+          if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        } finally {
+          if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+            throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+          }
+          _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+        }
+      }
+      @Override
+      public int describeContents() {
+        int _mask = 0;
+        return _mask;
+      }
+      public static class D implements android.os.Parcelable
+      {
+        public static final android.os.Parcelable.Creator<D> CREATOR = new android.os.Parcelable.Creator<D>() {
+          @Override
+          public D createFromParcel(android.os.Parcel _aidl_source) {
+            D _aidl_out = new D();
+            _aidl_out.readFromParcel(_aidl_source);
+            return _aidl_out;
+          }
+          @Override
+          public D[] newArray(int _aidl_size) {
+            return new D[_aidl_size];
+          }
+        };
+        @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+        {
+          int _aidl_start_pos = _aidl_parcel.dataPosition();
+          _aidl_parcel.writeInt(0);
+          int _aidl_end_pos = _aidl_parcel.dataPosition();
+          _aidl_parcel.setDataPosition(_aidl_start_pos);
+          _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+          _aidl_parcel.setDataPosition(_aidl_end_pos);
+        }
+        public final void readFromParcel(android.os.Parcel _aidl_parcel)
+        {
+          int _aidl_start_pos = _aidl_parcel.dataPosition();
+          int _aidl_parcelable_size = _aidl_parcel.readInt();
+          try {
+            if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+          } finally {
+            if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+              throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+            }
+            _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+          }
+        }
+        @Override
+        public int describeContents() {
+          int _mask = 0;
+          return _mask;
+        }
+        public static @interface E {
+          public static final byte OK = 0;
+        }
+      }
+    }
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/DeeplyNested.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/DeeplyNested.java.d
new file mode 100644
index 0000000..8576ab7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/DeeplyNested.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/nested/DeeplyNested.java : \
+  system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/INestedService.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/INestedService.java
new file mode 100644
index 0000000..f675468
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/INestedService.java
@@ -0,0 +1,350 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/nested/INestedService.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+package android.aidl.tests.nested;
+public interface INestedService extends android.os.IInterface
+{
+  /** Default implementation for INestedService. */
+  public static class Default implements android.aidl.tests.nested.INestedService
+  {
+    @Override public android.aidl.tests.nested.INestedService.Result flipStatus(android.aidl.tests.nested.ParcelableWithNested p) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public void flipStatusWithCallback(byte status, android.aidl.tests.nested.INestedService.ICallback cb) throws android.os.RemoteException
+    {
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.nested.INestedService
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.nested.INestedService interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.nested.INestedService asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.nested.INestedService))) {
+        return ((android.aidl.tests.nested.INestedService)iin);
+      }
+      return new android.aidl.tests.nested.INestedService.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_flipStatus:
+        {
+          return "flipStatus";
+        }
+        case TRANSACTION_flipStatusWithCallback:
+        {
+          return "flipStatusWithCallback";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_flipStatus:
+        {
+          android.aidl.tests.nested.ParcelableWithNested _arg0;
+          _arg0 = data.readTypedObject(android.aidl.tests.nested.ParcelableWithNested.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.tests.nested.INestedService.Result _result = this.flipStatus(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_flipStatusWithCallback:
+        {
+          byte _arg0;
+          _arg0 = data.readByte();
+          android.aidl.tests.nested.INestedService.ICallback _arg1;
+          _arg1 = android.aidl.tests.nested.INestedService.ICallback.Stub.asInterface(data.readStrongBinder());
+          data.enforceNoDataAvail();
+          this.flipStatusWithCallback(_arg0, _arg1);
+          reply.writeNoException();
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.nested.INestedService
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public android.aidl.tests.nested.INestedService.Result flipStatus(android.aidl.tests.nested.ParcelableWithNested p) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.nested.INestedService.Result _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(p, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_flipStatus, _data, _reply, 0);
+          _reply.readException();
+          _result = _reply.readTypedObject(android.aidl.tests.nested.INestedService.Result.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public void flipStatusWithCallback(byte status, android.aidl.tests.nested.INestedService.ICallback cb) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeByte(status);
+          _data.writeStrongInterface(cb);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_flipStatusWithCallback, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+    }
+    static final int TRANSACTION_flipStatus = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    static final int TRANSACTION_flipStatusWithCallback = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 1;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.nested.INestedService";
+  public android.aidl.tests.nested.INestedService.Result flipStatus(android.aidl.tests.nested.ParcelableWithNested p) throws android.os.RemoteException;
+  public void flipStatusWithCallback(byte status, android.aidl.tests.nested.INestedService.ICallback cb) throws android.os.RemoteException;
+  public static class Result implements android.os.Parcelable
+  {
+    public byte status = android.aidl.tests.nested.ParcelableWithNested.Status.OK;
+    public static final android.os.Parcelable.Creator<Result> CREATOR = new android.os.Parcelable.Creator<Result>() {
+      @Override
+      public Result createFromParcel(android.os.Parcel _aidl_source) {
+        Result _aidl_out = new Result();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public Result[] newArray(int _aidl_size) {
+        return new Result[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeByte(status);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        status = _aidl_parcel.readByte();
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+  public interface ICallback extends android.os.IInterface
+  {
+    /** Default implementation for ICallback. */
+    public static class Default implements android.aidl.tests.nested.INestedService.ICallback
+    {
+      @Override public void done(byte status) throws android.os.RemoteException
+      {
+      }
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.tests.nested.INestedService.ICallback
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.tests.nested.INestedService.ICallback interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.tests.nested.INestedService.ICallback asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.tests.nested.INestedService.ICallback))) {
+          return ((android.aidl.tests.nested.INestedService.ICallback)iin);
+        }
+        return new android.aidl.tests.nested.INestedService.ICallback.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      /** @hide */
+      public static java.lang.String getDefaultTransactionName(int transactionCode)
+      {
+        switch (transactionCode)
+        {
+          case TRANSACTION_done:
+          {
+            return "done";
+          }
+          default:
+          {
+            return null;
+          }
+        }
+      }
+      /** @hide */
+      public java.lang.String getTransactionName(int transactionCode)
+      {
+        return this.getDefaultTransactionName(transactionCode);
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+          data.enforceInterface(descriptor);
+        }
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        switch (code)
+        {
+          case TRANSACTION_done:
+          {
+            byte _arg0;
+            _arg0 = data.readByte();
+            data.enforceNoDataAvail();
+            this.done(_arg0);
+            reply.writeNoException();
+            break;
+          }
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+        return true;
+      }
+      private static class Proxy implements android.aidl.tests.nested.INestedService.ICallback
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+        @Override public void done(byte status) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeByte(status);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_done, _data, _reply, 0);
+            _reply.readException();
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+        }
+      }
+      static final int TRANSACTION_done = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+      /** @hide */
+      public int getMaxTransactionId()
+      {
+        return 0;
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android.aidl.tests.nested.INestedService.ICallback";
+    public void done(byte status) throws android.os.RemoteException;
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/INestedService.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/INestedService.java.d
new file mode 100644
index 0000000..83a9e41
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/INestedService.java.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/nested/INestedService.java : \
+  system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/ParcelableWithNested.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/ParcelableWithNested.java
new file mode 100644
index 0000000..22b7bc6
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/ParcelableWithNested.java
@@ -0,0 +1,55 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/nested/ParcelableWithNested.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+package android.aidl.tests.nested;
+public class ParcelableWithNested implements android.os.Parcelable
+{
+  public byte status = android.aidl.tests.nested.ParcelableWithNested.Status.OK;
+  public static final android.os.Parcelable.Creator<ParcelableWithNested> CREATOR = new android.os.Parcelable.Creator<ParcelableWithNested>() {
+    @Override
+    public ParcelableWithNested createFromParcel(android.os.Parcel _aidl_source) {
+      ParcelableWithNested _aidl_out = new ParcelableWithNested();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public ParcelableWithNested[] newArray(int _aidl_size) {
+      return new ParcelableWithNested[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeByte(status);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      status = _aidl_parcel.readByte();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+  public static @interface Status {
+    public static final byte OK = 0;
+    public static final byte NOT_OK = 1;
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/ParcelableWithNested.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/ParcelableWithNested.java.d
new file mode 100644
index 0000000..0f7a8c4
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/nested/ParcelableWithNested.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/nested/ParcelableWithNested.java : \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/unions/EnumUnion.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/unions/EnumUnion.java
new file mode 100644
index 0000000..2841c14
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/unions/EnumUnion.java
@@ -0,0 +1,190 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/unions/EnumUnion.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+package android.aidl.tests.unions;
+public final class EnumUnion implements android.os.Parcelable {
+  // tags for union fields
+  public final static int intEnum = 0;  // android.aidl.tests.IntEnum intEnum;
+  public final static int longEnum = 1;  // android.aidl.tests.LongEnum longEnum;
+  public final static int deprecatedField = 2;  // int deprecatedField;
+
+  private int _tag;
+  private Object _value;
+
+  public EnumUnion() {
+    int _value = android.aidl.tests.IntEnum.FOO;
+    this._tag = intEnum;
+    this._value = _value;
+  }
+
+  private EnumUnion(android.os.Parcel _aidl_parcel) {
+    readFromParcel(_aidl_parcel);
+  }
+
+  private EnumUnion(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+
+  public int getTag() {
+    return _tag;
+  }
+
+  // android.aidl.tests.IntEnum intEnum;
+
+  public static EnumUnion intEnum(int _value) {
+    return new EnumUnion(intEnum, _value);
+  }
+
+  public int getIntEnum() {
+    _assertTag(intEnum);
+    return (int) _value;
+  }
+
+  public void setIntEnum(int _value) {
+    _set(intEnum, _value);
+  }
+
+  // android.aidl.tests.LongEnum longEnum;
+
+  public static EnumUnion longEnum(long _value) {
+    return new EnumUnion(longEnum, _value);
+  }
+
+  public long getLongEnum() {
+    _assertTag(longEnum);
+    return (long) _value;
+  }
+
+  public void setLongEnum(long _value) {
+    _set(longEnum, _value);
+  }
+
+  // int deprecatedField;
+
+  /** @deprecated do not use this */
+  @Deprecated
+  public static EnumUnion deprecatedField(int _value) {
+    return new EnumUnion(deprecatedField, _value);
+  }
+
+  public int getDeprecatedField() {
+    _assertTag(deprecatedField);
+    return (int) _value;
+  }
+
+  public void setDeprecatedField(int _value) {
+    _set(deprecatedField, _value);
+  }
+
+  public static final android.os.Parcelable.Creator<EnumUnion> CREATOR = new android.os.Parcelable.Creator<EnumUnion>() {
+    @Override
+    public EnumUnion createFromParcel(android.os.Parcel _aidl_source) {
+      return new EnumUnion(_aidl_source);
+    }
+    @Override
+    public EnumUnion[] newArray(int _aidl_size) {
+      return new EnumUnion[_aidl_size];
+    }
+  };
+
+  @Override
+  public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+    _aidl_parcel.writeInt(_tag);
+    switch (_tag) {
+    case intEnum:
+      _aidl_parcel.writeInt(getIntEnum());
+      break;
+    case longEnum:
+      _aidl_parcel.writeLong(getLongEnum());
+      break;
+    case deprecatedField:
+      _aidl_parcel.writeInt(getDeprecatedField());
+      break;
+    }
+  }
+
+  public void readFromParcel(android.os.Parcel _aidl_parcel) {
+    int _aidl_tag;
+    _aidl_tag = _aidl_parcel.readInt();
+    switch (_aidl_tag) {
+    case intEnum: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case longEnum: {
+      long _aidl_value;
+      _aidl_value = _aidl_parcel.readLong();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case deprecatedField: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    }
+    throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+  }
+
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    switch (getTag()) {
+    }
+    return _mask;
+  }
+
+  @Override
+  public String toString() {
+    switch (_tag) {
+    case intEnum: return "EnumUnion.intEnum(" + (android.aidl.tests.IntEnum.$.toString(getIntEnum())) + ")";
+    case longEnum: return "EnumUnion.longEnum(" + (getLongEnum()) + ")";
+    case deprecatedField: return "EnumUnion.deprecatedField(" + (getDeprecatedField()) + ")";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+  @Override
+  public boolean equals(Object other) {
+    if (this == other) return true;
+    if (other == null) return false;
+    if (!(other instanceof EnumUnion)) return false;
+    EnumUnion that = (EnumUnion)other;
+    if (_tag != that._tag) return false;
+    if (!java.util.Objects.deepEquals(_value, that._value)) return false;
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return java.util.Arrays.deepHashCode(java.util.Arrays.asList(_tag, _value).toArray());
+  }
+
+  private void _assertTag(int tag) {
+    if (getTag() != tag) {
+      throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+    }
+  }
+
+  private String _tagString(int _tag) {
+    switch (_tag) {
+    case intEnum: return "intEnum";
+    case longEnum: return "longEnum";
+    case deprecatedField: return "deprecatedField";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+
+  private void _set(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+  public static @interface Tag {
+    public static final int intEnum = 0;
+    public static final int longEnum = 1;
+    /** @deprecated do not use this */
+    @Deprecated
+    public static final int deprecatedField = 2;
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/unions/EnumUnion.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/unions/EnumUnion.java.d
new file mode 100644
index 0000000..d7b0669
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/unions/EnumUnion.java.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/unions/EnumUnion.java : \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/unions/UnionInUnion.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/unions/UnionInUnion.java
new file mode 100644
index 0000000..e40020f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/unions/UnionInUnion.java
@@ -0,0 +1,169 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/unions/UnionInUnion.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+package android.aidl.tests.unions;
+public final class UnionInUnion implements android.os.Parcelable {
+  // tags for union fields
+  public final static int first = 0;  // android.aidl.tests.unions.EnumUnion first;
+  public final static int second = 1;  // int second;
+
+  private int _tag;
+  private Object _value;
+
+  public UnionInUnion() {
+    android.aidl.tests.unions.EnumUnion _value = null;
+    this._tag = first;
+    this._value = _value;
+  }
+
+  private UnionInUnion(android.os.Parcel _aidl_parcel) {
+    readFromParcel(_aidl_parcel);
+  }
+
+  private UnionInUnion(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+
+  public int getTag() {
+    return _tag;
+  }
+
+  // android.aidl.tests.unions.EnumUnion first;
+
+  public static UnionInUnion first(android.aidl.tests.unions.EnumUnion _value) {
+    return new UnionInUnion(first, _value);
+  }
+
+  public android.aidl.tests.unions.EnumUnion getFirst() {
+    _assertTag(first);
+    return (android.aidl.tests.unions.EnumUnion) _value;
+  }
+
+  public void setFirst(android.aidl.tests.unions.EnumUnion _value) {
+    _set(first, _value);
+  }
+
+  // int second;
+
+  public static UnionInUnion second(int _value) {
+    return new UnionInUnion(second, _value);
+  }
+
+  public int getSecond() {
+    _assertTag(second);
+    return (int) _value;
+  }
+
+  public void setSecond(int _value) {
+    _set(second, _value);
+  }
+
+  public static final android.os.Parcelable.Creator<UnionInUnion> CREATOR = new android.os.Parcelable.Creator<UnionInUnion>() {
+    @Override
+    public UnionInUnion createFromParcel(android.os.Parcel _aidl_source) {
+      return new UnionInUnion(_aidl_source);
+    }
+    @Override
+    public UnionInUnion[] newArray(int _aidl_size) {
+      return new UnionInUnion[_aidl_size];
+    }
+  };
+
+  @Override
+  public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+    _aidl_parcel.writeInt(_tag);
+    switch (_tag) {
+    case first:
+      _aidl_parcel.writeTypedObject(getFirst(), _aidl_flag);
+      break;
+    case second:
+      _aidl_parcel.writeInt(getSecond());
+      break;
+    }
+  }
+
+  public void readFromParcel(android.os.Parcel _aidl_parcel) {
+    int _aidl_tag;
+    _aidl_tag = _aidl_parcel.readInt();
+    switch (_aidl_tag) {
+    case first: {
+      android.aidl.tests.unions.EnumUnion _aidl_value;
+      _aidl_value = _aidl_parcel.readTypedObject(android.aidl.tests.unions.EnumUnion.CREATOR);
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case second: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    }
+    throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+  }
+
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    switch (getTag()) {
+    case first:
+      _mask |= describeContents(getFirst());
+      break;
+    }
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+
+  @Override
+  public String toString() {
+    switch (_tag) {
+    case first: return "UnionInUnion.first(" + (java.util.Objects.toString(getFirst())) + ")";
+    case second: return "UnionInUnion.second(" + (getSecond()) + ")";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+  @Override
+  public boolean equals(Object other) {
+    if (this == other) return true;
+    if (other == null) return false;
+    if (!(other instanceof UnionInUnion)) return false;
+    UnionInUnion that = (UnionInUnion)other;
+    if (_tag != that._tag) return false;
+    if (!java.util.Objects.deepEquals(_value, that._value)) return false;
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return java.util.Arrays.deepHashCode(java.util.Arrays.asList(_tag, _value).toArray());
+  }
+
+  private void _assertTag(int tag) {
+    if (getTag() != tag) {
+      throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+    }
+  }
+
+  private String _tagString(int _tag) {
+    switch (_tag) {
+    case first: return "first";
+    case second: return "second";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+
+  private void _set(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+  public static @interface Tag {
+    public static final int first = 0;
+    public static final int second = 1;
+  }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/unions/UnionInUnion.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/unions/UnionInUnion.java.d
new file mode 100644
index 0000000..7d27fdd
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/unions/UnionInUnion.java.d
@@ -0,0 +1,5 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/unions/UnionInUnion.java : \
+  system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/timestamp b/tests/golden_output/aidl-test-interface-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp
new file mode 100644
index 0000000..4708a51
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp
@@ -0,0 +1,499 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#include "aidl/android/aidl/tests/ArrayOfInterfaces.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ArrayOfInterfaces::descriptor = "android.aidl.tests.ArrayOfInterfaces";
+
+binder_status_t ArrayOfInterfaces::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ArrayOfInterfaces::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_ArrayOfInterfaces_IEmptyInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  (void)_aidl_binder;
+  (void)_aidl_code;
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ArrayOfInterfaces_IEmptyInterface_clazz = ::ndk::ICInterface::defineClass(ArrayOfInterfaces::IEmptyInterface::descriptor, _aidl_android_aidl_tests_ArrayOfInterfaces_IEmptyInterface_onTransact);
+
+ArrayOfInterfaces::BpEmptyInterface::BpEmptyInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ArrayOfInterfaces::BpEmptyInterface::~BpEmptyInterface() {}
+
+// Source for BnEmptyInterface
+ArrayOfInterfaces::BnEmptyInterface::BnEmptyInterface() {}
+ArrayOfInterfaces::BnEmptyInterface::~BnEmptyInterface() {}
+::ndk::SpAIBinder ArrayOfInterfaces::BnEmptyInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ArrayOfInterfaces_IEmptyInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IEmptyInterface
+const char* ArrayOfInterfaces::IEmptyInterface::descriptor = "android.aidl.tests.ArrayOfInterfaces.IEmptyInterface";
+ArrayOfInterfaces::IEmptyInterface::IEmptyInterface() {}
+ArrayOfInterfaces::IEmptyInterface::~IEmptyInterface() {}
+
+
+std::shared_ptr<ArrayOfInterfaces::IEmptyInterface> ArrayOfInterfaces::IEmptyInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ArrayOfInterfaces_IEmptyInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ArrayOfInterfaces::BpEmptyInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IEmptyInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ArrayOfInterfaces::BpEmptyInterface>(binder);
+}
+
+binder_status_t ArrayOfInterfaces::IEmptyInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<IEmptyInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ArrayOfInterfaces::IEmptyInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<IEmptyInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IEmptyInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ArrayOfInterfaces::IEmptyInterface::setDefaultImpl(const std::shared_ptr<IEmptyInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IEmptyInterface::default_impl);
+  if (impl) {
+    IEmptyInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ArrayOfInterfaces::IEmptyInterface>& ArrayOfInterfaces::IEmptyInterface::getDefaultImpl() {
+  return IEmptyInterface::default_impl;
+}
+std::shared_ptr<ArrayOfInterfaces::IEmptyInterface> ArrayOfInterfaces::IEmptyInterface::default_impl = nullptr;
+::ndk::SpAIBinder ArrayOfInterfaces::IEmptyInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ArrayOfInterfaces::IEmptyInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_ArrayOfInterfaces_IMyInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<ArrayOfInterfaces::BnMyInterface> _aidl_impl = std::static_pointer_cast<ArrayOfInterfaces::BnMyInterface>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*methodWithInterfaces*/): {
+      std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> in_iface;
+      std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> in_nullable_iface;
+      std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> in_iface_array_in;
+      std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> out_iface_array_out;
+      std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> in_iface_array_inout;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> in_nullable_iface_array_in;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> out_nullable_iface_array_out;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> in_nullable_iface_array_inout;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_iface);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_nullable_iface);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_iface_array_in);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_iface_array_out);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_iface_array_inout);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_nullable_iface_array_in);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_nullable_iface_array_out);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_nullable_iface_array_inout);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->methodWithInterfaces(in_iface, in_nullable_iface, in_iface_array_in, &out_iface_array_out, &in_iface_array_inout, in_nullable_iface_array_in, &out_nullable_iface_array_out, &in_nullable_iface_array_inout, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_iface_array_out);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_iface_array_inout);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, out_nullable_iface_array_out);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, in_nullable_iface_array_inout);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ArrayOfInterfaces_IMyInterface_clazz = ::ndk::ICInterface::defineClass(ArrayOfInterfaces::IMyInterface::descriptor, _aidl_android_aidl_tests_ArrayOfInterfaces_IMyInterface_onTransact);
+
+ArrayOfInterfaces::BpMyInterface::BpMyInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ArrayOfInterfaces::BpMyInterface::~BpMyInterface() {}
+
+::ndk::ScopedAStatus ArrayOfInterfaces::BpMyInterface::methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& in_iface, const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& in_nullable_iface, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& in_iface_array_in, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* out_iface_array_out, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* in_iface_array_inout, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& in_nullable_iface_array_in, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* out_nullable_iface_array_out, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* in_nullable_iface_array_inout, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_iface);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_nullable_iface);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_iface_array_in);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_iface_array_out);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_iface_array_inout);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_nullable_iface_array_in);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_nullable_iface_array_out);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), *in_nullable_iface_array_inout);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*methodWithInterfaces*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyInterface::getDefaultImpl()) {
+    _aidl_status = IMyInterface::getDefaultImpl()->methodWithInterfaces(in_iface, in_nullable_iface, in_iface_array_in, out_iface_array_out, in_iface_array_inout, in_nullable_iface_array_in, out_nullable_iface_array_out, in_nullable_iface_array_inout, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_iface_array_out);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_iface_array_inout);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), out_nullable_iface_array_out);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), in_nullable_iface_array_inout);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnMyInterface
+ArrayOfInterfaces::BnMyInterface::BnMyInterface() {}
+ArrayOfInterfaces::BnMyInterface::~BnMyInterface() {}
+::ndk::SpAIBinder ArrayOfInterfaces::BnMyInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ArrayOfInterfaces_IMyInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IMyInterface
+const char* ArrayOfInterfaces::IMyInterface::descriptor = "android.aidl.tests.ArrayOfInterfaces.IMyInterface";
+ArrayOfInterfaces::IMyInterface::IMyInterface() {}
+ArrayOfInterfaces::IMyInterface::~IMyInterface() {}
+
+
+std::shared_ptr<ArrayOfInterfaces::IMyInterface> ArrayOfInterfaces::IMyInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ArrayOfInterfaces_IMyInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ArrayOfInterfaces::BpMyInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IMyInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ArrayOfInterfaces::BpMyInterface>(binder);
+}
+
+binder_status_t ArrayOfInterfaces::IMyInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<IMyInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ArrayOfInterfaces::IMyInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<IMyInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IMyInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ArrayOfInterfaces::IMyInterface::setDefaultImpl(const std::shared_ptr<IMyInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IMyInterface::default_impl);
+  if (impl) {
+    IMyInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ArrayOfInterfaces::IMyInterface>& ArrayOfInterfaces::IMyInterface::getDefaultImpl() {
+  return IMyInterface::default_impl;
+}
+std::shared_ptr<ArrayOfInterfaces::IMyInterface> ArrayOfInterfaces::IMyInterface::default_impl = nullptr;
+::ndk::ScopedAStatus ArrayOfInterfaces::IMyInterfaceDefault::methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& /*in_iface*/, const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& /*in_nullable_iface*/, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& /*in_iface_array_in*/, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* /*out_iface_array_out*/, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* /*in_iface_array_inout*/, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& /*in_nullable_iface_array_in*/, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* /*out_nullable_iface_array_out*/, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* /*in_nullable_iface_array_inout*/, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder ArrayOfInterfaces::IMyInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ArrayOfInterfaces::IMyInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ArrayOfInterfaces::MyParcelable::descriptor = "android.aidl.tests.ArrayOfInterfaces.MyParcelable";
+
+binder_status_t ArrayOfInterfaces::MyParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &iface);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_iface);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &iface_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_iface_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ArrayOfInterfaces::MyParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, iface);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_iface);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, iface_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_iface_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ArrayOfInterfaces::MyUnion::descriptor = "android.aidl.tests.ArrayOfInterfaces.MyUnion";
+
+binder_status_t ArrayOfInterfaces::MyUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case iface: {
+    std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>) {
+      set<iface>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<iface>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case nullable_iface: {
+    std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readNullableData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>) {
+      set<nullable_iface>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<nullable_iface>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case iface_array: {
+    std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>) {
+      set<iface_array>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<iface_array>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case nullable_iface_array: {
+    std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readNullableData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>>) {
+      set<nullable_iface_array>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<nullable_iface_array>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t ArrayOfInterfaces::MyUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case iface: return ::ndk::AParcel_writeData(_parcel, get<iface>());
+  case nullable_iface: return ::ndk::AParcel_writeNullableData(_parcel, get<nullable_iface>());
+  case iface_array: return ::ndk::AParcel_writeData(_parcel, get<iface_array>());
+  case nullable_iface_array: return ::ndk::AParcel_writeNullableData(_parcel, get<nullable_iface_array>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d
new file mode 100644
index 0000000..d67076b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/BackendType.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/BackendType.cpp
new file mode 100644
index 0000000..a9210ae
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/BackendType.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/BackendType.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/BackendType.cpp.d
new file mode 100644
index 0000000..89a9bf9
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/BackendType.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/BackendType.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ByteEnum.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ByteEnum.cpp
new file mode 100644
index 0000000..ee759d8
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ByteEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ByteEnum.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ByteEnum.cpp.d
new file mode 100644
index 0000000..c858c80
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ByteEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/ByteEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/CircularParcelable.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/CircularParcelable.cpp
new file mode 100644
index 0000000..1023776
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/CircularParcelable.cpp
@@ -0,0 +1,68 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#include "aidl/android/aidl/tests/CircularParcelable.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/tests/BnCircular.h>
+#include <aidl/android/aidl/tests/BnNamedCallback.h>
+#include <aidl/android/aidl/tests/BnNewName.h>
+#include <aidl/android/aidl/tests/BnOldName.h>
+#include <aidl/android/aidl/tests/BnTestService.h>
+#include <aidl/android/aidl/tests/BpCircular.h>
+#include <aidl/android/aidl/tests/BpNamedCallback.h>
+#include <aidl/android/aidl/tests/BpNewName.h>
+#include <aidl/android/aidl/tests/BpOldName.h>
+#include <aidl/android/aidl/tests/BpTestService.h>
+#include <aidl/android/aidl/tests/ICircular.h>
+#include <aidl/android/aidl/tests/INamedCallback.h>
+#include <aidl/android/aidl/tests/INewName.h>
+#include <aidl/android/aidl/tests/IOldName.h>
+#include <aidl/android/aidl/tests/ITestService.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* CircularParcelable::descriptor = "android.aidl.tests.CircularParcelable";
+
+binder_status_t CircularParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &testService);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t CircularParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, testService);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/CircularParcelable.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/CircularParcelable.cpp.d
new file mode 100644
index 0000000..a455283
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/CircularParcelable.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/CircularParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp
new file mode 100644
index 0000000..d521ac6
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d
new file mode 100644
index 0000000..d0ab502
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedEnum.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedEnum.cpp
new file mode 100644
index 0000000..b6b6bc1
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d
new file mode 100644
index 0000000..e25ec9e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedParcelable.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedParcelable.cpp
new file mode 100644
index 0000000..470496a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedParcelable.cpp
@@ -0,0 +1,43 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#include "aidl/android/aidl/tests/DeprecatedParcelable.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* DeprecatedParcelable::descriptor = "android.aidl.tests.DeprecatedParcelable";
+
+binder_status_t DeprecatedParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t DeprecatedParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d
new file mode 100644
index 0000000..fcc436c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/FixedSize.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/FixedSize.cpp
new file mode 100644
index 0000000..1e58c5d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/FixedSize.cpp
@@ -0,0 +1,282 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#include "aidl/android/aidl/tests/FixedSize.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* FixedSize::descriptor = "android.aidl.tests.FixedSize";
+
+binder_status_t FixedSize::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t FixedSize::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* FixedSize::FixedParcelable::descriptor = "android.aidl.tests.FixedSize.FixedParcelable";
+
+binder_status_t FixedSize::FixedParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &booleanValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &charValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &floatValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &doubleValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &enumValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcelableValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t FixedSize::FixedParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, booleanValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, charValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, floatValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, doubleValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, enumValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcelableValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* FixedSize::FixedUnion::descriptor = "android.aidl.tests.FixedSize.FixedUnion";
+
+binder_status_t FixedSize::FixedUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case booleanValue: {
+    bool _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<bool>) {
+      set<booleanValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<booleanValue>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case byteValue: {
+    int8_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int8_t>) {
+      set<byteValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<byteValue>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case charValue: {
+    char16_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<char16_t>) {
+      set<charValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<charValue>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case intValue: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<intValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intValue>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case longValue: {
+    int64_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int64_t>) {
+      set<longValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<longValue>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case floatValue: {
+    float _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<float>) {
+      set<floatValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<floatValue>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case doubleValue: {
+    double _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<double>) {
+      set<doubleValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<doubleValue>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case enumValue: {
+    ::aidl::android::aidl::tests::LongEnum _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::aidl::android::aidl::tests::LongEnum>) {
+      set<enumValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<enumValue>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t FixedSize::FixedUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case booleanValue: return ::ndk::AParcel_writeData(_parcel, get<booleanValue>());
+  case byteValue: return ::ndk::AParcel_writeData(_parcel, get<byteValue>());
+  case charValue: return ::ndk::AParcel_writeData(_parcel, get<charValue>());
+  case intValue: return ::ndk::AParcel_writeData(_parcel, get<intValue>());
+  case longValue: return ::ndk::AParcel_writeData(_parcel, get<longValue>());
+  case floatValue: return ::ndk::AParcel_writeData(_parcel, get<floatValue>());
+  case doubleValue: return ::ndk::AParcel_writeData(_parcel, get<doubleValue>());
+  case enumValue: return ::ndk::AParcel_writeData(_parcel, get<enumValue>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/FixedSize.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/FixedSize.cpp.d
new file mode 100644
index 0000000..b27ad3e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/FixedSize.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/FixedSize.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp
new file mode 100644
index 0000000..8b42714
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp
@@ -0,0 +1,4 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d
new file mode 100644
index 0000000..06b2f5d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ICircular.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ICircular.cpp
new file mode 100644
index 0000000..e8ff550
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ICircular.cpp
@@ -0,0 +1,166 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#include "aidl/android/aidl/tests/ICircular.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/tests/BnCircular.h>
+#include <aidl/android/aidl/tests/BnNamedCallback.h>
+#include <aidl/android/aidl/tests/BnNewName.h>
+#include <aidl/android/aidl/tests/BnOldName.h>
+#include <aidl/android/aidl/tests/BnTestService.h>
+#include <aidl/android/aidl/tests/BpCircular.h>
+#include <aidl/android/aidl/tests/BpNamedCallback.h>
+#include <aidl/android/aidl/tests/BpNewName.h>
+#include <aidl/android/aidl/tests/BpOldName.h>
+#include <aidl/android/aidl/tests/BpTestService.h>
+#include <aidl/android/aidl/tests/INamedCallback.h>
+#include <aidl/android/aidl/tests/INewName.h>
+#include <aidl/android/aidl/tests/IOldName.h>
+#include <aidl/android/aidl/tests/ITestService.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_ICircular_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnCircular> _aidl_impl = std::static_pointer_cast<BnCircular>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*GetTestService*/): {
+      std::shared_ptr<::aidl::android::aidl::tests::ITestService> _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetTestService(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ICircular_clazz = ::ndk::ICInterface::defineClass(ICircular::descriptor, _aidl_android_aidl_tests_ICircular_onTransact);
+
+BpCircular::BpCircular(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpCircular::~BpCircular() {}
+
+::ndk::ScopedAStatus BpCircular::GetTestService(std::shared_ptr<::aidl::android::aidl::tests::ITestService>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*GetTestService*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ICircular::getDefaultImpl()) {
+    _aidl_status = ICircular::getDefaultImpl()->GetTestService(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnCircular
+BnCircular::BnCircular() {}
+BnCircular::~BnCircular() {}
+::ndk::SpAIBinder BnCircular::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ICircular_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for ICircular
+const char* ICircular::descriptor = "android.aidl.tests.ICircular";
+ICircular::ICircular() {}
+ICircular::~ICircular() {}
+
+
+std::shared_ptr<ICircular> ICircular::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ICircular_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpCircular>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<ICircular>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpCircular>(binder);
+}
+
+binder_status_t ICircular::writeToParcel(AParcel* parcel, const std::shared_ptr<ICircular>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ICircular::readFromParcel(const AParcel* parcel, std::shared_ptr<ICircular>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = ICircular::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ICircular::setDefaultImpl(const std::shared_ptr<ICircular>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!ICircular::default_impl);
+  if (impl) {
+    ICircular::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ICircular>& ICircular::getDefaultImpl() {
+  return ICircular::default_impl;
+}
+std::shared_ptr<ICircular> ICircular::default_impl = nullptr;
+::ndk::ScopedAStatus ICircularDefault::GetTestService(std::shared_ptr<::aidl::android::aidl::tests::ITestService>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder ICircularDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ICircularDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ICircular.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ICircular.cpp.d
new file mode 100644
index 0000000..3c20e3a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ICircular.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/ICircular.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IDeprecated.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IDeprecated.cpp
new file mode 100644
index 0000000..88d52b1
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IDeprecated.cpp
@@ -0,0 +1,100 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#include "aidl/android/aidl/tests/IDeprecated.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/tests/BnDeprecated.h>
+#include <aidl/android/aidl/tests/BpDeprecated.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated"
+static binder_status_t _aidl_android_aidl_tests_IDeprecated_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  (void)_aidl_binder;
+  (void)_aidl_code;
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_IDeprecated_clazz = ::ndk::ICInterface::defineClass(IDeprecated::descriptor, _aidl_android_aidl_tests_IDeprecated_onTransact);
+
+#pragma clang diagnostic pop
+BpDeprecated::BpDeprecated(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpDeprecated::~BpDeprecated() {}
+
+// Source for BnDeprecated
+BnDeprecated::BnDeprecated() {}
+BnDeprecated::~BnDeprecated() {}
+::ndk::SpAIBinder BnDeprecated::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_IDeprecated_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IDeprecated
+const char* IDeprecated::descriptor = "android.aidl.tests.IDeprecated";
+IDeprecated::IDeprecated() {}
+IDeprecated::~IDeprecated() {}
+
+
+std::shared_ptr<IDeprecated> IDeprecated::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_IDeprecated_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpDeprecated>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IDeprecated>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpDeprecated>(binder);
+}
+
+binder_status_t IDeprecated::writeToParcel(AParcel* parcel, const std::shared_ptr<IDeprecated>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t IDeprecated::readFromParcel(const AParcel* parcel, std::shared_ptr<IDeprecated>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IDeprecated::fromBinder(binder);
+  return STATUS_OK;
+}
+bool IDeprecated::setDefaultImpl(const std::shared_ptr<IDeprecated>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IDeprecated::default_impl);
+  if (impl) {
+    IDeprecated::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<IDeprecated>& IDeprecated::getDefaultImpl() {
+  return IDeprecated::default_impl;
+}
+std::shared_ptr<IDeprecated> IDeprecated::default_impl = nullptr;
+::ndk::SpAIBinder IDeprecatedDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool IDeprecatedDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IDeprecated.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IDeprecated.cpp.d
new file mode 100644
index 0000000..d92d4e5
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IDeprecated.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/IDeprecated.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/INamedCallback.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/INamedCallback.cpp
new file mode 100644
index 0000000..147cfde
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/INamedCallback.cpp
@@ -0,0 +1,154 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#include "aidl/android/aidl/tests/INamedCallback.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/tests/BnNamedCallback.h>
+#include <aidl/android/aidl/tests/BpNamedCallback.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_INamedCallback_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnNamedCallback> _aidl_impl = std::static_pointer_cast<BnNamedCallback>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*GetName*/): {
+      std::string _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetName(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_INamedCallback_clazz = ::ndk::ICInterface::defineClass(INamedCallback::descriptor, _aidl_android_aidl_tests_INamedCallback_onTransact);
+
+BpNamedCallback::BpNamedCallback(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpNamedCallback::~BpNamedCallback() {}
+
+::ndk::ScopedAStatus BpNamedCallback::GetName(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*GetName*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && INamedCallback::getDefaultImpl()) {
+    _aidl_status = INamedCallback::getDefaultImpl()->GetName(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnNamedCallback
+BnNamedCallback::BnNamedCallback() {}
+BnNamedCallback::~BnNamedCallback() {}
+::ndk::SpAIBinder BnNamedCallback::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_INamedCallback_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for INamedCallback
+const char* INamedCallback::descriptor = "android.aidl.tests.INamedCallback";
+INamedCallback::INamedCallback() {}
+INamedCallback::~INamedCallback() {}
+
+
+std::shared_ptr<INamedCallback> INamedCallback::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_INamedCallback_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpNamedCallback>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<INamedCallback>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpNamedCallback>(binder);
+}
+
+binder_status_t INamedCallback::writeToParcel(AParcel* parcel, const std::shared_ptr<INamedCallback>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t INamedCallback::readFromParcel(const AParcel* parcel, std::shared_ptr<INamedCallback>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = INamedCallback::fromBinder(binder);
+  return STATUS_OK;
+}
+bool INamedCallback::setDefaultImpl(const std::shared_ptr<INamedCallback>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!INamedCallback::default_impl);
+  if (impl) {
+    INamedCallback::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<INamedCallback>& INamedCallback::getDefaultImpl() {
+  return INamedCallback::default_impl;
+}
+std::shared_ptr<INamedCallback> INamedCallback::default_impl = nullptr;
+::ndk::ScopedAStatus INamedCallbackDefault::GetName(std::string* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder INamedCallbackDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool INamedCallbackDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/INamedCallback.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/INamedCallback.cpp.d
new file mode 100644
index 0000000..b6ec5e6
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/INamedCallback.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/INamedCallback.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/INewName.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/INewName.cpp
new file mode 100644
index 0000000..73f954c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/INewName.cpp
@@ -0,0 +1,154 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#include "aidl/android/aidl/tests/INewName.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/tests/BnNewName.h>
+#include <aidl/android/aidl/tests/BpNewName.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_INewName_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnNewName> _aidl_impl = std::static_pointer_cast<BnNewName>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*RealName*/): {
+      std::string _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RealName(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_INewName_clazz = ::ndk::ICInterface::defineClass(INewName::descriptor, _aidl_android_aidl_tests_INewName_onTransact);
+
+BpNewName::BpNewName(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpNewName::~BpNewName() {}
+
+::ndk::ScopedAStatus BpNewName::RealName(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*RealName*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && INewName::getDefaultImpl()) {
+    _aidl_status = INewName::getDefaultImpl()->RealName(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnNewName
+BnNewName::BnNewName() {}
+BnNewName::~BnNewName() {}
+::ndk::SpAIBinder BnNewName::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_INewName_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for INewName
+const char* INewName::descriptor = "android.aidl.tests.IOldName";
+INewName::INewName() {}
+INewName::~INewName() {}
+
+
+std::shared_ptr<INewName> INewName::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_INewName_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpNewName>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<INewName>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpNewName>(binder);
+}
+
+binder_status_t INewName::writeToParcel(AParcel* parcel, const std::shared_ptr<INewName>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t INewName::readFromParcel(const AParcel* parcel, std::shared_ptr<INewName>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = INewName::fromBinder(binder);
+  return STATUS_OK;
+}
+bool INewName::setDefaultImpl(const std::shared_ptr<INewName>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!INewName::default_impl);
+  if (impl) {
+    INewName::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<INewName>& INewName::getDefaultImpl() {
+  return INewName::default_impl;
+}
+std::shared_ptr<INewName> INewName::default_impl = nullptr;
+::ndk::ScopedAStatus INewNameDefault::RealName(std::string* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder INewNameDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool INewNameDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/INewName.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/INewName.cpp.d
new file mode 100644
index 0000000..459e176
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/INewName.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/INewName.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IOldName.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IOldName.cpp
new file mode 100644
index 0000000..284757a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IOldName.cpp
@@ -0,0 +1,154 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#include "aidl/android/aidl/tests/IOldName.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/tests/BnOldName.h>
+#include <aidl/android/aidl/tests/BpOldName.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_IOldName_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnOldName> _aidl_impl = std::static_pointer_cast<BnOldName>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*RealName*/): {
+      std::string _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RealName(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_IOldName_clazz = ::ndk::ICInterface::defineClass(IOldName::descriptor, _aidl_android_aidl_tests_IOldName_onTransact);
+
+BpOldName::BpOldName(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpOldName::~BpOldName() {}
+
+::ndk::ScopedAStatus BpOldName::RealName(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*RealName*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IOldName::getDefaultImpl()) {
+    _aidl_status = IOldName::getDefaultImpl()->RealName(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnOldName
+BnOldName::BnOldName() {}
+BnOldName::~BnOldName() {}
+::ndk::SpAIBinder BnOldName::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_IOldName_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IOldName
+const char* IOldName::descriptor = "android.aidl.tests.IOldName";
+IOldName::IOldName() {}
+IOldName::~IOldName() {}
+
+
+std::shared_ptr<IOldName> IOldName::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_IOldName_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpOldName>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IOldName>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpOldName>(binder);
+}
+
+binder_status_t IOldName::writeToParcel(AParcel* parcel, const std::shared_ptr<IOldName>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t IOldName::readFromParcel(const AParcel* parcel, std::shared_ptr<IOldName>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IOldName::fromBinder(binder);
+  return STATUS_OK;
+}
+bool IOldName::setDefaultImpl(const std::shared_ptr<IOldName>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IOldName::default_impl);
+  if (impl) {
+    IOldName::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<IOldName>& IOldName::getDefaultImpl() {
+  return IOldName::default_impl;
+}
+std::shared_ptr<IOldName> IOldName::default_impl = nullptr;
+::ndk::ScopedAStatus IOldNameDefault::RealName(std::string* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder IOldNameDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool IOldNameDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IOldName.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IOldName.cpp.d
new file mode 100644
index 0000000..1ca4239
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IOldName.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/IOldName.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ITestService.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ITestService.cpp
new file mode 100644
index 0000000..04b5a06
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ITestService.cpp
@@ -0,0 +1,5367 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#include "aidl/android/aidl/tests/ITestService.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/tests/BnCircular.h>
+#include <aidl/android/aidl/tests/BnNamedCallback.h>
+#include <aidl/android/aidl/tests/BnNewName.h>
+#include <aidl/android/aidl/tests/BnOldName.h>
+#include <aidl/android/aidl/tests/BnTestService.h>
+#include <aidl/android/aidl/tests/BpCircular.h>
+#include <aidl/android/aidl/tests/BpNamedCallback.h>
+#include <aidl/android/aidl/tests/BpNewName.h>
+#include <aidl/android/aidl/tests/BpOldName.h>
+#include <aidl/android/aidl/tests/BpTestService.h>
+#include <aidl/android/aidl/tests/ICircular.h>
+#include <aidl/android/aidl/tests/INamedCallback.h>
+#include <aidl/android/aidl/tests/INewName.h>
+#include <aidl/android/aidl/tests/IOldName.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated"
+static binder_status_t _aidl_android_aidl_tests_ITestService_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnTestService> _aidl_impl = std::static_pointer_cast<BnTestService>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*UnimplementedMethod*/): {
+      int32_t in_arg;
+      int32_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_arg);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->UnimplementedMethod(in_arg, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*Deprecated*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->Deprecated();
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*TestOneway*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->TestOneway();
+      _aidl_ret_status = STATUS_OK;
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 3 /*RepeatBoolean*/): {
+      bool in_token;
+      bool _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatBoolean(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 4 /*RepeatByte*/): {
+      int8_t in_token;
+      int8_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatByte(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 5 /*RepeatChar*/): {
+      char16_t in_token;
+      char16_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatChar(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 6 /*RepeatInt*/): {
+      int32_t in_token;
+      int32_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatInt(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 7 /*RepeatLong*/): {
+      int64_t in_token;
+      int64_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatLong(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 8 /*RepeatFloat*/): {
+      float in_token;
+      float _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatFloat(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 9 /*RepeatDouble*/): {
+      double in_token;
+      double _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatDouble(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 10 /*RepeatString*/): {
+      std::string in_token;
+      std::string _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatString(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 11 /*RepeatByteEnum*/): {
+      ::aidl::android::aidl::tests::ByteEnum in_token;
+      ::aidl::android::aidl::tests::ByteEnum _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatByteEnum(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 12 /*RepeatIntEnum*/): {
+      ::aidl::android::aidl::tests::IntEnum in_token;
+      ::aidl::android::aidl::tests::IntEnum _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatIntEnum(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 13 /*RepeatLongEnum*/): {
+      ::aidl::android::aidl::tests::LongEnum in_token;
+      ::aidl::android::aidl::tests::LongEnum _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatLongEnum(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 14 /*ReverseBoolean*/): {
+      std::vector<bool> in_input;
+      std::vector<bool> out_repeated;
+      std::vector<bool> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseBoolean(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 15 /*ReverseByte*/): {
+      std::vector<uint8_t> in_input;
+      std::vector<uint8_t> out_repeated;
+      std::vector<uint8_t> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseByte(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16 /*ReverseChar*/): {
+      std::vector<char16_t> in_input;
+      std::vector<char16_t> out_repeated;
+      std::vector<char16_t> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseChar(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 17 /*ReverseInt*/): {
+      std::vector<int32_t> in_input;
+      std::vector<int32_t> out_repeated;
+      std::vector<int32_t> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseInt(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 18 /*ReverseLong*/): {
+      std::vector<int64_t> in_input;
+      std::vector<int64_t> out_repeated;
+      std::vector<int64_t> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseLong(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 19 /*ReverseFloat*/): {
+      std::vector<float> in_input;
+      std::vector<float> out_repeated;
+      std::vector<float> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseFloat(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 20 /*ReverseDouble*/): {
+      std::vector<double> in_input;
+      std::vector<double> out_repeated;
+      std::vector<double> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseDouble(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 21 /*ReverseString*/): {
+      std::vector<std::string> in_input;
+      std::vector<std::string> out_repeated;
+      std::vector<std::string> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseString(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 22 /*ReverseByteEnum*/): {
+      std::vector<::aidl::android::aidl::tests::ByteEnum> in_input;
+      std::vector<::aidl::android::aidl::tests::ByteEnum> out_repeated;
+      std::vector<::aidl::android::aidl::tests::ByteEnum> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseByteEnum(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 23 /*ReverseIntEnum*/): {
+      std::vector<::aidl::android::aidl::tests::IntEnum> in_input;
+      std::vector<::aidl::android::aidl::tests::IntEnum> out_repeated;
+      std::vector<::aidl::android::aidl::tests::IntEnum> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseIntEnum(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 24 /*ReverseLongEnum*/): {
+      std::vector<::aidl::android::aidl::tests::LongEnum> in_input;
+      std::vector<::aidl::android::aidl::tests::LongEnum> out_repeated;
+      std::vector<::aidl::android::aidl::tests::LongEnum> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseLongEnum(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 25 /*GetOtherTestService*/): {
+      std::string in_name;
+      std::shared_ptr<::aidl::android::aidl::tests::INamedCallback> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_name);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetOtherTestService(in_name, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 26 /*SetOtherTestService*/): {
+      std::string in_name;
+      std::shared_ptr<::aidl::android::aidl::tests::INamedCallback> in_service;
+      bool _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_name);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_service);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->SetOtherTestService(in_name, in_service, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 27 /*VerifyName*/): {
+      std::shared_ptr<::aidl::android::aidl::tests::INamedCallback> in_service;
+      std::string in_name;
+      bool _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_service);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_name);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->VerifyName(in_service, in_name, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 28 /*GetInterfaceArray*/): {
+      std::vector<std::string> in_names;
+      std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_names);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetInterfaceArray(in_names, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 29 /*VerifyNamesWithInterfaceArray*/): {
+      std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>> in_services;
+      std::vector<std::string> in_names;
+      bool _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_services);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_names);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->VerifyNamesWithInterfaceArray(in_services, in_names, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 30 /*GetNullableInterfaceArray*/): {
+      std::optional<std::vector<std::optional<std::string>>> in_names;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_names);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetNullableInterfaceArray(in_names, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 31 /*VerifyNamesWithNullableInterfaceArray*/): {
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>> in_services;
+      std::optional<std::vector<std::optional<std::string>>> in_names;
+      bool _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_services);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_names);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->VerifyNamesWithNullableInterfaceArray(in_services, in_names, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 32 /*GetInterfaceList*/): {
+      std::optional<std::vector<std::optional<std::string>>> in_names;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_names);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetInterfaceList(in_names, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 33 /*VerifyNamesWithInterfaceList*/): {
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>> in_services;
+      std::optional<std::vector<std::optional<std::string>>> in_names;
+      bool _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_services);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_names);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->VerifyNamesWithInterfaceList(in_services, in_names, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 34 /*ReverseStringList*/): {
+      std::vector<std::string> in_input;
+      std::vector<std::string> out_repeated;
+      std::vector<std::string> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseStringList(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 35 /*RepeatParcelFileDescriptor*/): {
+      ::ndk::ScopedFileDescriptor in_read;
+      ::ndk::ScopedFileDescriptor _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_read);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatParcelFileDescriptor(in_read, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 36 /*ReverseParcelFileDescriptorArray*/): {
+      std::vector<::ndk::ScopedFileDescriptor> in_input;
+      std::vector<::ndk::ScopedFileDescriptor> out_repeated;
+      std::vector<::ndk::ScopedFileDescriptor> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseParcelFileDescriptorArray(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 37 /*ThrowServiceException*/): {
+      int32_t in_code;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_code);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ThrowServiceException(in_code);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 38 /*RepeatNullableIntArray*/): {
+      std::optional<std::vector<int32_t>> in_input;
+      std::optional<std::vector<int32_t>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableIntArray(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 39 /*RepeatNullableByteEnumArray*/): {
+      std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>> in_input;
+      std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableByteEnumArray(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 40 /*RepeatNullableIntEnumArray*/): {
+      std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>> in_input;
+      std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableIntEnumArray(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 41 /*RepeatNullableLongEnumArray*/): {
+      std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>> in_input;
+      std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableLongEnumArray(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 42 /*RepeatNullableString*/): {
+      std::optional<std::string> in_input;
+      std::optional<std::string> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableString(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 43 /*RepeatNullableStringList*/): {
+      std::optional<std::vector<std::optional<std::string>>> in_input;
+      std::optional<std::vector<std::optional<std::string>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableStringList(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 44 /*RepeatNullableParcelable*/): {
+      std::optional<::aidl::android::aidl::tests::ITestService::Empty> in_input;
+      std::optional<::aidl::android::aidl::tests::ITestService::Empty> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableParcelable(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 45 /*RepeatNullableParcelableArray*/): {
+      std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>> in_input;
+      std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableParcelableArray(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 46 /*RepeatNullableParcelableList*/): {
+      std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>> in_input;
+      std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableParcelableList(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 47 /*TakesAnIBinder*/): {
+      ::ndk::SpAIBinder in_input;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->TakesAnIBinder(in_input);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 48 /*TakesANullableIBinder*/): {
+      ::ndk::SpAIBinder in_input;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->TakesANullableIBinder(in_input);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 49 /*TakesAnIBinderList*/): {
+      std::vector<::ndk::SpAIBinder> in_input;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->TakesAnIBinderList(in_input);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 50 /*TakesANullableIBinderList*/): {
+      std::optional<std::vector<::ndk::SpAIBinder>> in_input;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->TakesANullableIBinderList(in_input);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 51 /*RepeatUtf8CppString*/): {
+      std::string in_token;
+      std::string _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatUtf8CppString(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 52 /*RepeatNullableUtf8CppString*/): {
+      std::optional<std::string> in_token;
+      std::optional<std::string> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableUtf8CppString(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 53 /*ReverseUtf8CppString*/): {
+      std::vector<std::string> in_input;
+      std::vector<std::string> out_repeated;
+      std::vector<std::string> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseUtf8CppString(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 54 /*ReverseNullableUtf8CppString*/): {
+      std::optional<std::vector<std::optional<std::string>>> in_input;
+      std::optional<std::vector<std::optional<std::string>>> out_repeated;
+      std::optional<std::vector<std::optional<std::string>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseNullableUtf8CppString(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 55 /*ReverseUtf8CppStringList*/): {
+      std::optional<std::vector<std::optional<std::string>>> in_input;
+      std::optional<std::vector<std::optional<std::string>>> out_repeated;
+      std::optional<std::vector<std::optional<std::string>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseUtf8CppStringList(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 56 /*GetCallback*/): {
+      bool in_return_null;
+      std::shared_ptr<::aidl::android::aidl::tests::INamedCallback> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_return_null);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetCallback(in_return_null, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 57 /*FillOutStructuredParcelable*/): {
+      ::aidl::android::aidl::tests::StructuredParcelable in_parcel;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_parcel);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->FillOutStructuredParcelable(&in_parcel);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_parcel);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 58 /*RepeatExtendableParcelable*/): {
+      ::aidl::android::aidl::tests::extension::ExtendableParcelable in_ep;
+      ::aidl::android::aidl::tests::extension::ExtendableParcelable out_ep2;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_ep);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatExtendableParcelable(in_ep, &out_ep2);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_ep2);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 59 /*ReverseList*/): {
+      ::aidl::android::aidl::tests::RecursiveList in_list;
+      ::aidl::android::aidl::tests::RecursiveList _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_list);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseList(in_list, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 60 /*ReverseIBinderArray*/): {
+      std::vector<::ndk::SpAIBinder> in_input;
+      std::vector<::ndk::SpAIBinder> out_repeated;
+      std::vector<::ndk::SpAIBinder> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseIBinderArray(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 61 /*ReverseNullableIBinderArray*/): {
+      std::optional<std::vector<::ndk::SpAIBinder>> in_input;
+      std::optional<std::vector<::ndk::SpAIBinder>> out_repeated;
+      std::optional<std::vector<::ndk::SpAIBinder>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseNullableIBinderArray(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 62 /*GetOldNameInterface*/): {
+      std::shared_ptr<::aidl::android::aidl::tests::IOldName> _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetOldNameInterface(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 63 /*GetNewNameInterface*/): {
+      std::shared_ptr<::aidl::android::aidl::tests::INewName> _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetNewNameInterface(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 64 /*GetUnionTags*/): {
+      std::vector<::aidl::android::aidl::tests::Union> in_input;
+      std::vector<::aidl::android::aidl::tests::Union::Tag> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetUnionTags(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 65 /*GetCppJavaTests*/): {
+      ::ndk::SpAIBinder _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetCppJavaTests(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 66 /*getBackendType*/): {
+      ::aidl::android::aidl::tests::BackendType _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getBackendType(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 67 /*GetCircular*/): {
+      ::aidl::android::aidl::tests::CircularParcelable out_cp;
+      std::shared_ptr<::aidl::android::aidl::tests::ICircular> _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetCircular(&out_cp, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_cp);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ITestService_clazz = ::ndk::ICInterface::defineClass(ITestService::descriptor, _aidl_android_aidl_tests_ITestService_onTransact);
+
+#pragma clang diagnostic pop
+BpTestService::BpTestService(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpTestService::~BpTestService() {}
+
+::ndk::ScopedAStatus BpTestService::UnimplementedMethod(int32_t in_arg, int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_arg);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*UnimplementedMethod*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->UnimplementedMethod(in_arg, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::Deprecated() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*Deprecated*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->Deprecated();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::TestOneway() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*TestOneway*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_ONEWAY | FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->TestOneway();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatBoolean(bool in_token, bool* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 3 /*RepeatBoolean*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatBoolean(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatByte(int8_t in_token, int8_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 4 /*RepeatByte*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatByte(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatChar(char16_t in_token, char16_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 5 /*RepeatChar*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatChar(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatInt(int32_t in_token, int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 6 /*RepeatInt*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatInt(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatLong(int64_t in_token, int64_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 7 /*RepeatLong*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatLong(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatFloat(float in_token, float* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 8 /*RepeatFloat*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatFloat(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatDouble(double in_token, double* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 9 /*RepeatDouble*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatDouble(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatString(const std::string& in_token, std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 10 /*RepeatString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatString(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatByteEnum(::aidl::android::aidl::tests::ByteEnum in_token, ::aidl::android::aidl::tests::ByteEnum* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 11 /*RepeatByteEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatByteEnum(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatIntEnum(::aidl::android::aidl::tests::IntEnum in_token, ::aidl::android::aidl::tests::IntEnum* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 12 /*RepeatIntEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatIntEnum(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatLongEnum(::aidl::android::aidl::tests::LongEnum in_token, ::aidl::android::aidl::tests::LongEnum* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 13 /*RepeatLongEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatLongEnum(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseBoolean(const std::vector<bool>& in_input, std::vector<bool>* out_repeated, std::vector<bool>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 14 /*ReverseBoolean*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseBoolean(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseByte(const std::vector<uint8_t>& in_input, std::vector<uint8_t>* out_repeated, std::vector<uint8_t>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 15 /*ReverseByte*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseByte(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseChar(const std::vector<char16_t>& in_input, std::vector<char16_t>* out_repeated, std::vector<char16_t>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16 /*ReverseChar*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseChar(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseInt(const std::vector<int32_t>& in_input, std::vector<int32_t>* out_repeated, std::vector<int32_t>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 17 /*ReverseInt*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseInt(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseLong(const std::vector<int64_t>& in_input, std::vector<int64_t>* out_repeated, std::vector<int64_t>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 18 /*ReverseLong*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseLong(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseFloat(const std::vector<float>& in_input, std::vector<float>* out_repeated, std::vector<float>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 19 /*ReverseFloat*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseFloat(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseDouble(const std::vector<double>& in_input, std::vector<double>* out_repeated, std::vector<double>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 20 /*ReverseDouble*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseDouble(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 21 /*ReverseString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseString(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseByteEnum(const std::vector<::aidl::android::aidl::tests::ByteEnum>& in_input, std::vector<::aidl::android::aidl::tests::ByteEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::ByteEnum>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 22 /*ReverseByteEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseByteEnum(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseIntEnum(const std::vector<::aidl::android::aidl::tests::IntEnum>& in_input, std::vector<::aidl::android::aidl::tests::IntEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::IntEnum>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 23 /*ReverseIntEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseIntEnum(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseLongEnum(const std::vector<::aidl::android::aidl::tests::LongEnum>& in_input, std::vector<::aidl::android::aidl::tests::LongEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::LongEnum>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 24 /*ReverseLongEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseLongEnum(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetOtherTestService(const std::string& in_name, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_name);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 25 /*GetOtherTestService*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetOtherTestService(in_name, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::SetOtherTestService(const std::string& in_name, const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, bool* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_name);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_service);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 26 /*SetOtherTestService*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->SetOtherTestService(in_name, in_service, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::VerifyName(const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, const std::string& in_name, bool* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_service);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_name);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 27 /*VerifyName*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->VerifyName(in_service, in_name, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetInterfaceArray(const std::vector<std::string>& in_names, std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_names);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 28 /*GetInterfaceArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetInterfaceArray(in_names, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::VerifyNamesWithInterfaceArray(const std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>& in_services, const std::vector<std::string>& in_names, bool* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_services);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_names);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 29 /*VerifyNamesWithInterfaceArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->VerifyNamesWithInterfaceArray(in_services, in_names, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetNullableInterfaceArray(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_names);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 30 /*GetNullableInterfaceArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetNullableInterfaceArray(in_names, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::VerifyNamesWithNullableInterfaceArray(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_services);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_names);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 31 /*VerifyNamesWithNullableInterfaceArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->VerifyNamesWithNullableInterfaceArray(in_services, in_names, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetInterfaceList(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_names);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 32 /*GetInterfaceList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetInterfaceList(in_names, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::VerifyNamesWithInterfaceList(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_services);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_names);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 33 /*VerifyNamesWithInterfaceList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->VerifyNamesWithInterfaceList(in_services, in_names, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseStringList(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 34 /*ReverseStringList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseStringList(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatParcelFileDescriptor(const ::ndk::ScopedFileDescriptor& in_read, ::ndk::ScopedFileDescriptor* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_read);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 35 /*RepeatParcelFileDescriptor*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatParcelFileDescriptor(in_read, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseParcelFileDescriptorArray(const std::vector<::ndk::ScopedFileDescriptor>& in_input, std::vector<::ndk::ScopedFileDescriptor>* out_repeated, std::vector<::ndk::ScopedFileDescriptor>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 36 /*ReverseParcelFileDescriptorArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseParcelFileDescriptorArray(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ThrowServiceException(int32_t in_code) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_code);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 37 /*ThrowServiceException*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ThrowServiceException(in_code);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableIntArray(const std::optional<std::vector<int32_t>>& in_input, std::optional<std::vector<int32_t>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 38 /*RepeatNullableIntArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableIntArray(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableByteEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 39 /*RepeatNullableByteEnumArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableByteEnumArray(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableIntEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 40 /*RepeatNullableIntEnumArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableIntEnumArray(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableLongEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 41 /*RepeatNullableLongEnumArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableLongEnumArray(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableString(const std::optional<std::string>& in_input, std::optional<std::string>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 42 /*RepeatNullableString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableString(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 43 /*RepeatNullableStringList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableStringList(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableParcelable(const std::optional<::aidl::android::aidl::tests::ITestService::Empty>& in_input, std::optional<::aidl::android::aidl::tests::ITestService::Empty>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 44 /*RepeatNullableParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableParcelable(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableParcelableArray(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 45 /*RepeatNullableParcelableArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableParcelableArray(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableParcelableList(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 46 /*RepeatNullableParcelableList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableParcelableList(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::TakesAnIBinder(const ::ndk::SpAIBinder& in_input) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 47 /*TakesAnIBinder*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->TakesAnIBinder(in_input);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::TakesANullableIBinder(const ::ndk::SpAIBinder& in_input) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 48 /*TakesANullableIBinder*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->TakesANullableIBinder(in_input);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::TakesAnIBinderList(const std::vector<::ndk::SpAIBinder>& in_input) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 49 /*TakesAnIBinderList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->TakesAnIBinderList(in_input);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::TakesANullableIBinderList(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 50 /*TakesANullableIBinderList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->TakesANullableIBinderList(in_input);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatUtf8CppString(const std::string& in_token, std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 51 /*RepeatUtf8CppString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatUtf8CppString(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableUtf8CppString(const std::optional<std::string>& in_token, std::optional<std::string>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 52 /*RepeatNullableUtf8CppString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableUtf8CppString(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseUtf8CppString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 53 /*ReverseUtf8CppString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseUtf8CppString(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseNullableUtf8CppString(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 54 /*ReverseNullableUtf8CppString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseNullableUtf8CppString(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseUtf8CppStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 55 /*ReverseUtf8CppStringList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseUtf8CppStringList(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetCallback(bool in_return_null, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_return_null);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 56 /*GetCallback*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetCallback(in_return_null, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::FillOutStructuredParcelable(::aidl::android::aidl::tests::StructuredParcelable* in_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_parcel);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 57 /*FillOutStructuredParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->FillOutStructuredParcelable(in_parcel);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_parcel);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatExtendableParcelable(const ::aidl::android::aidl::tests::extension::ExtendableParcelable& in_ep, ::aidl::android::aidl::tests::extension::ExtendableParcelable* out_ep2) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_ep);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 58 /*RepeatExtendableParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatExtendableParcelable(in_ep, out_ep2);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_ep2);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseList(const ::aidl::android::aidl::tests::RecursiveList& in_list, ::aidl::android::aidl::tests::RecursiveList* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_list);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 59 /*ReverseList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseList(in_list, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseIBinderArray(const std::vector<::ndk::SpAIBinder>& in_input, std::vector<::ndk::SpAIBinder>* out_repeated, std::vector<::ndk::SpAIBinder>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 60 /*ReverseIBinderArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseIBinderArray(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseNullableIBinderArray(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input, std::optional<std::vector<::ndk::SpAIBinder>>* out_repeated, std::optional<std::vector<::ndk::SpAIBinder>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 61 /*ReverseNullableIBinderArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseNullableIBinderArray(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetOldNameInterface(std::shared_ptr<::aidl::android::aidl::tests::IOldName>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 62 /*GetOldNameInterface*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetOldNameInterface(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetNewNameInterface(std::shared_ptr<::aidl::android::aidl::tests::INewName>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 63 /*GetNewNameInterface*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetNewNameInterface(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetUnionTags(const std::vector<::aidl::android::aidl::tests::Union>& in_input, std::vector<::aidl::android::aidl::tests::Union::Tag>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 64 /*GetUnionTags*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetUnionTags(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetCppJavaTests(::ndk::SpAIBinder* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 65 /*GetCppJavaTests*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetCppJavaTests(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::getBackendType(::aidl::android::aidl::tests::BackendType* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 66 /*getBackendType*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->getBackendType(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetCircular(::aidl::android::aidl::tests::CircularParcelable* out_cp, std::shared_ptr<::aidl::android::aidl::tests::ICircular>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 67 /*GetCircular*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetCircular(out_cp, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_cp);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnTestService
+BnTestService::BnTestService() {}
+BnTestService::~BnTestService() {}
+::ndk::SpAIBinder BnTestService::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ITestService_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for ITestService
+const char* ITestService::descriptor = "android.aidl.tests.ITestService";
+ITestService::ITestService() {}
+ITestService::~ITestService() {}
+
+const char* ITestService::STRING_CONSTANT = "foo";
+const char* ITestService::STRING_CONSTANT2 = "bar";
+const char* ITestService::STRING_CONSTANT_UTF8 = "baz";
+
+std::shared_ptr<ITestService> ITestService::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ITestService_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpTestService>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<ITestService>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpTestService>(binder);
+}
+
+binder_status_t ITestService::writeToParcel(AParcel* parcel, const std::shared_ptr<ITestService>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ITestService::readFromParcel(const AParcel* parcel, std::shared_ptr<ITestService>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = ITestService::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ITestService::setDefaultImpl(const std::shared_ptr<ITestService>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!ITestService::default_impl);
+  if (impl) {
+    ITestService::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ITestService>& ITestService::getDefaultImpl() {
+  return ITestService::default_impl;
+}
+std::shared_ptr<ITestService> ITestService::default_impl = nullptr;
+::ndk::ScopedAStatus ITestServiceDefault::UnimplementedMethod(int32_t /*in_arg*/, int32_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::Deprecated() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::TestOneway() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatBoolean(bool /*in_token*/, bool* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatByte(int8_t /*in_token*/, int8_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatChar(char16_t /*in_token*/, char16_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatInt(int32_t /*in_token*/, int32_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatLong(int64_t /*in_token*/, int64_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatFloat(float /*in_token*/, float* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatDouble(double /*in_token*/, double* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatString(const std::string& /*in_token*/, std::string* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatByteEnum(::aidl::android::aidl::tests::ByteEnum /*in_token*/, ::aidl::android::aidl::tests::ByteEnum* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatIntEnum(::aidl::android::aidl::tests::IntEnum /*in_token*/, ::aidl::android::aidl::tests::IntEnum* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatLongEnum(::aidl::android::aidl::tests::LongEnum /*in_token*/, ::aidl::android::aidl::tests::LongEnum* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseBoolean(const std::vector<bool>& /*in_input*/, std::vector<bool>* /*out_repeated*/, std::vector<bool>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseByte(const std::vector<uint8_t>& /*in_input*/, std::vector<uint8_t>* /*out_repeated*/, std::vector<uint8_t>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseChar(const std::vector<char16_t>& /*in_input*/, std::vector<char16_t>* /*out_repeated*/, std::vector<char16_t>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseInt(const std::vector<int32_t>& /*in_input*/, std::vector<int32_t>* /*out_repeated*/, std::vector<int32_t>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseLong(const std::vector<int64_t>& /*in_input*/, std::vector<int64_t>* /*out_repeated*/, std::vector<int64_t>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseFloat(const std::vector<float>& /*in_input*/, std::vector<float>* /*out_repeated*/, std::vector<float>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseDouble(const std::vector<double>& /*in_input*/, std::vector<double>* /*out_repeated*/, std::vector<double>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseString(const std::vector<std::string>& /*in_input*/, std::vector<std::string>* /*out_repeated*/, std::vector<std::string>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseByteEnum(const std::vector<::aidl::android::aidl::tests::ByteEnum>& /*in_input*/, std::vector<::aidl::android::aidl::tests::ByteEnum>* /*out_repeated*/, std::vector<::aidl::android::aidl::tests::ByteEnum>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseIntEnum(const std::vector<::aidl::android::aidl::tests::IntEnum>& /*in_input*/, std::vector<::aidl::android::aidl::tests::IntEnum>* /*out_repeated*/, std::vector<::aidl::android::aidl::tests::IntEnum>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseLongEnum(const std::vector<::aidl::android::aidl::tests::LongEnum>& /*in_input*/, std::vector<::aidl::android::aidl::tests::LongEnum>* /*out_repeated*/, std::vector<::aidl::android::aidl::tests::LongEnum>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetOtherTestService(const std::string& /*in_name*/, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::SetOtherTestService(const std::string& /*in_name*/, const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& /*in_service*/, bool* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::VerifyName(const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& /*in_service*/, const std::string& /*in_name*/, bool* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetInterfaceArray(const std::vector<std::string>& /*in_names*/, std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::VerifyNamesWithInterfaceArray(const std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>& /*in_services*/, const std::vector<std::string>& /*in_names*/, bool* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetNullableInterfaceArray(const std::optional<std::vector<std::optional<std::string>>>& /*in_names*/, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::VerifyNamesWithNullableInterfaceArray(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& /*in_services*/, const std::optional<std::vector<std::optional<std::string>>>& /*in_names*/, bool* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetInterfaceList(const std::optional<std::vector<std::optional<std::string>>>& /*in_names*/, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::VerifyNamesWithInterfaceList(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& /*in_services*/, const std::optional<std::vector<std::optional<std::string>>>& /*in_names*/, bool* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseStringList(const std::vector<std::string>& /*in_input*/, std::vector<std::string>* /*out_repeated*/, std::vector<std::string>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatParcelFileDescriptor(const ::ndk::ScopedFileDescriptor& /*in_read*/, ::ndk::ScopedFileDescriptor* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseParcelFileDescriptorArray(const std::vector<::ndk::ScopedFileDescriptor>& /*in_input*/, std::vector<::ndk::ScopedFileDescriptor>* /*out_repeated*/, std::vector<::ndk::ScopedFileDescriptor>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ThrowServiceException(int32_t /*in_code*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableIntArray(const std::optional<std::vector<int32_t>>& /*in_input*/, std::optional<std::vector<int32_t>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableByteEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>& /*in_input*/, std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableIntEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>& /*in_input*/, std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableLongEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>& /*in_input*/, std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableString(const std::optional<std::string>& /*in_input*/, std::optional<std::string>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableStringList(const std::optional<std::vector<std::optional<std::string>>>& /*in_input*/, std::optional<std::vector<std::optional<std::string>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableParcelable(const std::optional<::aidl::android::aidl::tests::ITestService::Empty>& /*in_input*/, std::optional<::aidl::android::aidl::tests::ITestService::Empty>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableParcelableArray(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& /*in_input*/, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableParcelableList(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& /*in_input*/, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::TakesAnIBinder(const ::ndk::SpAIBinder& /*in_input*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::TakesANullableIBinder(const ::ndk::SpAIBinder& /*in_input*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::TakesAnIBinderList(const std::vector<::ndk::SpAIBinder>& /*in_input*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::TakesANullableIBinderList(const std::optional<std::vector<::ndk::SpAIBinder>>& /*in_input*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatUtf8CppString(const std::string& /*in_token*/, std::string* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableUtf8CppString(const std::optional<std::string>& /*in_token*/, std::optional<std::string>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseUtf8CppString(const std::vector<std::string>& /*in_input*/, std::vector<std::string>* /*out_repeated*/, std::vector<std::string>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseNullableUtf8CppString(const std::optional<std::vector<std::optional<std::string>>>& /*in_input*/, std::optional<std::vector<std::optional<std::string>>>* /*out_repeated*/, std::optional<std::vector<std::optional<std::string>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseUtf8CppStringList(const std::optional<std::vector<std::optional<std::string>>>& /*in_input*/, std::optional<std::vector<std::optional<std::string>>>* /*out_repeated*/, std::optional<std::vector<std::optional<std::string>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetCallback(bool /*in_return_null*/, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::FillOutStructuredParcelable(::aidl::android::aidl::tests::StructuredParcelable* /*in_parcel*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatExtendableParcelable(const ::aidl::android::aidl::tests::extension::ExtendableParcelable& /*in_ep*/, ::aidl::android::aidl::tests::extension::ExtendableParcelable* /*out_ep2*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseList(const ::aidl::android::aidl::tests::RecursiveList& /*in_list*/, ::aidl::android::aidl::tests::RecursiveList* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseIBinderArray(const std::vector<::ndk::SpAIBinder>& /*in_input*/, std::vector<::ndk::SpAIBinder>* /*out_repeated*/, std::vector<::ndk::SpAIBinder>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseNullableIBinderArray(const std::optional<std::vector<::ndk::SpAIBinder>>& /*in_input*/, std::optional<std::vector<::ndk::SpAIBinder>>* /*out_repeated*/, std::optional<std::vector<::ndk::SpAIBinder>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetOldNameInterface(std::shared_ptr<::aidl::android::aidl::tests::IOldName>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetNewNameInterface(std::shared_ptr<::aidl::android::aidl::tests::INewName>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetUnionTags(const std::vector<::aidl::android::aidl::tests::Union>& /*in_input*/, std::vector<::aidl::android::aidl::tests::Union::Tag>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetCppJavaTests(::ndk::SpAIBinder* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::getBackendType(::aidl::android::aidl::tests::BackendType* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetCircular(::aidl::android::aidl::tests::CircularParcelable* /*out_cp*/, std::shared_ptr<::aidl::android::aidl::tests::ICircular>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder ITestServiceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ITestServiceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ITestService::Empty::descriptor = "android.aidl.tests.ITestService.Empty";
+
+binder_status_t ITestService::Empty::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ITestService::Empty::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ITestService::CompilerChecks::descriptor = "android.aidl.tests.ITestService.CompilerChecks";
+
+binder_status_t ITestService::CompilerChecks::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &binder);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_binder);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &binder_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_binder_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &binder_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_binder_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &pfd);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_pfd);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &pfd_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_pfd_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &pfd_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_pfd_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcel);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_parcel);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcel_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_parcel_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcel_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_parcel_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ITestService::CompilerChecks::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, binder);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_binder);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, binder_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_binder_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, binder_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_binder_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, pfd);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_pfd);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, pfd_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_pfd_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, pfd_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_pfd_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcel);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_parcel);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcel_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_parcel_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcel_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_parcel_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_ITestService_CompilerChecks_Foo_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  (void)_aidl_binder;
+  (void)_aidl_code;
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ITestService_CompilerChecks_Foo_clazz = ::ndk::ICInterface::defineClass(ITestService::CompilerChecks::IFoo::descriptor, _aidl_android_aidl_tests_ITestService_CompilerChecks_Foo_onTransact);
+
+ITestService::CompilerChecks::BpFoo::BpFoo(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ITestService::CompilerChecks::BpFoo::~BpFoo() {}
+
+// Source for BnFoo
+ITestService::CompilerChecks::BnFoo::BnFoo() {}
+ITestService::CompilerChecks::BnFoo::~BnFoo() {}
+::ndk::SpAIBinder ITestService::CompilerChecks::BnFoo::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ITestService_CompilerChecks_Foo_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IFoo
+const char* ITestService::CompilerChecks::IFoo::descriptor = "android.aidl.tests.ITestService.CompilerChecks.Foo";
+ITestService::CompilerChecks::IFoo::IFoo() {}
+ITestService::CompilerChecks::IFoo::~IFoo() {}
+
+
+std::shared_ptr<ITestService::CompilerChecks::IFoo> ITestService::CompilerChecks::IFoo::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ITestService_CompilerChecks_Foo_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ITestService::CompilerChecks::BpFoo>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IFoo>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ITestService::CompilerChecks::BpFoo>(binder);
+}
+
+binder_status_t ITestService::CompilerChecks::IFoo::writeToParcel(AParcel* parcel, const std::shared_ptr<IFoo>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ITestService::CompilerChecks::IFoo::readFromParcel(const AParcel* parcel, std::shared_ptr<IFoo>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IFoo::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ITestService::CompilerChecks::IFoo::setDefaultImpl(const std::shared_ptr<IFoo>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IFoo::default_impl);
+  if (impl) {
+    IFoo::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ITestService::CompilerChecks::IFoo>& ITestService::CompilerChecks::IFoo::getDefaultImpl() {
+  return IFoo::default_impl;
+}
+std::shared_ptr<ITestService::CompilerChecks::IFoo> ITestService::CompilerChecks::IFoo::default_impl = nullptr;
+::ndk::SpAIBinder ITestService::CompilerChecks::IFooDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ITestService::CompilerChecks::IFooDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ITestService::CompilerChecks::HasDeprecated::descriptor = "android.aidl.tests.ITestService.CompilerChecks.HasDeprecated";
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+binder_status_t ITestService::CompilerChecks::HasDeprecated::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &deprecated);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ITestService::CompilerChecks::HasDeprecated::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, deprecated);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+#pragma clang diagnostic pop
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ITestService::CompilerChecks::UsingHasDeprecated::descriptor = "android.aidl.tests.ITestService.CompilerChecks.UsingHasDeprecated";
+
+binder_status_t ITestService::CompilerChecks::UsingHasDeprecated::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case n: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<n>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<n>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case m: {
+    ::aidl::android::aidl::tests::ITestService::CompilerChecks::HasDeprecated _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::aidl::android::aidl::tests::ITestService::CompilerChecks::HasDeprecated>) {
+      set<m>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<m>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t ITestService::CompilerChecks::UsingHasDeprecated::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case n: return ::ndk::AParcel_writeData(_parcel, get<n>());
+  case m: return ::ndk::AParcel_writeData(_parcel, get<m>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<ITestService::CompilerChecks::BnNoPrefixInterface> _aidl_impl = std::static_pointer_cast<ITestService::CompilerChecks::BnNoPrefixInterface>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*foo*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->foo();
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_clazz = ::ndk::ICInterface::defineClass(ITestService::CompilerChecks::INoPrefixInterface::descriptor, _aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_onTransact);
+
+ITestService::CompilerChecks::BpNoPrefixInterface::BpNoPrefixInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ITestService::CompilerChecks::BpNoPrefixInterface::~BpNoPrefixInterface() {}
+
+::ndk::ScopedAStatus ITestService::CompilerChecks::BpNoPrefixInterface::foo() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*foo*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && INoPrefixInterface::getDefaultImpl()) {
+    _aidl_status = INoPrefixInterface::getDefaultImpl()->foo();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnNoPrefixInterface
+ITestService::CompilerChecks::BnNoPrefixInterface::BnNoPrefixInterface() {}
+ITestService::CompilerChecks::BnNoPrefixInterface::~BnNoPrefixInterface() {}
+::ndk::SpAIBinder ITestService::CompilerChecks::BnNoPrefixInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for INoPrefixInterface
+const char* ITestService::CompilerChecks::INoPrefixInterface::descriptor = "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface";
+ITestService::CompilerChecks::INoPrefixInterface::INoPrefixInterface() {}
+ITestService::CompilerChecks::INoPrefixInterface::~INoPrefixInterface() {}
+
+
+std::shared_ptr<ITestService::CompilerChecks::INoPrefixInterface> ITestService::CompilerChecks::INoPrefixInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ITestService::CompilerChecks::BpNoPrefixInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<INoPrefixInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ITestService::CompilerChecks::BpNoPrefixInterface>(binder);
+}
+
+binder_status_t ITestService::CompilerChecks::INoPrefixInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<INoPrefixInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ITestService::CompilerChecks::INoPrefixInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<INoPrefixInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = INoPrefixInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ITestService::CompilerChecks::INoPrefixInterface::setDefaultImpl(const std::shared_ptr<INoPrefixInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!INoPrefixInterface::default_impl);
+  if (impl) {
+    INoPrefixInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ITestService::CompilerChecks::INoPrefixInterface>& ITestService::CompilerChecks::INoPrefixInterface::getDefaultImpl() {
+  return INoPrefixInterface::default_impl;
+}
+std::shared_ptr<ITestService::CompilerChecks::INoPrefixInterface> ITestService::CompilerChecks::INoPrefixInterface::default_impl = nullptr;
+::ndk::ScopedAStatus ITestService::CompilerChecks::INoPrefixInterfaceDefault::foo() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder ITestService::CompilerChecks::INoPrefixInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ITestService::CompilerChecks::INoPrefixInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ITestService::CompilerChecks::INoPrefixInterface::Nested::descriptor = "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.Nested";
+
+binder_status_t ITestService::CompilerChecks::INoPrefixInterface::Nested::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ITestService::CompilerChecks::INoPrefixInterface::Nested::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_NestedNoPrefixInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<ITestService::CompilerChecks::INoPrefixInterface::BnNestedNoPrefixInterface> _aidl_impl = std::static_pointer_cast<ITestService::CompilerChecks::INoPrefixInterface::BnNestedNoPrefixInterface>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*foo*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->foo();
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_NestedNoPrefixInterface_clazz = ::ndk::ICInterface::defineClass(ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::descriptor, _aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_NestedNoPrefixInterface_onTransact);
+
+ITestService::CompilerChecks::INoPrefixInterface::BpNestedNoPrefixInterface::BpNestedNoPrefixInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ITestService::CompilerChecks::INoPrefixInterface::BpNestedNoPrefixInterface::~BpNestedNoPrefixInterface() {}
+
+::ndk::ScopedAStatus ITestService::CompilerChecks::INoPrefixInterface::BpNestedNoPrefixInterface::foo() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*foo*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && INestedNoPrefixInterface::getDefaultImpl()) {
+    _aidl_status = INestedNoPrefixInterface::getDefaultImpl()->foo();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnNestedNoPrefixInterface
+ITestService::CompilerChecks::INoPrefixInterface::BnNestedNoPrefixInterface::BnNestedNoPrefixInterface() {}
+ITestService::CompilerChecks::INoPrefixInterface::BnNestedNoPrefixInterface::~BnNestedNoPrefixInterface() {}
+::ndk::SpAIBinder ITestService::CompilerChecks::INoPrefixInterface::BnNestedNoPrefixInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_NestedNoPrefixInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for INestedNoPrefixInterface
+const char* ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::descriptor = "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface";
+ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::INestedNoPrefixInterface() {}
+ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::~INestedNoPrefixInterface() {}
+
+
+std::shared_ptr<ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface> ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_NestedNoPrefixInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ITestService::CompilerChecks::INoPrefixInterface::BpNestedNoPrefixInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<INestedNoPrefixInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ITestService::CompilerChecks::INoPrefixInterface::BpNestedNoPrefixInterface>(binder);
+}
+
+binder_status_t ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<INestedNoPrefixInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<INestedNoPrefixInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = INestedNoPrefixInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::setDefaultImpl(const std::shared_ptr<INestedNoPrefixInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!INestedNoPrefixInterface::default_impl);
+  if (impl) {
+    INestedNoPrefixInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface>& ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::getDefaultImpl() {
+  return INestedNoPrefixInterface::default_impl;
+}
+std::shared_ptr<ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface> ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::default_impl = nullptr;
+::ndk::ScopedAStatus ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterfaceDefault::foo() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ITestService.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ITestService.cpp.d
new file mode 100644
index 0000000..6cdbb1b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ITestService.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/ITestService.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IntEnum.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IntEnum.cpp
new file mode 100644
index 0000000..c2afc84
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IntEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IntEnum.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IntEnum.cpp.d
new file mode 100644
index 0000000..65e3972
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/IntEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/IntEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ListOfInterfaces.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ListOfInterfaces.cpp
new file mode 100644
index 0000000..a4702c6
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ListOfInterfaces.cpp
@@ -0,0 +1,487 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#include "aidl/android/aidl/tests/ListOfInterfaces.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ListOfInterfaces::descriptor = "android.aidl.tests.ListOfInterfaces";
+
+binder_status_t ListOfInterfaces::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ListOfInterfaces::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_ListOfInterfaces_IEmptyInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  (void)_aidl_binder;
+  (void)_aidl_code;
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ListOfInterfaces_IEmptyInterface_clazz = ::ndk::ICInterface::defineClass(ListOfInterfaces::IEmptyInterface::descriptor, _aidl_android_aidl_tests_ListOfInterfaces_IEmptyInterface_onTransact);
+
+ListOfInterfaces::BpEmptyInterface::BpEmptyInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ListOfInterfaces::BpEmptyInterface::~BpEmptyInterface() {}
+
+// Source for BnEmptyInterface
+ListOfInterfaces::BnEmptyInterface::BnEmptyInterface() {}
+ListOfInterfaces::BnEmptyInterface::~BnEmptyInterface() {}
+::ndk::SpAIBinder ListOfInterfaces::BnEmptyInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ListOfInterfaces_IEmptyInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IEmptyInterface
+const char* ListOfInterfaces::IEmptyInterface::descriptor = "android.aidl.tests.ListOfInterfaces.IEmptyInterface";
+ListOfInterfaces::IEmptyInterface::IEmptyInterface() {}
+ListOfInterfaces::IEmptyInterface::~IEmptyInterface() {}
+
+
+std::shared_ptr<ListOfInterfaces::IEmptyInterface> ListOfInterfaces::IEmptyInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ListOfInterfaces_IEmptyInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ListOfInterfaces::BpEmptyInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IEmptyInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ListOfInterfaces::BpEmptyInterface>(binder);
+}
+
+binder_status_t ListOfInterfaces::IEmptyInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<IEmptyInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ListOfInterfaces::IEmptyInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<IEmptyInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IEmptyInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ListOfInterfaces::IEmptyInterface::setDefaultImpl(const std::shared_ptr<IEmptyInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IEmptyInterface::default_impl);
+  if (impl) {
+    IEmptyInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ListOfInterfaces::IEmptyInterface>& ListOfInterfaces::IEmptyInterface::getDefaultImpl() {
+  return IEmptyInterface::default_impl;
+}
+std::shared_ptr<ListOfInterfaces::IEmptyInterface> ListOfInterfaces::IEmptyInterface::default_impl = nullptr;
+::ndk::SpAIBinder ListOfInterfaces::IEmptyInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ListOfInterfaces::IEmptyInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_ListOfInterfaces_IMyInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<ListOfInterfaces::BnMyInterface> _aidl_impl = std::static_pointer_cast<ListOfInterfaces::BnMyInterface>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*methodWithInterfaces*/): {
+      std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface> in_iface;
+      std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface> in_nullable_iface;
+      std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> in_iface_list_in;
+      std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> out_iface_list_out;
+      std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> in_iface_list_inout;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> in_nullable_iface_list_in;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> out_nullable_iface_list_out;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> in_nullable_iface_list_inout;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_iface);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_nullable_iface);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_iface_list_in);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_iface_list_inout);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_nullable_iface_list_in);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_nullable_iface_list_inout);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->methodWithInterfaces(in_iface, in_nullable_iface, in_iface_list_in, &out_iface_list_out, &in_iface_list_inout, in_nullable_iface_list_in, &out_nullable_iface_list_out, &in_nullable_iface_list_inout, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_iface_list_out);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_iface_list_inout);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, out_nullable_iface_list_out);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, in_nullable_iface_list_inout);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ListOfInterfaces_IMyInterface_clazz = ::ndk::ICInterface::defineClass(ListOfInterfaces::IMyInterface::descriptor, _aidl_android_aidl_tests_ListOfInterfaces_IMyInterface_onTransact);
+
+ListOfInterfaces::BpMyInterface::BpMyInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ListOfInterfaces::BpMyInterface::~BpMyInterface() {}
+
+::ndk::ScopedAStatus ListOfInterfaces::BpMyInterface::methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& in_iface, const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& in_nullable_iface, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& in_iface_list_in, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* out_iface_list_out, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* in_iface_list_inout, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& in_nullable_iface_list_in, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* out_nullable_iface_list_out, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* in_nullable_iface_list_inout, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_iface);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_nullable_iface);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_iface_list_in);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_iface_list_inout);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_nullable_iface_list_in);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), *in_nullable_iface_list_inout);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*methodWithInterfaces*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyInterface::getDefaultImpl()) {
+    _aidl_status = IMyInterface::getDefaultImpl()->methodWithInterfaces(in_iface, in_nullable_iface, in_iface_list_in, out_iface_list_out, in_iface_list_inout, in_nullable_iface_list_in, out_nullable_iface_list_out, in_nullable_iface_list_inout, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_iface_list_out);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_iface_list_inout);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), out_nullable_iface_list_out);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), in_nullable_iface_list_inout);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnMyInterface
+ListOfInterfaces::BnMyInterface::BnMyInterface() {}
+ListOfInterfaces::BnMyInterface::~BnMyInterface() {}
+::ndk::SpAIBinder ListOfInterfaces::BnMyInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ListOfInterfaces_IMyInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IMyInterface
+const char* ListOfInterfaces::IMyInterface::descriptor = "android.aidl.tests.ListOfInterfaces.IMyInterface";
+ListOfInterfaces::IMyInterface::IMyInterface() {}
+ListOfInterfaces::IMyInterface::~IMyInterface() {}
+
+
+std::shared_ptr<ListOfInterfaces::IMyInterface> ListOfInterfaces::IMyInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ListOfInterfaces_IMyInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ListOfInterfaces::BpMyInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IMyInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ListOfInterfaces::BpMyInterface>(binder);
+}
+
+binder_status_t ListOfInterfaces::IMyInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<IMyInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ListOfInterfaces::IMyInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<IMyInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IMyInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ListOfInterfaces::IMyInterface::setDefaultImpl(const std::shared_ptr<IMyInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IMyInterface::default_impl);
+  if (impl) {
+    IMyInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ListOfInterfaces::IMyInterface>& ListOfInterfaces::IMyInterface::getDefaultImpl() {
+  return IMyInterface::default_impl;
+}
+std::shared_ptr<ListOfInterfaces::IMyInterface> ListOfInterfaces::IMyInterface::default_impl = nullptr;
+::ndk::ScopedAStatus ListOfInterfaces::IMyInterfaceDefault::methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& /*in_iface*/, const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& /*in_nullable_iface*/, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& /*in_iface_list_in*/, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* /*out_iface_list_out*/, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* /*in_iface_list_inout*/, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& /*in_nullable_iface_list_in*/, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* /*out_nullable_iface_list_out*/, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* /*in_nullable_iface_list_inout*/, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder ListOfInterfaces::IMyInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ListOfInterfaces::IMyInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ListOfInterfaces::MyParcelable::descriptor = "android.aidl.tests.ListOfInterfaces.MyParcelable";
+
+binder_status_t ListOfInterfaces::MyParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &iface);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_iface);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &iface_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_iface_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ListOfInterfaces::MyParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, iface);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_iface);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, iface_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_iface_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ListOfInterfaces::MyUnion::descriptor = "android.aidl.tests.ListOfInterfaces.MyUnion";
+
+binder_status_t ListOfInterfaces::MyUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case iface: {
+    std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>) {
+      set<iface>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<iface>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case nullable_iface: {
+    std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readNullableData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>) {
+      set<nullable_iface>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<nullable_iface>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case iface_list: {
+    std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>) {
+      set<iface_list>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<iface_list>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case nullable_iface_list: {
+    std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readNullableData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>>) {
+      set<nullable_iface_list>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<nullable_iface_list>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t ListOfInterfaces::MyUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case iface: return ::ndk::AParcel_writeData(_parcel, get<iface>());
+  case nullable_iface: return ::ndk::AParcel_writeNullableData(_parcel, get<nullable_iface>());
+  case iface_list: return ::ndk::AParcel_writeData(_parcel, get<iface_list>());
+  case nullable_iface_list: return ::ndk::AParcel_writeNullableData(_parcel, get<nullable_iface_list>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d
new file mode 100644
index 0000000..29da8d1
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/ListOfInterfaces.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/LongEnum.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/LongEnum.cpp
new file mode 100644
index 0000000..62b922e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/LongEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/LongEnum.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/LongEnum.cpp.d
new file mode 100644
index 0000000..e26849e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/LongEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/LongEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/OtherParcelableForToString.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/OtherParcelableForToString.cpp
new file mode 100644
index 0000000..4a42487
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/OtherParcelableForToString.cpp
@@ -0,0 +1,53 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#include "aidl/android/aidl/tests/OtherParcelableForToString.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* OtherParcelableForToString::descriptor = "android.aidl.tests.OtherParcelableForToString";
+
+binder_status_t OtherParcelableForToString::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &field);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t OtherParcelableForToString::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, field);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d
new file mode 100644
index 0000000..d8682ff
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/OtherParcelableForToString.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ParcelableForToString.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ParcelableForToString.cpp
new file mode 100644
index 0000000..4808730
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ParcelableForToString.cpp
@@ -0,0 +1,273 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#include "aidl/android/aidl/tests/ParcelableForToString.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ParcelableForToString::descriptor = "android.aidl.tests.ParcelableForToString";
+
+binder_status_t ParcelableForToString::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &doubleValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &doubleArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &floatValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &floatArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &booleanValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &booleanArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &stringValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &stringArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &stringList);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcelableValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcelableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &enumValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &enumArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &nullArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &nullList);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcelableGeneric);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &unionValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ParcelableForToString::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, doubleValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, doubleArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, floatValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, floatArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, booleanValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, booleanArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, stringValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, stringArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, stringList);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcelableValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcelableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, enumValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, enumArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, nullArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, nullList);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcelableGeneric);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, unionValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ParcelableForToString.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ParcelableForToString.cpp.d
new file mode 100644
index 0000000..1d654df
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/ParcelableForToString.cpp.d
@@ -0,0 +1,10 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/ParcelableForToString.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/RecursiveList.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/RecursiveList.cpp
new file mode 100644
index 0000000..4c282e9
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/RecursiveList.cpp
@@ -0,0 +1,63 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#include "aidl/android/aidl/tests/RecursiveList.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* RecursiveList::descriptor = "android.aidl.tests.RecursiveList";
+
+binder_status_t RecursiveList::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &value);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &next);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t RecursiveList::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, value);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, next);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/RecursiveList.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/RecursiveList.cpp.d
new file mode 100644
index 0000000..d413961
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/RecursiveList.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/RecursiveList.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/StructuredParcelable.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/StructuredParcelable.cpp
new file mode 100644
index 0000000..3c396b1
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/StructuredParcelable.cpp
@@ -0,0 +1,628 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#include "aidl/android/aidl/tests/StructuredParcelable.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* StructuredParcelable::descriptor = "android.aidl.tests.StructuredParcelable";
+
+binder_status_t StructuredParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldContainThreeFs);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &f);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldBeJerry);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldBeByteBar);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldBeIntBar);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldBeLongBar);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldContainTwoByteFoos);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldContainTwoIntFoos);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldContainTwoLongFoos);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &stringDefaultsToFoo);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteDefaultsToFour);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intDefaultsToFive);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longDefaultsToNegativeSeven);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &booleanDefaultsToTrue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &charDefaultsToC);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &floatDefaultsToPi);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &doubleWithDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &arrayDefaultsTo123);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &arrayDefaultsToEmpty);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &boolDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &floatDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &doubleDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &checkDoubleFromFloat);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &checkStringArray1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &checkStringArray2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &int32_min);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &int32_max);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &int64_max);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &hexInt32_neg_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &ibinder);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &empty);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &int8_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &int32_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &int64_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &hexInt32_pos_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &hexInt64_pos_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_3);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_4);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_5);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_6);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_7);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_8);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_9);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_10);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &addString1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &addString2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldSetBit0AndBit2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &u);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &shouldBeConstS1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &defaultWithFoo);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t StructuredParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldContainThreeFs);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, f);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldBeJerry);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldBeByteBar);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldBeIntBar);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldBeLongBar);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldContainTwoByteFoos);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldContainTwoIntFoos);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldContainTwoLongFoos);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, stringDefaultsToFoo);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteDefaultsToFour);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intDefaultsToFive);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longDefaultsToNegativeSeven);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, booleanDefaultsToTrue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, charDefaultsToC);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, floatDefaultsToPi);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, doubleWithDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, arrayDefaultsTo123);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, arrayDefaultsToEmpty);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, boolDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, floatDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, doubleDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, checkDoubleFromFloat);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, checkStringArray1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, checkStringArray2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, int32_min);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, int32_max);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, int64_max);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, hexInt32_neg_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, ibinder);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, empty);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, int8_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, int32_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, int64_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, hexInt32_pos_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, hexInt64_pos_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_3);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_4);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_5);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_6);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_7);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_8);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_9);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_10);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, addString1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, addString2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldSetBit0AndBit2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, u);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, shouldBeConstS1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, defaultWithFoo);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* StructuredParcelable::Empty::descriptor = "android.aidl.tests.StructuredParcelable.Empty";
+
+binder_status_t StructuredParcelable::Empty::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t StructuredParcelable::Empty::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/StructuredParcelable.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/StructuredParcelable.cpp.d
new file mode 100644
index 0000000..7e7bdf7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/StructuredParcelable.cpp.d
@@ -0,0 +1,7 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/StructuredParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/Union.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/Union.cpp
new file mode 100644
index 0000000..026bfbe
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/Union.cpp
@@ -0,0 +1,112 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#include "aidl/android/aidl/tests/Union.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* Union::descriptor = "android.aidl.tests.Union";
+
+const char* Union::S1 = "a string constant in union";
+binder_status_t Union::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case ns: {
+    std::vector<int32_t> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::vector<int32_t>>) {
+      set<ns>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<ns>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case n: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<n>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<n>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case m: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<m>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<m>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case s: {
+    std::string _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::string>) {
+      set<s>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<s>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case ibinder: {
+    ::ndk::SpAIBinder _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readNullableData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::ndk::SpAIBinder>) {
+      set<ibinder>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<ibinder>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case ss: {
+    std::vector<std::string> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::vector<std::string>>) {
+      set<ss>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<ss>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case be: {
+    ::aidl::android::aidl::tests::ByteEnum _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::aidl::android::aidl::tests::ByteEnum>) {
+      set<be>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<be>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t Union::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case ns: return ::ndk::AParcel_writeData(_parcel, get<ns>());
+  case n: return ::ndk::AParcel_writeData(_parcel, get<n>());
+  case m: return ::ndk::AParcel_writeData(_parcel, get<m>());
+  case s: return ::ndk::AParcel_writeData(_parcel, get<s>());
+  case ibinder: return ::ndk::AParcel_writeNullableData(_parcel, get<ibinder>());
+  case ss: return ::ndk::AParcel_writeData(_parcel, get<ss>());
+  case be: return ::ndk::AParcel_writeData(_parcel, get<be>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/Union.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/Union.cpp.d
new file mode 100644
index 0000000..2892180
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/Union.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/Union.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/UnionWithFd.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/UnionWithFd.cpp
new file mode 100644
index 0000000..68571ef
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/UnionWithFd.cpp
@@ -0,0 +1,56 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#include "aidl/android/aidl/tests/UnionWithFd.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* UnionWithFd::descriptor = "android.aidl.tests.UnionWithFd";
+
+binder_status_t UnionWithFd::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case num: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<num>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<num>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case pfd: {
+    ::ndk::ScopedFileDescriptor _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::ndk::ScopedFileDescriptor>) {
+      set<pfd>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<pfd>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t UnionWithFd::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case num: return ::ndk::AParcel_writeData(_parcel, get<num>());
+  case pfd: return ::ndk::AParcel_writeData(_parcel, get<pfd>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/UnionWithFd.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/UnionWithFd.cpp.d
new file mode 100644
index 0000000..a696bc6
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/UnionWithFd.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/UnionWithFd.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp
new file mode 100644
index 0000000..9b05c83
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp
@@ -0,0 +1,95 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#include "aidl/android/aidl/tests/extension/ExtendableParcelable.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+const char* ExtendableParcelable::descriptor = "android.aidl.tests.extension.ExtendableParcelable";
+
+binder_status_t ExtendableParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &ext);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &c);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &ext2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ExtendableParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, ext);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, c);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, ext2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d
new file mode 100644
index 0000000..92a1e5e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt.cpp
new file mode 100644
index 0000000..13f2718
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt.cpp
@@ -0,0 +1,65 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#include "aidl/android/aidl/tests/extension/MyExt.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+const char* MyExt::descriptor = "android.aidl.tests.extension.MyExt";
+
+binder_status_t MyExt::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t MyExt::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt.cpp.d
new file mode 100644
index 0000000..c15eb09
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt2.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt2.cpp
new file mode 100644
index 0000000..15321fd
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt2.cpp
@@ -0,0 +1,75 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#include "aidl/android/aidl/tests/extension/MyExt2.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+const char* MyExt2::descriptor = "android.aidl.tests.extension.MyExt2";
+
+binder_status_t MyExt2::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &c);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t MyExt2::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, c);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt2.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt2.cpp.d
new file mode 100644
index 0000000..4d6062c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt2.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt2.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExtLike.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExtLike.cpp
new file mode 100644
index 0000000..070f719
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExtLike.cpp
@@ -0,0 +1,65 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#include "aidl/android/aidl/tests/extension/MyExtLike.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+const char* MyExtLike::descriptor = "android.aidl.tests.extension.MyExtLike";
+
+binder_status_t MyExtLike::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t MyExtLike::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d
new file mode 100644
index 0000000..512292d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExtLike.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/DeeplyNested.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/DeeplyNested.cpp
new file mode 100644
index 0000000..1263acc
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/DeeplyNested.cpp
@@ -0,0 +1,203 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#include "aidl/android/aidl/tests/nested/DeeplyNested.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+const char* DeeplyNested::descriptor = "android.aidl.tests.nested.DeeplyNested";
+
+binder_status_t DeeplyNested::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t DeeplyNested::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+const char* DeeplyNested::A::descriptor = "android.aidl.tests.nested.DeeplyNested.A";
+
+binder_status_t DeeplyNested::A::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &e);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t DeeplyNested::A::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, e);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+const char* DeeplyNested::B::descriptor = "android.aidl.tests.nested.DeeplyNested.B";
+
+binder_status_t DeeplyNested::B::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t DeeplyNested::B::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+const char* DeeplyNested::B::C::descriptor = "android.aidl.tests.nested.DeeplyNested.B.C";
+
+binder_status_t DeeplyNested::B::C::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t DeeplyNested::B::C::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+const char* DeeplyNested::B::C::D::descriptor = "android.aidl.tests.nested.DeeplyNested.B.C.D";
+
+binder_status_t DeeplyNested::B::C::D::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t DeeplyNested::B::C::D::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d
new file mode 100644
index 0000000..5965970
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/DeeplyNested.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/INestedService.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/INestedService.cpp
new file mode 100644
index 0000000..0ec9154
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/INestedService.cpp
@@ -0,0 +1,419 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#include "aidl/android/aidl/tests/nested/INestedService.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/tests/nested/BnNestedService.h>
+#include <aidl/android/aidl/tests/nested/BpNestedService.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+static binder_status_t _aidl_android_aidl_tests_nested_INestedService_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnNestedService> _aidl_impl = std::static_pointer_cast<BnNestedService>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*flipStatus*/): {
+      ::aidl::android::aidl::tests::nested::ParcelableWithNested in_p;
+      ::aidl::android::aidl::tests::nested::INestedService::Result _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_p);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->flipStatus(in_p, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*flipStatusWithCallback*/): {
+      ::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status;
+      std::shared_ptr<::aidl::android::aidl::tests::nested::INestedService::ICallback> in_cb;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_status);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_cb);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->flipStatusWithCallback(in_status, in_cb);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_nested_INestedService_clazz = ::ndk::ICInterface::defineClass(INestedService::descriptor, _aidl_android_aidl_tests_nested_INestedService_onTransact);
+
+BpNestedService::BpNestedService(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpNestedService::~BpNestedService() {}
+
+::ndk::ScopedAStatus BpNestedService::flipStatus(const ::aidl::android::aidl::tests::nested::ParcelableWithNested& in_p, ::aidl::android::aidl::tests::nested::INestedService::Result* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_p);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*flipStatus*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && INestedService::getDefaultImpl()) {
+    _aidl_status = INestedService::getDefaultImpl()->flipStatus(in_p, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpNestedService::flipStatusWithCallback(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status, const std::shared_ptr<::aidl::android::aidl::tests::nested::INestedService::ICallback>& in_cb) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_status);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_cb);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*flipStatusWithCallback*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && INestedService::getDefaultImpl()) {
+    _aidl_status = INestedService::getDefaultImpl()->flipStatusWithCallback(in_status, in_cb);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnNestedService
+BnNestedService::BnNestedService() {}
+BnNestedService::~BnNestedService() {}
+::ndk::SpAIBinder BnNestedService::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_nested_INestedService_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for INestedService
+const char* INestedService::descriptor = "android.aidl.tests.nested.INestedService";
+INestedService::INestedService() {}
+INestedService::~INestedService() {}
+
+
+std::shared_ptr<INestedService> INestedService::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_nested_INestedService_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpNestedService>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<INestedService>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpNestedService>(binder);
+}
+
+binder_status_t INestedService::writeToParcel(AParcel* parcel, const std::shared_ptr<INestedService>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t INestedService::readFromParcel(const AParcel* parcel, std::shared_ptr<INestedService>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = INestedService::fromBinder(binder);
+  return STATUS_OK;
+}
+bool INestedService::setDefaultImpl(const std::shared_ptr<INestedService>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!INestedService::default_impl);
+  if (impl) {
+    INestedService::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<INestedService>& INestedService::getDefaultImpl() {
+  return INestedService::default_impl;
+}
+std::shared_ptr<INestedService> INestedService::default_impl = nullptr;
+::ndk::ScopedAStatus INestedServiceDefault::flipStatus(const ::aidl::android::aidl::tests::nested::ParcelableWithNested& /*in_p*/, ::aidl::android::aidl::tests::nested::INestedService::Result* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus INestedServiceDefault::flipStatusWithCallback(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status /*in_status*/, const std::shared_ptr<::aidl::android::aidl::tests::nested::INestedService::ICallback>& /*in_cb*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder INestedServiceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool INestedServiceDefault::isRemote() {
+  return false;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+const char* INestedService::Result::descriptor = "android.aidl.tests.nested.INestedService.Result";
+
+binder_status_t INestedService::Result::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &status);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t INestedService::Result::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, status);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+static binder_status_t _aidl_android_aidl_tests_nested_INestedService_ICallback_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<INestedService::BnCallback> _aidl_impl = std::static_pointer_cast<INestedService::BnCallback>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*done*/): {
+      ::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_status);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->done(in_status);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_nested_INestedService_ICallback_clazz = ::ndk::ICInterface::defineClass(INestedService::ICallback::descriptor, _aidl_android_aidl_tests_nested_INestedService_ICallback_onTransact);
+
+INestedService::BpCallback::BpCallback(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+INestedService::BpCallback::~BpCallback() {}
+
+::ndk::ScopedAStatus INestedService::BpCallback::done(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_status);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*done*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ICallback::getDefaultImpl()) {
+    _aidl_status = ICallback::getDefaultImpl()->done(in_status);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnCallback
+INestedService::BnCallback::BnCallback() {}
+INestedService::BnCallback::~BnCallback() {}
+::ndk::SpAIBinder INestedService::BnCallback::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_nested_INestedService_ICallback_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for ICallback
+const char* INestedService::ICallback::descriptor = "android.aidl.tests.nested.INestedService.ICallback";
+INestedService::ICallback::ICallback() {}
+INestedService::ICallback::~ICallback() {}
+
+
+std::shared_ptr<INestedService::ICallback> INestedService::ICallback::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_nested_INestedService_ICallback_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<INestedService::BpCallback>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<ICallback>(interface);
+  }
+  return ::ndk::SharedRefBase::make<INestedService::BpCallback>(binder);
+}
+
+binder_status_t INestedService::ICallback::writeToParcel(AParcel* parcel, const std::shared_ptr<ICallback>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t INestedService::ICallback::readFromParcel(const AParcel* parcel, std::shared_ptr<ICallback>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = ICallback::fromBinder(binder);
+  return STATUS_OK;
+}
+bool INestedService::ICallback::setDefaultImpl(const std::shared_ptr<ICallback>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!ICallback::default_impl);
+  if (impl) {
+    ICallback::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<INestedService::ICallback>& INestedService::ICallback::getDefaultImpl() {
+  return ICallback::default_impl;
+}
+std::shared_ptr<INestedService::ICallback> INestedService::ICallback::default_impl = nullptr;
+::ndk::ScopedAStatus INestedService::ICallbackDefault::done(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status /*in_status*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder INestedService::ICallbackDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool INestedService::ICallbackDefault::isRemote() {
+  return false;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/INestedService.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/INestedService.cpp.d
new file mode 100644
index 0000000..0481ef2
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/INestedService.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/INestedService.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp
new file mode 100644
index 0000000..d81941d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp
@@ -0,0 +1,55 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#include "aidl/android/aidl/tests/nested/ParcelableWithNested.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+const char* ParcelableWithNested::descriptor = "android.aidl.tests.nested.ParcelableWithNested";
+
+binder_status_t ParcelableWithNested::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &status);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ParcelableWithNested::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, status);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d
new file mode 100644
index 0000000..ce5f36a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/EnumUnion.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/EnumUnion.cpp
new file mode 100644
index 0000000..9b6af60
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/EnumUnion.cpp
@@ -0,0 +1,75 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#include "aidl/android/aidl/tests/unions/EnumUnion.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+const char* EnumUnion::descriptor = "android.aidl.tests.unions.EnumUnion";
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+binder_status_t EnumUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case intEnum: {
+    ::aidl::android::aidl::tests::IntEnum _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::aidl::android::aidl::tests::IntEnum>) {
+      set<intEnum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intEnum>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case longEnum: {
+    ::aidl::android::aidl::tests::LongEnum _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::aidl::android::aidl::tests::LongEnum>) {
+      set<longEnum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<longEnum>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case deprecatedField: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<deprecatedField>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<deprecatedField>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t EnumUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case intEnum: return ::ndk::AParcel_writeData(_parcel, get<intEnum>());
+  case longEnum: return ::ndk::AParcel_writeData(_parcel, get<longEnum>());
+  #pragma clang diagnostic push
+  #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+  case deprecatedField: return ::ndk::AParcel_writeData(_parcel, get<deprecatedField>());
+  #pragma clang diagnostic pop
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+#pragma clang diagnostic pop
+
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d
new file mode 100644
index 0000000..9ad133c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/EnumUnion.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/UnionInUnion.cpp b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/UnionInUnion.cpp
new file mode 100644
index 0000000..fbdc456
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/UnionInUnion.cpp
@@ -0,0 +1,58 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#include "aidl/android/aidl/tests/unions/UnionInUnion.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+const char* UnionInUnion::descriptor = "android.aidl.tests.unions.UnionInUnion";
+
+binder_status_t UnionInUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case first: {
+    ::aidl::android::aidl::tests::unions::EnumUnion _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::aidl::android::aidl::tests::unions::EnumUnion>) {
+      set<first>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<first>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case second: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<second>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<second>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t UnionInUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case first: return ::ndk::AParcel_writeData(_parcel, get<first>());
+  case second: return ::ndk::AParcel_writeData(_parcel, get<second>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d
new file mode 100644
index 0000000..37113d9
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d
@@ -0,0 +1,5 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/UnionInUnion.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ArrayOfInterfaces.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ArrayOfInterfaces.h
new file mode 100644
index 0000000..f266545
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ArrayOfInterfaces.h
@@ -0,0 +1,333 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_ibinder.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/ArrayOfInterfaces.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class ArrayOfInterfaces {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  class IEmptyInterfaceDelegator;
+
+  class IEmptyInterface : public ::ndk::ICInterface {
+  public:
+    typedef IEmptyInterfaceDelegator DefaultDelegator;
+    static const char* descriptor;
+    IEmptyInterface();
+    virtual ~IEmptyInterface();
+
+
+    static std::shared_ptr<IEmptyInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IEmptyInterface>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IEmptyInterface>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<IEmptyInterface>& impl);
+    static const std::shared_ptr<IEmptyInterface>& getDefaultImpl();
+  private:
+    static std::shared_ptr<IEmptyInterface> default_impl;
+  };
+  class IEmptyInterfaceDefault : public IEmptyInterface {
+  public:
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpEmptyInterface : public ::ndk::BpCInterface<IEmptyInterface> {
+  public:
+    explicit BpEmptyInterface(const ::ndk::SpAIBinder& binder);
+    virtual ~BpEmptyInterface();
+
+  };
+  class BnEmptyInterface : public ::ndk::BnCInterface<IEmptyInterface> {
+  public:
+    BnEmptyInterface();
+    virtual ~BnEmptyInterface();
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  class IMyInterfaceDelegator;
+
+  class IMyInterface : public ::ndk::ICInterface {
+  public:
+    typedef IMyInterfaceDelegator DefaultDelegator;
+    static const char* descriptor;
+    IMyInterface();
+    virtual ~IMyInterface();
+
+    static constexpr uint32_t TRANSACTION_methodWithInterfaces = FIRST_CALL_TRANSACTION + 0;
+
+    static std::shared_ptr<IMyInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IMyInterface>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IMyInterface>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<IMyInterface>& impl);
+    static const std::shared_ptr<IMyInterface>& getDefaultImpl();
+    virtual ::ndk::ScopedAStatus methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& in_iface, const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& in_nullable_iface, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& in_iface_array_in, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* out_iface_array_out, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* in_iface_array_inout, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& in_nullable_iface_array_in, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* out_nullable_iface_array_out, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* in_nullable_iface_array_inout, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) = 0;
+  private:
+    static std::shared_ptr<IMyInterface> default_impl;
+  };
+  class IMyInterfaceDefault : public IMyInterface {
+  public:
+    ::ndk::ScopedAStatus methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& in_iface, const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& in_nullable_iface, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& in_iface_array_in, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* out_iface_array_out, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* in_iface_array_inout, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& in_nullable_iface_array_in, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* out_nullable_iface_array_out, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* in_nullable_iface_array_inout, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) override;
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpMyInterface : public ::ndk::BpCInterface<IMyInterface> {
+  public:
+    explicit BpMyInterface(const ::ndk::SpAIBinder& binder);
+    virtual ~BpMyInterface();
+
+    ::ndk::ScopedAStatus methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& in_iface, const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& in_nullable_iface, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& in_iface_array_in, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* out_iface_array_out, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* in_iface_array_inout, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& in_nullable_iface_array_in, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* out_nullable_iface_array_out, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* in_nullable_iface_array_inout, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) override;
+  };
+  class BnMyInterface : public ::ndk::BnCInterface<IMyInterface> {
+  public:
+    BnMyInterface();
+    virtual ~BnMyInterface();
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  class MyParcelable {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> iface;
+    std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> nullable_iface;
+    std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> iface_array;
+    std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> nullable_iface_array;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) != std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator<(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) < std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator<=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) <= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator==(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) == std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator>(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) > std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator>=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) >= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyParcelable{";
+      os << "iface: " << ::android::internal::ToString(iface);
+      os << ", nullable_iface: " << ::android::internal::ToString(nullable_iface);
+      os << ", iface_array: " << ::android::internal::ToString(iface_array);
+      os << ", nullable_iface_array: " << ::android::internal::ToString(nullable_iface_array);
+      os << "}";
+      return os.str();
+    }
+  };
+  class MyUnion {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    enum class Tag : int32_t {
+      iface = 0,
+      nullable_iface = 1,
+      iface_array = 2,
+      nullable_iface_array = 3,
+    };
+
+    // Expose tag symbols for legacy code
+    static const inline Tag iface = Tag::iface;
+    static const inline Tag nullable_iface = Tag::nullable_iface;
+    static const inline Tag iface_array = Tag::iface_array;
+    static const inline Tag nullable_iface_array = Tag::nullable_iface_array;
+
+    template<typename _Tp>
+    static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, MyUnion>;
+
+    MyUnion() : _value(std::in_place_index<static_cast<size_t>(iface)>, std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>()) { }
+
+    template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+    // NOLINTNEXTLINE(google-explicit-constructor)
+    constexpr MyUnion(_Tp&& _arg)
+        : _value(std::forward<_Tp>(_arg)) {}
+
+    template <size_t _Np, typename... _Tp>
+    constexpr explicit MyUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+        : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+    template <Tag _tag, typename... _Tp>
+    static MyUnion make(_Tp&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+    }
+
+    template <Tag _tag, typename _Tp, typename... _Up>
+    static MyUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+    }
+
+    Tag getTag() const {
+      return static_cast<Tag>(_value.index());
+    }
+
+    template <Tag _tag>
+    const auto& get() const {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag>
+    auto& get() {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag, typename... _Tp>
+    void set(_Tp&&... _args) {
+      _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+    }
+
+    binder_status_t readFromParcel(const AParcel* _parcel);
+    binder_status_t writeToParcel(AParcel* _parcel) const;
+
+    inline bool operator!=(const MyUnion& rhs) const {
+      return _value != rhs._value;
+    }
+    inline bool operator<(const MyUnion& rhs) const {
+      return _value < rhs._value;
+    }
+    inline bool operator<=(const MyUnion& rhs) const {
+      return _value <= rhs._value;
+    }
+    inline bool operator==(const MyUnion& rhs) const {
+      return _value == rhs._value;
+    }
+    inline bool operator>(const MyUnion& rhs) const {
+      return _value > rhs._value;
+    }
+    inline bool operator>=(const MyUnion& rhs) const {
+      return _value >= rhs._value;
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyUnion{";
+      switch (getTag()) {
+      case iface: os << "iface: " << ::android::internal::ToString(get<iface>()); break;
+      case nullable_iface: os << "nullable_iface: " << ::android::internal::ToString(get<nullable_iface>()); break;
+      case iface_array: os << "iface_array: " << ::android::internal::ToString(get<iface_array>()); break;
+      case nullable_iface_array: os << "nullable_iface_array: " << ::android::internal::ToString(get<nullable_iface_array>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    std::variant<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>, std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>> _value;
+  };
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const ArrayOfInterfaces&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const ArrayOfInterfaces&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const ArrayOfInterfaces&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const ArrayOfInterfaces&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const ArrayOfInterfaces&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const ArrayOfInterfaces&) const {
+    return std::tie() >= std::tie();
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ArrayOfInterfaces{";
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ArrayOfInterfaces::MyUnion::Tag val) {
+  switch(val) {
+  case ArrayOfInterfaces::MyUnion::Tag::iface:
+    return "iface";
+  case ArrayOfInterfaces::MyUnion::Tag::nullable_iface:
+    return "nullable_iface";
+  case ArrayOfInterfaces::MyUnion::Tag::iface_array:
+    return "iface_array";
+  case ArrayOfInterfaces::MyUnion::Tag::nullable_iface_array:
+    return "nullable_iface_array";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag, 4> enum_values<aidl::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag> = {
+  aidl::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::iface,
+  aidl::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::nullable_iface,
+  aidl::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::iface_array,
+  aidl::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::nullable_iface_array,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BackendType.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BackendType.h
new file mode 100644
index 0000000..bca8a65
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BackendType.h
@@ -0,0 +1,68 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+enum class BackendType : int8_t {
+  CPP = 0,
+  JAVA = 1,
+  NDK = 2,
+  RUST = 3,
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(BackendType val) {
+  switch(val) {
+  case BackendType::CPP:
+    return "CPP";
+  case BackendType::JAVA:
+    return "JAVA";
+  case BackendType::NDK:
+    return "NDK";
+  case BackendType::RUST:
+    return "RUST";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::BackendType, 4> enum_values<aidl::android::aidl::tests::BackendType> = {
+  aidl::android::aidl::tests::BackendType::CPP,
+  aidl::android::aidl::tests::BackendType::JAVA,
+  aidl::android::aidl::tests::BackendType::NDK,
+  aidl::android::aidl::tests::BackendType::RUST,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnArrayOfInterfaces.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnArrayOfInterfaces.h
new file mode 100644
index 0000000..c1dc818
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnArrayOfInterfaces.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnBackendType.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnBackendType.h
new file mode 100644
index 0000000..124fac4
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnBackendType.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnByteEnum.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnByteEnum.h
new file mode 100644
index 0000000..e9b0f45
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnByteEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnCircular.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnCircular.h
new file mode 100644
index 0000000..5f63edf
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnCircular.h
@@ -0,0 +1,46 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/ICircular.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BnCircular : public ::ndk::BnCInterface<ICircular> {
+public:
+  BnCircular();
+  virtual ~BnCircular();
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class ICircularDelegator : public BnCircular {
+public:
+  explicit ICircularDelegator(const std::shared_ptr<ICircular> &impl) : _impl(impl) {
+  }
+
+  ::ndk::ScopedAStatus GetTestService(std::shared_ptr<::aidl::android::aidl::tests::ITestService>* _aidl_return) override {
+    return _impl->GetTestService(_aidl_return);
+  }
+protected:
+private:
+  std::shared_ptr<ICircular> _impl;
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnCircularParcelable.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnCircularParcelable.h
new file mode 100644
index 0000000..6b973ed
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnCircularParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnConstantExpressionEnum.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnConstantExpressionEnum.h
new file mode 100644
index 0000000..ed4a5e8
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnConstantExpressionEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecated.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecated.h
new file mode 100644
index 0000000..c1647fe
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecated.h
@@ -0,0 +1,43 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/IDeprecated.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class __attribute__((deprecated("test"))) BnDeprecated : public ::ndk::BnCInterface<IDeprecated> {
+public:
+  BnDeprecated();
+  virtual ~BnDeprecated();
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class __attribute__((deprecated("test"))) IDeprecatedDelegator : public BnDeprecated {
+public:
+  explicit IDeprecatedDelegator(const std::shared_ptr<IDeprecated> &impl) : _impl(impl) {
+  }
+
+protected:
+private:
+  std::shared_ptr<IDeprecated> _impl;
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecatedEnum.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecatedEnum.h
new file mode 100644
index 0000000..7910387
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecatedEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecatedParcelable.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecatedParcelable.h
new file mode 100644
index 0000000..ab17001
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecatedParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnFixedSize.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnFixedSize.h
new file mode 100644
index 0000000..2102f06
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnFixedSize.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnGenericStructuredParcelable.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnGenericStructuredParcelable.h
new file mode 100644
index 0000000..2d0984d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnGenericStructuredParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnIntEnum.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnIntEnum.h
new file mode 100644
index 0000000..0cb3e7e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnIntEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnListOfInterfaces.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnListOfInterfaces.h
new file mode 100644
index 0000000..d67e153
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnListOfInterfaces.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnLongEnum.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnLongEnum.h
new file mode 100644
index 0000000..364dbaf
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnLongEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnNamedCallback.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnNamedCallback.h
new file mode 100644
index 0000000..3d5af79
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnNamedCallback.h
@@ -0,0 +1,46 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/INamedCallback.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BnNamedCallback : public ::ndk::BnCInterface<INamedCallback> {
+public:
+  BnNamedCallback();
+  virtual ~BnNamedCallback();
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class INamedCallbackDelegator : public BnNamedCallback {
+public:
+  explicit INamedCallbackDelegator(const std::shared_ptr<INamedCallback> &impl) : _impl(impl) {
+  }
+
+  ::ndk::ScopedAStatus GetName(std::string* _aidl_return) override {
+    return _impl->GetName(_aidl_return);
+  }
+protected:
+private:
+  std::shared_ptr<INamedCallback> _impl;
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnNewName.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnNewName.h
new file mode 100644
index 0000000..ef00282
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnNewName.h
@@ -0,0 +1,46 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/INewName.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BnNewName : public ::ndk::BnCInterface<INewName> {
+public:
+  BnNewName();
+  virtual ~BnNewName();
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class INewNameDelegator : public BnNewName {
+public:
+  explicit INewNameDelegator(const std::shared_ptr<INewName> &impl) : _impl(impl) {
+  }
+
+  ::ndk::ScopedAStatus RealName(std::string* _aidl_return) override {
+    return _impl->RealName(_aidl_return);
+  }
+protected:
+private:
+  std::shared_ptr<INewName> _impl;
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnOldName.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnOldName.h
new file mode 100644
index 0000000..af49cab
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnOldName.h
@@ -0,0 +1,46 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/IOldName.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BnOldName : public ::ndk::BnCInterface<IOldName> {
+public:
+  BnOldName();
+  virtual ~BnOldName();
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class IOldNameDelegator : public BnOldName {
+public:
+  explicit IOldNameDelegator(const std::shared_ptr<IOldName> &impl) : _impl(impl) {
+  }
+
+  ::ndk::ScopedAStatus RealName(std::string* _aidl_return) override {
+    return _impl->RealName(_aidl_return);
+  }
+protected:
+private:
+  std::shared_ptr<IOldName> _impl;
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnOtherParcelableForToString.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnOtherParcelableForToString.h
new file mode 100644
index 0000000..2f031bc
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnOtherParcelableForToString.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnParcelableForToString.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnParcelableForToString.h
new file mode 100644
index 0000000..bbe83a7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnParcelableForToString.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnRecursiveList.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnRecursiveList.h
new file mode 100644
index 0000000..27b58c5
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnRecursiveList.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnStructuredParcelable.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnStructuredParcelable.h
new file mode 100644
index 0000000..3f2b153
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnStructuredParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnTestService.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnTestService.h
new file mode 100644
index 0000000..690e9cd
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnTestService.h
@@ -0,0 +1,247 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/ITestService.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BnTestService : public ::ndk::BnCInterface<ITestService> {
+public:
+  BnTestService();
+  virtual ~BnTestService();
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class ITestServiceDelegator : public BnTestService {
+public:
+  explicit ITestServiceDelegator(const std::shared_ptr<ITestService> &impl) : _impl(impl) {
+  }
+
+  ::ndk::ScopedAStatus UnimplementedMethod(int32_t in_arg, int32_t* _aidl_return) override {
+    return _impl->UnimplementedMethod(in_arg, _aidl_return);
+  }
+  ::ndk::ScopedAStatus Deprecated() override __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"))) {
+    return _impl->Deprecated();
+  }
+  ::ndk::ScopedAStatus TestOneway() override {
+    return _impl->TestOneway();
+  }
+  ::ndk::ScopedAStatus RepeatBoolean(bool in_token, bool* _aidl_return) override {
+    return _impl->RepeatBoolean(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatByte(int8_t in_token, int8_t* _aidl_return) override {
+    return _impl->RepeatByte(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatChar(char16_t in_token, char16_t* _aidl_return) override {
+    return _impl->RepeatChar(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatInt(int32_t in_token, int32_t* _aidl_return) override {
+    return _impl->RepeatInt(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatLong(int64_t in_token, int64_t* _aidl_return) override {
+    return _impl->RepeatLong(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatFloat(float in_token, float* _aidl_return) override {
+    return _impl->RepeatFloat(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatDouble(double in_token, double* _aidl_return) override {
+    return _impl->RepeatDouble(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatString(const std::string& in_token, std::string* _aidl_return) override {
+    return _impl->RepeatString(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatByteEnum(::aidl::android::aidl::tests::ByteEnum in_token, ::aidl::android::aidl::tests::ByteEnum* _aidl_return) override {
+    return _impl->RepeatByteEnum(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatIntEnum(::aidl::android::aidl::tests::IntEnum in_token, ::aidl::android::aidl::tests::IntEnum* _aidl_return) override {
+    return _impl->RepeatIntEnum(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatLongEnum(::aidl::android::aidl::tests::LongEnum in_token, ::aidl::android::aidl::tests::LongEnum* _aidl_return) override {
+    return _impl->RepeatLongEnum(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseBoolean(const std::vector<bool>& in_input, std::vector<bool>* out_repeated, std::vector<bool>* _aidl_return) override {
+    return _impl->ReverseBoolean(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseByte(const std::vector<uint8_t>& in_input, std::vector<uint8_t>* out_repeated, std::vector<uint8_t>* _aidl_return) override {
+    return _impl->ReverseByte(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseChar(const std::vector<char16_t>& in_input, std::vector<char16_t>* out_repeated, std::vector<char16_t>* _aidl_return) override {
+    return _impl->ReverseChar(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseInt(const std::vector<int32_t>& in_input, std::vector<int32_t>* out_repeated, std::vector<int32_t>* _aidl_return) override {
+    return _impl->ReverseInt(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseLong(const std::vector<int64_t>& in_input, std::vector<int64_t>* out_repeated, std::vector<int64_t>* _aidl_return) override {
+    return _impl->ReverseLong(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseFloat(const std::vector<float>& in_input, std::vector<float>* out_repeated, std::vector<float>* _aidl_return) override {
+    return _impl->ReverseFloat(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseDouble(const std::vector<double>& in_input, std::vector<double>* out_repeated, std::vector<double>* _aidl_return) override {
+    return _impl->ReverseDouble(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override {
+    return _impl->ReverseString(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseByteEnum(const std::vector<::aidl::android::aidl::tests::ByteEnum>& in_input, std::vector<::aidl::android::aidl::tests::ByteEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::ByteEnum>* _aidl_return) override {
+    return _impl->ReverseByteEnum(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseIntEnum(const std::vector<::aidl::android::aidl::tests::IntEnum>& in_input, std::vector<::aidl::android::aidl::tests::IntEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::IntEnum>* _aidl_return) override {
+    return _impl->ReverseIntEnum(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseLongEnum(const std::vector<::aidl::android::aidl::tests::LongEnum>& in_input, std::vector<::aidl::android::aidl::tests::LongEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::LongEnum>* _aidl_return) override {
+    return _impl->ReverseLongEnum(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus GetOtherTestService(const std::string& in_name, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) override {
+    return _impl->GetOtherTestService(in_name, _aidl_return);
+  }
+  ::ndk::ScopedAStatus SetOtherTestService(const std::string& in_name, const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, bool* _aidl_return) override {
+    return _impl->SetOtherTestService(in_name, in_service, _aidl_return);
+  }
+  ::ndk::ScopedAStatus VerifyName(const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, const std::string& in_name, bool* _aidl_return) override {
+    return _impl->VerifyName(in_service, in_name, _aidl_return);
+  }
+  ::ndk::ScopedAStatus GetInterfaceArray(const std::vector<std::string>& in_names, std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>* _aidl_return) override {
+    return _impl->GetInterfaceArray(in_names, _aidl_return);
+  }
+  ::ndk::ScopedAStatus VerifyNamesWithInterfaceArray(const std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>& in_services, const std::vector<std::string>& in_names, bool* _aidl_return) override {
+    return _impl->VerifyNamesWithInterfaceArray(in_services, in_names, _aidl_return);
+  }
+  ::ndk::ScopedAStatus GetNullableInterfaceArray(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) override {
+    return _impl->GetNullableInterfaceArray(in_names, _aidl_return);
+  }
+  ::ndk::ScopedAStatus VerifyNamesWithNullableInterfaceArray(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) override {
+    return _impl->VerifyNamesWithNullableInterfaceArray(in_services, in_names, _aidl_return);
+  }
+  ::ndk::ScopedAStatus GetInterfaceList(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) override {
+    return _impl->GetInterfaceList(in_names, _aidl_return);
+  }
+  ::ndk::ScopedAStatus VerifyNamesWithInterfaceList(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) override {
+    return _impl->VerifyNamesWithInterfaceList(in_services, in_names, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseStringList(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override {
+    return _impl->ReverseStringList(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatParcelFileDescriptor(const ::ndk::ScopedFileDescriptor& in_read, ::ndk::ScopedFileDescriptor* _aidl_return) override {
+    return _impl->RepeatParcelFileDescriptor(in_read, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseParcelFileDescriptorArray(const std::vector<::ndk::ScopedFileDescriptor>& in_input, std::vector<::ndk::ScopedFileDescriptor>* out_repeated, std::vector<::ndk::ScopedFileDescriptor>* _aidl_return) override {
+    return _impl->ReverseParcelFileDescriptorArray(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ThrowServiceException(int32_t in_code) override {
+    return _impl->ThrowServiceException(in_code);
+  }
+  ::ndk::ScopedAStatus RepeatNullableIntArray(const std::optional<std::vector<int32_t>>& in_input, std::optional<std::vector<int32_t>>* _aidl_return) override {
+    return _impl->RepeatNullableIntArray(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableByteEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>* _aidl_return) override {
+    return _impl->RepeatNullableByteEnumArray(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableIntEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>* _aidl_return) override {
+    return _impl->RepeatNullableIntEnumArray(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableLongEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>* _aidl_return) override {
+    return _impl->RepeatNullableLongEnumArray(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableString(const std::optional<std::string>& in_input, std::optional<std::string>* _aidl_return) override {
+    return _impl->RepeatNullableString(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override {
+    return _impl->RepeatNullableStringList(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableParcelable(const std::optional<::aidl::android::aidl::tests::ITestService::Empty>& in_input, std::optional<::aidl::android::aidl::tests::ITestService::Empty>* _aidl_return) override {
+    return _impl->RepeatNullableParcelable(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableParcelableArray(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override {
+    return _impl->RepeatNullableParcelableArray(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableParcelableList(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override {
+    return _impl->RepeatNullableParcelableList(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus TakesAnIBinder(const ::ndk::SpAIBinder& in_input) override {
+    return _impl->TakesAnIBinder(in_input);
+  }
+  ::ndk::ScopedAStatus TakesANullableIBinder(const ::ndk::SpAIBinder& in_input) override {
+    return _impl->TakesANullableIBinder(in_input);
+  }
+  ::ndk::ScopedAStatus TakesAnIBinderList(const std::vector<::ndk::SpAIBinder>& in_input) override {
+    return _impl->TakesAnIBinderList(in_input);
+  }
+  ::ndk::ScopedAStatus TakesANullableIBinderList(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input) override {
+    return _impl->TakesANullableIBinderList(in_input);
+  }
+  ::ndk::ScopedAStatus RepeatUtf8CppString(const std::string& in_token, std::string* _aidl_return) override {
+    return _impl->RepeatUtf8CppString(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableUtf8CppString(const std::optional<std::string>& in_token, std::optional<std::string>* _aidl_return) override {
+    return _impl->RepeatNullableUtf8CppString(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseUtf8CppString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override {
+    return _impl->ReverseUtf8CppString(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseNullableUtf8CppString(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override {
+    return _impl->ReverseNullableUtf8CppString(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseUtf8CppStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override {
+    return _impl->ReverseUtf8CppStringList(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus GetCallback(bool in_return_null, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) override {
+    return _impl->GetCallback(in_return_null, _aidl_return);
+  }
+  ::ndk::ScopedAStatus FillOutStructuredParcelable(::aidl::android::aidl::tests::StructuredParcelable* in_parcel) override {
+    return _impl->FillOutStructuredParcelable(in_parcel);
+  }
+  ::ndk::ScopedAStatus RepeatExtendableParcelable(const ::aidl::android::aidl::tests::extension::ExtendableParcelable& in_ep, ::aidl::android::aidl::tests::extension::ExtendableParcelable* out_ep2) override {
+    return _impl->RepeatExtendableParcelable(in_ep, out_ep2);
+  }
+  ::ndk::ScopedAStatus ReverseList(const ::aidl::android::aidl::tests::RecursiveList& in_list, ::aidl::android::aidl::tests::RecursiveList* _aidl_return) override {
+    return _impl->ReverseList(in_list, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseIBinderArray(const std::vector<::ndk::SpAIBinder>& in_input, std::vector<::ndk::SpAIBinder>* out_repeated, std::vector<::ndk::SpAIBinder>* _aidl_return) override {
+    return _impl->ReverseIBinderArray(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseNullableIBinderArray(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input, std::optional<std::vector<::ndk::SpAIBinder>>* out_repeated, std::optional<std::vector<::ndk::SpAIBinder>>* _aidl_return) override {
+    return _impl->ReverseNullableIBinderArray(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus GetOldNameInterface(std::shared_ptr<::aidl::android::aidl::tests::IOldName>* _aidl_return) override {
+    return _impl->GetOldNameInterface(_aidl_return);
+  }
+  ::ndk::ScopedAStatus GetNewNameInterface(std::shared_ptr<::aidl::android::aidl::tests::INewName>* _aidl_return) override {
+    return _impl->GetNewNameInterface(_aidl_return);
+  }
+  ::ndk::ScopedAStatus GetUnionTags(const std::vector<::aidl::android::aidl::tests::Union>& in_input, std::vector<::aidl::android::aidl::tests::Union::Tag>* _aidl_return) override {
+    return _impl->GetUnionTags(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus GetCppJavaTests(::ndk::SpAIBinder* _aidl_return) override {
+    return _impl->GetCppJavaTests(_aidl_return);
+  }
+  ::ndk::ScopedAStatus getBackendType(::aidl::android::aidl::tests::BackendType* _aidl_return) override {
+    return _impl->getBackendType(_aidl_return);
+  }
+  ::ndk::ScopedAStatus GetCircular(::aidl::android::aidl::tests::CircularParcelable* out_cp, std::shared_ptr<::aidl::android::aidl::tests::ICircular>* _aidl_return) override {
+    return _impl->GetCircular(out_cp, _aidl_return);
+  }
+protected:
+private:
+  std::shared_ptr<ITestService> _impl;
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnUnion.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnUnion.h
new file mode 100644
index 0000000..3b631a8
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnUnionWithFd.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnUnionWithFd.h
new file mode 100644
index 0000000..a9a3aea
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnUnionWithFd.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpArrayOfInterfaces.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpArrayOfInterfaces.h
new file mode 100644
index 0000000..2024751
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpArrayOfInterfaces.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpBackendType.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpBackendType.h
new file mode 100644
index 0000000..b76099e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpBackendType.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpByteEnum.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpByteEnum.h
new file mode 100644
index 0000000..bf31320
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpByteEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpCircular.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpCircular.h
new file mode 100644
index 0000000..b048539
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpCircular.h
@@ -0,0 +1,25 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/ICircular.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BpCircular : public ::ndk::BpCInterface<ICircular> {
+public:
+  explicit BpCircular(const ::ndk::SpAIBinder& binder);
+  virtual ~BpCircular();
+
+  ::ndk::ScopedAStatus GetTestService(std::shared_ptr<::aidl::android::aidl::tests::ITestService>* _aidl_return) override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpCircularParcelable.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpCircularParcelable.h
new file mode 100644
index 0000000..10c5cae
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpCircularParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpConstantExpressionEnum.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpConstantExpressionEnum.h
new file mode 100644
index 0000000..dc9d2c2
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpConstantExpressionEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecated.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecated.h
new file mode 100644
index 0000000..5ef793b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecated.h
@@ -0,0 +1,24 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/IDeprecated.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class __attribute__((deprecated("test"))) BpDeprecated : public ::ndk::BpCInterface<IDeprecated> {
+public:
+  explicit BpDeprecated(const ::ndk::SpAIBinder& binder);
+  virtual ~BpDeprecated();
+
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecatedEnum.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecatedEnum.h
new file mode 100644
index 0000000..e7ec47e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecatedEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecatedParcelable.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecatedParcelable.h
new file mode 100644
index 0000000..2000d78
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecatedParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpFixedSize.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpFixedSize.h
new file mode 100644
index 0000000..8ddd24c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpFixedSize.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpGenericStructuredParcelable.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpGenericStructuredParcelable.h
new file mode 100644
index 0000000..c14064e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpGenericStructuredParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpIntEnum.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpIntEnum.h
new file mode 100644
index 0000000..0df4606
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpIntEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpListOfInterfaces.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpListOfInterfaces.h
new file mode 100644
index 0000000..e9a633c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpListOfInterfaces.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpLongEnum.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpLongEnum.h
new file mode 100644
index 0000000..70569b1
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpLongEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpNamedCallback.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpNamedCallback.h
new file mode 100644
index 0000000..76dce29
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpNamedCallback.h
@@ -0,0 +1,25 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/INamedCallback.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BpNamedCallback : public ::ndk::BpCInterface<INamedCallback> {
+public:
+  explicit BpNamedCallback(const ::ndk::SpAIBinder& binder);
+  virtual ~BpNamedCallback();
+
+  ::ndk::ScopedAStatus GetName(std::string* _aidl_return) override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpNewName.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpNewName.h
new file mode 100644
index 0000000..74b9985
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpNewName.h
@@ -0,0 +1,25 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/INewName.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BpNewName : public ::ndk::BpCInterface<INewName> {
+public:
+  explicit BpNewName(const ::ndk::SpAIBinder& binder);
+  virtual ~BpNewName();
+
+  ::ndk::ScopedAStatus RealName(std::string* _aidl_return) override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpOldName.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpOldName.h
new file mode 100644
index 0000000..8da9b8a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpOldName.h
@@ -0,0 +1,25 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/IOldName.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BpOldName : public ::ndk::BpCInterface<IOldName> {
+public:
+  explicit BpOldName(const ::ndk::SpAIBinder& binder);
+  virtual ~BpOldName();
+
+  ::ndk::ScopedAStatus RealName(std::string* _aidl_return) override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpOtherParcelableForToString.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpOtherParcelableForToString.h
new file mode 100644
index 0000000..b117665
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpOtherParcelableForToString.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpParcelableForToString.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpParcelableForToString.h
new file mode 100644
index 0000000..2312ef2
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpParcelableForToString.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpRecursiveList.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpRecursiveList.h
new file mode 100644
index 0000000..1e91d8a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpRecursiveList.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpStructuredParcelable.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpStructuredParcelable.h
new file mode 100644
index 0000000..09a08ab
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpStructuredParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpTestService.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpTestService.h
new file mode 100644
index 0000000..e6e60c2
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpTestService.h
@@ -0,0 +1,92 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/ITestService.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BpTestService : public ::ndk::BpCInterface<ITestService> {
+public:
+  explicit BpTestService(const ::ndk::SpAIBinder& binder);
+  virtual ~BpTestService();
+
+  ::ndk::ScopedAStatus UnimplementedMethod(int32_t in_arg, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus Deprecated() override __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens")));
+  ::ndk::ScopedAStatus TestOneway() override;
+  ::ndk::ScopedAStatus RepeatBoolean(bool in_token, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatByte(int8_t in_token, int8_t* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatChar(char16_t in_token, char16_t* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatInt(int32_t in_token, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatLong(int64_t in_token, int64_t* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatFloat(float in_token, float* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatDouble(double in_token, double* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatString(const std::string& in_token, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatByteEnum(::aidl::android::aidl::tests::ByteEnum in_token, ::aidl::android::aidl::tests::ByteEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatIntEnum(::aidl::android::aidl::tests::IntEnum in_token, ::aidl::android::aidl::tests::IntEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatLongEnum(::aidl::android::aidl::tests::LongEnum in_token, ::aidl::android::aidl::tests::LongEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseBoolean(const std::vector<bool>& in_input, std::vector<bool>* out_repeated, std::vector<bool>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseByte(const std::vector<uint8_t>& in_input, std::vector<uint8_t>* out_repeated, std::vector<uint8_t>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseChar(const std::vector<char16_t>& in_input, std::vector<char16_t>* out_repeated, std::vector<char16_t>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseInt(const std::vector<int32_t>& in_input, std::vector<int32_t>* out_repeated, std::vector<int32_t>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseLong(const std::vector<int64_t>& in_input, std::vector<int64_t>* out_repeated, std::vector<int64_t>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseFloat(const std::vector<float>& in_input, std::vector<float>* out_repeated, std::vector<float>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseDouble(const std::vector<double>& in_input, std::vector<double>* out_repeated, std::vector<double>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseByteEnum(const std::vector<::aidl::android::aidl::tests::ByteEnum>& in_input, std::vector<::aidl::android::aidl::tests::ByteEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::ByteEnum>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseIntEnum(const std::vector<::aidl::android::aidl::tests::IntEnum>& in_input, std::vector<::aidl::android::aidl::tests::IntEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::IntEnum>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseLongEnum(const std::vector<::aidl::android::aidl::tests::LongEnum>& in_input, std::vector<::aidl::android::aidl::tests::LongEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::LongEnum>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetOtherTestService(const std::string& in_name, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) override;
+  ::ndk::ScopedAStatus SetOtherTestService(const std::string& in_name, const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus VerifyName(const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, const std::string& in_name, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus GetInterfaceArray(const std::vector<std::string>& in_names, std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>* _aidl_return) override;
+  ::ndk::ScopedAStatus VerifyNamesWithInterfaceArray(const std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>& in_services, const std::vector<std::string>& in_names, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus GetNullableInterfaceArray(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus VerifyNamesWithNullableInterfaceArray(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus GetInterfaceList(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus VerifyNamesWithInterfaceList(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseStringList(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatParcelFileDescriptor(const ::ndk::ScopedFileDescriptor& in_read, ::ndk::ScopedFileDescriptor* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseParcelFileDescriptorArray(const std::vector<::ndk::ScopedFileDescriptor>& in_input, std::vector<::ndk::ScopedFileDescriptor>* out_repeated, std::vector<::ndk::ScopedFileDescriptor>* _aidl_return) override;
+  ::ndk::ScopedAStatus ThrowServiceException(int32_t in_code) override;
+  ::ndk::ScopedAStatus RepeatNullableIntArray(const std::optional<std::vector<int32_t>>& in_input, std::optional<std::vector<int32_t>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableByteEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableIntEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableLongEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableString(const std::optional<std::string>& in_input, std::optional<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableParcelable(const std::optional<::aidl::android::aidl::tests::ITestService::Empty>& in_input, std::optional<::aidl::android::aidl::tests::ITestService::Empty>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableParcelableArray(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableParcelableList(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus TakesAnIBinder(const ::ndk::SpAIBinder& in_input) override;
+  ::ndk::ScopedAStatus TakesANullableIBinder(const ::ndk::SpAIBinder& in_input) override;
+  ::ndk::ScopedAStatus TakesAnIBinderList(const std::vector<::ndk::SpAIBinder>& in_input) override;
+  ::ndk::ScopedAStatus TakesANullableIBinderList(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input) override;
+  ::ndk::ScopedAStatus RepeatUtf8CppString(const std::string& in_token, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableUtf8CppString(const std::optional<std::string>& in_token, std::optional<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseUtf8CppString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseNullableUtf8CppString(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseUtf8CppStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetCallback(bool in_return_null, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) override;
+  ::ndk::ScopedAStatus FillOutStructuredParcelable(::aidl::android::aidl::tests::StructuredParcelable* in_parcel) override;
+  ::ndk::ScopedAStatus RepeatExtendableParcelable(const ::aidl::android::aidl::tests::extension::ExtendableParcelable& in_ep, ::aidl::android::aidl::tests::extension::ExtendableParcelable* out_ep2) override;
+  ::ndk::ScopedAStatus ReverseList(const ::aidl::android::aidl::tests::RecursiveList& in_list, ::aidl::android::aidl::tests::RecursiveList* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseIBinderArray(const std::vector<::ndk::SpAIBinder>& in_input, std::vector<::ndk::SpAIBinder>* out_repeated, std::vector<::ndk::SpAIBinder>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseNullableIBinderArray(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input, std::optional<std::vector<::ndk::SpAIBinder>>* out_repeated, std::optional<std::vector<::ndk::SpAIBinder>>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetOldNameInterface(std::shared_ptr<::aidl::android::aidl::tests::IOldName>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetNewNameInterface(std::shared_ptr<::aidl::android::aidl::tests::INewName>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetUnionTags(const std::vector<::aidl::android::aidl::tests::Union>& in_input, std::vector<::aidl::android::aidl::tests::Union::Tag>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetCppJavaTests(::ndk::SpAIBinder* _aidl_return) override;
+  ::ndk::ScopedAStatus getBackendType(::aidl::android::aidl::tests::BackendType* _aidl_return) override;
+  ::ndk::ScopedAStatus GetCircular(::aidl::android::aidl::tests::CircularParcelable* out_cp, std::shared_ptr<::aidl::android::aidl::tests::ICircular>* _aidl_return) override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpUnion.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpUnion.h
new file mode 100644
index 0000000..ffae148
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpUnionWithFd.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpUnionWithFd.h
new file mode 100644
index 0000000..34fb802
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpUnionWithFd.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ByteEnum.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ByteEnum.h
new file mode 100644
index 0000000..480e825
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ByteEnum.h
@@ -0,0 +1,64 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+enum class ByteEnum : int8_t {
+  FOO = 1,
+  BAR = 2,
+  BAZ = 3,
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ByteEnum val) {
+  switch(val) {
+  case ByteEnum::FOO:
+    return "FOO";
+  case ByteEnum::BAR:
+    return "BAR";
+  case ByteEnum::BAZ:
+    return "BAZ";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::ByteEnum, 3> enum_values<aidl::android::aidl::tests::ByteEnum> = {
+  aidl::android::aidl::tests::ByteEnum::FOO,
+  aidl::android::aidl::tests::ByteEnum::BAR,
+  aidl::android::aidl::tests::ByteEnum::BAZ,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/CircularParcelable.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/CircularParcelable.h
new file mode 100644
index 0000000..cd814b1
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/CircularParcelable.h
@@ -0,0 +1,68 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/ITestService.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::tests {
+class ITestService;
+}  // namespace aidl::android::aidl::tests
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class CircularParcelable {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  std::shared_ptr<::aidl::android::aidl::tests::ITestService> testService;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const CircularParcelable& rhs) const {
+    return std::tie(testService) != std::tie(rhs.testService);
+  }
+  inline bool operator<(const CircularParcelable& rhs) const {
+    return std::tie(testService) < std::tie(rhs.testService);
+  }
+  inline bool operator<=(const CircularParcelable& rhs) const {
+    return std::tie(testService) <= std::tie(rhs.testService);
+  }
+  inline bool operator==(const CircularParcelable& rhs) const {
+    return std::tie(testService) == std::tie(rhs.testService);
+  }
+  inline bool operator>(const CircularParcelable& rhs) const {
+    return std::tie(testService) > std::tie(rhs.testService);
+  }
+  inline bool operator>=(const CircularParcelable& rhs) const {
+    return std::tie(testService) >= std::tie(rhs.testService);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "CircularParcelable{";
+    os << "testService: " << ::android::internal::ToString(testService);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ConstantExpressionEnum.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ConstantExpressionEnum.h
new file mode 100644
index 0000000..d4bdaab
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ConstantExpressionEnum.h
@@ -0,0 +1,74 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+enum class ConstantExpressionEnum : int32_t {
+  decInt32_1 = 1,
+  decInt32_2 = 1,
+  decInt64_1 = 1,
+  decInt64_2 = 1,
+  decInt64_3 = 1,
+  decInt64_4 = 1,
+  hexInt32_1 = 1,
+  hexInt32_2 = 1,
+  hexInt32_3 = 1,
+  hexInt64_1 = 1,
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ConstantExpressionEnum val) {
+  switch(val) {
+  case ConstantExpressionEnum::decInt32_1:
+    return "decInt32_1";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::ConstantExpressionEnum, 10> enum_values<aidl::android::aidl::tests::ConstantExpressionEnum> = {
+  aidl::android::aidl::tests::ConstantExpressionEnum::decInt32_1,
+  aidl::android::aidl::tests::ConstantExpressionEnum::decInt32_2,
+  aidl::android::aidl::tests::ConstantExpressionEnum::decInt64_1,
+  aidl::android::aidl::tests::ConstantExpressionEnum::decInt64_2,
+  aidl::android::aidl::tests::ConstantExpressionEnum::decInt64_3,
+  aidl::android::aidl::tests::ConstantExpressionEnum::decInt64_4,
+  aidl::android::aidl::tests::ConstantExpressionEnum::hexInt32_1,
+  aidl::android::aidl::tests::ConstantExpressionEnum::hexInt32_2,
+  aidl::android::aidl::tests::ConstantExpressionEnum::hexInt32_3,
+  aidl::android::aidl::tests::ConstantExpressionEnum::hexInt64_1,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/DeprecatedEnum.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/DeprecatedEnum.h
new file mode 100644
index 0000000..4c45d4e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/DeprecatedEnum.h
@@ -0,0 +1,68 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+enum class __attribute__((deprecated("test"))) DeprecatedEnum : int32_t {
+  A = 0,
+  B = 1,
+  C = 2,
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+[[nodiscard]] static inline std::string toString(DeprecatedEnum val) {
+  switch(val) {
+  case DeprecatedEnum::A:
+    return "A";
+  case DeprecatedEnum::B:
+    return "B";
+  case DeprecatedEnum::C:
+    return "C";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+#pragma clang diagnostic pop
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::DeprecatedEnum, 3> enum_values<aidl::android::aidl::tests::DeprecatedEnum> = {
+  aidl::android::aidl::tests::DeprecatedEnum::A,
+  aidl::android::aidl::tests::DeprecatedEnum::B,
+  aidl::android::aidl::tests::DeprecatedEnum::C,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/DeprecatedParcelable.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/DeprecatedParcelable.h
new file mode 100644
index 0000000..cee8ba3
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/DeprecatedParcelable.h
@@ -0,0 +1,62 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class __attribute__((deprecated("test"))) DeprecatedParcelable {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const DeprecatedParcelable&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const DeprecatedParcelable&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const DeprecatedParcelable&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const DeprecatedParcelable&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const DeprecatedParcelable&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const DeprecatedParcelable&) const {
+    return std::tie() >= std::tie();
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "DeprecatedParcelable{";
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/FixedSize.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/FixedSize.h
new file mode 100644
index 0000000..6e512ad
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/FixedSize.h
@@ -0,0 +1,299 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/FixedSize.h>
+#include <aidl/android/aidl/tests/LongEnum.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class FixedSize {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  class FixedUnion {
+  public:
+    typedef std::true_type fixed_size;
+    static const char* descriptor;
+
+    enum class Tag : int8_t {
+      booleanValue = 0,
+      byteValue = 1,
+      charValue = 2,
+      intValue = 3,
+      longValue = 4,
+      floatValue = 5,
+      doubleValue = 6,
+      enumValue = 7,
+    };
+
+    // Expose tag symbols for legacy code
+    static const inline Tag booleanValue = Tag::booleanValue;
+    static const inline Tag byteValue = Tag::byteValue;
+    static const inline Tag charValue = Tag::charValue;
+    static const inline Tag intValue = Tag::intValue;
+    static const inline Tag longValue = Tag::longValue;
+    static const inline Tag floatValue = Tag::floatValue;
+    static const inline Tag doubleValue = Tag::doubleValue;
+    static const inline Tag enumValue = Tag::enumValue;
+
+    template <Tag _Tag>
+    using _at = typename std::tuple_element<static_cast<size_t>(_Tag), std::tuple<bool, int8_t, char16_t, int32_t, int64_t, float, double, ::aidl::android::aidl::tests::LongEnum>>::type;
+    template <Tag _Tag, typename _Type>
+    static FixedUnion make(_Type&& _arg) {
+      FixedUnion _inst;
+      _inst.set<_Tag>(std::forward<_Type>(_arg));
+      return _inst;
+    }
+    constexpr Tag getTag() const {
+      return _tag;
+    }
+    template <Tag _Tag>
+    const _at<_Tag>& get() const {
+      if (_Tag != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return *(_at<_Tag>*)(&_value);
+    }
+    template <Tag _Tag>
+    _at<_Tag>& get() {
+      if (_Tag != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return *(_at<_Tag>*)(&_value);
+    }
+    template <Tag _Tag, typename _Type>
+    void set(_Type&& _arg) {
+      _tag = _Tag;
+      get<_Tag>() = std::forward<_Type>(_arg);
+    }
+    binder_status_t readFromParcel(const AParcel* _parcel);
+    binder_status_t writeToParcel(AParcel* _parcel) const;
+
+    static int _cmp(const FixedUnion& _lhs, const FixedUnion& _rhs) {
+      return _cmp_value(_lhs.getTag(), _rhs.getTag()) || _cmp_value_at<enumValue>(_lhs, _rhs);
+    }
+    template <Tag _Tag>
+    static int _cmp_value_at(const FixedUnion& _lhs, const FixedUnion& _rhs) {
+      if constexpr (_Tag == booleanValue) {
+        return _cmp_value(_lhs.get<_Tag>(), _rhs.get<_Tag>());
+      } else {
+        return (_lhs.getTag() == _Tag)
+          ? _cmp_value(_lhs.get<_Tag>(), _rhs.get<_Tag>())
+          : _cmp_value_at<static_cast<Tag>(static_cast<size_t>(_Tag)-1)>(_lhs, _rhs);
+      }
+    }
+    template <typename _Type>
+    static int _cmp_value(const _Type& _lhs, const _Type& _rhs) {
+      return (_lhs == _rhs) ? 0 : (_lhs < _rhs) ? -1 : 1;
+    }
+    inline bool operator!=(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) != 0;
+    }
+    inline bool operator<(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) < 0;
+    }
+    inline bool operator<=(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) <= 0;
+    }
+    inline bool operator==(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) == 0;
+    }
+    inline bool operator>(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) > 0;
+    }
+    inline bool operator>=(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) >= 0;
+    }
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "FixedUnion{";
+      switch (getTag()) {
+      case booleanValue: os << "booleanValue: " << ::android::internal::ToString(get<booleanValue>()); break;
+      case byteValue: os << "byteValue: " << ::android::internal::ToString(get<byteValue>()); break;
+      case charValue: os << "charValue: " << ::android::internal::ToString(get<charValue>()); break;
+      case intValue: os << "intValue: " << ::android::internal::ToString(get<intValue>()); break;
+      case longValue: os << "longValue: " << ::android::internal::ToString(get<longValue>()); break;
+      case floatValue: os << "floatValue: " << ::android::internal::ToString(get<floatValue>()); break;
+      case doubleValue: os << "doubleValue: " << ::android::internal::ToString(get<doubleValue>()); break;
+      case enumValue: os << "enumValue: " << ::android::internal::ToString(get<enumValue>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    Tag _tag = booleanValue;
+    union _value_t {
+      _value_t() {}
+      ~_value_t() {}
+      bool booleanValue __attribute__((aligned (1))) = bool(false);
+      int8_t byteValue __attribute__((aligned (1)));
+      char16_t charValue __attribute__((aligned (2)));
+      int32_t intValue __attribute__((aligned (4)));
+      int64_t longValue __attribute__((aligned (8)));
+      float floatValue __attribute__((aligned (4)));
+      double doubleValue __attribute__((aligned (8)));
+      ::aidl::android::aidl::tests::LongEnum enumValue __attribute__((aligned (8)));
+    } _value;
+  };
+  class FixedParcelable {
+  public:
+    typedef std::true_type fixed_size;
+    static const char* descriptor;
+
+    bool booleanValue __attribute__((aligned (1))) = false;
+    int8_t byteValue __attribute__((aligned (1))) = 0;
+    char16_t charValue __attribute__((aligned (2))) = '\0';
+    int32_t intValue __attribute__((aligned (4))) = 0;
+    int64_t longValue __attribute__((aligned (8))) = 0L;
+    float floatValue __attribute__((aligned (4))) = 0.000000f;
+    double doubleValue __attribute__((aligned (8))) = 0.000000;
+    ::aidl::android::aidl::tests::LongEnum enumValue __attribute__((aligned (8))) = ::aidl::android::aidl::tests::LongEnum::FOO;
+    ::aidl::android::aidl::tests::FixedSize::FixedUnion parcelableValue;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) != std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator<(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) < std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator<=(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) <= std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator==(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) == std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator>(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) > std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator>=(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) >= std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "FixedParcelable{";
+      os << "booleanValue: " << ::android::internal::ToString(booleanValue);
+      os << ", byteValue: " << ::android::internal::ToString(byteValue);
+      os << ", charValue: " << ::android::internal::ToString(charValue);
+      os << ", intValue: " << ::android::internal::ToString(intValue);
+      os << ", longValue: " << ::android::internal::ToString(longValue);
+      os << ", floatValue: " << ::android::internal::ToString(floatValue);
+      os << ", doubleValue: " << ::android::internal::ToString(doubleValue);
+      os << ", enumValue: " << ::android::internal::ToString(enumValue);
+      os << ", parcelableValue: " << ::android::internal::ToString(parcelableValue);
+      os << "}";
+      return os.str();
+    }
+  };
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const FixedSize&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const FixedSize&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const FixedSize&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const FixedSize&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const FixedSize&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const FixedSize&) const {
+    return std::tie() >= std::tie();
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "FixedSize{";
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(FixedSize::FixedUnion::Tag val) {
+  switch(val) {
+  case FixedSize::FixedUnion::Tag::booleanValue:
+    return "booleanValue";
+  case FixedSize::FixedUnion::Tag::byteValue:
+    return "byteValue";
+  case FixedSize::FixedUnion::Tag::charValue:
+    return "charValue";
+  case FixedSize::FixedUnion::Tag::intValue:
+    return "intValue";
+  case FixedSize::FixedUnion::Tag::longValue:
+    return "longValue";
+  case FixedSize::FixedUnion::Tag::floatValue:
+    return "floatValue";
+  case FixedSize::FixedUnion::Tag::doubleValue:
+    return "doubleValue";
+  case FixedSize::FixedUnion::Tag::enumValue:
+    return "enumValue";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::FixedSize::FixedUnion::Tag, 8> enum_values<aidl::android::aidl::tests::FixedSize::FixedUnion::Tag> = {
+  aidl::android::aidl::tests::FixedSize::FixedUnion::Tag::booleanValue,
+  aidl::android::aidl::tests::FixedSize::FixedUnion::Tag::byteValue,
+  aidl::android::aidl::tests::FixedSize::FixedUnion::Tag::charValue,
+  aidl::android::aidl::tests::FixedSize::FixedUnion::Tag::intValue,
+  aidl::android::aidl::tests::FixedSize::FixedUnion::Tag::longValue,
+  aidl::android::aidl::tests::FixedSize::FixedUnion::Tag::floatValue,
+  aidl::android::aidl::tests::FixedSize::FixedUnion::Tag::doubleValue,
+  aidl::android::aidl::tests::FixedSize::FixedUnion::Tag::enumValue,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/GenericStructuredParcelable.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/GenericStructuredParcelable.h
new file mode 100644
index 0000000..3c14e70
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/GenericStructuredParcelable.h
@@ -0,0 +1,129 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+template <typename T, typename U, typename B>
+class GenericStructuredParcelable {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t a = 0;
+  int32_t b = 0;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<=(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator==(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>=(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "GenericStructuredParcelable{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+#include "aidl/android/aidl/tests/GenericStructuredParcelable.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+template <typename T, typename U, typename B>
+const char* GenericStructuredParcelable<T, U, B>::descriptor = "android.aidl.tests.GenericStructuredParcelable";
+
+template <typename T, typename U, typename B>
+binder_status_t GenericStructuredParcelable<T, U, B>::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+template <typename T, typename U, typename B>
+binder_status_t GenericStructuredParcelable<T, U, B>::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ICircular.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ICircular.h
new file mode 100644
index 0000000..72e9de9
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ICircular.h
@@ -0,0 +1,54 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <aidl/android/aidl/tests/ITestService.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::tests {
+class ITestService;
+}  // namespace aidl::android::aidl::tests
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class ICircularDelegator;
+
+class ICircular : public ::ndk::ICInterface {
+public:
+  typedef ICircularDelegator DefaultDelegator;
+  static const char* descriptor;
+  ICircular();
+  virtual ~ICircular();
+
+  static constexpr uint32_t TRANSACTION_GetTestService = FIRST_CALL_TRANSACTION + 0;
+
+  static std::shared_ptr<ICircular> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<ICircular>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<ICircular>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<ICircular>& impl);
+  static const std::shared_ptr<ICircular>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus GetTestService(std::shared_ptr<::aidl::android::aidl::tests::ITestService>* _aidl_return) = 0;
+private:
+  static std::shared_ptr<ICircular> default_impl;
+};
+class ICircularDefault : public ICircular {
+public:
+  ::ndk::ScopedAStatus GetTestService(std::shared_ptr<::aidl::android::aidl::tests::ITestService>* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IDeprecated.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IDeprecated.h
new file mode 100644
index 0000000..6c70567
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IDeprecated.h
@@ -0,0 +1,47 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class IDeprecatedDelegator;
+
+class __attribute__((deprecated("test"))) IDeprecated : public ::ndk::ICInterface {
+public:
+  typedef IDeprecatedDelegator DefaultDelegator;
+  static const char* descriptor;
+  IDeprecated();
+  virtual ~IDeprecated();
+
+
+  static std::shared_ptr<IDeprecated> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IDeprecated>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IDeprecated>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<IDeprecated>& impl);
+  static const std::shared_ptr<IDeprecated>& getDefaultImpl();
+private:
+  static std::shared_ptr<IDeprecated> default_impl;
+};
+class __attribute__((deprecated("test"))) IDeprecatedDefault : public IDeprecated {
+public:
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/INamedCallback.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/INamedCallback.h
new file mode 100644
index 0000000..c6d263e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/INamedCallback.h
@@ -0,0 +1,50 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class INamedCallbackDelegator;
+
+class INamedCallback : public ::ndk::ICInterface {
+public:
+  typedef INamedCallbackDelegator DefaultDelegator;
+  static const char* descriptor;
+  INamedCallback();
+  virtual ~INamedCallback();
+
+  static constexpr uint32_t TRANSACTION_GetName = FIRST_CALL_TRANSACTION + 0;
+
+  static std::shared_ptr<INamedCallback> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<INamedCallback>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<INamedCallback>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<INamedCallback>& impl);
+  static const std::shared_ptr<INamedCallback>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus GetName(std::string* _aidl_return) = 0;
+private:
+  static std::shared_ptr<INamedCallback> default_impl;
+};
+class INamedCallbackDefault : public INamedCallback {
+public:
+  ::ndk::ScopedAStatus GetName(std::string* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/INewName.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/INewName.h
new file mode 100644
index 0000000..535f0f6
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/INewName.h
@@ -0,0 +1,50 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class INewNameDelegator;
+
+class INewName : public ::ndk::ICInterface {
+public:
+  typedef INewNameDelegator DefaultDelegator;
+  static const char* descriptor;
+  INewName();
+  virtual ~INewName();
+
+  static constexpr uint32_t TRANSACTION_RealName = FIRST_CALL_TRANSACTION + 0;
+
+  static std::shared_ptr<INewName> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<INewName>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<INewName>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<INewName>& impl);
+  static const std::shared_ptr<INewName>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus RealName(std::string* _aidl_return) = 0;
+private:
+  static std::shared_ptr<INewName> default_impl;
+};
+class INewNameDefault : public INewName {
+public:
+  ::ndk::ScopedAStatus RealName(std::string* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IOldName.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IOldName.h
new file mode 100644
index 0000000..f728d1f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IOldName.h
@@ -0,0 +1,50 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class IOldNameDelegator;
+
+class IOldName : public ::ndk::ICInterface {
+public:
+  typedef IOldNameDelegator DefaultDelegator;
+  static const char* descriptor;
+  IOldName();
+  virtual ~IOldName();
+
+  static constexpr uint32_t TRANSACTION_RealName = FIRST_CALL_TRANSACTION + 0;
+
+  static std::shared_ptr<IOldName> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IOldName>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IOldName>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<IOldName>& impl);
+  static const std::shared_ptr<IOldName>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus RealName(std::string* _aidl_return) = 0;
+private:
+  static std::shared_ptr<IOldName> default_impl;
+};
+class IOldNameDefault : public IOldName {
+public:
+  ::ndk::ScopedAStatus RealName(std::string* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ITestService.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ITestService.h
new file mode 100644
index 0000000..3c16090
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ITestService.h
@@ -0,0 +1,811 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_ibinder.h>
+#include <android/binder_ibinder_platform.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcel_platform.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/BackendType.h>
+#include <aidl/android/aidl/tests/ByteEnum.h>
+#include <aidl/android/aidl/tests/CircularParcelable.h>
+#include <aidl/android/aidl/tests/ICircular.h>
+#include <aidl/android/aidl/tests/INamedCallback.h>
+#include <aidl/android/aidl/tests/INewName.h>
+#include <aidl/android/aidl/tests/IOldName.h>
+#include <aidl/android/aidl/tests/ITestService.h>
+#include <aidl/android/aidl/tests/IntEnum.h>
+#include <aidl/android/aidl/tests/LongEnum.h>
+#include <aidl/android/aidl/tests/RecursiveList.h>
+#include <aidl/android/aidl/tests/StructuredParcelable.h>
+#include <aidl/android/aidl/tests/Union.h>
+#include <aidl/android/aidl/tests/extension/ExtendableParcelable.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl::android::aidl::tests {
+class CircularParcelable;
+class ICircular;
+class INamedCallback;
+class INewName;
+class IOldName;
+class RecursiveList;
+class StructuredParcelable;
+}  // namespace aidl::android::aidl::tests
+namespace aidl::android::aidl::tests::extension {
+class ExtendableParcelable;
+}  // namespace aidl::android::aidl::tests::extension
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class ITestServiceDelegator;
+
+class ITestService : public ::ndk::ICInterface {
+public:
+  typedef ITestServiceDelegator DefaultDelegator;
+  static const char* descriptor;
+  ITestService();
+  virtual ~ITestService();
+
+  class Empty {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const Empty&) const {
+      return std::tie() != std::tie();
+    }
+    inline bool operator<(const Empty&) const {
+      return std::tie() < std::tie();
+    }
+    inline bool operator<=(const Empty&) const {
+      return std::tie() <= std::tie();
+    }
+    inline bool operator==(const Empty&) const {
+      return std::tie() == std::tie();
+    }
+    inline bool operator>(const Empty&) const {
+      return std::tie() > std::tie();
+    }
+    inline bool operator>=(const Empty&) const {
+      return std::tie() >= std::tie();
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "Empty{";
+      os << "}";
+      return os.str();
+    }
+  };
+  class CompilerChecks {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    class IFooDelegator;
+
+    class IFoo : public ::ndk::ICInterface {
+    public:
+      typedef IFooDelegator DefaultDelegator;
+      static const char* descriptor;
+      IFoo();
+      virtual ~IFoo();
+
+
+      static std::shared_ptr<IFoo> fromBinder(const ::ndk::SpAIBinder& binder);
+      static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IFoo>& instance);
+      static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IFoo>* instance);
+      static bool setDefaultImpl(const std::shared_ptr<IFoo>& impl);
+      static const std::shared_ptr<IFoo>& getDefaultImpl();
+    private:
+      static std::shared_ptr<IFoo> default_impl;
+    };
+    class IFooDefault : public IFoo {
+    public:
+      ::ndk::SpAIBinder asBinder() override;
+      bool isRemote() override;
+    };
+    class BpFoo : public ::ndk::BpCInterface<IFoo> {
+    public:
+      explicit BpFoo(const ::ndk::SpAIBinder& binder);
+      virtual ~BpFoo();
+
+    };
+    class BnFoo : public ::ndk::BnCInterface<IFoo> {
+    public:
+      BnFoo();
+      virtual ~BnFoo();
+    protected:
+      ::ndk::SpAIBinder createBinder() override;
+    private:
+    };
+    #pragma clang diagnostic push
+    #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+    class HasDeprecated {
+    public:
+      typedef std::false_type fixed_size;
+      static const char* descriptor;
+
+      int32_t __attribute__((deprecated("field"))) deprecated = 0;
+
+      binder_status_t readFromParcel(const AParcel* parcel);
+      binder_status_t writeToParcel(AParcel* parcel) const;
+
+      inline bool operator!=(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) != std::tie(rhs.deprecated);
+      }
+      inline bool operator<(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) < std::tie(rhs.deprecated);
+      }
+      inline bool operator<=(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) <= std::tie(rhs.deprecated);
+      }
+      inline bool operator==(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) == std::tie(rhs.deprecated);
+      }
+      inline bool operator>(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) > std::tie(rhs.deprecated);
+      }
+      inline bool operator>=(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) >= std::tie(rhs.deprecated);
+      }
+
+      static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+      inline std::string toString() const {
+        std::ostringstream os;
+        os << "HasDeprecated{";
+        os << "deprecated: " << ::android::internal::ToString(deprecated);
+        os << "}";
+        return os.str();
+      }
+    };
+    #pragma clang diagnostic pop
+    class UsingHasDeprecated {
+    public:
+      typedef std::false_type fixed_size;
+      static const char* descriptor;
+
+      enum class Tag : int32_t {
+        n = 0,
+        m = 1,
+      };
+
+      // Expose tag symbols for legacy code
+      static const inline Tag n = Tag::n;
+      static const inline Tag m = Tag::m;
+
+      template<typename _Tp>
+      static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, UsingHasDeprecated>;
+
+      UsingHasDeprecated() : _value(std::in_place_index<static_cast<size_t>(n)>, int32_t(0)) { }
+
+      template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+      // NOLINTNEXTLINE(google-explicit-constructor)
+      constexpr UsingHasDeprecated(_Tp&& _arg)
+          : _value(std::forward<_Tp>(_arg)) {}
+
+      template <size_t _Np, typename... _Tp>
+      constexpr explicit UsingHasDeprecated(std::in_place_index_t<_Np>, _Tp&&... _args)
+          : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+      template <Tag _tag, typename... _Tp>
+      static UsingHasDeprecated make(_Tp&&... _args) {
+        return UsingHasDeprecated(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+      }
+
+      template <Tag _tag, typename _Tp, typename... _Up>
+      static UsingHasDeprecated make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+        return UsingHasDeprecated(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+      }
+
+      Tag getTag() const {
+        return static_cast<Tag>(_value.index());
+      }
+
+      template <Tag _tag>
+      const auto& get() const {
+        if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+        return std::get<static_cast<size_t>(_tag)>(_value);
+      }
+
+      template <Tag _tag>
+      auto& get() {
+        if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+        return std::get<static_cast<size_t>(_tag)>(_value);
+      }
+
+      template <Tag _tag, typename... _Tp>
+      void set(_Tp&&... _args) {
+        _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+      }
+
+      binder_status_t readFromParcel(const AParcel* _parcel);
+      binder_status_t writeToParcel(AParcel* _parcel) const;
+
+      inline bool operator!=(const UsingHasDeprecated& rhs) const {
+        return _value != rhs._value;
+      }
+      inline bool operator<(const UsingHasDeprecated& rhs) const {
+        return _value < rhs._value;
+      }
+      inline bool operator<=(const UsingHasDeprecated& rhs) const {
+        return _value <= rhs._value;
+      }
+      inline bool operator==(const UsingHasDeprecated& rhs) const {
+        return _value == rhs._value;
+      }
+      inline bool operator>(const UsingHasDeprecated& rhs) const {
+        return _value > rhs._value;
+      }
+      inline bool operator>=(const UsingHasDeprecated& rhs) const {
+        return _value >= rhs._value;
+      }
+
+      static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+      inline std::string toString() const {
+        std::ostringstream os;
+        os << "UsingHasDeprecated{";
+        switch (getTag()) {
+        case n: os << "n: " << ::android::internal::ToString(get<n>()); break;
+        case m: os << "m: " << ::android::internal::ToString(get<m>()); break;
+        }
+        os << "}";
+        return os.str();
+      }
+    private:
+      std::variant<int32_t, ::aidl::android::aidl::tests::ITestService::CompilerChecks::HasDeprecated> _value;
+    };
+    class INoPrefixInterfaceDelegator;
+
+    class INoPrefixInterface : public ::ndk::ICInterface {
+    public:
+      typedef INoPrefixInterfaceDelegator DefaultDelegator;
+      static const char* descriptor;
+      INoPrefixInterface();
+      virtual ~INoPrefixInterface();
+
+      class Nested {
+      public:
+        typedef std::false_type fixed_size;
+        static const char* descriptor;
+
+
+        binder_status_t readFromParcel(const AParcel* parcel);
+        binder_status_t writeToParcel(AParcel* parcel) const;
+
+        inline bool operator!=(const Nested&) const {
+          return std::tie() != std::tie();
+        }
+        inline bool operator<(const Nested&) const {
+          return std::tie() < std::tie();
+        }
+        inline bool operator<=(const Nested&) const {
+          return std::tie() <= std::tie();
+        }
+        inline bool operator==(const Nested&) const {
+          return std::tie() == std::tie();
+        }
+        inline bool operator>(const Nested&) const {
+          return std::tie() > std::tie();
+        }
+        inline bool operator>=(const Nested&) const {
+          return std::tie() >= std::tie();
+        }
+
+        static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+        inline std::string toString() const {
+          std::ostringstream os;
+          os << "Nested{";
+          os << "}";
+          return os.str();
+        }
+      };
+      class INestedNoPrefixInterfaceDelegator;
+
+      class INestedNoPrefixInterface : public ::ndk::ICInterface {
+      public:
+        typedef INestedNoPrefixInterfaceDelegator DefaultDelegator;
+        static const char* descriptor;
+        INestedNoPrefixInterface();
+        virtual ~INestedNoPrefixInterface();
+
+        static constexpr uint32_t TRANSACTION_foo = FIRST_CALL_TRANSACTION + 0;
+
+        static std::shared_ptr<INestedNoPrefixInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+        static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<INestedNoPrefixInterface>& instance);
+        static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<INestedNoPrefixInterface>* instance);
+        static bool setDefaultImpl(const std::shared_ptr<INestedNoPrefixInterface>& impl);
+        static const std::shared_ptr<INestedNoPrefixInterface>& getDefaultImpl();
+        virtual ::ndk::ScopedAStatus foo() = 0;
+      private:
+        static std::shared_ptr<INestedNoPrefixInterface> default_impl;
+      };
+      class INestedNoPrefixInterfaceDefault : public INestedNoPrefixInterface {
+      public:
+        ::ndk::ScopedAStatus foo() override;
+        ::ndk::SpAIBinder asBinder() override;
+        bool isRemote() override;
+      };
+      class BpNestedNoPrefixInterface : public ::ndk::BpCInterface<INestedNoPrefixInterface> {
+      public:
+        explicit BpNestedNoPrefixInterface(const ::ndk::SpAIBinder& binder);
+        virtual ~BpNestedNoPrefixInterface();
+
+        ::ndk::ScopedAStatus foo() override;
+      };
+      class BnNestedNoPrefixInterface : public ::ndk::BnCInterface<INestedNoPrefixInterface> {
+      public:
+        BnNestedNoPrefixInterface();
+        virtual ~BnNestedNoPrefixInterface();
+      protected:
+        ::ndk::SpAIBinder createBinder() override;
+      private:
+      };
+      static constexpr uint32_t TRANSACTION_foo = FIRST_CALL_TRANSACTION + 0;
+
+      static std::shared_ptr<INoPrefixInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+      static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<INoPrefixInterface>& instance);
+      static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<INoPrefixInterface>* instance);
+      static bool setDefaultImpl(const std::shared_ptr<INoPrefixInterface>& impl);
+      static const std::shared_ptr<INoPrefixInterface>& getDefaultImpl();
+      virtual ::ndk::ScopedAStatus foo() = 0;
+    private:
+      static std::shared_ptr<INoPrefixInterface> default_impl;
+    };
+    class INoPrefixInterfaceDefault : public INoPrefixInterface {
+    public:
+      ::ndk::ScopedAStatus foo() override;
+      ::ndk::SpAIBinder asBinder() override;
+      bool isRemote() override;
+    };
+    class BpNoPrefixInterface : public ::ndk::BpCInterface<INoPrefixInterface> {
+    public:
+      explicit BpNoPrefixInterface(const ::ndk::SpAIBinder& binder);
+      virtual ~BpNoPrefixInterface();
+
+      ::ndk::ScopedAStatus foo() override;
+    };
+    class BnNoPrefixInterface : public ::ndk::BnCInterface<INoPrefixInterface> {
+    public:
+      BnNoPrefixInterface();
+      virtual ~BnNoPrefixInterface();
+    protected:
+      ::ndk::SpAIBinder createBinder() override;
+    private:
+    };
+    ::ndk::SpAIBinder binder;
+    ::ndk::SpAIBinder nullable_binder;
+    std::vector<::ndk::SpAIBinder> binder_array;
+    std::optional<std::vector<::ndk::SpAIBinder>> nullable_binder_array;
+    std::vector<::ndk::SpAIBinder> binder_list;
+    std::optional<std::vector<::ndk::SpAIBinder>> nullable_binder_list;
+    ::ndk::ScopedFileDescriptor pfd;
+    ::ndk::ScopedFileDescriptor nullable_pfd;
+    std::vector<::ndk::ScopedFileDescriptor> pfd_array;
+    std::optional<std::vector<::ndk::ScopedFileDescriptor>> nullable_pfd_array;
+    std::vector<::ndk::ScopedFileDescriptor> pfd_list;
+    std::optional<std::vector<::ndk::ScopedFileDescriptor>> nullable_pfd_list;
+    ::aidl::android::aidl::tests::ITestService::Empty parcel;
+    std::optional<::aidl::android::aidl::tests::ITestService::Empty> nullable_parcel;
+    std::vector<::aidl::android::aidl::tests::ITestService::Empty> parcel_array;
+    std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>> nullable_parcel_array;
+    std::vector<::aidl::android::aidl::tests::ITestService::Empty> parcel_list;
+    std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>> nullable_parcel_list;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) != std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator<(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) < std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator<=(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) <= std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator==(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) == std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator>(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) > std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator>=(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) >= std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "CompilerChecks{";
+      os << "binder: " << ::android::internal::ToString(binder);
+      os << ", nullable_binder: " << ::android::internal::ToString(nullable_binder);
+      os << ", binder_array: " << ::android::internal::ToString(binder_array);
+      os << ", nullable_binder_array: " << ::android::internal::ToString(nullable_binder_array);
+      os << ", binder_list: " << ::android::internal::ToString(binder_list);
+      os << ", nullable_binder_list: " << ::android::internal::ToString(nullable_binder_list);
+      os << ", pfd: " << ::android::internal::ToString(pfd);
+      os << ", nullable_pfd: " << ::android::internal::ToString(nullable_pfd);
+      os << ", pfd_array: " << ::android::internal::ToString(pfd_array);
+      os << ", nullable_pfd_array: " << ::android::internal::ToString(nullable_pfd_array);
+      os << ", pfd_list: " << ::android::internal::ToString(pfd_list);
+      os << ", nullable_pfd_list: " << ::android::internal::ToString(nullable_pfd_list);
+      os << ", parcel: " << ::android::internal::ToString(parcel);
+      os << ", nullable_parcel: " << ::android::internal::ToString(nullable_parcel);
+      os << ", parcel_array: " << ::android::internal::ToString(parcel_array);
+      os << ", nullable_parcel_array: " << ::android::internal::ToString(nullable_parcel_array);
+      os << ", parcel_list: " << ::android::internal::ToString(parcel_list);
+      os << ", nullable_parcel_list: " << ::android::internal::ToString(nullable_parcel_list);
+      os << "}";
+      return os.str();
+    }
+  };
+  enum : int32_t { CONSTANT = 42 };
+  enum : int32_t { CONSTANT2 = -42 };
+  enum : int32_t { CONSTANT3 = 42 };
+  enum : int32_t { CONSTANT4 = 4 };
+  enum : int32_t { CONSTANT5 = -4 };
+  enum : int32_t { CONSTANT6 = 0 };
+  enum : int32_t { CONSTANT7 = 0 };
+  enum : int32_t { CONSTANT8 = 0 };
+  enum : int32_t { CONSTANT9 = 86 };
+  enum : int32_t { CONSTANT10 = 165 };
+  enum : int32_t { CONSTANT11 = 250 };
+  enum : int32_t { CONSTANT12 = -1 };
+  enum : int8_t { BYTE_CONSTANT = 17 };
+  enum : int64_t { LONG_CONSTANT = 1099511627776L };
+  static const char* STRING_CONSTANT;
+  static const char* STRING_CONSTANT2;
+  static constexpr float FLOAT_CONSTANT = 1.000000f;
+  static constexpr float FLOAT_CONSTANT2 = -1.000000f;
+  static constexpr float FLOAT_CONSTANT3 = 1.000000f;
+  static constexpr float FLOAT_CONSTANT4 = 2.200000f;
+  static constexpr float FLOAT_CONSTANT5 = -2.200000f;
+  static constexpr float FLOAT_CONSTANT6 = -0.000000f;
+  static constexpr float FLOAT_CONSTANT7 = 0.000000f;
+  static constexpr double DOUBLE_CONSTANT = 1.000000;
+  static constexpr double DOUBLE_CONSTANT2 = -1.000000;
+  static constexpr double DOUBLE_CONSTANT3 = 1.000000;
+  static constexpr double DOUBLE_CONSTANT4 = 2.200000;
+  static constexpr double DOUBLE_CONSTANT5 = -2.200000;
+  static constexpr double DOUBLE_CONSTANT6 = -0.000000;
+  static constexpr double DOUBLE_CONSTANT7 = 0.000000;
+  static constexpr double DOUBLE_CONSTANT8 = 1.100000;
+  static constexpr double DOUBLE_CONSTANT9 = -1.100000;
+  static const char* STRING_CONSTANT_UTF8;
+  enum : int32_t { A1 = 1 };
+  enum : int32_t { A2 = 1 };
+  enum : int32_t { A3 = 1 };
+  enum : int32_t { A4 = 1 };
+  enum : int32_t { A5 = 1 };
+  enum : int32_t { A6 = 1 };
+  enum : int32_t { A7 = 1 };
+  enum : int32_t { A8 = 1 };
+  enum : int32_t { A9 = 1 };
+  enum : int32_t { A10 = 1 };
+  enum : int32_t { A11 = 1 };
+  enum : int32_t { A12 = 1 };
+  enum : int32_t { A13 = 1 };
+  enum : int32_t { A14 = 1 };
+  enum : int32_t { A15 = 1 };
+  enum : int32_t { A16 = 1 };
+  enum : int32_t { A17 = 1 };
+  enum : int32_t { A18 = 1 };
+  enum : int32_t { A19 = 1 };
+  enum : int32_t { A20 = 1 };
+  enum : int32_t { A21 = 1 };
+  enum : int32_t { A22 = 1 };
+  enum : int32_t { A23 = 1 };
+  enum : int32_t { A24 = 1 };
+  enum : int32_t { A25 = 1 };
+  enum : int32_t { A26 = 1 };
+  enum : int32_t { A27 = 1 };
+  enum : int32_t { A28 = 1 };
+  enum : int32_t { A29 = 1 };
+  enum : int32_t { A30 = 1 };
+  enum : int32_t { A31 = 1 };
+  enum : int32_t { A32 = 1 };
+  enum : int32_t { A33 = 1 };
+  enum : int32_t { A34 = 1 };
+  enum : int32_t { A35 = 1 };
+  enum : int32_t { A36 = 1 };
+  enum : int32_t { A37 = 1 };
+  enum : int32_t { A38 = 1 };
+  enum : int32_t { A39 = 1 };
+  enum : int32_t { A40 = 1 };
+  enum : int32_t { A41 = 1 };
+  enum : int32_t { A42 = 1 };
+  enum : int32_t { A43 = 1 };
+  enum : int32_t { A44 = 1 };
+  enum : int32_t { A45 = 1 };
+  enum : int32_t { A46 = 1 };
+  enum : int32_t { A47 = 1 };
+  enum : int32_t { A48 = 1 };
+  enum : int32_t { A49 = 1 };
+  enum : int32_t { A50 = 1 };
+  enum : int32_t { A51 = 1 };
+  enum : int32_t { A52 = 1 };
+  enum : int32_t { A53 = 1 };
+  enum : int32_t { A54 = 1 };
+  enum : int32_t { A55 = 1 };
+  enum : int32_t { A56 = 1 };
+  enum : int32_t { A57 = 1 };
+  static constexpr uint32_t TRANSACTION_UnimplementedMethod = FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_Deprecated = FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_TestOneway = FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_RepeatBoolean = FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_RepeatByte = FIRST_CALL_TRANSACTION + 4;
+  static constexpr uint32_t TRANSACTION_RepeatChar = FIRST_CALL_TRANSACTION + 5;
+  static constexpr uint32_t TRANSACTION_RepeatInt = FIRST_CALL_TRANSACTION + 6;
+  static constexpr uint32_t TRANSACTION_RepeatLong = FIRST_CALL_TRANSACTION + 7;
+  static constexpr uint32_t TRANSACTION_RepeatFloat = FIRST_CALL_TRANSACTION + 8;
+  static constexpr uint32_t TRANSACTION_RepeatDouble = FIRST_CALL_TRANSACTION + 9;
+  static constexpr uint32_t TRANSACTION_RepeatString = FIRST_CALL_TRANSACTION + 10;
+  static constexpr uint32_t TRANSACTION_RepeatByteEnum = FIRST_CALL_TRANSACTION + 11;
+  static constexpr uint32_t TRANSACTION_RepeatIntEnum = FIRST_CALL_TRANSACTION + 12;
+  static constexpr uint32_t TRANSACTION_RepeatLongEnum = FIRST_CALL_TRANSACTION + 13;
+  static constexpr uint32_t TRANSACTION_ReverseBoolean = FIRST_CALL_TRANSACTION + 14;
+  static constexpr uint32_t TRANSACTION_ReverseByte = FIRST_CALL_TRANSACTION + 15;
+  static constexpr uint32_t TRANSACTION_ReverseChar = FIRST_CALL_TRANSACTION + 16;
+  static constexpr uint32_t TRANSACTION_ReverseInt = FIRST_CALL_TRANSACTION + 17;
+  static constexpr uint32_t TRANSACTION_ReverseLong = FIRST_CALL_TRANSACTION + 18;
+  static constexpr uint32_t TRANSACTION_ReverseFloat = FIRST_CALL_TRANSACTION + 19;
+  static constexpr uint32_t TRANSACTION_ReverseDouble = FIRST_CALL_TRANSACTION + 20;
+  static constexpr uint32_t TRANSACTION_ReverseString = FIRST_CALL_TRANSACTION + 21;
+  static constexpr uint32_t TRANSACTION_ReverseByteEnum = FIRST_CALL_TRANSACTION + 22;
+  static constexpr uint32_t TRANSACTION_ReverseIntEnum = FIRST_CALL_TRANSACTION + 23;
+  static constexpr uint32_t TRANSACTION_ReverseLongEnum = FIRST_CALL_TRANSACTION + 24;
+  static constexpr uint32_t TRANSACTION_GetOtherTestService = FIRST_CALL_TRANSACTION + 25;
+  static constexpr uint32_t TRANSACTION_SetOtherTestService = FIRST_CALL_TRANSACTION + 26;
+  static constexpr uint32_t TRANSACTION_VerifyName = FIRST_CALL_TRANSACTION + 27;
+  static constexpr uint32_t TRANSACTION_GetInterfaceArray = FIRST_CALL_TRANSACTION + 28;
+  static constexpr uint32_t TRANSACTION_VerifyNamesWithInterfaceArray = FIRST_CALL_TRANSACTION + 29;
+  static constexpr uint32_t TRANSACTION_GetNullableInterfaceArray = FIRST_CALL_TRANSACTION + 30;
+  static constexpr uint32_t TRANSACTION_VerifyNamesWithNullableInterfaceArray = FIRST_CALL_TRANSACTION + 31;
+  static constexpr uint32_t TRANSACTION_GetInterfaceList = FIRST_CALL_TRANSACTION + 32;
+  static constexpr uint32_t TRANSACTION_VerifyNamesWithInterfaceList = FIRST_CALL_TRANSACTION + 33;
+  static constexpr uint32_t TRANSACTION_ReverseStringList = FIRST_CALL_TRANSACTION + 34;
+  static constexpr uint32_t TRANSACTION_RepeatParcelFileDescriptor = FIRST_CALL_TRANSACTION + 35;
+  static constexpr uint32_t TRANSACTION_ReverseParcelFileDescriptorArray = FIRST_CALL_TRANSACTION + 36;
+  static constexpr uint32_t TRANSACTION_ThrowServiceException = FIRST_CALL_TRANSACTION + 37;
+  static constexpr uint32_t TRANSACTION_RepeatNullableIntArray = FIRST_CALL_TRANSACTION + 38;
+  static constexpr uint32_t TRANSACTION_RepeatNullableByteEnumArray = FIRST_CALL_TRANSACTION + 39;
+  static constexpr uint32_t TRANSACTION_RepeatNullableIntEnumArray = FIRST_CALL_TRANSACTION + 40;
+  static constexpr uint32_t TRANSACTION_RepeatNullableLongEnumArray = FIRST_CALL_TRANSACTION + 41;
+  static constexpr uint32_t TRANSACTION_RepeatNullableString = FIRST_CALL_TRANSACTION + 42;
+  static constexpr uint32_t TRANSACTION_RepeatNullableStringList = FIRST_CALL_TRANSACTION + 43;
+  static constexpr uint32_t TRANSACTION_RepeatNullableParcelable = FIRST_CALL_TRANSACTION + 44;
+  static constexpr uint32_t TRANSACTION_RepeatNullableParcelableArray = FIRST_CALL_TRANSACTION + 45;
+  static constexpr uint32_t TRANSACTION_RepeatNullableParcelableList = FIRST_CALL_TRANSACTION + 46;
+  static constexpr uint32_t TRANSACTION_TakesAnIBinder = FIRST_CALL_TRANSACTION + 47;
+  static constexpr uint32_t TRANSACTION_TakesANullableIBinder = FIRST_CALL_TRANSACTION + 48;
+  static constexpr uint32_t TRANSACTION_TakesAnIBinderList = FIRST_CALL_TRANSACTION + 49;
+  static constexpr uint32_t TRANSACTION_TakesANullableIBinderList = FIRST_CALL_TRANSACTION + 50;
+  static constexpr uint32_t TRANSACTION_RepeatUtf8CppString = FIRST_CALL_TRANSACTION + 51;
+  static constexpr uint32_t TRANSACTION_RepeatNullableUtf8CppString = FIRST_CALL_TRANSACTION + 52;
+  static constexpr uint32_t TRANSACTION_ReverseUtf8CppString = FIRST_CALL_TRANSACTION + 53;
+  static constexpr uint32_t TRANSACTION_ReverseNullableUtf8CppString = FIRST_CALL_TRANSACTION + 54;
+  static constexpr uint32_t TRANSACTION_ReverseUtf8CppStringList = FIRST_CALL_TRANSACTION + 55;
+  static constexpr uint32_t TRANSACTION_GetCallback = FIRST_CALL_TRANSACTION + 56;
+  static constexpr uint32_t TRANSACTION_FillOutStructuredParcelable = FIRST_CALL_TRANSACTION + 57;
+  static constexpr uint32_t TRANSACTION_RepeatExtendableParcelable = FIRST_CALL_TRANSACTION + 58;
+  static constexpr uint32_t TRANSACTION_ReverseList = FIRST_CALL_TRANSACTION + 59;
+  static constexpr uint32_t TRANSACTION_ReverseIBinderArray = FIRST_CALL_TRANSACTION + 60;
+  static constexpr uint32_t TRANSACTION_ReverseNullableIBinderArray = FIRST_CALL_TRANSACTION + 61;
+  static constexpr uint32_t TRANSACTION_GetOldNameInterface = FIRST_CALL_TRANSACTION + 62;
+  static constexpr uint32_t TRANSACTION_GetNewNameInterface = FIRST_CALL_TRANSACTION + 63;
+  static constexpr uint32_t TRANSACTION_GetUnionTags = FIRST_CALL_TRANSACTION + 64;
+  static constexpr uint32_t TRANSACTION_GetCppJavaTests = FIRST_CALL_TRANSACTION + 65;
+  static constexpr uint32_t TRANSACTION_getBackendType = FIRST_CALL_TRANSACTION + 66;
+  static constexpr uint32_t TRANSACTION_GetCircular = FIRST_CALL_TRANSACTION + 67;
+
+  static std::shared_ptr<ITestService> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<ITestService>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<ITestService>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<ITestService>& impl);
+  static const std::shared_ptr<ITestService>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus UnimplementedMethod(int32_t in_arg, int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus Deprecated() __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"))) = 0;
+  virtual ::ndk::ScopedAStatus TestOneway() = 0;
+  virtual ::ndk::ScopedAStatus RepeatBoolean(bool in_token, bool* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatByte(int8_t in_token, int8_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatChar(char16_t in_token, char16_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatInt(int32_t in_token, int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatLong(int64_t in_token, int64_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatFloat(float in_token, float* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatDouble(double in_token, double* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatString(const std::string& in_token, std::string* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatByteEnum(::aidl::android::aidl::tests::ByteEnum in_token, ::aidl::android::aidl::tests::ByteEnum* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatIntEnum(::aidl::android::aidl::tests::IntEnum in_token, ::aidl::android::aidl::tests::IntEnum* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatLongEnum(::aidl::android::aidl::tests::LongEnum in_token, ::aidl::android::aidl::tests::LongEnum* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseBoolean(const std::vector<bool>& in_input, std::vector<bool>* out_repeated, std::vector<bool>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseByte(const std::vector<uint8_t>& in_input, std::vector<uint8_t>* out_repeated, std::vector<uint8_t>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseChar(const std::vector<char16_t>& in_input, std::vector<char16_t>* out_repeated, std::vector<char16_t>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseInt(const std::vector<int32_t>& in_input, std::vector<int32_t>* out_repeated, std::vector<int32_t>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseLong(const std::vector<int64_t>& in_input, std::vector<int64_t>* out_repeated, std::vector<int64_t>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseFloat(const std::vector<float>& in_input, std::vector<float>* out_repeated, std::vector<float>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseDouble(const std::vector<double>& in_input, std::vector<double>* out_repeated, std::vector<double>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseByteEnum(const std::vector<::aidl::android::aidl::tests::ByteEnum>& in_input, std::vector<::aidl::android::aidl::tests::ByteEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::ByteEnum>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseIntEnum(const std::vector<::aidl::android::aidl::tests::IntEnum>& in_input, std::vector<::aidl::android::aidl::tests::IntEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::IntEnum>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseLongEnum(const std::vector<::aidl::android::aidl::tests::LongEnum>& in_input, std::vector<::aidl::android::aidl::tests::LongEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::LongEnum>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetOtherTestService(const std::string& in_name, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus SetOtherTestService(const std::string& in_name, const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, bool* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus VerifyName(const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, const std::string& in_name, bool* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetInterfaceArray(const std::vector<std::string>& in_names, std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus VerifyNamesWithInterfaceArray(const std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>& in_services, const std::vector<std::string>& in_names, bool* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetNullableInterfaceArray(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus VerifyNamesWithNullableInterfaceArray(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetInterfaceList(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus VerifyNamesWithInterfaceList(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseStringList(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatParcelFileDescriptor(const ::ndk::ScopedFileDescriptor& in_read, ::ndk::ScopedFileDescriptor* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseParcelFileDescriptorArray(const std::vector<::ndk::ScopedFileDescriptor>& in_input, std::vector<::ndk::ScopedFileDescriptor>* out_repeated, std::vector<::ndk::ScopedFileDescriptor>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ThrowServiceException(int32_t in_code) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableIntArray(const std::optional<std::vector<int32_t>>& in_input, std::optional<std::vector<int32_t>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableByteEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableIntEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableLongEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableString(const std::optional<std::string>& in_input, std::optional<std::string>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableParcelable(const std::optional<::aidl::android::aidl::tests::ITestService::Empty>& in_input, std::optional<::aidl::android::aidl::tests::ITestService::Empty>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableParcelableArray(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableParcelableList(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus TakesAnIBinder(const ::ndk::SpAIBinder& in_input) = 0;
+  virtual ::ndk::ScopedAStatus TakesANullableIBinder(const ::ndk::SpAIBinder& in_input) = 0;
+  virtual ::ndk::ScopedAStatus TakesAnIBinderList(const std::vector<::ndk::SpAIBinder>& in_input) = 0;
+  virtual ::ndk::ScopedAStatus TakesANullableIBinderList(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input) = 0;
+  virtual ::ndk::ScopedAStatus RepeatUtf8CppString(const std::string& in_token, std::string* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableUtf8CppString(const std::optional<std::string>& in_token, std::optional<std::string>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseUtf8CppString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseNullableUtf8CppString(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseUtf8CppStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetCallback(bool in_return_null, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus FillOutStructuredParcelable(::aidl::android::aidl::tests::StructuredParcelable* in_parcel) = 0;
+  virtual ::ndk::ScopedAStatus RepeatExtendableParcelable(const ::aidl::android::aidl::tests::extension::ExtendableParcelable& in_ep, ::aidl::android::aidl::tests::extension::ExtendableParcelable* out_ep2) = 0;
+  virtual ::ndk::ScopedAStatus ReverseList(const ::aidl::android::aidl::tests::RecursiveList& in_list, ::aidl::android::aidl::tests::RecursiveList* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseIBinderArray(const std::vector<::ndk::SpAIBinder>& in_input, std::vector<::ndk::SpAIBinder>* out_repeated, std::vector<::ndk::SpAIBinder>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseNullableIBinderArray(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input, std::optional<std::vector<::ndk::SpAIBinder>>* out_repeated, std::optional<std::vector<::ndk::SpAIBinder>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetOldNameInterface(std::shared_ptr<::aidl::android::aidl::tests::IOldName>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetNewNameInterface(std::shared_ptr<::aidl::android::aidl::tests::INewName>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetUnionTags(const std::vector<::aidl::android::aidl::tests::Union>& in_input, std::vector<::aidl::android::aidl::tests::Union::Tag>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetCppJavaTests(::ndk::SpAIBinder* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus getBackendType(::aidl::android::aidl::tests::BackendType* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetCircular(::aidl::android::aidl::tests::CircularParcelable* out_cp, std::shared_ptr<::aidl::android::aidl::tests::ICircular>* _aidl_return) = 0;
+private:
+  static std::shared_ptr<ITestService> default_impl;
+};
+class ITestServiceDefault : public ITestService {
+public:
+  ::ndk::ScopedAStatus UnimplementedMethod(int32_t in_arg, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus Deprecated() override __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens")));
+  ::ndk::ScopedAStatus TestOneway() override;
+  ::ndk::ScopedAStatus RepeatBoolean(bool in_token, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatByte(int8_t in_token, int8_t* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatChar(char16_t in_token, char16_t* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatInt(int32_t in_token, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatLong(int64_t in_token, int64_t* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatFloat(float in_token, float* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatDouble(double in_token, double* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatString(const std::string& in_token, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatByteEnum(::aidl::android::aidl::tests::ByteEnum in_token, ::aidl::android::aidl::tests::ByteEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatIntEnum(::aidl::android::aidl::tests::IntEnum in_token, ::aidl::android::aidl::tests::IntEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatLongEnum(::aidl::android::aidl::tests::LongEnum in_token, ::aidl::android::aidl::tests::LongEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseBoolean(const std::vector<bool>& in_input, std::vector<bool>* out_repeated, std::vector<bool>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseByte(const std::vector<uint8_t>& in_input, std::vector<uint8_t>* out_repeated, std::vector<uint8_t>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseChar(const std::vector<char16_t>& in_input, std::vector<char16_t>* out_repeated, std::vector<char16_t>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseInt(const std::vector<int32_t>& in_input, std::vector<int32_t>* out_repeated, std::vector<int32_t>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseLong(const std::vector<int64_t>& in_input, std::vector<int64_t>* out_repeated, std::vector<int64_t>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseFloat(const std::vector<float>& in_input, std::vector<float>* out_repeated, std::vector<float>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseDouble(const std::vector<double>& in_input, std::vector<double>* out_repeated, std::vector<double>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseByteEnum(const std::vector<::aidl::android::aidl::tests::ByteEnum>& in_input, std::vector<::aidl::android::aidl::tests::ByteEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::ByteEnum>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseIntEnum(const std::vector<::aidl::android::aidl::tests::IntEnum>& in_input, std::vector<::aidl::android::aidl::tests::IntEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::IntEnum>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseLongEnum(const std::vector<::aidl::android::aidl::tests::LongEnum>& in_input, std::vector<::aidl::android::aidl::tests::LongEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::LongEnum>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetOtherTestService(const std::string& in_name, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) override;
+  ::ndk::ScopedAStatus SetOtherTestService(const std::string& in_name, const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus VerifyName(const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, const std::string& in_name, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus GetInterfaceArray(const std::vector<std::string>& in_names, std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>* _aidl_return) override;
+  ::ndk::ScopedAStatus VerifyNamesWithInterfaceArray(const std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>& in_services, const std::vector<std::string>& in_names, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus GetNullableInterfaceArray(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus VerifyNamesWithNullableInterfaceArray(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus GetInterfaceList(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus VerifyNamesWithInterfaceList(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseStringList(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatParcelFileDescriptor(const ::ndk::ScopedFileDescriptor& in_read, ::ndk::ScopedFileDescriptor* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseParcelFileDescriptorArray(const std::vector<::ndk::ScopedFileDescriptor>& in_input, std::vector<::ndk::ScopedFileDescriptor>* out_repeated, std::vector<::ndk::ScopedFileDescriptor>* _aidl_return) override;
+  ::ndk::ScopedAStatus ThrowServiceException(int32_t in_code) override;
+  ::ndk::ScopedAStatus RepeatNullableIntArray(const std::optional<std::vector<int32_t>>& in_input, std::optional<std::vector<int32_t>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableByteEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableIntEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableLongEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableString(const std::optional<std::string>& in_input, std::optional<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableParcelable(const std::optional<::aidl::android::aidl::tests::ITestService::Empty>& in_input, std::optional<::aidl::android::aidl::tests::ITestService::Empty>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableParcelableArray(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableParcelableList(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus TakesAnIBinder(const ::ndk::SpAIBinder& in_input) override;
+  ::ndk::ScopedAStatus TakesANullableIBinder(const ::ndk::SpAIBinder& in_input) override;
+  ::ndk::ScopedAStatus TakesAnIBinderList(const std::vector<::ndk::SpAIBinder>& in_input) override;
+  ::ndk::ScopedAStatus TakesANullableIBinderList(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input) override;
+  ::ndk::ScopedAStatus RepeatUtf8CppString(const std::string& in_token, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableUtf8CppString(const std::optional<std::string>& in_token, std::optional<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseUtf8CppString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseNullableUtf8CppString(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseUtf8CppStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetCallback(bool in_return_null, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) override;
+  ::ndk::ScopedAStatus FillOutStructuredParcelable(::aidl::android::aidl::tests::StructuredParcelable* in_parcel) override;
+  ::ndk::ScopedAStatus RepeatExtendableParcelable(const ::aidl::android::aidl::tests::extension::ExtendableParcelable& in_ep, ::aidl::android::aidl::tests::extension::ExtendableParcelable* out_ep2) override;
+  ::ndk::ScopedAStatus ReverseList(const ::aidl::android::aidl::tests::RecursiveList& in_list, ::aidl::android::aidl::tests::RecursiveList* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseIBinderArray(const std::vector<::ndk::SpAIBinder>& in_input, std::vector<::ndk::SpAIBinder>* out_repeated, std::vector<::ndk::SpAIBinder>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseNullableIBinderArray(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input, std::optional<std::vector<::ndk::SpAIBinder>>* out_repeated, std::optional<std::vector<::ndk::SpAIBinder>>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetOldNameInterface(std::shared_ptr<::aidl::android::aidl::tests::IOldName>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetNewNameInterface(std::shared_ptr<::aidl::android::aidl::tests::INewName>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetUnionTags(const std::vector<::aidl::android::aidl::tests::Union>& in_input, std::vector<::aidl::android::aidl::tests::Union::Tag>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetCppJavaTests(::ndk::SpAIBinder* _aidl_return) override;
+  ::ndk::ScopedAStatus getBackendType(::aidl::android::aidl::tests::BackendType* _aidl_return) override;
+  ::ndk::ScopedAStatus GetCircular(::aidl::android::aidl::tests::CircularParcelable* out_cp, std::shared_ptr<::aidl::android::aidl::tests::ICircular>* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ITestService::CompilerChecks::UsingHasDeprecated::Tag val) {
+  switch(val) {
+  case ITestService::CompilerChecks::UsingHasDeprecated::Tag::n:
+    return "n";
+  case ITestService::CompilerChecks::UsingHasDeprecated::Tag::m:
+    return "m";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::ITestService::CompilerChecks::UsingHasDeprecated::Tag, 2> enum_values<aidl::android::aidl::tests::ITestService::CompilerChecks::UsingHasDeprecated::Tag> = {
+  aidl::android::aidl::tests::ITestService::CompilerChecks::UsingHasDeprecated::Tag::n,
+  aidl::android::aidl::tests::ITestService::CompilerChecks::UsingHasDeprecated::Tag::m,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IntEnum.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IntEnum.h
new file mode 100644
index 0000000..d7c5fb0
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IntEnum.h
@@ -0,0 +1,72 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+enum class IntEnum : int32_t {
+  FOO = 1000,
+  BAR = 2000,
+  BAZ = 2001,
+  QUX __attribute__((deprecated("do not use this"))) = 2002,
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+[[nodiscard]] static inline std::string toString(IntEnum val) {
+  switch(val) {
+  case IntEnum::FOO:
+    return "FOO";
+  case IntEnum::BAR:
+    return "BAR";
+  case IntEnum::BAZ:
+    return "BAZ";
+  case IntEnum::QUX:
+    return "QUX";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+#pragma clang diagnostic pop
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::IntEnum, 4> enum_values<aidl::android::aidl::tests::IntEnum> = {
+  aidl::android::aidl::tests::IntEnum::FOO,
+  aidl::android::aidl::tests::IntEnum::BAR,
+  aidl::android::aidl::tests::IntEnum::BAZ,
+  aidl::android::aidl::tests::IntEnum::QUX,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ListOfInterfaces.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ListOfInterfaces.h
new file mode 100644
index 0000000..d48979b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ListOfInterfaces.h
@@ -0,0 +1,333 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_ibinder.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/ListOfInterfaces.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class ListOfInterfaces {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  class IEmptyInterfaceDelegator;
+
+  class IEmptyInterface : public ::ndk::ICInterface {
+  public:
+    typedef IEmptyInterfaceDelegator DefaultDelegator;
+    static const char* descriptor;
+    IEmptyInterface();
+    virtual ~IEmptyInterface();
+
+
+    static std::shared_ptr<IEmptyInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IEmptyInterface>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IEmptyInterface>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<IEmptyInterface>& impl);
+    static const std::shared_ptr<IEmptyInterface>& getDefaultImpl();
+  private:
+    static std::shared_ptr<IEmptyInterface> default_impl;
+  };
+  class IEmptyInterfaceDefault : public IEmptyInterface {
+  public:
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpEmptyInterface : public ::ndk::BpCInterface<IEmptyInterface> {
+  public:
+    explicit BpEmptyInterface(const ::ndk::SpAIBinder& binder);
+    virtual ~BpEmptyInterface();
+
+  };
+  class BnEmptyInterface : public ::ndk::BnCInterface<IEmptyInterface> {
+  public:
+    BnEmptyInterface();
+    virtual ~BnEmptyInterface();
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  class IMyInterfaceDelegator;
+
+  class IMyInterface : public ::ndk::ICInterface {
+  public:
+    typedef IMyInterfaceDelegator DefaultDelegator;
+    static const char* descriptor;
+    IMyInterface();
+    virtual ~IMyInterface();
+
+    static constexpr uint32_t TRANSACTION_methodWithInterfaces = FIRST_CALL_TRANSACTION + 0;
+
+    static std::shared_ptr<IMyInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IMyInterface>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IMyInterface>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<IMyInterface>& impl);
+    static const std::shared_ptr<IMyInterface>& getDefaultImpl();
+    virtual ::ndk::ScopedAStatus methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& in_iface, const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& in_nullable_iface, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& in_iface_list_in, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* out_iface_list_out, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* in_iface_list_inout, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& in_nullable_iface_list_in, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* out_nullable_iface_list_out, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* in_nullable_iface_list_inout, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* _aidl_return) = 0;
+  private:
+    static std::shared_ptr<IMyInterface> default_impl;
+  };
+  class IMyInterfaceDefault : public IMyInterface {
+  public:
+    ::ndk::ScopedAStatus methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& in_iface, const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& in_nullable_iface, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& in_iface_list_in, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* out_iface_list_out, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* in_iface_list_inout, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& in_nullable_iface_list_in, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* out_nullable_iface_list_out, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* in_nullable_iface_list_inout, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* _aidl_return) override;
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpMyInterface : public ::ndk::BpCInterface<IMyInterface> {
+  public:
+    explicit BpMyInterface(const ::ndk::SpAIBinder& binder);
+    virtual ~BpMyInterface();
+
+    ::ndk::ScopedAStatus methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& in_iface, const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& in_nullable_iface, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& in_iface_list_in, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* out_iface_list_out, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* in_iface_list_inout, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& in_nullable_iface_list_in, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* out_nullable_iface_list_out, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* in_nullable_iface_list_inout, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* _aidl_return) override;
+  };
+  class BnMyInterface : public ::ndk::BnCInterface<IMyInterface> {
+  public:
+    BnMyInterface();
+    virtual ~BnMyInterface();
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  class MyParcelable {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface> iface;
+    std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface> nullable_iface;
+    std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> iface_list;
+    std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> nullable_iface_list;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) != std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator<(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) < std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator<=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) <= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator==(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) == std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator>(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) > std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator>=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) >= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyParcelable{";
+      os << "iface: " << ::android::internal::ToString(iface);
+      os << ", nullable_iface: " << ::android::internal::ToString(nullable_iface);
+      os << ", iface_list: " << ::android::internal::ToString(iface_list);
+      os << ", nullable_iface_list: " << ::android::internal::ToString(nullable_iface_list);
+      os << "}";
+      return os.str();
+    }
+  };
+  class MyUnion {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    enum class Tag : int32_t {
+      iface = 0,
+      nullable_iface = 1,
+      iface_list = 2,
+      nullable_iface_list = 3,
+    };
+
+    // Expose tag symbols for legacy code
+    static const inline Tag iface = Tag::iface;
+    static const inline Tag nullable_iface = Tag::nullable_iface;
+    static const inline Tag iface_list = Tag::iface_list;
+    static const inline Tag nullable_iface_list = Tag::nullable_iface_list;
+
+    template<typename _Tp>
+    static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, MyUnion>;
+
+    MyUnion() : _value(std::in_place_index<static_cast<size_t>(iface)>, std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>()) { }
+
+    template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+    // NOLINTNEXTLINE(google-explicit-constructor)
+    constexpr MyUnion(_Tp&& _arg)
+        : _value(std::forward<_Tp>(_arg)) {}
+
+    template <size_t _Np, typename... _Tp>
+    constexpr explicit MyUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+        : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+    template <Tag _tag, typename... _Tp>
+    static MyUnion make(_Tp&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+    }
+
+    template <Tag _tag, typename _Tp, typename... _Up>
+    static MyUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+    }
+
+    Tag getTag() const {
+      return static_cast<Tag>(_value.index());
+    }
+
+    template <Tag _tag>
+    const auto& get() const {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag>
+    auto& get() {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag, typename... _Tp>
+    void set(_Tp&&... _args) {
+      _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+    }
+
+    binder_status_t readFromParcel(const AParcel* _parcel);
+    binder_status_t writeToParcel(AParcel* _parcel) const;
+
+    inline bool operator!=(const MyUnion& rhs) const {
+      return _value != rhs._value;
+    }
+    inline bool operator<(const MyUnion& rhs) const {
+      return _value < rhs._value;
+    }
+    inline bool operator<=(const MyUnion& rhs) const {
+      return _value <= rhs._value;
+    }
+    inline bool operator==(const MyUnion& rhs) const {
+      return _value == rhs._value;
+    }
+    inline bool operator>(const MyUnion& rhs) const {
+      return _value > rhs._value;
+    }
+    inline bool operator>=(const MyUnion& rhs) const {
+      return _value >= rhs._value;
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyUnion{";
+      switch (getTag()) {
+      case iface: os << "iface: " << ::android::internal::ToString(get<iface>()); break;
+      case nullable_iface: os << "nullable_iface: " << ::android::internal::ToString(get<nullable_iface>()); break;
+      case iface_list: os << "iface_list: " << ::android::internal::ToString(get<iface_list>()); break;
+      case nullable_iface_list: os << "nullable_iface_list: " << ::android::internal::ToString(get<nullable_iface_list>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    std::variant<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>, std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>> _value;
+  };
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const ListOfInterfaces&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const ListOfInterfaces&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const ListOfInterfaces&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const ListOfInterfaces&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const ListOfInterfaces&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const ListOfInterfaces&) const {
+    return std::tie() >= std::tie();
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ListOfInterfaces{";
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ListOfInterfaces::MyUnion::Tag val) {
+  switch(val) {
+  case ListOfInterfaces::MyUnion::Tag::iface:
+    return "iface";
+  case ListOfInterfaces::MyUnion::Tag::nullable_iface:
+    return "nullable_iface";
+  case ListOfInterfaces::MyUnion::Tag::iface_list:
+    return "iface_list";
+  case ListOfInterfaces::MyUnion::Tag::nullable_iface_list:
+    return "nullable_iface_list";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::ListOfInterfaces::MyUnion::Tag, 4> enum_values<aidl::android::aidl::tests::ListOfInterfaces::MyUnion::Tag> = {
+  aidl::android::aidl::tests::ListOfInterfaces::MyUnion::Tag::iface,
+  aidl::android::aidl::tests::ListOfInterfaces::MyUnion::Tag::nullable_iface,
+  aidl::android::aidl::tests::ListOfInterfaces::MyUnion::Tag::iface_list,
+  aidl::android::aidl::tests::ListOfInterfaces::MyUnion::Tag::nullable_iface_list,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/LongEnum.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/LongEnum.h
new file mode 100644
index 0000000..fd31daf
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/LongEnum.h
@@ -0,0 +1,64 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+enum class LongEnum : int64_t {
+  FOO = 100000000000L,
+  BAR = 200000000000L,
+  BAZ = 200000000001L,
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(LongEnum val) {
+  switch(val) {
+  case LongEnum::FOO:
+    return "FOO";
+  case LongEnum::BAR:
+    return "BAR";
+  case LongEnum::BAZ:
+    return "BAZ";
+  default:
+    return std::to_string(static_cast<int64_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::LongEnum, 3> enum_values<aidl::android::aidl::tests::LongEnum> = {
+  aidl::android::aidl::tests::LongEnum::FOO,
+  aidl::android::aidl::tests::LongEnum::BAR,
+  aidl::android::aidl::tests::LongEnum::BAZ,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/OtherParcelableForToString.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/OtherParcelableForToString.h
new file mode 100644
index 0000000..7dd14ce
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/OtherParcelableForToString.h
@@ -0,0 +1,64 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class OtherParcelableForToString {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  std::string field;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) != std::tie(rhs.field);
+  }
+  inline bool operator<(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) < std::tie(rhs.field);
+  }
+  inline bool operator<=(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) <= std::tie(rhs.field);
+  }
+  inline bool operator==(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) == std::tie(rhs.field);
+  }
+  inline bool operator>(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) > std::tie(rhs.field);
+  }
+  inline bool operator>=(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) >= std::tie(rhs.field);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "OtherParcelableForToString{";
+    os << "field: " << ::android::internal::ToString(field);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ParcelableForToString.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ParcelableForToString.h
new file mode 100644
index 0000000..06baa9c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ParcelableForToString.h
@@ -0,0 +1,119 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/GenericStructuredParcelable.h>
+#include <aidl/android/aidl/tests/IntEnum.h>
+#include <aidl/android/aidl/tests/OtherParcelableForToString.h>
+#include <aidl/android/aidl/tests/StructuredParcelable.h>
+#include <aidl/android/aidl/tests/Union.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::tests {
+template <typename T, typename U, typename B>
+class GenericStructuredParcelable;
+class OtherParcelableForToString;
+class StructuredParcelable;
+}  // namespace aidl::android::aidl::tests
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class ParcelableForToString {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t intValue = 0;
+  std::vector<int32_t> intArray;
+  int64_t longValue = 0L;
+  std::vector<int64_t> longArray;
+  double doubleValue = 0.000000;
+  std::vector<double> doubleArray;
+  float floatValue = 0.000000f;
+  std::vector<float> floatArray;
+  int8_t byteValue = 0;
+  std::vector<uint8_t> byteArray;
+  bool booleanValue = false;
+  std::vector<bool> booleanArray;
+  std::string stringValue;
+  std::vector<std::string> stringArray;
+  std::vector<std::string> stringList;
+  ::aidl::android::aidl::tests::OtherParcelableForToString parcelableValue;
+  std::vector<::aidl::android::aidl::tests::OtherParcelableForToString> parcelableArray;
+  ::aidl::android::aidl::tests::IntEnum enumValue = ::aidl::android::aidl::tests::IntEnum::FOO;
+  std::vector<::aidl::android::aidl::tests::IntEnum> enumArray;
+  std::vector<std::string> nullArray;
+  std::vector<std::string> nullList;
+  ::aidl::android::aidl::tests::GenericStructuredParcelable<int32_t, ::aidl::android::aidl::tests::StructuredParcelable, ::aidl::android::aidl::tests::IntEnum> parcelableGeneric;
+  ::aidl::android::aidl::tests::Union unionValue;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) != std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator<(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) < std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator<=(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) <= std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator==(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) == std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator>(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) > std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator>=(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) >= std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ParcelableForToString{";
+    os << "intValue: " << ::android::internal::ToString(intValue);
+    os << ", intArray: " << ::android::internal::ToString(intArray);
+    os << ", longValue: " << ::android::internal::ToString(longValue);
+    os << ", longArray: " << ::android::internal::ToString(longArray);
+    os << ", doubleValue: " << ::android::internal::ToString(doubleValue);
+    os << ", doubleArray: " << ::android::internal::ToString(doubleArray);
+    os << ", floatValue: " << ::android::internal::ToString(floatValue);
+    os << ", floatArray: " << ::android::internal::ToString(floatArray);
+    os << ", byteValue: " << ::android::internal::ToString(byteValue);
+    os << ", byteArray: " << ::android::internal::ToString(byteArray);
+    os << ", booleanValue: " << ::android::internal::ToString(booleanValue);
+    os << ", booleanArray: " << ::android::internal::ToString(booleanArray);
+    os << ", stringValue: " << ::android::internal::ToString(stringValue);
+    os << ", stringArray: " << ::android::internal::ToString(stringArray);
+    os << ", stringList: " << ::android::internal::ToString(stringList);
+    os << ", parcelableValue: " << ::android::internal::ToString(parcelableValue);
+    os << ", parcelableArray: " << ::android::internal::ToString(parcelableArray);
+    os << ", enumValue: " << ::android::internal::ToString(enumValue);
+    os << ", enumArray: " << ::android::internal::ToString(enumArray);
+    os << ", nullArray: " << ::android::internal::ToString(nullArray);
+    os << ", nullList: " << ::android::internal::ToString(nullList);
+    os << ", parcelableGeneric: " << ::android::internal::ToString(parcelableGeneric);
+    os << ", unionValue: " << ::android::internal::ToString(unionValue);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/RecursiveList.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/RecursiveList.h
new file mode 100644
index 0000000..4fb1263
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/RecursiveList.h
@@ -0,0 +1,70 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/RecursiveList.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::tests {
+class RecursiveList;
+}  // namespace aidl::android::aidl::tests
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class RecursiveList {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t value = 0;
+  std::unique_ptr<::aidl::android::aidl::tests::RecursiveList> next;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const RecursiveList& rhs) const {
+    return std::tie(value, next) != std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator<(const RecursiveList& rhs) const {
+    return std::tie(value, next) < std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator<=(const RecursiveList& rhs) const {
+    return std::tie(value, next) <= std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator==(const RecursiveList& rhs) const {
+    return std::tie(value, next) == std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator>(const RecursiveList& rhs) const {
+    return std::tie(value, next) > std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator>=(const RecursiveList& rhs) const {
+    return std::tie(value, next) >= std::tie(rhs.value, rhs.next);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "RecursiveList{";
+    os << "value: " << ::android::internal::ToString(value);
+    os << ", next: " << ::android::internal::ToString(next);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/StructuredParcelable.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/StructuredParcelable.h
new file mode 100644
index 0000000..79454da
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/StructuredParcelable.h
@@ -0,0 +1,217 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/ByteEnum.h>
+#include <aidl/android/aidl/tests/ConstantExpressionEnum.h>
+#include <aidl/android/aidl/tests/IntEnum.h>
+#include <aidl/android/aidl/tests/LongEnum.h>
+#include <aidl/android/aidl/tests/StructuredParcelable.h>
+#include <aidl/android/aidl/tests/Union.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class StructuredParcelable {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  class Empty {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const Empty&) const {
+      return std::tie() != std::tie();
+    }
+    inline bool operator<(const Empty&) const {
+      return std::tie() < std::tie();
+    }
+    inline bool operator<=(const Empty&) const {
+      return std::tie() <= std::tie();
+    }
+    inline bool operator==(const Empty&) const {
+      return std::tie() == std::tie();
+    }
+    inline bool operator>(const Empty&) const {
+      return std::tie() > std::tie();
+    }
+    inline bool operator>=(const Empty&) const {
+      return std::tie() >= std::tie();
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "Empty{";
+      os << "}";
+      return os.str();
+    }
+  };
+  std::vector<int32_t> shouldContainThreeFs;
+  int32_t f = 0;
+  std::string shouldBeJerry;
+  ::aidl::android::aidl::tests::ByteEnum shouldBeByteBar = ::aidl::android::aidl::tests::ByteEnum(0);
+  ::aidl::android::aidl::tests::IntEnum shouldBeIntBar = ::aidl::android::aidl::tests::IntEnum(0);
+  ::aidl::android::aidl::tests::LongEnum shouldBeLongBar = ::aidl::android::aidl::tests::LongEnum(0);
+  std::vector<::aidl::android::aidl::tests::ByteEnum> shouldContainTwoByteFoos;
+  std::vector<::aidl::android::aidl::tests::IntEnum> shouldContainTwoIntFoos;
+  std::vector<::aidl::android::aidl::tests::LongEnum> shouldContainTwoLongFoos;
+  std::string stringDefaultsToFoo = "foo";
+  int8_t byteDefaultsToFour = 4;
+  int32_t intDefaultsToFive = 5;
+  int64_t longDefaultsToNegativeSeven = -7L;
+  bool booleanDefaultsToTrue = true;
+  char16_t charDefaultsToC = 'C';
+  float floatDefaultsToPi = 3.140000f;
+  double doubleWithDefault = -314000000000000000.000000;
+  std::vector<int32_t> arrayDefaultsTo123 = {1, 2, 3};
+  std::vector<int32_t> arrayDefaultsToEmpty = {};
+  bool boolDefault = false;
+  int8_t byteDefault = 0;
+  int32_t intDefault = 0;
+  int64_t longDefault = 0L;
+  float floatDefault = 0.000000f;
+  double doubleDefault = 0.000000;
+  double checkDoubleFromFloat = 3.140000;
+  std::vector<std::string> checkStringArray1 = {"a", "b"};
+  std::vector<std::string> checkStringArray2 = {"a", "b"};
+  int32_t int32_min = -2147483648;
+  int32_t int32_max = 2147483647;
+  int64_t int64_max = 9223372036854775807L;
+  int32_t hexInt32_neg_1 = -1;
+  ::ndk::SpAIBinder ibinder;
+  ::aidl::android::aidl::tests::StructuredParcelable::Empty empty;
+  std::vector<uint8_t> int8_1 = {1, 1, 1, 1, 1};
+  std::vector<int32_t> int32_1 = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
+  std::vector<int64_t> int64_1 = {1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L};
+  int32_t hexInt32_pos_1 = 1;
+  int32_t hexInt64_pos_1 = 1;
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_1 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_2 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_3 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_4 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_5 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_6 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_7 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_8 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_9 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_10 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  std::string addString1 = "hello world!";
+  std::string addString2 = "The quick brown fox jumps over the lazy dog.";
+  int32_t shouldSetBit0AndBit2 = 0;
+  std::optional<::aidl::android::aidl::tests::Union> u;
+  std::optional<::aidl::android::aidl::tests::Union> shouldBeConstS1;
+  ::aidl::android::aidl::tests::IntEnum defaultWithFoo = ::aidl::android::aidl::tests::IntEnum::FOO;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) != std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator<(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) < std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator<=(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) <= std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator==(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) == std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator>(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) > std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator>=(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) >= std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  enum : int32_t { BIT0 = 1 };
+  enum : int32_t { BIT1 = 2 };
+  enum : int32_t { BIT2 = 4 };
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "StructuredParcelable{";
+    os << "shouldContainThreeFs: " << ::android::internal::ToString(shouldContainThreeFs);
+    os << ", f: " << ::android::internal::ToString(f);
+    os << ", shouldBeJerry: " << ::android::internal::ToString(shouldBeJerry);
+    os << ", shouldBeByteBar: " << ::android::internal::ToString(shouldBeByteBar);
+    os << ", shouldBeIntBar: " << ::android::internal::ToString(shouldBeIntBar);
+    os << ", shouldBeLongBar: " << ::android::internal::ToString(shouldBeLongBar);
+    os << ", shouldContainTwoByteFoos: " << ::android::internal::ToString(shouldContainTwoByteFoos);
+    os << ", shouldContainTwoIntFoos: " << ::android::internal::ToString(shouldContainTwoIntFoos);
+    os << ", shouldContainTwoLongFoos: " << ::android::internal::ToString(shouldContainTwoLongFoos);
+    os << ", stringDefaultsToFoo: " << ::android::internal::ToString(stringDefaultsToFoo);
+    os << ", byteDefaultsToFour: " << ::android::internal::ToString(byteDefaultsToFour);
+    os << ", intDefaultsToFive: " << ::android::internal::ToString(intDefaultsToFive);
+    os << ", longDefaultsToNegativeSeven: " << ::android::internal::ToString(longDefaultsToNegativeSeven);
+    os << ", booleanDefaultsToTrue: " << ::android::internal::ToString(booleanDefaultsToTrue);
+    os << ", charDefaultsToC: " << ::android::internal::ToString(charDefaultsToC);
+    os << ", floatDefaultsToPi: " << ::android::internal::ToString(floatDefaultsToPi);
+    os << ", doubleWithDefault: " << ::android::internal::ToString(doubleWithDefault);
+    os << ", arrayDefaultsTo123: " << ::android::internal::ToString(arrayDefaultsTo123);
+    os << ", arrayDefaultsToEmpty: " << ::android::internal::ToString(arrayDefaultsToEmpty);
+    os << ", boolDefault: " << ::android::internal::ToString(boolDefault);
+    os << ", byteDefault: " << ::android::internal::ToString(byteDefault);
+    os << ", intDefault: " << ::android::internal::ToString(intDefault);
+    os << ", longDefault: " << ::android::internal::ToString(longDefault);
+    os << ", floatDefault: " << ::android::internal::ToString(floatDefault);
+    os << ", doubleDefault: " << ::android::internal::ToString(doubleDefault);
+    os << ", checkDoubleFromFloat: " << ::android::internal::ToString(checkDoubleFromFloat);
+    os << ", checkStringArray1: " << ::android::internal::ToString(checkStringArray1);
+    os << ", checkStringArray2: " << ::android::internal::ToString(checkStringArray2);
+    os << ", int32_min: " << ::android::internal::ToString(int32_min);
+    os << ", int32_max: " << ::android::internal::ToString(int32_max);
+    os << ", int64_max: " << ::android::internal::ToString(int64_max);
+    os << ", hexInt32_neg_1: " << ::android::internal::ToString(hexInt32_neg_1);
+    os << ", ibinder: " << ::android::internal::ToString(ibinder);
+    os << ", empty: " << ::android::internal::ToString(empty);
+    os << ", int8_1: " << ::android::internal::ToString(int8_1);
+    os << ", int32_1: " << ::android::internal::ToString(int32_1);
+    os << ", int64_1: " << ::android::internal::ToString(int64_1);
+    os << ", hexInt32_pos_1: " << ::android::internal::ToString(hexInt32_pos_1);
+    os << ", hexInt64_pos_1: " << ::android::internal::ToString(hexInt64_pos_1);
+    os << ", const_exprs_1: " << ::android::internal::ToString(const_exprs_1);
+    os << ", const_exprs_2: " << ::android::internal::ToString(const_exprs_2);
+    os << ", const_exprs_3: " << ::android::internal::ToString(const_exprs_3);
+    os << ", const_exprs_4: " << ::android::internal::ToString(const_exprs_4);
+    os << ", const_exprs_5: " << ::android::internal::ToString(const_exprs_5);
+    os << ", const_exprs_6: " << ::android::internal::ToString(const_exprs_6);
+    os << ", const_exprs_7: " << ::android::internal::ToString(const_exprs_7);
+    os << ", const_exprs_8: " << ::android::internal::ToString(const_exprs_8);
+    os << ", const_exprs_9: " << ::android::internal::ToString(const_exprs_9);
+    os << ", const_exprs_10: " << ::android::internal::ToString(const_exprs_10);
+    os << ", addString1: " << ::android::internal::ToString(addString1);
+    os << ", addString2: " << ::android::internal::ToString(addString2);
+    os << ", shouldSetBit0AndBit2: " << ::android::internal::ToString(shouldSetBit0AndBit2);
+    os << ", u: " << ::android::internal::ToString(u);
+    os << ", shouldBeConstS1: " << ::android::internal::ToString(shouldBeConstS1);
+    os << ", defaultWithFoo: " << ::android::internal::ToString(defaultWithFoo);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/Union.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/Union.h
new file mode 100644
index 0000000..1300fb1
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/Union.h
@@ -0,0 +1,193 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/ByteEnum.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class Union {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Tag : int32_t {
+    ns = 0,
+    n = 1,
+    m = 2,
+    s = 3,
+    ibinder = 4,
+    ss = 5,
+    be = 6,
+  };
+
+  // Expose tag symbols for legacy code
+  static const inline Tag ns = Tag::ns;
+  static const inline Tag n = Tag::n;
+  static const inline Tag m = Tag::m;
+  static const inline Tag s = Tag::s;
+  static const inline Tag ibinder = Tag::ibinder;
+  static const inline Tag ss = Tag::ss;
+  static const inline Tag be = Tag::be;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, Union>;
+
+  Union() : _value(std::in_place_index<static_cast<size_t>(ns)>, std::vector<int32_t>({})) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr Union(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit Union(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static Union make(_Tp&&... _args) {
+    return Union(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static Union make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return Union(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  binder_status_t readFromParcel(const AParcel* _parcel);
+  binder_status_t writeToParcel(AParcel* _parcel) const;
+
+  inline bool operator!=(const Union& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const Union& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const Union& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const Union& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const Union& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const Union& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  static const char* S1;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Union{";
+    switch (getTag()) {
+    case ns: os << "ns: " << ::android::internal::ToString(get<ns>()); break;
+    case n: os << "n: " << ::android::internal::ToString(get<n>()); break;
+    case m: os << "m: " << ::android::internal::ToString(get<m>()); break;
+    case s: os << "s: " << ::android::internal::ToString(get<s>()); break;
+    case ibinder: os << "ibinder: " << ::android::internal::ToString(get<ibinder>()); break;
+    case ss: os << "ss: " << ::android::internal::ToString(get<ss>()); break;
+    case be: os << "be: " << ::android::internal::ToString(get<be>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<std::vector<int32_t>, int32_t, int32_t, std::string, ::ndk::SpAIBinder, std::vector<std::string>, ::aidl::android::aidl::tests::ByteEnum> _value;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(Union::Tag val) {
+  switch(val) {
+  case Union::Tag::ns:
+    return "ns";
+  case Union::Tag::n:
+    return "n";
+  case Union::Tag::m:
+    return "m";
+  case Union::Tag::s:
+    return "s";
+  case Union::Tag::ibinder:
+    return "ibinder";
+  case Union::Tag::ss:
+    return "ss";
+  case Union::Tag::be:
+    return "be";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::Union::Tag, 7> enum_values<aidl::android::aidl::tests::Union::Tag> = {
+  aidl::android::aidl::tests::Union::Tag::ns,
+  aidl::android::aidl::tests::Union::Tag::n,
+  aidl::android::aidl::tests::Union::Tag::m,
+  aidl::android::aidl::tests::Union::Tag::s,
+  aidl::android::aidl::tests::Union::Tag::ibinder,
+  aidl::android::aidl::tests::Union::Tag::ss,
+  aidl::android::aidl::tests::Union::Tag::be,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/UnionWithFd.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/UnionWithFd.h
new file mode 100644
index 0000000..381e9c7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/UnionWithFd.h
@@ -0,0 +1,161 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class UnionWithFd {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Tag : int32_t {
+    num = 0,
+    pfd = 1,
+  };
+
+  // Expose tag symbols for legacy code
+  static const inline Tag num = Tag::num;
+  static const inline Tag pfd = Tag::pfd;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, UnionWithFd>;
+
+  UnionWithFd() : _value(std::in_place_index<static_cast<size_t>(num)>, int32_t(0)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr UnionWithFd(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit UnionWithFd(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static UnionWithFd make(_Tp&&... _args) {
+    return UnionWithFd(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static UnionWithFd make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return UnionWithFd(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  binder_status_t readFromParcel(const AParcel* _parcel);
+  binder_status_t writeToParcel(AParcel* _parcel) const;
+
+  inline bool operator!=(const UnionWithFd& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const UnionWithFd& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const UnionWithFd& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const UnionWithFd& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const UnionWithFd& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const UnionWithFd& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "UnionWithFd{";
+    switch (getTag()) {
+    case num: os << "num: " << ::android::internal::ToString(get<num>()); break;
+    case pfd: os << "pfd: " << ::android::internal::ToString(get<pfd>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t, ::ndk::ScopedFileDescriptor> _value;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(UnionWithFd::Tag val) {
+  switch(val) {
+  case UnionWithFd::Tag::num:
+    return "num";
+  case UnionWithFd::Tag::pfd:
+    return "pfd";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::UnionWithFd::Tag, 2> enum_values<aidl::android::aidl::tests::UnionWithFd::Tag> = {
+  aidl::android::aidl::tests::UnionWithFd::Tag::num,
+  aidl::android::aidl::tests::UnionWithFd::Tag::pfd,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnExtendableParcelable.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnExtendableParcelable.h
new file mode 100644
index 0000000..c25f696
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnExtendableParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExt.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExt.h
new file mode 100644
index 0000000..edc7ac2
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExt.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExt2.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExt2.h
new file mode 100644
index 0000000..fedcd72
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExt2.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExtLike.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExtLike.h
new file mode 100644
index 0000000..3805f56
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExtLike.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpExtendableParcelable.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpExtendableParcelable.h
new file mode 100644
index 0000000..253e8c5
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpExtendableParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExt.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExt.h
new file mode 100644
index 0000000..3504c71
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExt.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExt2.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExt2.h
new file mode 100644
index 0000000..9de8160
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExt2.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExtLike.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExtLike.h
new file mode 100644
index 0000000..4e692b4
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExtLike.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/ExtendableParcelable.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/ExtendableParcelable.h
new file mode 100644
index 0000000..64f0d32
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/ExtendableParcelable.h
@@ -0,0 +1,74 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+class ExtendableParcelable {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t a = 0;
+  std::string b;
+  ::ndk::AParcelableHolder ext{::ndk::STABILITY_LOCAL};
+  int64_t c = 0L;
+  ::ndk::AParcelableHolder ext2{::ndk::STABILITY_LOCAL};
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) != std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator<(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) < std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator<=(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) <= std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator==(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) == std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator>(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) > std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator>=(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) >= std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ExtendableParcelable{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << ", ext: " << ::android::internal::ToString(ext);
+    os << ", c: " << ::android::internal::ToString(c);
+    os << ", ext2: " << ::android::internal::ToString(ext2);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExt.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExt.h
new file mode 100644
index 0000000..65d77dd
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExt.h
@@ -0,0 +1,68 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+class MyExt {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t a = 0;
+  std::string b;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const MyExt& rhs) const {
+    return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<(const MyExt& rhs) const {
+    return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<=(const MyExt& rhs) const {
+    return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator==(const MyExt& rhs) const {
+    return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>(const MyExt& rhs) const {
+    return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>=(const MyExt& rhs) const {
+    return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "MyExt{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExt2.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExt2.h
new file mode 100644
index 0000000..e305910
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExt2.h
@@ -0,0 +1,74 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/extension/MyExt.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::tests::extension {
+class MyExt;
+}  // namespace aidl::android::aidl::tests::extension
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+class MyExt2 {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t a = 0;
+  ::aidl::android::aidl::tests::extension::MyExt b;
+  std::string c;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const MyExt2& rhs) const {
+    return std::tie(a, b, c) != std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator<(const MyExt2& rhs) const {
+    return std::tie(a, b, c) < std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator<=(const MyExt2& rhs) const {
+    return std::tie(a, b, c) <= std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator==(const MyExt2& rhs) const {
+    return std::tie(a, b, c) == std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator>(const MyExt2& rhs) const {
+    return std::tie(a, b, c) > std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator>=(const MyExt2& rhs) const {
+    return std::tie(a, b, c) >= std::tie(rhs.a, rhs.b, rhs.c);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "MyExt2{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << ", c: " << ::android::internal::ToString(c);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExtLike.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExtLike.h
new file mode 100644
index 0000000..0ae5336
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExtLike.h
@@ -0,0 +1,68 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+class MyExtLike {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t a = 0;
+  std::string b;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const MyExtLike& rhs) const {
+    return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<(const MyExtLike& rhs) const {
+    return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<=(const MyExtLike& rhs) const {
+    return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator==(const MyExtLike& rhs) const {
+    return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>(const MyExtLike& rhs) const {
+    return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>=(const MyExtLike& rhs) const {
+    return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "MyExtLike{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnDeeplyNested.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnDeeplyNested.h
new file mode 100644
index 0000000..d5c2ba5
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnDeeplyNested.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnNestedService.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnNestedService.h
new file mode 100644
index 0000000..fa05f80
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnNestedService.h
@@ -0,0 +1,51 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/nested/INestedService.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class BnNestedService : public ::ndk::BnCInterface<INestedService> {
+public:
+  BnNestedService();
+  virtual ~BnNestedService();
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class INestedServiceDelegator : public BnNestedService {
+public:
+  explicit INestedServiceDelegator(const std::shared_ptr<INestedService> &impl) : _impl(impl) {
+  }
+
+  ::ndk::ScopedAStatus flipStatus(const ::aidl::android::aidl::tests::nested::ParcelableWithNested& in_p, ::aidl::android::aidl::tests::nested::INestedService::Result* _aidl_return) override {
+    return _impl->flipStatus(in_p, _aidl_return);
+  }
+  ::ndk::ScopedAStatus flipStatusWithCallback(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status, const std::shared_ptr<::aidl::android::aidl::tests::nested::INestedService::ICallback>& in_cb) override {
+    return _impl->flipStatusWithCallback(in_status, in_cb);
+  }
+protected:
+private:
+  std::shared_ptr<INestedService> _impl;
+};
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnParcelableWithNested.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnParcelableWithNested.h
new file mode 100644
index 0000000..bee1348
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnParcelableWithNested.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpDeeplyNested.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpDeeplyNested.h
new file mode 100644
index 0000000..f390693
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpDeeplyNested.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpNestedService.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpNestedService.h
new file mode 100644
index 0000000..4a41c20
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpNestedService.h
@@ -0,0 +1,28 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/nested/INestedService.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class BpNestedService : public ::ndk::BpCInterface<INestedService> {
+public:
+  explicit BpNestedService(const ::ndk::SpAIBinder& binder);
+  virtual ~BpNestedService();
+
+  ::ndk::ScopedAStatus flipStatus(const ::aidl::android::aidl::tests::nested::ParcelableWithNested& in_p, ::aidl::android::aidl::tests::nested::INestedService::Result* _aidl_return) override;
+  ::ndk::ScopedAStatus flipStatusWithCallback(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status, const std::shared_ptr<::aidl::android::aidl::tests::nested::INestedService::ICallback>& in_cb) override;
+};
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpParcelableWithNested.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpParcelableWithNested.h
new file mode 100644
index 0000000..2a9ae60
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpParcelableWithNested.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/DeeplyNested.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/DeeplyNested.h
new file mode 100644
index 0000000..58a2217
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/DeeplyNested.h
@@ -0,0 +1,246 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/nested/DeeplyNested.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class DeeplyNested {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  class B {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    class C {
+    public:
+      typedef std::false_type fixed_size;
+      static const char* descriptor;
+
+      class D {
+      public:
+        typedef std::false_type fixed_size;
+        static const char* descriptor;
+
+        enum class E : int8_t {
+          OK = 0,
+        };
+
+
+        binder_status_t readFromParcel(const AParcel* parcel);
+        binder_status_t writeToParcel(AParcel* parcel) const;
+
+        inline bool operator!=(const D&) const {
+          return std::tie() != std::tie();
+        }
+        inline bool operator<(const D&) const {
+          return std::tie() < std::tie();
+        }
+        inline bool operator<=(const D&) const {
+          return std::tie() <= std::tie();
+        }
+        inline bool operator==(const D&) const {
+          return std::tie() == std::tie();
+        }
+        inline bool operator>(const D&) const {
+          return std::tie() > std::tie();
+        }
+        inline bool operator>=(const D&) const {
+          return std::tie() >= std::tie();
+        }
+
+        static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+        inline std::string toString() const {
+          std::ostringstream os;
+          os << "D{";
+          os << "}";
+          return os.str();
+        }
+      };
+
+      binder_status_t readFromParcel(const AParcel* parcel);
+      binder_status_t writeToParcel(AParcel* parcel) const;
+
+      inline bool operator!=(const C&) const {
+        return std::tie() != std::tie();
+      }
+      inline bool operator<(const C&) const {
+        return std::tie() < std::tie();
+      }
+      inline bool operator<=(const C&) const {
+        return std::tie() <= std::tie();
+      }
+      inline bool operator==(const C&) const {
+        return std::tie() == std::tie();
+      }
+      inline bool operator>(const C&) const {
+        return std::tie() > std::tie();
+      }
+      inline bool operator>=(const C&) const {
+        return std::tie() >= std::tie();
+      }
+
+      static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+      inline std::string toString() const {
+        std::ostringstream os;
+        os << "C{";
+        os << "}";
+        return os.str();
+      }
+    };
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const B&) const {
+      return std::tie() != std::tie();
+    }
+    inline bool operator<(const B&) const {
+      return std::tie() < std::tie();
+    }
+    inline bool operator<=(const B&) const {
+      return std::tie() <= std::tie();
+    }
+    inline bool operator==(const B&) const {
+      return std::tie() == std::tie();
+    }
+    inline bool operator>(const B&) const {
+      return std::tie() > std::tie();
+    }
+    inline bool operator>=(const B&) const {
+      return std::tie() >= std::tie();
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "B{";
+      os << "}";
+      return os.str();
+    }
+  };
+  class A {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    ::aidl::android::aidl::tests::nested::DeeplyNested::B::C::D::E e = ::aidl::android::aidl::tests::nested::DeeplyNested::B::C::D::E::OK;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const A& rhs) const {
+      return std::tie(e) != std::tie(rhs.e);
+    }
+    inline bool operator<(const A& rhs) const {
+      return std::tie(e) < std::tie(rhs.e);
+    }
+    inline bool operator<=(const A& rhs) const {
+      return std::tie(e) <= std::tie(rhs.e);
+    }
+    inline bool operator==(const A& rhs) const {
+      return std::tie(e) == std::tie(rhs.e);
+    }
+    inline bool operator>(const A& rhs) const {
+      return std::tie(e) > std::tie(rhs.e);
+    }
+    inline bool operator>=(const A& rhs) const {
+      return std::tie(e) >= std::tie(rhs.e);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "A{";
+      os << "e: " << ::android::internal::ToString(e);
+      os << "}";
+      return os.str();
+    }
+  };
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const DeeplyNested&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const DeeplyNested&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const DeeplyNested&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const DeeplyNested&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const DeeplyNested&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const DeeplyNested&) const {
+    return std::tie() >= std::tie();
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "DeeplyNested{";
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+[[nodiscard]] static inline std::string toString(DeeplyNested::B::C::D::E val) {
+  switch(val) {
+  case DeeplyNested::B::C::D::E::OK:
+    return "OK";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::nested::DeeplyNested::B::C::D::E, 1> enum_values<aidl::android::aidl::tests::nested::DeeplyNested::B::C::D::E> = {
+  aidl::android::aidl::tests::nested::DeeplyNested::B::C::D::E::OK,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/INestedService.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/INestedService.h
new file mode 100644
index 0000000..5ec478f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/INestedService.h
@@ -0,0 +1,142 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_ibinder.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/nested/INestedService.h>
+#include <aidl/android/aidl/tests/nested/ParcelableWithNested.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::tests::nested {
+class ParcelableWithNested;
+}  // namespace aidl::android::aidl::tests::nested
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class INestedServiceDelegator;
+
+class INestedService : public ::ndk::ICInterface {
+public:
+  typedef INestedServiceDelegator DefaultDelegator;
+  static const char* descriptor;
+  INestedService();
+  virtual ~INestedService();
+
+  class Result {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    ::aidl::android::aidl::tests::nested::ParcelableWithNested::Status status = ::aidl::android::aidl::tests::nested::ParcelableWithNested::Status::OK;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const Result& rhs) const {
+      return std::tie(status) != std::tie(rhs.status);
+    }
+    inline bool operator<(const Result& rhs) const {
+      return std::tie(status) < std::tie(rhs.status);
+    }
+    inline bool operator<=(const Result& rhs) const {
+      return std::tie(status) <= std::tie(rhs.status);
+    }
+    inline bool operator==(const Result& rhs) const {
+      return std::tie(status) == std::tie(rhs.status);
+    }
+    inline bool operator>(const Result& rhs) const {
+      return std::tie(status) > std::tie(rhs.status);
+    }
+    inline bool operator>=(const Result& rhs) const {
+      return std::tie(status) >= std::tie(rhs.status);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "Result{";
+      os << "status: " << ::android::internal::ToString(status);
+      os << "}";
+      return os.str();
+    }
+  };
+  class ICallbackDelegator;
+
+  class ICallback : public ::ndk::ICInterface {
+  public:
+    typedef ICallbackDelegator DefaultDelegator;
+    static const char* descriptor;
+    ICallback();
+    virtual ~ICallback();
+
+    static constexpr uint32_t TRANSACTION_done = FIRST_CALL_TRANSACTION + 0;
+
+    static std::shared_ptr<ICallback> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<ICallback>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<ICallback>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<ICallback>& impl);
+    static const std::shared_ptr<ICallback>& getDefaultImpl();
+    virtual ::ndk::ScopedAStatus done(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status) = 0;
+  private:
+    static std::shared_ptr<ICallback> default_impl;
+  };
+  class ICallbackDefault : public ICallback {
+  public:
+    ::ndk::ScopedAStatus done(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status) override;
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpCallback : public ::ndk::BpCInterface<ICallback> {
+  public:
+    explicit BpCallback(const ::ndk::SpAIBinder& binder);
+    virtual ~BpCallback();
+
+    ::ndk::ScopedAStatus done(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status) override;
+  };
+  class BnCallback : public ::ndk::BnCInterface<ICallback> {
+  public:
+    BnCallback();
+    virtual ~BnCallback();
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  static constexpr uint32_t TRANSACTION_flipStatus = FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_flipStatusWithCallback = FIRST_CALL_TRANSACTION + 1;
+
+  static std::shared_ptr<INestedService> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<INestedService>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<INestedService>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<INestedService>& impl);
+  static const std::shared_ptr<INestedService>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus flipStatus(const ::aidl::android::aidl::tests::nested::ParcelableWithNested& in_p, ::aidl::android::aidl::tests::nested::INestedService::Result* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus flipStatusWithCallback(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status, const std::shared_ptr<::aidl::android::aidl::tests::nested::INestedService::ICallback>& in_cb) = 0;
+private:
+  static std::shared_ptr<INestedService> default_impl;
+};
+class INestedServiceDefault : public INestedService {
+public:
+  ::ndk::ScopedAStatus flipStatus(const ::aidl::android::aidl::tests::nested::ParcelableWithNested& in_p, ::aidl::android::aidl::tests::nested::INestedService::Result* _aidl_return) override;
+  ::ndk::ScopedAStatus flipStatusWithCallback(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status, const std::shared_ptr<::aidl::android::aidl::tests::nested::INestedService::ICallback>& in_cb) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/ParcelableWithNested.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/ParcelableWithNested.h
new file mode 100644
index 0000000..eb7404a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/ParcelableWithNested.h
@@ -0,0 +1,106 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/nested/ParcelableWithNested.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class ParcelableWithNested {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Status : int8_t {
+    OK = 0,
+    NOT_OK = 1,
+  };
+
+  ::aidl::android::aidl::tests::nested::ParcelableWithNested::Status status = ::aidl::android::aidl::tests::nested::ParcelableWithNested::Status::OK;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const ParcelableWithNested& rhs) const {
+    return std::tie(status) != std::tie(rhs.status);
+  }
+  inline bool operator<(const ParcelableWithNested& rhs) const {
+    return std::tie(status) < std::tie(rhs.status);
+  }
+  inline bool operator<=(const ParcelableWithNested& rhs) const {
+    return std::tie(status) <= std::tie(rhs.status);
+  }
+  inline bool operator==(const ParcelableWithNested& rhs) const {
+    return std::tie(status) == std::tie(rhs.status);
+  }
+  inline bool operator>(const ParcelableWithNested& rhs) const {
+    return std::tie(status) > std::tie(rhs.status);
+  }
+  inline bool operator>=(const ParcelableWithNested& rhs) const {
+    return std::tie(status) >= std::tie(rhs.status);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ParcelableWithNested{";
+    os << "status: " << ::android::internal::ToString(status);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+[[nodiscard]] static inline std::string toString(ParcelableWithNested::Status val) {
+  switch(val) {
+  case ParcelableWithNested::Status::OK:
+    return "OK";
+  case ParcelableWithNested::Status::NOT_OK:
+    return "NOT_OK";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::nested::ParcelableWithNested::Status, 2> enum_values<aidl::android::aidl::tests::nested::ParcelableWithNested::Status> = {
+  aidl::android::aidl::tests::nested::ParcelableWithNested::Status::OK,
+  aidl::android::aidl::tests::nested::ParcelableWithNested::Status::NOT_OK,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BnEnumUnion.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BnEnumUnion.h
new file mode 100644
index 0000000..1b9fb99
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BnEnumUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BnUnionInUnion.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BnUnionInUnion.h
new file mode 100644
index 0000000..0617da7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BnUnionInUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BpEnumUnion.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BpEnumUnion.h
new file mode 100644
index 0000000..997e6fc
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BpEnumUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BpUnionInUnion.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BpUnionInUnion.h
new file mode 100644
index 0000000..77d0764
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BpUnionInUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/EnumUnion.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/EnumUnion.h
new file mode 100644
index 0000000..9dd7376
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/EnumUnion.h
@@ -0,0 +1,180 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/IntEnum.h>
+#include <aidl/android/aidl/tests/LongEnum.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+class EnumUnion {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Tag : int32_t {
+    intEnum = 0,
+    longEnum = 1,
+    deprecatedField __attribute__((deprecated("do not use this"))) = 2,
+  };
+
+  // Expose tag symbols for legacy code
+  static const inline Tag intEnum = Tag::intEnum;
+  static const inline Tag longEnum = Tag::longEnum;
+  static const inline Tag __attribute__((deprecated("do not use this"))) deprecatedField = Tag::deprecatedField;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, EnumUnion>;
+
+  EnumUnion() : _value(std::in_place_index<static_cast<size_t>(intEnum)>, ::aidl::android::aidl::tests::IntEnum(::aidl::android::aidl::tests::IntEnum::FOO)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr EnumUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit EnumUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static EnumUnion make(_Tp&&... _args) {
+    return EnumUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static EnumUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return EnumUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  binder_status_t readFromParcel(const AParcel* _parcel);
+  binder_status_t writeToParcel(AParcel* _parcel) const;
+
+  inline bool operator!=(const EnumUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const EnumUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const EnumUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const EnumUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const EnumUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const EnumUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "EnumUnion{";
+    switch (getTag()) {
+    case intEnum: os << "intEnum: " << ::android::internal::ToString(get<intEnum>()); break;
+    case longEnum: os << "longEnum: " << ::android::internal::ToString(get<longEnum>()); break;
+    case deprecatedField: os << "deprecatedField: " << ::android::internal::ToString(get<deprecatedField>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<::aidl::android::aidl::tests::IntEnum, ::aidl::android::aidl::tests::LongEnum, int32_t> _value;
+};
+#pragma clang diagnostic pop
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+[[nodiscard]] static inline std::string toString(EnumUnion::Tag val) {
+  switch(val) {
+  case EnumUnion::Tag::intEnum:
+    return "intEnum";
+  case EnumUnion::Tag::longEnum:
+    return "longEnum";
+  case EnumUnion::Tag::deprecatedField:
+    return "deprecatedField";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+#pragma clang diagnostic pop
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::unions::EnumUnion::Tag, 3> enum_values<aidl::android::aidl::tests::unions::EnumUnion::Tag> = {
+  aidl::android::aidl::tests::unions::EnumUnion::Tag::intEnum,
+  aidl::android::aidl::tests::unions::EnumUnion::Tag::longEnum,
+  aidl::android::aidl::tests::unions::EnumUnion::Tag::deprecatedField,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/UnionInUnion.h b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/UnionInUnion.h
new file mode 100644
index 0000000..d84452a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/UnionInUnion.h
@@ -0,0 +1,166 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/unions/EnumUnion.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+class UnionInUnion {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Tag : int32_t {
+    first = 0,
+    second = 1,
+  };
+
+  // Expose tag symbols for legacy code
+  static const inline Tag first = Tag::first;
+  static const inline Tag second = Tag::second;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, UnionInUnion>;
+
+  UnionInUnion() : _value(std::in_place_index<static_cast<size_t>(first)>, ::aidl::android::aidl::tests::unions::EnumUnion()) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr UnionInUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit UnionInUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static UnionInUnion make(_Tp&&... _args) {
+    return UnionInUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static UnionInUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return UnionInUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  binder_status_t readFromParcel(const AParcel* _parcel);
+  binder_status_t writeToParcel(AParcel* _parcel) const;
+
+  inline bool operator!=(const UnionInUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const UnionInUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const UnionInUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const UnionInUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const UnionInUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const UnionInUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "UnionInUnion{";
+    switch (getTag()) {
+    case first: os << "first: " << ::android::internal::ToString(get<first>()); break;
+    case second: os << "second: " << ::android::internal::ToString(get<second>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<::aidl::android::aidl::tests::unions::EnumUnion, int32_t> _value;
+};
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+[[nodiscard]] static inline std::string toString(UnionInUnion::Tag val) {
+  switch(val) {
+  case UnionInUnion::Tag::first:
+    return "first";
+  case UnionInUnion::Tag::second:
+    return "second";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::unions::UnionInUnion::Tag, 2> enum_values<aidl::android::aidl::tests::unions::UnionInUnion::Tag> = {
+  aidl::android::aidl::tests::unions::UnionInUnion::Tag::first,
+  aidl::android::aidl::tests::unions::UnionInUnion::Tag::second,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-interface-ndk-source/gen/timestamp b/tests/golden_output/aidl-test-interface-ndk-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/INoPermission.java b/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/INoPermission.java
new file mode 100644
index 0000000..1013bed
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/INoPermission.java
@@ -0,0 +1,131 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/INoPermission.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen -Iframeworks/base/core/java -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/permission/INoPermission.aidl
+ */
+package android.aidl.tests.permission;
+public interface INoPermission extends android.os.IInterface
+{
+  /** Default implementation for INoPermission. */
+  public static class Default implements android.aidl.tests.permission.INoPermission
+  {
+    @Override public void foo() throws android.os.RemoteException
+    {
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.permission.INoPermission
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.permission.INoPermission interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.permission.INoPermission asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.permission.INoPermission))) {
+        return ((android.aidl.tests.permission.INoPermission)iin);
+      }
+      return new android.aidl.tests.permission.INoPermission.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_foo:
+        {
+          return "foo";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_foo:
+        {
+          this.foo();
+          reply.writeNoException();
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.permission.INoPermission
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public void foo() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_foo, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+    }
+    static final int TRANSACTION_foo = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 0;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.permission.INoPermission";
+  @android.annotation.RequiresNoPermission
+  public void foo() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/INoPermission.java.d b/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/INoPermission.java.d
new file mode 100644
index 0000000..c213fdc
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/INoPermission.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/INoPermission.java : \
+  system/tools/aidl/tests/android/aidl/tests/permission/INoPermission.aidl
diff --git a/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtected.java b/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtected.java
new file mode 100644
index 0000000..96a2468
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtected.java
@@ -0,0 +1,351 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtected.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen -Iframeworks/base/core/java -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/permission/IProtected.aidl
+ */
+package android.aidl.tests.permission;
+public interface IProtected extends android.os.IInterface
+{
+  /** Default implementation for IProtected. */
+  public static class Default implements android.aidl.tests.permission.IProtected
+  {
+    @Override public void PermissionProtected() throws android.os.RemoteException
+    {
+    }
+    @Override public void MultiplePermissionsAll() throws android.os.RemoteException
+    {
+    }
+    @Override public void MultiplePermissionsAny() throws android.os.RemoteException
+    {
+    }
+    @Override public void NonManifestPermission() throws android.os.RemoteException
+    {
+    }
+    // Used by the integration tests to dynamically set permissions that are considered granted.
+    @Override public void Grant(java.lang.String permission) throws android.os.RemoteException
+    {
+    }
+    @Override public void Revoke(java.lang.String permission) throws android.os.RemoteException
+    {
+    }
+    @Override public void RevokeAll() throws android.os.RemoteException
+    {
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.permission.IProtected
+  {
+    private final android.os.PermissionEnforcer mEnforcer;
+    /** Construct the stub using the Enforcer provided. */
+    public Stub(android.os.PermissionEnforcer enforcer)
+    {
+      this.attachInterface(this, DESCRIPTOR);
+      if (enforcer == null) {
+        throw new IllegalArgumentException("enforcer cannot be null");
+      }
+      mEnforcer = enforcer;
+    }
+    @Deprecated
+    /** Default constructor. */
+    public Stub() {
+      this(android.os.PermissionEnforcer.fromContext(
+         android.app.ActivityThread.currentActivityThread().getSystemContext()));
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.permission.IProtected interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.permission.IProtected asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.permission.IProtected))) {
+        return ((android.aidl.tests.permission.IProtected)iin);
+      }
+      return new android.aidl.tests.permission.IProtected.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_PermissionProtected:
+        {
+          return "PermissionProtected";
+        }
+        case TRANSACTION_MultiplePermissionsAll:
+        {
+          return "MultiplePermissionsAll";
+        }
+        case TRANSACTION_MultiplePermissionsAny:
+        {
+          return "MultiplePermissionsAny";
+        }
+        case TRANSACTION_NonManifestPermission:
+        {
+          return "NonManifestPermission";
+        }
+        case TRANSACTION_Grant:
+        {
+          return "Grant";
+        }
+        case TRANSACTION_Revoke:
+        {
+          return "Revoke";
+        }
+        case TRANSACTION_RevokeAll:
+        {
+          return "RevokeAll";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_PermissionProtected:
+        {
+          this.PermissionProtected();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_MultiplePermissionsAll:
+        {
+          this.MultiplePermissionsAll();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_MultiplePermissionsAny:
+        {
+          this.MultiplePermissionsAny();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_NonManifestPermission:
+        {
+          this.NonManifestPermission();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_Grant:
+        {
+          java.lang.String _arg0;
+          _arg0 = data.readString();
+          data.enforceNoDataAvail();
+          this.Grant(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_Revoke:
+        {
+          java.lang.String _arg0;
+          _arg0 = data.readString();
+          data.enforceNoDataAvail();
+          this.Revoke(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_RevokeAll:
+        {
+          this.RevokeAll();
+          reply.writeNoException();
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.permission.IProtected
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public void PermissionProtected() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_PermissionProtected, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void MultiplePermissionsAll() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_MultiplePermissionsAll, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void MultiplePermissionsAny() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_MultiplePermissionsAny, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void NonManifestPermission() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_NonManifestPermission, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      // Used by the integration tests to dynamically set permissions that are considered granted.
+      @Override public void Grant(java.lang.String permission) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeString(permission);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_Grant, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void Revoke(java.lang.String permission) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeString(permission);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_Revoke, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void RevokeAll() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RevokeAll, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+    }
+    static final int TRANSACTION_PermissionProtected = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    /** Helper method to enforce permissions for PermissionProtected */
+    protected void PermissionProtected_enforcePermission() throws SecurityException {
+      mEnforcer.enforcePermission(android.Manifest.permission.READ_PHONE_STATE, getCallingPid(), getCallingUid());
+    }
+    static final int TRANSACTION_MultiplePermissionsAll = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    static final String[] PERMISSIONS_MultiplePermissionsAll = {android.Manifest.permission.INTERNET, android.Manifest.permission.VIBRATE};
+    /** Helper method to enforce permissions for MultiplePermissionsAll */
+    protected void MultiplePermissionsAll_enforcePermission() throws SecurityException {
+      mEnforcer.enforcePermissionAllOf(PERMISSIONS_MultiplePermissionsAll, getCallingPid(), getCallingUid());
+    }
+    static final int TRANSACTION_MultiplePermissionsAny = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+    static final String[] PERMISSIONS_MultiplePermissionsAny = {android.Manifest.permission.INTERNET, android.Manifest.permission.VIBRATE};
+    /** Helper method to enforce permissions for MultiplePermissionsAny */
+    protected void MultiplePermissionsAny_enforcePermission() throws SecurityException {
+      mEnforcer.enforcePermissionAnyOf(PERMISSIONS_MultiplePermissionsAny, getCallingPid(), getCallingUid());
+    }
+    static final int TRANSACTION_NonManifestPermission = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+    /** Helper method to enforce permissions for NonManifestPermission */
+    protected void NonManifestPermission_enforcePermission() throws SecurityException {
+      mEnforcer.enforcePermission(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, getCallingPid(), getCallingUid());
+    }
+    static final int TRANSACTION_Grant = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
+    static final int TRANSACTION_Revoke = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5);
+    static final int TRANSACTION_RevokeAll = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 6;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.permission.IProtected";
+  @android.annotation.EnforcePermission(android.Manifest.permission.READ_PHONE_STATE)
+  public void PermissionProtected() throws android.os.RemoteException;
+  @android.annotation.EnforcePermission(allOf = {android.Manifest.permission.INTERNET, android.Manifest.permission.VIBRATE})
+  public void MultiplePermissionsAll() throws android.os.RemoteException;
+  @android.annotation.EnforcePermission(anyOf = {android.Manifest.permission.INTERNET, android.Manifest.permission.VIBRATE})
+  public void MultiplePermissionsAny() throws android.os.RemoteException;
+  @android.annotation.EnforcePermission(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK)
+  public void NonManifestPermission() throws android.os.RemoteException;
+  // Used by the integration tests to dynamically set permissions that are considered granted.
+  @android.annotation.RequiresNoPermission
+  public void Grant(java.lang.String permission) throws android.os.RemoteException;
+  @android.annotation.RequiresNoPermission
+  public void Revoke(java.lang.String permission) throws android.os.RemoteException;
+  @android.annotation.RequiresNoPermission
+  public void RevokeAll() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtected.java.d b/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtected.java.d
new file mode 100644
index 0000000..752e4bf
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtected.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtected.java : \
+  system/tools/aidl/tests/android/aidl/tests/permission/IProtected.aidl
diff --git a/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtectedInterface.java b/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtectedInterface.java
new file mode 100644
index 0000000..e79abe3
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtectedInterface.java
@@ -0,0 +1,180 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtectedInterface.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen -Iframeworks/base/core/java -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/permission/IProtectedInterface.aidl
+ */
+package android.aidl.tests.permission;
+public interface IProtectedInterface extends android.os.IInterface
+{
+  /** Default implementation for IProtectedInterface. */
+  public static class Default implements android.aidl.tests.permission.IProtectedInterface
+  {
+    @Override public void Method1() throws android.os.RemoteException
+    {
+    }
+    @Override public void Method2() throws android.os.RemoteException
+    {
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.permission.IProtectedInterface
+  {
+    private final android.os.PermissionEnforcer mEnforcer;
+    /** Construct the stub using the Enforcer provided. */
+    public Stub(android.os.PermissionEnforcer enforcer)
+    {
+      this.attachInterface(this, DESCRIPTOR);
+      if (enforcer == null) {
+        throw new IllegalArgumentException("enforcer cannot be null");
+      }
+      mEnforcer = enforcer;
+    }
+    @Deprecated
+    /** Default constructor. */
+    public Stub() {
+      this(android.os.PermissionEnforcer.fromContext(
+         android.app.ActivityThread.currentActivityThread().getSystemContext()));
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.permission.IProtectedInterface interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.permission.IProtectedInterface asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.permission.IProtectedInterface))) {
+        return ((android.aidl.tests.permission.IProtectedInterface)iin);
+      }
+      return new android.aidl.tests.permission.IProtectedInterface.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_Method1:
+        {
+          return "Method1";
+        }
+        case TRANSACTION_Method2:
+        {
+          return "Method2";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_Method1:
+        {
+          this.Method1();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_Method2:
+        {
+          this.Method2();
+          reply.writeNoException();
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.permission.IProtectedInterface
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public void Method1() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_Method1, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void Method2() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_Method2, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+    }
+    static final int TRANSACTION_Method1 = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    /** Helper method to enforce permissions for Method1 */
+    protected void Method1_enforcePermission() throws SecurityException {
+      mEnforcer.enforcePermission(android.Manifest.permission.ACCESS_FINE_LOCATION, getCallingPid(), getCallingUid());
+    }
+    static final int TRANSACTION_Method2 = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    /** Helper method to enforce permissions for Method2 */
+    protected void Method2_enforcePermission() throws SecurityException {
+      mEnforcer.enforcePermission(android.Manifest.permission.ACCESS_FINE_LOCATION, getCallingPid(), getCallingUid());
+    }
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 1;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.permission.IProtectedInterface";
+  @android.annotation.EnforcePermission(android.Manifest.permission.ACCESS_FINE_LOCATION)
+  public void Method1() throws android.os.RemoteException;
+  @android.annotation.EnforcePermission(android.Manifest.permission.ACCESS_FINE_LOCATION)
+  public void Method2() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtectedInterface.java.d b/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtectedInterface.java.d
new file mode 100644
index 0000000..1a36e38
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtectedInterface.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtectedInterface.java : \
+  system/tools/aidl/tests/android/aidl/tests/permission/IProtectedInterface.aidl
diff --git a/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/platform/IProtected.java b/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/platform/IProtected.java
new file mode 100644
index 0000000..ca05d0d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/platform/IProtected.java
@@ -0,0 +1,151 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/platform/IProtected.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen -Iframeworks/base/core/java -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/permission/platform/IProtected.aidl
+ */
+package android.aidl.tests.permission.platform;
+public interface IProtected extends android.os.IInterface
+{
+  /** Default implementation for IProtected. */
+  public static class Default implements android.aidl.tests.permission.platform.IProtected
+  {
+    @Override public void ProtectedWithSourceAttribution(android.content.AttributionSource source) throws android.os.RemoteException
+    {
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.permission.platform.IProtected
+  {
+    private final android.os.PermissionEnforcer mEnforcer;
+    /** Construct the stub using the Enforcer provided. */
+    public Stub(android.os.PermissionEnforcer enforcer)
+    {
+      this.attachInterface(this, DESCRIPTOR);
+      if (enforcer == null) {
+        throw new IllegalArgumentException("enforcer cannot be null");
+      }
+      mEnforcer = enforcer;
+    }
+    @Deprecated
+    /** Default constructor. */
+    public Stub() {
+      this(android.os.PermissionEnforcer.fromContext(
+         android.app.ActivityThread.currentActivityThread().getSystemContext()));
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.permission.platform.IProtected interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.permission.platform.IProtected asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.permission.platform.IProtected))) {
+        return ((android.aidl.tests.permission.platform.IProtected)iin);
+      }
+      return new android.aidl.tests.permission.platform.IProtected.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_ProtectedWithSourceAttribution:
+        {
+          return "ProtectedWithSourceAttribution";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_ProtectedWithSourceAttribution:
+        {
+          android.content.AttributionSource _arg0;
+          _arg0 = data.readTypedObject(android.content.AttributionSource.CREATOR);
+          data.enforceNoDataAvail();
+          this.ProtectedWithSourceAttribution(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.permission.platform.IProtected
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public void ProtectedWithSourceAttribution(android.content.AttributionSource source) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(source, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ProtectedWithSourceAttribution, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+    }
+    static final int TRANSACTION_ProtectedWithSourceAttribution = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    static final String[] PERMISSIONS_ProtectedWithSourceAttribution = {android.Manifest.permission.INTERNET, android.Manifest.permission.VIBRATE};
+    /** Helper method to enforce permissions for ProtectedWithSourceAttribution */
+    protected void ProtectedWithSourceAttribution_enforcePermission() throws SecurityException {
+      mEnforcer.enforcePermissionAllOf(PERMISSIONS_ProtectedWithSourceAttribution, getCallingPid(), getCallingUid());
+    }
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 0;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.permission.platform.IProtected";
+  @android.annotation.EnforcePermission(allOf = {android.Manifest.permission.INTERNET, android.Manifest.permission.VIBRATE})
+  public void ProtectedWithSourceAttribution(android.content.AttributionSource source) throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/platform/IProtected.java.d b/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/platform/IProtected.java.d
new file mode 100644
index 0000000..86866a2
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/platform/IProtected.java.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/platform/IProtected.java : \
+  system/tools/aidl/tests/android/aidl/tests/permission/platform/IProtected.aidl \
+  frameworks/base/core/java/android/content/AttributionSource.aidl
diff --git a/tests/golden_output/aidl-test-interface-permission-java-source/gen/timestamp b/tests/golden_output/aidl-test-interface-permission-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-permission-java-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-interface-platform-java-source/gen/timestamp b/tests/golden_output/aidl-test-interface-platform-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-platform-java-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs
new file mode 100644
index 0000000..f8ff563
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs
@@ -0,0 +1,411 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#ArrayOfInterfaces {
+}
+impl Default for r#ArrayOfInterfaces {
+  fn default() -> Self {
+    Self {
+    }
+  }
+}
+impl binder::Parcelable for r#ArrayOfInterfaces {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#ArrayOfInterfaces);
+binder::impl_deserialize_for_parcelable!(r#ArrayOfInterfaces);
+impl binder::binder_impl::ParcelableMetadata for r#ArrayOfInterfaces {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.ArrayOfInterfaces" }
+}
+pub mod r#IEmptyInterface {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    IEmptyInterface["android.aidl.tests.ArrayOfInterfaces.IEmptyInterface"] {
+      native: BnEmptyInterface(on_transact),
+      proxy: BpEmptyInterface {
+      },
+      async: IEmptyInterfaceAsync,
+    }
+  }
+  pub trait IEmptyInterface: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ArrayOfInterfaces.IEmptyInterface" }
+    fn getDefaultImpl() -> IEmptyInterfaceDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: IEmptyInterfaceDefaultRef) -> IEmptyInterfaceDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait IEmptyInterfaceAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ArrayOfInterfaces.IEmptyInterface" }
+  }
+  #[::async_trait::async_trait]
+  pub trait IEmptyInterfaceAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ArrayOfInterfaces.IEmptyInterface" }
+  }
+  impl BnEmptyInterface {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IEmptyInterface>
+    where
+      T: IEmptyInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> IEmptyInterface for Wrapper<T, R>
+      where
+        T: IEmptyInterfaceAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait IEmptyInterfaceDefault: Send + Sync {
+  }
+  pub mod transactions {
+  }
+  pub type IEmptyInterfaceDefaultRef = Option<std::sync::Arc<dyn IEmptyInterfaceDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None);
+  }
+  impl BpEmptyInterface {
+  }
+  impl IEmptyInterface for BpEmptyInterface {
+  }
+  impl<P: binder::BinderAsyncPool> IEmptyInterfaceAsync<P> for BpEmptyInterface {
+  }
+  impl IEmptyInterface for binder::binder_impl::Binder<BnEmptyInterface> {
+  }
+  fn on_transact(_aidl_service: &dyn IEmptyInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub mod r#IMyInterface {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    IMyInterface["android.aidl.tests.ArrayOfInterfaces.IMyInterface"] {
+      native: BnMyInterface(on_transact),
+      proxy: BpMyInterface {
+      },
+      async: IMyInterfaceAsync,
+    }
+  }
+  pub trait IMyInterface: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ArrayOfInterfaces.IMyInterface" }
+    fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>>;
+    fn getDefaultImpl() -> IMyInterfaceDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: IMyInterfaceDefaultRef) -> IMyInterfaceDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait IMyInterfaceAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ArrayOfInterfaces.IMyInterface" }
+    fn r#methodWithInterfaces<'a>(&'a self, _arg_iface: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &'a [binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &'a mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &'a mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&'a [Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &'a mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &'a mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>>>;
+  }
+  #[::async_trait::async_trait]
+  pub trait IMyInterfaceAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ArrayOfInterfaces.IMyInterface" }
+    async fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>>;
+  }
+  impl BnMyInterface {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IMyInterface>
+    where
+      T: IMyInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> IMyInterface for Wrapper<T, R>
+      where
+        T: IMyInterfaceAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+        fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>> {
+          self._rt.block_on(self._inner.r#methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_array_in, _arg_iface_array_out, _arg_iface_array_inout, _arg_nullable_iface_array_in, _arg_nullable_iface_array_out, _arg_nullable_iface_array_inout))
+        }
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait IMyInterfaceDefault: Send + Sync {
+    fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+  }
+  pub mod transactions {
+    pub const r#methodWithInterfaces: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  }
+  pub type IMyInterfaceDefaultRef = Option<std::sync::Arc<dyn IMyInterfaceDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<IMyInterfaceDefaultRef> = std::sync::Mutex::new(None);
+  }
+  impl BpMyInterface {
+    fn build_parcel_methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_iface)?;
+      aidl_data.write(&_arg_nullable_iface)?;
+      aidl_data.write(_arg_iface_array_in)?;
+      aidl_data.write_slice_size(Some(_arg_iface_array_out))?;
+      aidl_data.write(_arg_iface_array_inout)?;
+      aidl_data.write(&_arg_nullable_iface_array_in)?;
+      aidl_data.write_slice_size(_arg_nullable_iface_array_out.as_deref())?;
+      aidl_data.write(_arg_nullable_iface_array_inout)?;
+      Ok(aidl_data)
+    }
+    fn read_response_methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyInterface>::getDefaultImpl() {
+          return _aidl_default_impl.r#methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_array_in, _arg_iface_array_out, _arg_iface_array_inout, _arg_nullable_iface_array_in, _arg_nullable_iface_array_out, _arg_nullable_iface_array_inout);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>> = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_iface_array_out)?;
+      _aidl_reply.read_onto(_arg_iface_array_inout)?;
+      _aidl_reply.read_onto(_arg_nullable_iface_array_out)?;
+      _aidl_reply.read_onto(_arg_nullable_iface_array_inout)?;
+      Ok(_aidl_return)
+    }
+  }
+  impl IMyInterface for BpMyInterface {
+    fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>> {
+      let _aidl_data = self.build_parcel_methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_array_in, _arg_iface_array_out, _arg_iface_array_inout, _arg_nullable_iface_array_in, _arg_nullable_iface_array_out, _arg_nullable_iface_array_inout)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#methodWithInterfaces, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_array_in, _arg_iface_array_out, _arg_iface_array_inout, _arg_nullable_iface_array_in, _arg_nullable_iface_array_out, _arg_nullable_iface_array_inout, _aidl_reply)
+    }
+  }
+  impl<P: binder::BinderAsyncPool> IMyInterfaceAsync<P> for BpMyInterface {
+    fn r#methodWithInterfaces<'a>(&'a self, _arg_iface: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &'a [binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &'a mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &'a mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&'a [Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &'a mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &'a mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>>> {
+      let _aidl_data = match self.build_parcel_methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_array_in, _arg_iface_array_out, _arg_iface_array_inout, _arg_nullable_iface_array_in, _arg_nullable_iface_array_out, _arg_nullable_iface_array_inout) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#methodWithInterfaces, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_array_in, _arg_iface_array_out, _arg_iface_array_inout, _arg_nullable_iface_array_in, _arg_nullable_iface_array_out, _arg_nullable_iface_array_inout, _aidl_reply)
+        }
+      )
+    }
+  }
+  impl IMyInterface for binder::binder_impl::Binder<BnMyInterface> {
+    fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>> { self.0.r#methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_array_in, _arg_iface_array_out, _arg_iface_array_inout, _arg_nullable_iface_array_in, _arg_nullable_iface_array_out, _arg_nullable_iface_array_inout) }
+  }
+  fn on_transact(_aidl_service: &dyn IMyInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      transactions::r#methodWithInterfaces => {
+        let _arg_iface: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface> = _aidl_data.read()?;
+        let _arg_nullable_iface: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>> = _aidl_data.read()?;
+        let _arg_iface_array_in: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>> = _aidl_data.read()?;
+        let mut _arg_iface_array_out: Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>> = Default::default();
+        _aidl_data.resize_out_vec(&mut _arg_iface_array_out)?;
+        let mut _arg_iface_array_inout: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>> = _aidl_data.read()?;
+        let _arg_nullable_iface_array_in: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>> = _aidl_data.read()?;
+        let mut _arg_nullable_iface_array_out: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>> = Default::default();
+        _aidl_data.resize_nullable_out_vec(&mut _arg_nullable_iface_array_out)?;
+        let mut _arg_nullable_iface_array_inout: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>> = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#methodWithInterfaces(&_arg_iface, _arg_nullable_iface.as_ref(), &_arg_iface_array_in, &mut _arg_iface_array_out, &mut _arg_iface_array_inout, _arg_nullable_iface_array_in.as_deref(), &mut _arg_nullable_iface_array_out, &mut _arg_nullable_iface_array_inout);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_iface_array_out)?;
+            _aidl_reply.write(&_arg_iface_array_inout)?;
+            _aidl_reply.write(&_arg_nullable_iface_array_out)?;
+            _aidl_reply.write(&_arg_nullable_iface_array_inout)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub mod r#MyParcelable {
+  #[derive(Debug)]
+  pub struct r#MyParcelable {
+    pub r#iface: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>,
+    pub r#nullable_iface: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>,
+    pub r#iface_array: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>,
+    pub r#nullable_iface_array: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>,
+  }
+  impl Default for r#MyParcelable {
+    fn default() -> Self {
+      Self {
+        r#iface: Default::default(),
+        r#nullable_iface: Default::default(),
+        r#iface_array: Default::default(),
+        r#nullable_iface_array: Default::default(),
+      }
+    }
+  }
+  impl binder::Parcelable for r#MyParcelable {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        let __field_ref = self.r#iface.as_ref().ok_or(binder::StatusCode::UNEXPECTED_NULL)?;
+        subparcel.write(__field_ref)?;
+        subparcel.write(&self.r#nullable_iface)?;
+        subparcel.write(&self.r#iface_array)?;
+        subparcel.write(&self.r#nullable_iface_array)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#iface = Some(subparcel.read()?);
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_iface = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#iface_array = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_iface_array = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyParcelable);
+  binder::impl_deserialize_for_parcelable!(r#MyParcelable);
+  impl binder::binder_impl::ParcelableMetadata for r#MyParcelable {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.ArrayOfInterfaces.MyParcelable" }
+  }
+}
+pub mod r#MyUnion {
+  #[derive(Debug)]
+  pub enum r#MyUnion {
+    Iface(Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>),
+    Nullable_iface(Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>),
+    Iface_array(Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>),
+    Nullable_iface_array(Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>),
+  }
+  impl Default for r#MyUnion {
+    fn default() -> Self {
+      Self::Iface(Default::default())
+    }
+  }
+  impl binder::Parcelable for r#MyUnion {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      match self {
+        Self::Iface(v) => {
+          parcel.write(&0i32)?;
+          let __field_ref = v.as_ref().ok_or(binder::StatusCode::UNEXPECTED_NULL)?;
+          parcel.write(__field_ref)
+        }
+        Self::Nullable_iface(v) => {
+          parcel.write(&1i32)?;
+          parcel.write(v)
+        }
+        Self::Iface_array(v) => {
+          parcel.write(&2i32)?;
+          parcel.write(v)
+        }
+        Self::Nullable_iface_array(v) => {
+          parcel.write(&3i32)?;
+          parcel.write(v)
+        }
+      }
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      let tag: i32 = parcel.read()?;
+      match tag {
+        0 => {
+          let value: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>> = Some(parcel.read()?);
+          *self = Self::Iface(value);
+          Ok(())
+        }
+        1 => {
+          let value: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>> = parcel.read()?;
+          *self = Self::Nullable_iface(value);
+          Ok(())
+        }
+        2 => {
+          let value: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>> = parcel.read()?;
+          *self = Self::Iface_array(value);
+          Ok(())
+        }
+        3 => {
+          let value: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>> = parcel.read()?;
+          *self = Self::Nullable_iface_array(value);
+          Ok(())
+        }
+        _ => {
+          Err(binder::StatusCode::BAD_VALUE)
+        }
+      }
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyUnion);
+  binder::impl_deserialize_for_parcelable!(r#MyUnion);
+  impl binder::binder_impl::ParcelableMetadata for r#MyUnion {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.ArrayOfInterfaces.MyUnion" }
+  }
+  pub mod r#Tag {
+    #![allow(non_upper_case_globals)]
+    use binder::declare_binder_enum;
+    declare_binder_enum! {
+      r#Tag : [i32; 4] {
+        r#iface = 0,
+        r#nullable_iface = 1,
+        r#iface_array = 2,
+        r#nullable_iface_array = 3,
+      }
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ArrayOfInterfaces as _7_android_4_aidl_5_tests_17_ArrayOfInterfaces;
+ pub use super::r#IEmptyInterface::r#IEmptyInterface as _7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface;
+ pub use super::r#IMyInterface::r#IMyInterface as _7_android_4_aidl_5_tests_17_ArrayOfInterfaces_12_IMyInterface;
+ pub use super::r#MyParcelable::r#MyParcelable as _7_android_4_aidl_5_tests_17_ArrayOfInterfaces_12_MyParcelable;
+ pub use super::r#MyUnion::r#MyUnion as _7_android_4_aidl_5_tests_17_ArrayOfInterfaces_7_MyUnion;
+ pub use super::r#MyUnion::r#Tag::r#Tag as _7_android_4_aidl_5_tests_17_ArrayOfInterfaces_7_MyUnion_3_Tag;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs.d
new file mode 100644
index 0000000..23e7dc5
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs : \
+  system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/BackendType.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/BackendType.rs
new file mode 100644
index 0000000..3433438
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/BackendType.rs
@@ -0,0 +1,19 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/BackendType.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+use binder::declare_binder_enum;
+declare_binder_enum! {
+  r#BackendType : [i8; 4] {
+    r#CPP = 0,
+    r#JAVA = 1,
+    r#NDK = 2,
+    r#RUST = 3,
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#BackendType as _7_android_4_aidl_5_tests_11_BackendType;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/BackendType.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/BackendType.rs.d
new file mode 100644
index 0000000..065463e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/BackendType.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/BackendType.rs : \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ByteEnum.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ByteEnum.rs
new file mode 100644
index 0000000..ac8d1a6
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ByteEnum.rs
@@ -0,0 +1,18 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ByteEnum.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+use binder::declare_binder_enum;
+declare_binder_enum! {
+  r#ByteEnum : [i8; 3] {
+    r#FOO = 1,
+    r#BAR = 2,
+    r#BAZ = 3,
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ByteEnum as _7_android_4_aidl_5_tests_8_ByteEnum;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ByteEnum.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ByteEnum.rs.d
new file mode 100644
index 0000000..f91b6e9
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ByteEnum.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ByteEnum.rs : \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/CircularParcelable.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/CircularParcelable.rs
new file mode 100644
index 0000000..d5d9097
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/CircularParcelable.rs
@@ -0,0 +1,41 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/CircularParcelable.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#CircularParcelable {
+  pub r#testService: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>,
+}
+impl Default for r#CircularParcelable {
+  fn default() -> Self {
+    Self {
+      r#testService: Default::default(),
+    }
+  }
+}
+impl binder::Parcelable for r#CircularParcelable {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#testService)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#testService = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#CircularParcelable);
+binder::impl_deserialize_for_parcelable!(r#CircularParcelable);
+impl binder::binder_impl::ParcelableMetadata for r#CircularParcelable {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.CircularParcelable" }
+}
+pub(crate) mod mangled {
+ pub use super::r#CircularParcelable as _7_android_4_aidl_5_tests_18_CircularParcelable;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/CircularParcelable.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/CircularParcelable.rs.d
new file mode 100644
index 0000000..f031808
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/CircularParcelable.rs.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/CircularParcelable.rs : \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ConstantExpressionEnum.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ConstantExpressionEnum.rs
new file mode 100644
index 0000000..16e136c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ConstantExpressionEnum.rs
@@ -0,0 +1,25 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ConstantExpressionEnum.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+use binder::declare_binder_enum;
+declare_binder_enum! {
+  r#ConstantExpressionEnum : [i32; 10] {
+    r#decInt32_1 = 1,
+    r#decInt32_2 = 1,
+    r#decInt64_1 = 1,
+    r#decInt64_2 = 1,
+    r#decInt64_3 = 1,
+    r#decInt64_4 = 1,
+    r#hexInt32_1 = 1,
+    r#hexInt32_2 = 1,
+    r#hexInt32_3 = 1,
+    r#hexInt64_1 = 1,
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ConstantExpressionEnum as _7_android_4_aidl_5_tests_22_ConstantExpressionEnum;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ConstantExpressionEnum.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ConstantExpressionEnum.rs.d
new file mode 100644
index 0000000..bd22319
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ConstantExpressionEnum.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ConstantExpressionEnum.rs : \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs
new file mode 100644
index 0000000..e8ac957
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs
@@ -0,0 +1,19 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+use binder::declare_binder_enum;
+declare_binder_enum! {
+  #[deprecated = "test"]
+  r#DeprecatedEnum : [i32; 3] {
+    r#A = 0,
+    r#B = 1,
+    r#C = 2,
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#DeprecatedEnum as _7_android_4_aidl_5_tests_14_DeprecatedEnum;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs.d
new file mode 100644
index 0000000..388f093
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs
new file mode 100644
index 0000000..41cc591
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs
@@ -0,0 +1,36 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+#[deprecated = "test"]
+pub struct r#DeprecatedParcelable {
+}
+impl Default for r#DeprecatedParcelable {
+  fn default() -> Self {
+    Self {
+    }
+  }
+}
+impl binder::Parcelable for r#DeprecatedParcelable {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#DeprecatedParcelable);
+binder::impl_deserialize_for_parcelable!(r#DeprecatedParcelable);
+impl binder::binder_impl::ParcelableMetadata for r#DeprecatedParcelable {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.DeprecatedParcelable" }
+}
+pub(crate) mod mangled {
+ pub use super::r#DeprecatedParcelable as _7_android_4_aidl_5_tests_20_DeprecatedParcelable;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs.d
new file mode 100644
index 0000000..a257852
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/FixedSize.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/FixedSize.rs
new file mode 100644
index 0000000..5fbba28
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/FixedSize.rs
@@ -0,0 +1,245 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/FixedSize.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#FixedSize {
+}
+impl Default for r#FixedSize {
+  fn default() -> Self {
+    Self {
+    }
+  }
+}
+impl binder::Parcelable for r#FixedSize {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#FixedSize);
+binder::impl_deserialize_for_parcelable!(r#FixedSize);
+impl binder::binder_impl::ParcelableMetadata for r#FixedSize {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.FixedSize" }
+}
+pub mod r#FixedParcelable {
+  #[derive(Debug)]
+  pub struct r#FixedParcelable {
+    pub r#booleanValue: bool,
+    pub r#byteValue: i8,
+    pub r#charValue: u16,
+    pub r#intValue: i32,
+    pub r#longValue: i64,
+    pub r#floatValue: f32,
+    pub r#doubleValue: f64,
+    pub r#enumValue: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum,
+    pub r#parcelableValue: crate::mangled::_7_android_4_aidl_5_tests_9_FixedSize_10_FixedUnion,
+  }
+  impl Default for r#FixedParcelable {
+    fn default() -> Self {
+      Self {
+        r#booleanValue: false,
+        r#byteValue: 0,
+        r#charValue: '\0' as u16,
+        r#intValue: 0,
+        r#longValue: 0,
+        r#floatValue: 0.000000f32,
+        r#doubleValue: 0.000000f64,
+        r#enumValue: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum::FOO,
+        r#parcelableValue: Default::default(),
+      }
+    }
+  }
+  impl binder::Parcelable for r#FixedParcelable {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        subparcel.write(&self.r#booleanValue)?;
+        subparcel.write(&self.r#byteValue)?;
+        subparcel.write(&self.r#charValue)?;
+        subparcel.write(&self.r#intValue)?;
+        subparcel.write(&self.r#longValue)?;
+        subparcel.write(&self.r#floatValue)?;
+        subparcel.write(&self.r#doubleValue)?;
+        subparcel.write(&self.r#enumValue)?;
+        subparcel.write(&self.r#parcelableValue)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#booleanValue = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#byteValue = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#charValue = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#intValue = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#longValue = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#floatValue = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#doubleValue = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#enumValue = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#parcelableValue = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#FixedParcelable);
+  binder::impl_deserialize_for_parcelable!(r#FixedParcelable);
+  impl binder::binder_impl::ParcelableMetadata for r#FixedParcelable {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.FixedSize.FixedParcelable" }
+  }
+}
+pub mod r#FixedUnion {
+  #[derive(Debug)]
+  pub enum r#FixedUnion {
+    BooleanValue(bool),
+    ByteValue(i8),
+    CharValue(u16),
+    IntValue(i32),
+    LongValue(i64),
+    FloatValue(f32),
+    DoubleValue(f64),
+    EnumValue(crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum),
+  }
+  impl Default for r#FixedUnion {
+    fn default() -> Self {
+      Self::BooleanValue(false)
+    }
+  }
+  impl binder::Parcelable for r#FixedUnion {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      match self {
+        Self::BooleanValue(v) => {
+          parcel.write(&0i32)?;
+          parcel.write(v)
+        }
+        Self::ByteValue(v) => {
+          parcel.write(&1i32)?;
+          parcel.write(v)
+        }
+        Self::CharValue(v) => {
+          parcel.write(&2i32)?;
+          parcel.write(v)
+        }
+        Self::IntValue(v) => {
+          parcel.write(&3i32)?;
+          parcel.write(v)
+        }
+        Self::LongValue(v) => {
+          parcel.write(&4i32)?;
+          parcel.write(v)
+        }
+        Self::FloatValue(v) => {
+          parcel.write(&5i32)?;
+          parcel.write(v)
+        }
+        Self::DoubleValue(v) => {
+          parcel.write(&6i32)?;
+          parcel.write(v)
+        }
+        Self::EnumValue(v) => {
+          parcel.write(&7i32)?;
+          parcel.write(v)
+        }
+      }
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      let tag: i32 = parcel.read()?;
+      match tag {
+        0 => {
+          let value: bool = parcel.read()?;
+          *self = Self::BooleanValue(value);
+          Ok(())
+        }
+        1 => {
+          let value: i8 = parcel.read()?;
+          *self = Self::ByteValue(value);
+          Ok(())
+        }
+        2 => {
+          let value: u16 = parcel.read()?;
+          *self = Self::CharValue(value);
+          Ok(())
+        }
+        3 => {
+          let value: i32 = parcel.read()?;
+          *self = Self::IntValue(value);
+          Ok(())
+        }
+        4 => {
+          let value: i64 = parcel.read()?;
+          *self = Self::LongValue(value);
+          Ok(())
+        }
+        5 => {
+          let value: f32 = parcel.read()?;
+          *self = Self::FloatValue(value);
+          Ok(())
+        }
+        6 => {
+          let value: f64 = parcel.read()?;
+          *self = Self::DoubleValue(value);
+          Ok(())
+        }
+        7 => {
+          let value: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum = parcel.read()?;
+          *self = Self::EnumValue(value);
+          Ok(())
+        }
+        _ => {
+          Err(binder::StatusCode::BAD_VALUE)
+        }
+      }
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#FixedUnion);
+  binder::impl_deserialize_for_parcelable!(r#FixedUnion);
+  impl binder::binder_impl::ParcelableMetadata for r#FixedUnion {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.FixedSize.FixedUnion" }
+  }
+  pub mod r#Tag {
+    #![allow(non_upper_case_globals)]
+    use binder::declare_binder_enum;
+    declare_binder_enum! {
+      r#Tag : [i8; 8] {
+        r#booleanValue = 0,
+        r#byteValue = 1,
+        r#charValue = 2,
+        r#intValue = 3,
+        r#longValue = 4,
+        r#floatValue = 5,
+        r#doubleValue = 6,
+        r#enumValue = 7,
+      }
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#FixedSize as _7_android_4_aidl_5_tests_9_FixedSize;
+ pub use super::r#FixedParcelable::r#FixedParcelable as _7_android_4_aidl_5_tests_9_FixedSize_15_FixedParcelable;
+ pub use super::r#FixedUnion::r#FixedUnion as _7_android_4_aidl_5_tests_9_FixedSize_10_FixedUnion;
+ pub use super::r#FixedUnion::r#Tag::r#Tag as _7_android_4_aidl_5_tests_9_FixedSize_10_FixedUnion_3_Tag;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/FixedSize.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/FixedSize.rs.d
new file mode 100644
index 0000000..0635f5e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/FixedSize.rs.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/FixedSize.rs : \
+  system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/GenericStructuredParcelable.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/GenericStructuredParcelable.rs
new file mode 100644
index 0000000..17aa9d5
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/GenericStructuredParcelable.rs
@@ -0,0 +1,53 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/GenericStructuredParcelable.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug, Clone, Copy, Eq, PartialEq)]
+pub struct r#GenericStructuredParcelable<T,U,B,> {
+  pub r#a: i32,
+  pub r#b: i32,
+  _phantom_B: std::marker::PhantomData<B>,
+  _phantom_T: std::marker::PhantomData<T>,
+  _phantom_U: std::marker::PhantomData<U>,
+}
+impl<T: Default,U: Default,B: Default,> Default for r#GenericStructuredParcelable<T,U,B,> {
+  fn default() -> Self {
+    Self {
+      r#a: 0,
+      r#b: 0,
+      r#_phantom_B: Default::default(),
+      r#_phantom_T: Default::default(),
+      r#_phantom_U: Default::default(),
+    }
+  }
+}
+impl<T,U,B,> binder::Parcelable for r#GenericStructuredParcelable<T,U,B,> {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#a)?;
+      subparcel.write(&self.r#b)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#a = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#b = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#GenericStructuredParcelable<T,U,B,>);
+binder::impl_deserialize_for_parcelable!(r#GenericStructuredParcelable<T,U,B,>);
+impl<T,U,B,> binder::binder_impl::ParcelableMetadata for r#GenericStructuredParcelable<T,U,B,> {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.GenericStructuredParcelable" }
+}
+pub(crate) mod mangled {
+ pub use super::r#GenericStructuredParcelable as _7_android_4_aidl_5_tests_27_GenericStructuredParcelable;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/GenericStructuredParcelable.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/GenericStructuredParcelable.rs.d
new file mode 100644
index 0000000..01507cd
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/GenericStructuredParcelable.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/GenericStructuredParcelable.rs : \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs
new file mode 100644
index 0000000..22bdb92
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs
@@ -0,0 +1,140 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  ICircular["android.aidl.tests.ICircular"] {
+    native: BnCircular(on_transact),
+    proxy: BpCircular {
+    },
+    async: ICircularAsync,
+  }
+}
+pub trait ICircular: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ICircular" }
+  fn r#GetTestService(&self) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>>;
+  fn getDefaultImpl() -> ICircularDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: ICircularDefaultRef) -> ICircularDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait ICircularAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ICircular" }
+  fn r#GetTestService<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>>>;
+}
+#[::async_trait::async_trait]
+pub trait ICircularAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ICircular" }
+  async fn r#GetTestService(&self) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>>;
+}
+impl BnCircular {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn ICircular>
+  where
+    T: ICircularAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> ICircular for Wrapper<T, R>
+    where
+      T: ICircularAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#GetTestService(&self) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>> {
+        self._rt.block_on(self._inner.r#GetTestService())
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait ICircularDefault: Send + Sync {
+  fn r#GetTestService(&self) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#GetTestService: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+}
+pub type ICircularDefaultRef = Option<std::sync::Arc<dyn ICircularDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<ICircularDefaultRef> = std::sync::Mutex::new(None);
+}
+impl BpCircular {
+  fn build_parcel_GetTestService(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_GetTestService(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ICircular>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetTestService();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+}
+impl ICircular for BpCircular {
+  fn r#GetTestService(&self) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>> {
+    let _aidl_data = self.build_parcel_GetTestService()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetTestService, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetTestService(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> ICircularAsync<P> for BpCircular {
+  fn r#GetTestService<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>>> {
+    let _aidl_data = match self.build_parcel_GetTestService() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetTestService, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetTestService(_aidl_reply)
+      }
+    )
+  }
+}
+impl ICircular for binder::binder_impl::Binder<BnCircular> {
+  fn r#GetTestService(&self) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>> { self.0.r#GetTestService() }
+}
+fn on_transact(_aidl_service: &dyn ICircular, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#GetTestService => {
+      let _aidl_return = _aidl_service.r#GetTestService();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ICircular as _7_android_4_aidl_5_tests_9_ICircular;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs.d
new file mode 100644
index 0000000..2237337
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs : \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs
new file mode 100644
index 0000000..cd9528a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs
@@ -0,0 +1,87 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  IDeprecated["android.aidl.tests.IDeprecated"] {
+    native: BnDeprecated(on_transact),
+    proxy: BpDeprecated {
+    },
+    async: IDeprecatedAsync,
+  }
+}
+#[deprecated = "test"]
+pub trait IDeprecated: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IDeprecated" }
+  fn getDefaultImpl() -> IDeprecatedDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: IDeprecatedDefaultRef) -> IDeprecatedDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+#[deprecated = "test"]
+pub trait IDeprecatedAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IDeprecated" }
+}
+#[deprecated = "test"]
+#[::async_trait::async_trait]
+pub trait IDeprecatedAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IDeprecated" }
+}
+impl BnDeprecated {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IDeprecated>
+  where
+    T: IDeprecatedAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> IDeprecated for Wrapper<T, R>
+    where
+      T: IDeprecatedAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait IDeprecatedDefault: Send + Sync {
+}
+pub mod transactions {
+}
+pub type IDeprecatedDefaultRef = Option<std::sync::Arc<dyn IDeprecatedDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<IDeprecatedDefaultRef> = std::sync::Mutex::new(None);
+}
+impl BpDeprecated {
+}
+impl IDeprecated for BpDeprecated {
+}
+impl<P: binder::BinderAsyncPool> IDeprecatedAsync<P> for BpDeprecated {
+}
+impl IDeprecated for binder::binder_impl::Binder<BnDeprecated> {
+}
+fn on_transact(_aidl_service: &dyn IDeprecated, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#IDeprecated as _7_android_4_aidl_5_tests_11_IDeprecated;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs.d
new file mode 100644
index 0000000..dc96618
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs : \
+  system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs
new file mode 100644
index 0000000..026d893
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs
@@ -0,0 +1,140 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  INamedCallback["android.aidl.tests.INamedCallback"] {
+    native: BnNamedCallback(on_transact),
+    proxy: BpNamedCallback {
+    },
+    async: INamedCallbackAsync,
+  }
+}
+pub trait INamedCallback: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.INamedCallback" }
+  fn r#GetName(&self) -> binder::Result<String>;
+  fn getDefaultImpl() -> INamedCallbackDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: INamedCallbackDefaultRef) -> INamedCallbackDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait INamedCallbackAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.INamedCallback" }
+  fn r#GetName<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>>;
+}
+#[::async_trait::async_trait]
+pub trait INamedCallbackAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.INamedCallback" }
+  async fn r#GetName(&self) -> binder::Result<String>;
+}
+impl BnNamedCallback {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn INamedCallback>
+  where
+    T: INamedCallbackAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> INamedCallback for Wrapper<T, R>
+    where
+      T: INamedCallbackAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#GetName(&self) -> binder::Result<String> {
+        self._rt.block_on(self._inner.r#GetName())
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait INamedCallbackDefault: Send + Sync {
+  fn r#GetName(&self) -> binder::Result<String> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#GetName: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+}
+pub type INamedCallbackDefaultRef = Option<std::sync::Arc<dyn INamedCallbackDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<INamedCallbackDefaultRef> = std::sync::Mutex::new(None);
+}
+impl BpNamedCallback {
+  fn build_parcel_GetName(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_GetName(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as INamedCallback>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetName();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+}
+impl INamedCallback for BpNamedCallback {
+  fn r#GetName(&self) -> binder::Result<String> {
+    let _aidl_data = self.build_parcel_GetName()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetName, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetName(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> INamedCallbackAsync<P> for BpNamedCallback {
+  fn r#GetName<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    let _aidl_data = match self.build_parcel_GetName() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetName, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetName(_aidl_reply)
+      }
+    )
+  }
+}
+impl INamedCallback for binder::binder_impl::Binder<BnNamedCallback> {
+  fn r#GetName(&self) -> binder::Result<String> { self.0.r#GetName() }
+}
+fn on_transact(_aidl_service: &dyn INamedCallback, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#GetName => {
+      let _aidl_return = _aidl_service.r#GetName();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#INamedCallback as _7_android_4_aidl_5_tests_14_INamedCallback;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs.d
new file mode 100644
index 0000000..eea0b4d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs : \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs
new file mode 100644
index 0000000..64d6a35
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs
@@ -0,0 +1,140 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  INewName["android.aidl.tests.IOldName"] {
+    native: BnNewName(on_transact),
+    proxy: BpNewName {
+    },
+    async: INewNameAsync,
+  }
+}
+pub trait INewName: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IOldName" }
+  fn r#RealName(&self) -> binder::Result<String>;
+  fn getDefaultImpl() -> INewNameDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: INewNameDefaultRef) -> INewNameDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait INewNameAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IOldName" }
+  fn r#RealName<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>>;
+}
+#[::async_trait::async_trait]
+pub trait INewNameAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IOldName" }
+  async fn r#RealName(&self) -> binder::Result<String>;
+}
+impl BnNewName {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn INewName>
+  where
+    T: INewNameAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> INewName for Wrapper<T, R>
+    where
+      T: INewNameAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#RealName(&self) -> binder::Result<String> {
+        self._rt.block_on(self._inner.r#RealName())
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait INewNameDefault: Send + Sync {
+  fn r#RealName(&self) -> binder::Result<String> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#RealName: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+}
+pub type INewNameDefaultRef = Option<std::sync::Arc<dyn INewNameDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<INewNameDefaultRef> = std::sync::Mutex::new(None);
+}
+impl BpNewName {
+  fn build_parcel_RealName(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_RealName(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as INewName>::getDefaultImpl() {
+        return _aidl_default_impl.r#RealName();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+}
+impl INewName for BpNewName {
+  fn r#RealName(&self) -> binder::Result<String> {
+    let _aidl_data = self.build_parcel_RealName()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RealName, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RealName(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> INewNameAsync<P> for BpNewName {
+  fn r#RealName<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    let _aidl_data = match self.build_parcel_RealName() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RealName, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RealName(_aidl_reply)
+      }
+    )
+  }
+}
+impl INewName for binder::binder_impl::Binder<BnNewName> {
+  fn r#RealName(&self) -> binder::Result<String> { self.0.r#RealName() }
+}
+fn on_transact(_aidl_service: &dyn INewName, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#RealName => {
+      let _aidl_return = _aidl_service.r#RealName();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#INewName as _7_android_4_aidl_5_tests_8_INewName;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs.d
new file mode 100644
index 0000000..978238f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs : \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs
new file mode 100644
index 0000000..7fac9c3
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs
@@ -0,0 +1,140 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  IOldName["android.aidl.tests.IOldName"] {
+    native: BnOldName(on_transact),
+    proxy: BpOldName {
+    },
+    async: IOldNameAsync,
+  }
+}
+pub trait IOldName: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IOldName" }
+  fn r#RealName(&self) -> binder::Result<String>;
+  fn getDefaultImpl() -> IOldNameDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: IOldNameDefaultRef) -> IOldNameDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait IOldNameAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IOldName" }
+  fn r#RealName<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>>;
+}
+#[::async_trait::async_trait]
+pub trait IOldNameAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IOldName" }
+  async fn r#RealName(&self) -> binder::Result<String>;
+}
+impl BnOldName {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IOldName>
+  where
+    T: IOldNameAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> IOldName for Wrapper<T, R>
+    where
+      T: IOldNameAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#RealName(&self) -> binder::Result<String> {
+        self._rt.block_on(self._inner.r#RealName())
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait IOldNameDefault: Send + Sync {
+  fn r#RealName(&self) -> binder::Result<String> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#RealName: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+}
+pub type IOldNameDefaultRef = Option<std::sync::Arc<dyn IOldNameDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<IOldNameDefaultRef> = std::sync::Mutex::new(None);
+}
+impl BpOldName {
+  fn build_parcel_RealName(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_RealName(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IOldName>::getDefaultImpl() {
+        return _aidl_default_impl.r#RealName();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+}
+impl IOldName for BpOldName {
+  fn r#RealName(&self) -> binder::Result<String> {
+    let _aidl_data = self.build_parcel_RealName()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RealName, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RealName(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> IOldNameAsync<P> for BpOldName {
+  fn r#RealName<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    let _aidl_data = match self.build_parcel_RealName() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RealName, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RealName(_aidl_reply)
+      }
+    )
+  }
+}
+impl IOldName for binder::binder_impl::Binder<BnOldName> {
+  fn r#RealName(&self) -> binder::Result<String> { self.0.r#RealName() }
+}
+fn on_transact(_aidl_service: &dyn IOldName, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#RealName => {
+      let _aidl_return = _aidl_service.r#RealName();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#IOldName as _7_android_4_aidl_5_tests_8_IOldName;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs.d
new file mode 100644
index 0000000..77773e8
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs : \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs
new file mode 100644
index 0000000..1f5d18d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs
@@ -0,0 +1,4885 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  ITestService["android.aidl.tests.ITestService"] {
+    native: BnTestService(on_transact),
+    proxy: BpTestService {
+    },
+    async: ITestServiceAsync,
+  }
+}
+pub trait ITestService: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService" }
+  fn r#UnimplementedMethod(&self, _arg_arg: i32) -> binder::Result<i32>;
+  #[deprecated = "to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"]
+  fn r#Deprecated(&self) -> binder::Result<()>;
+  fn r#TestOneway(&self) -> binder::Result<()>;
+  fn r#RepeatBoolean(&self, _arg_token: bool) -> binder::Result<bool>;
+  fn r#RepeatByte(&self, _arg_token: i8) -> binder::Result<i8>;
+  fn r#RepeatChar(&self, _arg_token: u16) -> binder::Result<u16>;
+  fn r#RepeatInt(&self, _arg_token: i32) -> binder::Result<i32>;
+  fn r#RepeatLong(&self, _arg_token: i64) -> binder::Result<i64>;
+  fn r#RepeatFloat(&self, _arg_token: f32) -> binder::Result<f32>;
+  fn r#RepeatDouble(&self, _arg_token: f64) -> binder::Result<f64>;
+  fn r#RepeatString(&self, _arg_token: &str) -> binder::Result<String>;
+  fn r#RepeatByteEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>;
+  fn r#RepeatIntEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>;
+  fn r#RepeatLongEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>;
+  fn r#ReverseBoolean(&self, _arg_input: &[bool], _arg_repeated: &mut Vec<bool>) -> binder::Result<Vec<bool>>;
+  fn r#ReverseByte(&self, _arg_input: &[u8], _arg_repeated: &mut Vec<u8>) -> binder::Result<Vec<u8>>;
+  fn r#ReverseChar(&self, _arg_input: &[u16], _arg_repeated: &mut Vec<u16>) -> binder::Result<Vec<u16>>;
+  fn r#ReverseInt(&self, _arg_input: &[i32], _arg_repeated: &mut Vec<i32>) -> binder::Result<Vec<i32>>;
+  fn r#ReverseLong(&self, _arg_input: &[i64], _arg_repeated: &mut Vec<i64>) -> binder::Result<Vec<i64>>;
+  fn r#ReverseFloat(&self, _arg_input: &[f32], _arg_repeated: &mut Vec<f32>) -> binder::Result<Vec<f32>>;
+  fn r#ReverseDouble(&self, _arg_input: &[f64], _arg_repeated: &mut Vec<f64>) -> binder::Result<Vec<f64>>;
+  fn r#ReverseString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>>;
+  fn r#ReverseByteEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>;
+  fn r#ReverseIntEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>;
+  fn r#ReverseLongEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>;
+  fn r#GetOtherTestService(&self, _arg_name: &str) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>;
+  fn r#SetOtherTestService(&self, _arg_name: &str, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::Result<bool>;
+  fn r#VerifyName(&self, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &str) -> binder::Result<bool>;
+  fn r#GetInterfaceArray(&self, _arg_names: &[String]) -> binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>;
+  fn r#VerifyNamesWithInterfaceArray(&self, _arg_services: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &[String]) -> binder::Result<bool>;
+  fn r#GetNullableInterfaceArray(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>>;
+  fn r#VerifyNamesWithNullableInterfaceArray(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool>;
+  fn r#GetInterfaceList(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>>;
+  fn r#VerifyNamesWithInterfaceList(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool>;
+  fn r#ReverseStringList(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>>;
+  fn r#RepeatParcelFileDescriptor(&self, _arg_read: &binder::ParcelFileDescriptor) -> binder::Result<binder::ParcelFileDescriptor>;
+  fn r#ReverseParcelFileDescriptorArray(&self, _arg_input: &[binder::ParcelFileDescriptor], _arg_repeated: &mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::Result<Vec<binder::ParcelFileDescriptor>>;
+  fn r#ThrowServiceException(&self, _arg_code: i32) -> binder::Result<()>;
+  fn r#RepeatNullableIntArray(&self, _arg_input: Option<&[i32]>) -> binder::Result<Option<Vec<i32>>>;
+  fn r#RepeatNullableByteEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>>;
+  fn r#RepeatNullableIntEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>>;
+  fn r#RepeatNullableLongEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>>;
+  fn r#RepeatNullableString(&self, _arg_input: Option<&str>) -> binder::Result<Option<String>>;
+  fn r#RepeatNullableStringList(&self, _arg_input: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<String>>>>;
+  fn r#RepeatNullableParcelable(&self, _arg_input: Option<&crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>;
+  fn r#RepeatNullableParcelableArray(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>>;
+  fn r#RepeatNullableParcelableList(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>>;
+  fn r#TakesAnIBinder(&self, _arg_input: &binder::SpIBinder) -> binder::Result<()>;
+  fn r#TakesANullableIBinder(&self, _arg_input: Option<&binder::SpIBinder>) -> binder::Result<()>;
+  fn r#TakesAnIBinderList(&self, _arg_input: &[binder::SpIBinder]) -> binder::Result<()>;
+  fn r#TakesANullableIBinderList(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>) -> binder::Result<()>;
+  fn r#RepeatUtf8CppString(&self, _arg_token: &str) -> binder::Result<String>;
+  fn r#RepeatNullableUtf8CppString(&self, _arg_token: Option<&str>) -> binder::Result<Option<String>>;
+  fn r#ReverseUtf8CppString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>>;
+  fn r#ReverseNullableUtf8CppString(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>>;
+  fn r#ReverseUtf8CppStringList(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>>;
+  fn r#GetCallback(&self, _arg_return_null: bool) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>;
+  fn r#FillOutStructuredParcelable(&self, _arg_parcel: &mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::Result<()>;
+  fn r#RepeatExtendableParcelable(&self, _arg_ep: &crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::Result<()>;
+  fn r#ReverseList(&self, _arg_list: &crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList>;
+  fn r#ReverseIBinderArray(&self, _arg_input: &[binder::SpIBinder], _arg_repeated: &mut Vec<Option<binder::SpIBinder>>) -> binder::Result<Vec<binder::SpIBinder>>;
+  fn r#ReverseNullableIBinderArray(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _arg_repeated: &mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::Result<Option<Vec<Option<binder::SpIBinder>>>>;
+  fn r#GetOldNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>>;
+  fn r#GetNewNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>>;
+  fn r#GetUnionTags(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>>;
+  fn r#GetCppJavaTests(&self) -> binder::Result<Option<binder::SpIBinder>>;
+  fn r#getBackendType(&self) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType>;
+  fn r#GetCircular(&self, _arg_cp: &mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>>;
+  fn getDefaultImpl() -> ITestServiceDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: ITestServiceDefaultRef) -> ITestServiceDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait ITestServiceAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService" }
+  fn r#UnimplementedMethod<'a>(&'a self, _arg_arg: i32) -> binder::BoxFuture<'a, binder::Result<i32>>;
+  #[deprecated = "to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"]
+  fn r#Deprecated<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#TestOneway(&self) -> std::future::Ready<binder::Result<()>>;
+  fn r#RepeatBoolean<'a>(&'a self, _arg_token: bool) -> binder::BoxFuture<'a, binder::Result<bool>>;
+  fn r#RepeatByte<'a>(&'a self, _arg_token: i8) -> binder::BoxFuture<'a, binder::Result<i8>>;
+  fn r#RepeatChar<'a>(&'a self, _arg_token: u16) -> binder::BoxFuture<'a, binder::Result<u16>>;
+  fn r#RepeatInt<'a>(&'a self, _arg_token: i32) -> binder::BoxFuture<'a, binder::Result<i32>>;
+  fn r#RepeatLong<'a>(&'a self, _arg_token: i64) -> binder::BoxFuture<'a, binder::Result<i64>>;
+  fn r#RepeatFloat<'a>(&'a self, _arg_token: f32) -> binder::BoxFuture<'a, binder::Result<f32>>;
+  fn r#RepeatDouble<'a>(&'a self, _arg_token: f64) -> binder::BoxFuture<'a, binder::Result<f64>>;
+  fn r#RepeatString<'a>(&'a self, _arg_token: &'a str) -> binder::BoxFuture<'a, binder::Result<String>>;
+  fn r#RepeatByteEnum<'a>(&'a self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>;
+  fn r#RepeatIntEnum<'a>(&'a self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>;
+  fn r#RepeatLongEnum<'a>(&'a self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>;
+  fn r#ReverseBoolean<'a>(&'a self, _arg_input: &'a [bool], _arg_repeated: &'a mut Vec<bool>) -> binder::BoxFuture<'a, binder::Result<Vec<bool>>>;
+  fn r#ReverseByte<'a>(&'a self, _arg_input: &'a [u8], _arg_repeated: &'a mut Vec<u8>) -> binder::BoxFuture<'a, binder::Result<Vec<u8>>>;
+  fn r#ReverseChar<'a>(&'a self, _arg_input: &'a [u16], _arg_repeated: &'a mut Vec<u16>) -> binder::BoxFuture<'a, binder::Result<Vec<u16>>>;
+  fn r#ReverseInt<'a>(&'a self, _arg_input: &'a [i32], _arg_repeated: &'a mut Vec<i32>) -> binder::BoxFuture<'a, binder::Result<Vec<i32>>>;
+  fn r#ReverseLong<'a>(&'a self, _arg_input: &'a [i64], _arg_repeated: &'a mut Vec<i64>) -> binder::BoxFuture<'a, binder::Result<Vec<i64>>>;
+  fn r#ReverseFloat<'a>(&'a self, _arg_input: &'a [f32], _arg_repeated: &'a mut Vec<f32>) -> binder::BoxFuture<'a, binder::Result<Vec<f32>>>;
+  fn r#ReverseDouble<'a>(&'a self, _arg_input: &'a [f64], _arg_repeated: &'a mut Vec<f64>) -> binder::BoxFuture<'a, binder::Result<Vec<f64>>>;
+  fn r#ReverseString<'a>(&'a self, _arg_input: &'a [String], _arg_repeated: &'a mut Vec<String>) -> binder::BoxFuture<'a, binder::Result<Vec<String>>>;
+  fn r#ReverseByteEnum<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &'a mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::BoxFuture<'a, binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>>;
+  fn r#ReverseIntEnum<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &'a mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::BoxFuture<'a, binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>>;
+  fn r#ReverseLongEnum<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &'a mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::BoxFuture<'a, binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>>;
+  fn r#GetOtherTestService<'a>(&'a self, _arg_name: &'a str) -> binder::BoxFuture<'a, binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>;
+  fn r#SetOtherTestService<'a>(&'a self, _arg_name: &'a str, _arg_service: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::BoxFuture<'a, binder::Result<bool>>;
+  fn r#VerifyName<'a>(&'a self, _arg_service: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &'a str) -> binder::BoxFuture<'a, binder::Result<bool>>;
+  fn r#GetInterfaceArray<'a>(&'a self, _arg_names: &'a [String]) -> binder::BoxFuture<'a, binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>;
+  fn r#VerifyNamesWithInterfaceArray<'a>(&'a self, _arg_services: &'a [binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &'a [String]) -> binder::BoxFuture<'a, binder::Result<bool>>;
+  fn r#GetNullableInterfaceArray<'a>(&'a self, _arg_names: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>>>;
+  fn r#VerifyNamesWithNullableInterfaceArray<'a>(&'a self, _arg_services: Option<&'a [Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<bool>>;
+  fn r#GetInterfaceList<'a>(&'a self, _arg_names: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>>>;
+  fn r#VerifyNamesWithInterfaceList<'a>(&'a self, _arg_services: Option<&'a [Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<bool>>;
+  fn r#ReverseStringList<'a>(&'a self, _arg_input: &'a [String], _arg_repeated: &'a mut Vec<String>) -> binder::BoxFuture<'a, binder::Result<Vec<String>>>;
+  fn r#RepeatParcelFileDescriptor<'a>(&'a self, _arg_read: &'a binder::ParcelFileDescriptor) -> binder::BoxFuture<'a, binder::Result<binder::ParcelFileDescriptor>>;
+  fn r#ReverseParcelFileDescriptorArray<'a>(&'a self, _arg_input: &'a [binder::ParcelFileDescriptor], _arg_repeated: &'a mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::BoxFuture<'a, binder::Result<Vec<binder::ParcelFileDescriptor>>>;
+  fn r#ThrowServiceException<'a>(&'a self, _arg_code: i32) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#RepeatNullableIntArray<'a>(&'a self, _arg_input: Option<&'a [i32]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<i32>>>>;
+  fn r#RepeatNullableByteEnumArray<'a>(&'a self, _arg_input: Option<&'a [crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>>>;
+  fn r#RepeatNullableIntEnumArray<'a>(&'a self, _arg_input: Option<&'a [crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>>>;
+  fn r#RepeatNullableLongEnumArray<'a>(&'a self, _arg_input: Option<&'a [crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>>>;
+  fn r#RepeatNullableString<'a>(&'a self, _arg_input: Option<&'a str>) -> binder::BoxFuture<'a, binder::Result<Option<String>>>;
+  fn r#RepeatNullableStringList<'a>(&'a self, _arg_input: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<String>>>>>;
+  fn r#RepeatNullableParcelable<'a>(&'a self, _arg_input: Option<&'a crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::BoxFuture<'a, binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>;
+  fn r#RepeatNullableParcelableArray<'a>(&'a self, _arg_input: Option<&'a [Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>>>;
+  fn r#RepeatNullableParcelableList<'a>(&'a self, _arg_input: Option<&'a [Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>>>;
+  fn r#TakesAnIBinder<'a>(&'a self, _arg_input: &'a binder::SpIBinder) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#TakesANullableIBinder<'a>(&'a self, _arg_input: Option<&'a binder::SpIBinder>) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#TakesAnIBinderList<'a>(&'a self, _arg_input: &'a [binder::SpIBinder]) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#TakesANullableIBinderList<'a>(&'a self, _arg_input: Option<&'a [Option<binder::SpIBinder>]>) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#RepeatUtf8CppString<'a>(&'a self, _arg_token: &'a str) -> binder::BoxFuture<'a, binder::Result<String>>;
+  fn r#RepeatNullableUtf8CppString<'a>(&'a self, _arg_token: Option<&'a str>) -> binder::BoxFuture<'a, binder::Result<Option<String>>>;
+  fn r#ReverseUtf8CppString<'a>(&'a self, _arg_input: &'a [String], _arg_repeated: &'a mut Vec<String>) -> binder::BoxFuture<'a, binder::Result<Vec<String>>>;
+  fn r#ReverseNullableUtf8CppString<'a>(&'a self, _arg_input: Option<&'a [Option<String>]>, _arg_repeated: &'a mut Option<Vec<Option<String>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<String>>>>>;
+  fn r#ReverseUtf8CppStringList<'a>(&'a self, _arg_input: Option<&'a [Option<String>]>, _arg_repeated: &'a mut Option<Vec<Option<String>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<String>>>>>;
+  fn r#GetCallback<'a>(&'a self, _arg_return_null: bool) -> binder::BoxFuture<'a, binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>;
+  fn r#FillOutStructuredParcelable<'a>(&'a self, _arg_parcel: &'a mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#RepeatExtendableParcelable<'a>(&'a self, _arg_ep: &'a crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &'a mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#ReverseList<'a>(&'a self, _arg_list: &'a crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList>>;
+  fn r#ReverseIBinderArray<'a>(&'a self, _arg_input: &'a [binder::SpIBinder], _arg_repeated: &'a mut Vec<Option<binder::SpIBinder>>) -> binder::BoxFuture<'a, binder::Result<Vec<binder::SpIBinder>>>;
+  fn r#ReverseNullableIBinderArray<'a>(&'a self, _arg_input: Option<&'a [Option<binder::SpIBinder>]>, _arg_repeated: &'a mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::SpIBinder>>>>>;
+  fn r#GetOldNameInterface<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>>>;
+  fn r#GetNewNameInterface<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>>>;
+  fn r#GetUnionTags<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::BoxFuture<'a, binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>>>;
+  fn r#GetCppJavaTests<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<Option<binder::SpIBinder>>>;
+  fn r#getBackendType<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType>>;
+  fn r#GetCircular<'a>(&'a self, _arg_cp: &'a mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::BoxFuture<'a, binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>>>;
+}
+#[::async_trait::async_trait]
+pub trait ITestServiceAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService" }
+  async fn r#UnimplementedMethod(&self, _arg_arg: i32) -> binder::Result<i32>;
+  #[deprecated = "to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"]
+  async fn r#Deprecated(&self) -> binder::Result<()>;
+  async fn r#TestOneway(&self) -> binder::Result<()>;
+  async fn r#RepeatBoolean(&self, _arg_token: bool) -> binder::Result<bool>;
+  async fn r#RepeatByte(&self, _arg_token: i8) -> binder::Result<i8>;
+  async fn r#RepeatChar(&self, _arg_token: u16) -> binder::Result<u16>;
+  async fn r#RepeatInt(&self, _arg_token: i32) -> binder::Result<i32>;
+  async fn r#RepeatLong(&self, _arg_token: i64) -> binder::Result<i64>;
+  async fn r#RepeatFloat(&self, _arg_token: f32) -> binder::Result<f32>;
+  async fn r#RepeatDouble(&self, _arg_token: f64) -> binder::Result<f64>;
+  async fn r#RepeatString(&self, _arg_token: &str) -> binder::Result<String>;
+  async fn r#RepeatByteEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>;
+  async fn r#RepeatIntEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>;
+  async fn r#RepeatLongEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>;
+  async fn r#ReverseBoolean(&self, _arg_input: &[bool], _arg_repeated: &mut Vec<bool>) -> binder::Result<Vec<bool>>;
+  async fn r#ReverseByte(&self, _arg_input: &[u8], _arg_repeated: &mut Vec<u8>) -> binder::Result<Vec<u8>>;
+  async fn r#ReverseChar(&self, _arg_input: &[u16], _arg_repeated: &mut Vec<u16>) -> binder::Result<Vec<u16>>;
+  async fn r#ReverseInt(&self, _arg_input: &[i32], _arg_repeated: &mut Vec<i32>) -> binder::Result<Vec<i32>>;
+  async fn r#ReverseLong(&self, _arg_input: &[i64], _arg_repeated: &mut Vec<i64>) -> binder::Result<Vec<i64>>;
+  async fn r#ReverseFloat(&self, _arg_input: &[f32], _arg_repeated: &mut Vec<f32>) -> binder::Result<Vec<f32>>;
+  async fn r#ReverseDouble(&self, _arg_input: &[f64], _arg_repeated: &mut Vec<f64>) -> binder::Result<Vec<f64>>;
+  async fn r#ReverseString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>>;
+  async fn r#ReverseByteEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>;
+  async fn r#ReverseIntEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>;
+  async fn r#ReverseLongEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>;
+  async fn r#GetOtherTestService(&self, _arg_name: &str) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>;
+  async fn r#SetOtherTestService(&self, _arg_name: &str, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::Result<bool>;
+  async fn r#VerifyName(&self, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &str) -> binder::Result<bool>;
+  async fn r#GetInterfaceArray(&self, _arg_names: &[String]) -> binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>;
+  async fn r#VerifyNamesWithInterfaceArray(&self, _arg_services: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &[String]) -> binder::Result<bool>;
+  async fn r#GetNullableInterfaceArray(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>>;
+  async fn r#VerifyNamesWithNullableInterfaceArray(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool>;
+  async fn r#GetInterfaceList(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>>;
+  async fn r#VerifyNamesWithInterfaceList(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool>;
+  async fn r#ReverseStringList(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>>;
+  async fn r#RepeatParcelFileDescriptor(&self, _arg_read: &binder::ParcelFileDescriptor) -> binder::Result<binder::ParcelFileDescriptor>;
+  async fn r#ReverseParcelFileDescriptorArray(&self, _arg_input: &[binder::ParcelFileDescriptor], _arg_repeated: &mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::Result<Vec<binder::ParcelFileDescriptor>>;
+  async fn r#ThrowServiceException(&self, _arg_code: i32) -> binder::Result<()>;
+  async fn r#RepeatNullableIntArray(&self, _arg_input: Option<&[i32]>) -> binder::Result<Option<Vec<i32>>>;
+  async fn r#RepeatNullableByteEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>>;
+  async fn r#RepeatNullableIntEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>>;
+  async fn r#RepeatNullableLongEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>>;
+  async fn r#RepeatNullableString(&self, _arg_input: Option<&str>) -> binder::Result<Option<String>>;
+  async fn r#RepeatNullableStringList(&self, _arg_input: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<String>>>>;
+  async fn r#RepeatNullableParcelable(&self, _arg_input: Option<&crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>;
+  async fn r#RepeatNullableParcelableArray(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>>;
+  async fn r#RepeatNullableParcelableList(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>>;
+  async fn r#TakesAnIBinder(&self, _arg_input: &binder::SpIBinder) -> binder::Result<()>;
+  async fn r#TakesANullableIBinder(&self, _arg_input: Option<&binder::SpIBinder>) -> binder::Result<()>;
+  async fn r#TakesAnIBinderList(&self, _arg_input: &[binder::SpIBinder]) -> binder::Result<()>;
+  async fn r#TakesANullableIBinderList(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>) -> binder::Result<()>;
+  async fn r#RepeatUtf8CppString(&self, _arg_token: &str) -> binder::Result<String>;
+  async fn r#RepeatNullableUtf8CppString(&self, _arg_token: Option<&str>) -> binder::Result<Option<String>>;
+  async fn r#ReverseUtf8CppString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>>;
+  async fn r#ReverseNullableUtf8CppString(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>>;
+  async fn r#ReverseUtf8CppStringList(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>>;
+  async fn r#GetCallback(&self, _arg_return_null: bool) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>;
+  async fn r#FillOutStructuredParcelable(&self, _arg_parcel: &mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::Result<()>;
+  async fn r#RepeatExtendableParcelable(&self, _arg_ep: &crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::Result<()>;
+  async fn r#ReverseList(&self, _arg_list: &crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList>;
+  async fn r#ReverseIBinderArray(&self, _arg_input: &[binder::SpIBinder], _arg_repeated: &mut Vec<Option<binder::SpIBinder>>) -> binder::Result<Vec<binder::SpIBinder>>;
+  async fn r#ReverseNullableIBinderArray(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _arg_repeated: &mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::Result<Option<Vec<Option<binder::SpIBinder>>>>;
+  async fn r#GetOldNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>>;
+  async fn r#GetNewNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>>;
+  async fn r#GetUnionTags(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>>;
+  async fn r#GetCppJavaTests(&self) -> binder::Result<Option<binder::SpIBinder>>;
+  async fn r#getBackendType(&self) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType>;
+  async fn r#GetCircular(&self, _arg_cp: &mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>>;
+}
+impl BnTestService {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn ITestService>
+  where
+    T: ITestServiceAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> ITestService for Wrapper<T, R>
+    where
+      T: ITestServiceAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#UnimplementedMethod(&self, _arg_arg: i32) -> binder::Result<i32> {
+        self._rt.block_on(self._inner.r#UnimplementedMethod(_arg_arg))
+      }
+      fn r#Deprecated(&self) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#Deprecated())
+      }
+      fn r#TestOneway(&self) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#TestOneway())
+      }
+      fn r#RepeatBoolean(&self, _arg_token: bool) -> binder::Result<bool> {
+        self._rt.block_on(self._inner.r#RepeatBoolean(_arg_token))
+      }
+      fn r#RepeatByte(&self, _arg_token: i8) -> binder::Result<i8> {
+        self._rt.block_on(self._inner.r#RepeatByte(_arg_token))
+      }
+      fn r#RepeatChar(&self, _arg_token: u16) -> binder::Result<u16> {
+        self._rt.block_on(self._inner.r#RepeatChar(_arg_token))
+      }
+      fn r#RepeatInt(&self, _arg_token: i32) -> binder::Result<i32> {
+        self._rt.block_on(self._inner.r#RepeatInt(_arg_token))
+      }
+      fn r#RepeatLong(&self, _arg_token: i64) -> binder::Result<i64> {
+        self._rt.block_on(self._inner.r#RepeatLong(_arg_token))
+      }
+      fn r#RepeatFloat(&self, _arg_token: f32) -> binder::Result<f32> {
+        self._rt.block_on(self._inner.r#RepeatFloat(_arg_token))
+      }
+      fn r#RepeatDouble(&self, _arg_token: f64) -> binder::Result<f64> {
+        self._rt.block_on(self._inner.r#RepeatDouble(_arg_token))
+      }
+      fn r#RepeatString(&self, _arg_token: &str) -> binder::Result<String> {
+        self._rt.block_on(self._inner.r#RepeatString(_arg_token))
+      }
+      fn r#RepeatByteEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum> {
+        self._rt.block_on(self._inner.r#RepeatByteEnum(_arg_token))
+      }
+      fn r#RepeatIntEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum> {
+        self._rt.block_on(self._inner.r#RepeatIntEnum(_arg_token))
+      }
+      fn r#RepeatLongEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum> {
+        self._rt.block_on(self._inner.r#RepeatLongEnum(_arg_token))
+      }
+      fn r#ReverseBoolean(&self, _arg_input: &[bool], _arg_repeated: &mut Vec<bool>) -> binder::Result<Vec<bool>> {
+        self._rt.block_on(self._inner.r#ReverseBoolean(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseByte(&self, _arg_input: &[u8], _arg_repeated: &mut Vec<u8>) -> binder::Result<Vec<u8>> {
+        self._rt.block_on(self._inner.r#ReverseByte(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseChar(&self, _arg_input: &[u16], _arg_repeated: &mut Vec<u16>) -> binder::Result<Vec<u16>> {
+        self._rt.block_on(self._inner.r#ReverseChar(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseInt(&self, _arg_input: &[i32], _arg_repeated: &mut Vec<i32>) -> binder::Result<Vec<i32>> {
+        self._rt.block_on(self._inner.r#ReverseInt(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseLong(&self, _arg_input: &[i64], _arg_repeated: &mut Vec<i64>) -> binder::Result<Vec<i64>> {
+        self._rt.block_on(self._inner.r#ReverseLong(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseFloat(&self, _arg_input: &[f32], _arg_repeated: &mut Vec<f32>) -> binder::Result<Vec<f32>> {
+        self._rt.block_on(self._inner.r#ReverseFloat(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseDouble(&self, _arg_input: &[f64], _arg_repeated: &mut Vec<f64>) -> binder::Result<Vec<f64>> {
+        self._rt.block_on(self._inner.r#ReverseDouble(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+        self._rt.block_on(self._inner.r#ReverseString(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseByteEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>> {
+        self._rt.block_on(self._inner.r#ReverseByteEnum(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseIntEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>> {
+        self._rt.block_on(self._inner.r#ReverseIntEnum(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseLongEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>> {
+        self._rt.block_on(self._inner.r#ReverseLongEnum(_arg_input, _arg_repeated))
+      }
+      fn r#GetOtherTestService(&self, _arg_name: &str) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>> {
+        self._rt.block_on(self._inner.r#GetOtherTestService(_arg_name))
+      }
+      fn r#SetOtherTestService(&self, _arg_name: &str, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::Result<bool> {
+        self._rt.block_on(self._inner.r#SetOtherTestService(_arg_name, _arg_service))
+      }
+      fn r#VerifyName(&self, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &str) -> binder::Result<bool> {
+        self._rt.block_on(self._inner.r#VerifyName(_arg_service, _arg_name))
+      }
+      fn r#GetInterfaceArray(&self, _arg_names: &[String]) -> binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+        self._rt.block_on(self._inner.r#GetInterfaceArray(_arg_names))
+      }
+      fn r#VerifyNamesWithInterfaceArray(&self, _arg_services: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &[String]) -> binder::Result<bool> {
+        self._rt.block_on(self._inner.r#VerifyNamesWithInterfaceArray(_arg_services, _arg_names))
+      }
+      fn r#GetNullableInterfaceArray(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> {
+        self._rt.block_on(self._inner.r#GetNullableInterfaceArray(_arg_names))
+      }
+      fn r#VerifyNamesWithNullableInterfaceArray(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool> {
+        self._rt.block_on(self._inner.r#VerifyNamesWithNullableInterfaceArray(_arg_services, _arg_names))
+      }
+      fn r#GetInterfaceList(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> {
+        self._rt.block_on(self._inner.r#GetInterfaceList(_arg_names))
+      }
+      fn r#VerifyNamesWithInterfaceList(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool> {
+        self._rt.block_on(self._inner.r#VerifyNamesWithInterfaceList(_arg_services, _arg_names))
+      }
+      fn r#ReverseStringList(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+        self._rt.block_on(self._inner.r#ReverseStringList(_arg_input, _arg_repeated))
+      }
+      fn r#RepeatParcelFileDescriptor(&self, _arg_read: &binder::ParcelFileDescriptor) -> binder::Result<binder::ParcelFileDescriptor> {
+        self._rt.block_on(self._inner.r#RepeatParcelFileDescriptor(_arg_read))
+      }
+      fn r#ReverseParcelFileDescriptorArray(&self, _arg_input: &[binder::ParcelFileDescriptor], _arg_repeated: &mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::Result<Vec<binder::ParcelFileDescriptor>> {
+        self._rt.block_on(self._inner.r#ReverseParcelFileDescriptorArray(_arg_input, _arg_repeated))
+      }
+      fn r#ThrowServiceException(&self, _arg_code: i32) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#ThrowServiceException(_arg_code))
+      }
+      fn r#RepeatNullableIntArray(&self, _arg_input: Option<&[i32]>) -> binder::Result<Option<Vec<i32>>> {
+        self._rt.block_on(self._inner.r#RepeatNullableIntArray(_arg_input))
+      }
+      fn r#RepeatNullableByteEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>> {
+        self._rt.block_on(self._inner.r#RepeatNullableByteEnumArray(_arg_input))
+      }
+      fn r#RepeatNullableIntEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>> {
+        self._rt.block_on(self._inner.r#RepeatNullableIntEnumArray(_arg_input))
+      }
+      fn r#RepeatNullableLongEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>> {
+        self._rt.block_on(self._inner.r#RepeatNullableLongEnumArray(_arg_input))
+      }
+      fn r#RepeatNullableString(&self, _arg_input: Option<&str>) -> binder::Result<Option<String>> {
+        self._rt.block_on(self._inner.r#RepeatNullableString(_arg_input))
+      }
+      fn r#RepeatNullableStringList(&self, _arg_input: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<String>>>> {
+        self._rt.block_on(self._inner.r#RepeatNullableStringList(_arg_input))
+      }
+      fn r#RepeatNullableParcelable(&self, _arg_input: Option<&crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>> {
+        self._rt.block_on(self._inner.r#RepeatNullableParcelable(_arg_input))
+      }
+      fn r#RepeatNullableParcelableArray(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> {
+        self._rt.block_on(self._inner.r#RepeatNullableParcelableArray(_arg_input))
+      }
+      fn r#RepeatNullableParcelableList(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> {
+        self._rt.block_on(self._inner.r#RepeatNullableParcelableList(_arg_input))
+      }
+      fn r#TakesAnIBinder(&self, _arg_input: &binder::SpIBinder) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#TakesAnIBinder(_arg_input))
+      }
+      fn r#TakesANullableIBinder(&self, _arg_input: Option<&binder::SpIBinder>) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#TakesANullableIBinder(_arg_input))
+      }
+      fn r#TakesAnIBinderList(&self, _arg_input: &[binder::SpIBinder]) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#TakesAnIBinderList(_arg_input))
+      }
+      fn r#TakesANullableIBinderList(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#TakesANullableIBinderList(_arg_input))
+      }
+      fn r#RepeatUtf8CppString(&self, _arg_token: &str) -> binder::Result<String> {
+        self._rt.block_on(self._inner.r#RepeatUtf8CppString(_arg_token))
+      }
+      fn r#RepeatNullableUtf8CppString(&self, _arg_token: Option<&str>) -> binder::Result<Option<String>> {
+        self._rt.block_on(self._inner.r#RepeatNullableUtf8CppString(_arg_token))
+      }
+      fn r#ReverseUtf8CppString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+        self._rt.block_on(self._inner.r#ReverseUtf8CppString(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseNullableUtf8CppString(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>> {
+        self._rt.block_on(self._inner.r#ReverseNullableUtf8CppString(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseUtf8CppStringList(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>> {
+        self._rt.block_on(self._inner.r#ReverseUtf8CppStringList(_arg_input, _arg_repeated))
+      }
+      fn r#GetCallback(&self, _arg_return_null: bool) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+        self._rt.block_on(self._inner.r#GetCallback(_arg_return_null))
+      }
+      fn r#FillOutStructuredParcelable(&self, _arg_parcel: &mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#FillOutStructuredParcelable(_arg_parcel))
+      }
+      fn r#RepeatExtendableParcelable(&self, _arg_ep: &crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#RepeatExtendableParcelable(_arg_ep, _arg_ep2))
+      }
+      fn r#ReverseList(&self, _arg_list: &crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList> {
+        self._rt.block_on(self._inner.r#ReverseList(_arg_list))
+      }
+      fn r#ReverseIBinderArray(&self, _arg_input: &[binder::SpIBinder], _arg_repeated: &mut Vec<Option<binder::SpIBinder>>) -> binder::Result<Vec<binder::SpIBinder>> {
+        self._rt.block_on(self._inner.r#ReverseIBinderArray(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseNullableIBinderArray(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _arg_repeated: &mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::Result<Option<Vec<Option<binder::SpIBinder>>>> {
+        self._rt.block_on(self._inner.r#ReverseNullableIBinderArray(_arg_input, _arg_repeated))
+      }
+      fn r#GetOldNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>> {
+        self._rt.block_on(self._inner.r#GetOldNameInterface())
+      }
+      fn r#GetNewNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>> {
+        self._rt.block_on(self._inner.r#GetNewNameInterface())
+      }
+      fn r#GetUnionTags(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>> {
+        self._rt.block_on(self._inner.r#GetUnionTags(_arg_input))
+      }
+      fn r#GetCppJavaTests(&self) -> binder::Result<Option<binder::SpIBinder>> {
+        self._rt.block_on(self._inner.r#GetCppJavaTests())
+      }
+      fn r#getBackendType(&self) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType> {
+        self._rt.block_on(self._inner.r#getBackendType())
+      }
+      fn r#GetCircular(&self, _arg_cp: &mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>> {
+        self._rt.block_on(self._inner.r#GetCircular(_arg_cp))
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait ITestServiceDefault: Send + Sync {
+  fn r#UnimplementedMethod(&self, _arg_arg: i32) -> binder::Result<i32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#Deprecated(&self) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#TestOneway(&self) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatBoolean(&self, _arg_token: bool) -> binder::Result<bool> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatByte(&self, _arg_token: i8) -> binder::Result<i8> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatChar(&self, _arg_token: u16) -> binder::Result<u16> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatInt(&self, _arg_token: i32) -> binder::Result<i32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatLong(&self, _arg_token: i64) -> binder::Result<i64> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatFloat(&self, _arg_token: f32) -> binder::Result<f32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatDouble(&self, _arg_token: f64) -> binder::Result<f64> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatString(&self, _arg_token: &str) -> binder::Result<String> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatByteEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatIntEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatLongEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseBoolean(&self, _arg_input: &[bool], _arg_repeated: &mut Vec<bool>) -> binder::Result<Vec<bool>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseByte(&self, _arg_input: &[u8], _arg_repeated: &mut Vec<u8>) -> binder::Result<Vec<u8>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseChar(&self, _arg_input: &[u16], _arg_repeated: &mut Vec<u16>) -> binder::Result<Vec<u16>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseInt(&self, _arg_input: &[i32], _arg_repeated: &mut Vec<i32>) -> binder::Result<Vec<i32>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseLong(&self, _arg_input: &[i64], _arg_repeated: &mut Vec<i64>) -> binder::Result<Vec<i64>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseFloat(&self, _arg_input: &[f32], _arg_repeated: &mut Vec<f32>) -> binder::Result<Vec<f32>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseDouble(&self, _arg_input: &[f64], _arg_repeated: &mut Vec<f64>) -> binder::Result<Vec<f64>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseByteEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseIntEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseLongEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetOtherTestService(&self, _arg_name: &str) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#SetOtherTestService(&self, _arg_name: &str, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::Result<bool> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#VerifyName(&self, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &str) -> binder::Result<bool> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetInterfaceArray(&self, _arg_names: &[String]) -> binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#VerifyNamesWithInterfaceArray(&self, _arg_services: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &[String]) -> binder::Result<bool> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetNullableInterfaceArray(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#VerifyNamesWithNullableInterfaceArray(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetInterfaceList(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#VerifyNamesWithInterfaceList(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseStringList(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatParcelFileDescriptor(&self, _arg_read: &binder::ParcelFileDescriptor) -> binder::Result<binder::ParcelFileDescriptor> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseParcelFileDescriptorArray(&self, _arg_input: &[binder::ParcelFileDescriptor], _arg_repeated: &mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::Result<Vec<binder::ParcelFileDescriptor>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ThrowServiceException(&self, _arg_code: i32) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableIntArray(&self, _arg_input: Option<&[i32]>) -> binder::Result<Option<Vec<i32>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableByteEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableIntEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableLongEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableString(&self, _arg_input: Option<&str>) -> binder::Result<Option<String>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableStringList(&self, _arg_input: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<String>>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableParcelable(&self, _arg_input: Option<&crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableParcelableArray(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableParcelableList(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#TakesAnIBinder(&self, _arg_input: &binder::SpIBinder) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#TakesANullableIBinder(&self, _arg_input: Option<&binder::SpIBinder>) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#TakesAnIBinderList(&self, _arg_input: &[binder::SpIBinder]) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#TakesANullableIBinderList(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatUtf8CppString(&self, _arg_token: &str) -> binder::Result<String> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableUtf8CppString(&self, _arg_token: Option<&str>) -> binder::Result<Option<String>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseUtf8CppString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseNullableUtf8CppString(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseUtf8CppStringList(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetCallback(&self, _arg_return_null: bool) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#FillOutStructuredParcelable(&self, _arg_parcel: &mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatExtendableParcelable(&self, _arg_ep: &crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseList(&self, _arg_list: &crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseIBinderArray(&self, _arg_input: &[binder::SpIBinder], _arg_repeated: &mut Vec<Option<binder::SpIBinder>>) -> binder::Result<Vec<binder::SpIBinder>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseNullableIBinderArray(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _arg_repeated: &mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::Result<Option<Vec<Option<binder::SpIBinder>>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetOldNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetNewNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetUnionTags(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetCppJavaTests(&self) -> binder::Result<Option<binder::SpIBinder>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#getBackendType(&self) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetCircular(&self, _arg_cp: &mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#UnimplementedMethod: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  pub const r#Deprecated: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+  pub const r#TestOneway: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+  pub const r#RepeatBoolean: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 3;
+  pub const r#RepeatByte: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 4;
+  pub const r#RepeatChar: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 5;
+  pub const r#RepeatInt: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 6;
+  pub const r#RepeatLong: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 7;
+  pub const r#RepeatFloat: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 8;
+  pub const r#RepeatDouble: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 9;
+  pub const r#RepeatString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 10;
+  pub const r#RepeatByteEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 11;
+  pub const r#RepeatIntEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 12;
+  pub const r#RepeatLongEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 13;
+  pub const r#ReverseBoolean: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 14;
+  pub const r#ReverseByte: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 15;
+  pub const r#ReverseChar: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16;
+  pub const r#ReverseInt: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 17;
+  pub const r#ReverseLong: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 18;
+  pub const r#ReverseFloat: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 19;
+  pub const r#ReverseDouble: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 20;
+  pub const r#ReverseString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 21;
+  pub const r#ReverseByteEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 22;
+  pub const r#ReverseIntEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 23;
+  pub const r#ReverseLongEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 24;
+  pub const r#GetOtherTestService: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 25;
+  pub const r#SetOtherTestService: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 26;
+  pub const r#VerifyName: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 27;
+  pub const r#GetInterfaceArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 28;
+  pub const r#VerifyNamesWithInterfaceArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 29;
+  pub const r#GetNullableInterfaceArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 30;
+  pub const r#VerifyNamesWithNullableInterfaceArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 31;
+  pub const r#GetInterfaceList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 32;
+  pub const r#VerifyNamesWithInterfaceList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 33;
+  pub const r#ReverseStringList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 34;
+  pub const r#RepeatParcelFileDescriptor: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 35;
+  pub const r#ReverseParcelFileDescriptorArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 36;
+  pub const r#ThrowServiceException: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 37;
+  pub const r#RepeatNullableIntArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 38;
+  pub const r#RepeatNullableByteEnumArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 39;
+  pub const r#RepeatNullableIntEnumArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 40;
+  pub const r#RepeatNullableLongEnumArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 41;
+  pub const r#RepeatNullableString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 42;
+  pub const r#RepeatNullableStringList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 43;
+  pub const r#RepeatNullableParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 44;
+  pub const r#RepeatNullableParcelableArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 45;
+  pub const r#RepeatNullableParcelableList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 46;
+  pub const r#TakesAnIBinder: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 47;
+  pub const r#TakesANullableIBinder: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 48;
+  pub const r#TakesAnIBinderList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 49;
+  pub const r#TakesANullableIBinderList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 50;
+  pub const r#RepeatUtf8CppString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 51;
+  pub const r#RepeatNullableUtf8CppString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 52;
+  pub const r#ReverseUtf8CppString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 53;
+  pub const r#ReverseNullableUtf8CppString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 54;
+  pub const r#ReverseUtf8CppStringList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 55;
+  pub const r#GetCallback: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 56;
+  pub const r#FillOutStructuredParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 57;
+  pub const r#RepeatExtendableParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 58;
+  pub const r#ReverseList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 59;
+  pub const r#ReverseIBinderArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 60;
+  pub const r#ReverseNullableIBinderArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 61;
+  pub const r#GetOldNameInterface: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 62;
+  pub const r#GetNewNameInterface: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 63;
+  pub const r#GetUnionTags: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 64;
+  pub const r#GetCppJavaTests: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 65;
+  pub const r#getBackendType: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 66;
+  pub const r#GetCircular: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 67;
+}
+pub type ITestServiceDefaultRef = Option<std::sync::Arc<dyn ITestServiceDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<ITestServiceDefaultRef> = std::sync::Mutex::new(None);
+}
+pub const r#CONSTANT: i32 = 42;
+pub const r#CONSTANT2: i32 = -42;
+pub const r#CONSTANT3: i32 = 42;
+pub const r#CONSTANT4: i32 = 4;
+pub const r#CONSTANT5: i32 = -4;
+pub const r#CONSTANT6: i32 = 0;
+pub const r#CONSTANT7: i32 = 0;
+pub const r#CONSTANT8: i32 = 0;
+pub const r#CONSTANT9: i32 = 86;
+pub const r#CONSTANT10: i32 = 165;
+pub const r#CONSTANT11: i32 = 250;
+pub const r#CONSTANT12: i32 = -1;
+pub const r#BYTE_CONSTANT: i8 = 17;
+pub const r#LONG_CONSTANT: i64 = 1099511627776;
+pub const r#STRING_CONSTANT: &str = "foo";
+pub const r#STRING_CONSTANT2: &str = "bar";
+pub const r#FLOAT_CONSTANT: f32 = 1.000000f32;
+pub const r#FLOAT_CONSTANT2: f32 = -1.000000f32;
+pub const r#FLOAT_CONSTANT3: f32 = 1.000000f32;
+pub const r#FLOAT_CONSTANT4: f32 = 2.200000f32;
+pub const r#FLOAT_CONSTANT5: f32 = -2.200000f32;
+pub const r#FLOAT_CONSTANT6: f32 = -0.000000f32;
+pub const r#FLOAT_CONSTANT7: f32 = 0.000000f32;
+pub const r#DOUBLE_CONSTANT: f64 = 1.000000f64;
+pub const r#DOUBLE_CONSTANT2: f64 = -1.000000f64;
+pub const r#DOUBLE_CONSTANT3: f64 = 1.000000f64;
+pub const r#DOUBLE_CONSTANT4: f64 = 2.200000f64;
+pub const r#DOUBLE_CONSTANT5: f64 = -2.200000f64;
+pub const r#DOUBLE_CONSTANT6: f64 = -0.000000f64;
+pub const r#DOUBLE_CONSTANT7: f64 = 0.000000f64;
+pub const r#DOUBLE_CONSTANT8: f64 = 1.100000f64;
+pub const r#DOUBLE_CONSTANT9: f64 = -1.100000f64;
+pub const r#STRING_CONSTANT_UTF8: &str = "baz";
+pub const r#A1: i32 = 1;
+pub const r#A2: i32 = 1;
+pub const r#A3: i32 = 1;
+pub const r#A4: i32 = 1;
+pub const r#A5: i32 = 1;
+pub const r#A6: i32 = 1;
+pub const r#A7: i32 = 1;
+pub const r#A8: i32 = 1;
+pub const r#A9: i32 = 1;
+pub const r#A10: i32 = 1;
+pub const r#A11: i32 = 1;
+pub const r#A12: i32 = 1;
+pub const r#A13: i32 = 1;
+pub const r#A14: i32 = 1;
+pub const r#A15: i32 = 1;
+pub const r#A16: i32 = 1;
+pub const r#A17: i32 = 1;
+pub const r#A18: i32 = 1;
+pub const r#A19: i32 = 1;
+pub const r#A20: i32 = 1;
+pub const r#A21: i32 = 1;
+pub const r#A22: i32 = 1;
+pub const r#A23: i32 = 1;
+pub const r#A24: i32 = 1;
+pub const r#A25: i32 = 1;
+pub const r#A26: i32 = 1;
+pub const r#A27: i32 = 1;
+pub const r#A28: i32 = 1;
+pub const r#A29: i32 = 1;
+pub const r#A30: i32 = 1;
+pub const r#A31: i32 = 1;
+pub const r#A32: i32 = 1;
+pub const r#A33: i32 = 1;
+pub const r#A34: i32 = 1;
+pub const r#A35: i32 = 1;
+pub const r#A36: i32 = 1;
+pub const r#A37: i32 = 1;
+pub const r#A38: i32 = 1;
+pub const r#A39: i32 = 1;
+pub const r#A40: i32 = 1;
+pub const r#A41: i32 = 1;
+pub const r#A42: i32 = 1;
+pub const r#A43: i32 = 1;
+pub const r#A44: i32 = 1;
+pub const r#A45: i32 = 1;
+pub const r#A46: i32 = 1;
+pub const r#A47: i32 = 1;
+pub const r#A48: i32 = 1;
+pub const r#A49: i32 = 1;
+pub const r#A50: i32 = 1;
+pub const r#A51: i32 = 1;
+pub const r#A52: i32 = 1;
+pub const r#A53: i32 = 1;
+pub const r#A54: i32 = 1;
+pub const r#A55: i32 = 1;
+pub const r#A56: i32 = 1;
+pub const r#A57: i32 = 1;
+impl BpTestService {
+  fn build_parcel_UnimplementedMethod(&self, _arg_arg: i32) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_arg)?;
+    Ok(aidl_data)
+  }
+  fn read_response_UnimplementedMethod(&self, _arg_arg: i32, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#UnimplementedMethod(_arg_arg);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_Deprecated(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    Ok(aidl_data)
+  }
+  fn read_response_Deprecated(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#Deprecated();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_TestOneway(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    Ok(aidl_data)
+  }
+  fn read_response_TestOneway(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#TestOneway();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    Ok(())
+  }
+  fn build_parcel_RepeatBoolean(&self, _arg_token: bool) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatBoolean(&self, _arg_token: bool, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<bool> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatBoolean(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: bool = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatByte(&self, _arg_token: i8) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatByte(&self, _arg_token: i8, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i8> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatByte(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i8 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatChar(&self, _arg_token: u16) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatChar(&self, _arg_token: u16, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<u16> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatChar(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: u16 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatInt(&self, _arg_token: i32) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatInt(&self, _arg_token: i32, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatInt(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatLong(&self, _arg_token: i64) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatLong(&self, _arg_token: i64, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i64> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatLong(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i64 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatFloat(&self, _arg_token: f32) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatFloat(&self, _arg_token: f32, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<f32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatFloat(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: f32 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatDouble(&self, _arg_token: f64) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatDouble(&self, _arg_token: f64, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<f64> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatDouble(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: f64 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatString(&self, _arg_token: &str) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatString(&self, _arg_token: &str, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatString(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatByteEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatByteEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatByteEnum(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatIntEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatIntEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatIntEnum(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatLongEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatLongEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatLongEnum(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseBoolean(&self, _arg_input: &[bool], _arg_repeated: &mut Vec<bool>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseBoolean(&self, _arg_input: &[bool], _arg_repeated: &mut Vec<bool>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<bool>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseBoolean(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<bool> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseByte(&self, _arg_input: &[u8], _arg_repeated: &mut Vec<u8>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseByte(&self, _arg_input: &[u8], _arg_repeated: &mut Vec<u8>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<u8>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseByte(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<u8> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseChar(&self, _arg_input: &[u16], _arg_repeated: &mut Vec<u16>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseChar(&self, _arg_input: &[u16], _arg_repeated: &mut Vec<u16>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<u16>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseChar(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<u16> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseInt(&self, _arg_input: &[i32], _arg_repeated: &mut Vec<i32>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseInt(&self, _arg_input: &[i32], _arg_repeated: &mut Vec<i32>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<i32>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseInt(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<i32> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseLong(&self, _arg_input: &[i64], _arg_repeated: &mut Vec<i64>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseLong(&self, _arg_input: &[i64], _arg_repeated: &mut Vec<i64>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<i64>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseLong(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<i64> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseFloat(&self, _arg_input: &[f32], _arg_repeated: &mut Vec<f32>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseFloat(&self, _arg_input: &[f32], _arg_repeated: &mut Vec<f32>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<f32>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseFloat(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<f32> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseDouble(&self, _arg_input: &[f64], _arg_repeated: &mut Vec<f64>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseDouble(&self, _arg_input: &[f64], _arg_repeated: &mut Vec<f64>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<f64>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseDouble(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<f64> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<String>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseString(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<String> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseByteEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseByteEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseByteEnum(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseIntEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseIntEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseIntEnum(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseLongEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseLongEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseLongEnum(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetOtherTestService(&self, _arg_name: &str) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_name)?;
+    Ok(aidl_data)
+  }
+  fn read_response_GetOtherTestService(&self, _arg_name: &str, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetOtherTestService(_arg_name);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_SetOtherTestService(&self, _arg_name: &str, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_name)?;
+    aidl_data.write(_arg_service)?;
+    Ok(aidl_data)
+  }
+  fn read_response_SetOtherTestService(&self, _arg_name: &str, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<bool> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#SetOtherTestService(_arg_name, _arg_service);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: bool = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_VerifyName(&self, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &str) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_service)?;
+    aidl_data.write(_arg_name)?;
+    Ok(aidl_data)
+  }
+  fn read_response_VerifyName(&self, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &str, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<bool> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#VerifyName(_arg_service, _arg_name);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: bool = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetInterfaceArray(&self, _arg_names: &[String]) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_names)?;
+    Ok(aidl_data)
+  }
+  fn read_response_GetInterfaceArray(&self, _arg_names: &[String], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetInterfaceArray(_arg_names);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_VerifyNamesWithInterfaceArray(&self, _arg_services: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &[String]) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_services)?;
+    aidl_data.write(_arg_names)?;
+    Ok(aidl_data)
+  }
+  fn read_response_VerifyNamesWithInterfaceArray(&self, _arg_services: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &[String], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<bool> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#VerifyNamesWithInterfaceArray(_arg_services, _arg_names);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: bool = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetNullableInterfaceArray(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_names)?;
+    Ok(aidl_data)
+  }
+  fn read_response_GetNullableInterfaceArray(&self, _arg_names: Option<&[Option<String>]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetNullableInterfaceArray(_arg_names);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_VerifyNamesWithNullableInterfaceArray(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_services)?;
+    aidl_data.write(&_arg_names)?;
+    Ok(aidl_data)
+  }
+  fn read_response_VerifyNamesWithNullableInterfaceArray(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<bool> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#VerifyNamesWithNullableInterfaceArray(_arg_services, _arg_names);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: bool = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetInterfaceList(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_names)?;
+    Ok(aidl_data)
+  }
+  fn read_response_GetInterfaceList(&self, _arg_names: Option<&[Option<String>]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetInterfaceList(_arg_names);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_VerifyNamesWithInterfaceList(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_services)?;
+    aidl_data.write(&_arg_names)?;
+    Ok(aidl_data)
+  }
+  fn read_response_VerifyNamesWithInterfaceList(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<bool> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#VerifyNamesWithInterfaceList(_arg_services, _arg_names);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: bool = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseStringList(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseStringList(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<String>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseStringList(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<String> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatParcelFileDescriptor(&self, _arg_read: &binder::ParcelFileDescriptor) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_read)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatParcelFileDescriptor(&self, _arg_read: &binder::ParcelFileDescriptor, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<binder::ParcelFileDescriptor> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatParcelFileDescriptor(_arg_read);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: binder::ParcelFileDescriptor = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseParcelFileDescriptorArray(&self, _arg_input: &[binder::ParcelFileDescriptor], _arg_repeated: &mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseParcelFileDescriptorArray(&self, _arg_input: &[binder::ParcelFileDescriptor], _arg_repeated: &mut Vec<Option<binder::ParcelFileDescriptor>>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<binder::ParcelFileDescriptor>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseParcelFileDescriptorArray(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<binder::ParcelFileDescriptor> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ThrowServiceException(&self, _arg_code: i32) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_code)?;
+    Ok(aidl_data)
+  }
+  fn read_response_ThrowServiceException(&self, _arg_code: i32, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ThrowServiceException(_arg_code);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_RepeatNullableIntArray(&self, _arg_input: Option<&[i32]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableIntArray(&self, _arg_input: Option<&[i32]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<i32>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableIntArray(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<i32>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableByteEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableByteEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableByteEnumArray(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableIntEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableIntEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableIntEnumArray(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableLongEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableLongEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableLongEnumArray(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableString(&self, _arg_input: Option<&str>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableString(&self, _arg_input: Option<&str>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<String>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableString(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<String> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableStringList(&self, _arg_input: Option<&[Option<String>]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableStringList(&self, _arg_input: Option<&[Option<String>]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<String>>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableStringList(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<Option<String>>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableParcelable(&self, _arg_input: Option<&crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableParcelable(&self, _arg_input: Option<&crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableParcelable(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableParcelableArray(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableParcelableArray(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableParcelableArray(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableParcelableList(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableParcelableList(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableParcelableList(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_TakesAnIBinder(&self, _arg_input: &binder::SpIBinder) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_TakesAnIBinder(&self, _arg_input: &binder::SpIBinder, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#TakesAnIBinder(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_TakesANullableIBinder(&self, _arg_input: Option<&binder::SpIBinder>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_TakesANullableIBinder(&self, _arg_input: Option<&binder::SpIBinder>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#TakesANullableIBinder(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_TakesAnIBinderList(&self, _arg_input: &[binder::SpIBinder]) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_TakesAnIBinderList(&self, _arg_input: &[binder::SpIBinder], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#TakesAnIBinderList(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_TakesANullableIBinderList(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_TakesANullableIBinderList(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#TakesANullableIBinderList(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_RepeatUtf8CppString(&self, _arg_token: &str) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatUtf8CppString(&self, _arg_token: &str, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatUtf8CppString(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableUtf8CppString(&self, _arg_token: Option<&str>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableUtf8CppString(&self, _arg_token: Option<&str>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<String>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableUtf8CppString(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<String> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseUtf8CppString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseUtf8CppString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<String>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseUtf8CppString(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<String> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseNullableUtf8CppString(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    aidl_data.write_slice_size(_arg_repeated.as_deref())?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseNullableUtf8CppString(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<String>>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseNullableUtf8CppString(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<Option<String>>> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseUtf8CppStringList(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseUtf8CppStringList(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<String>>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseUtf8CppStringList(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<Option<String>>> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetCallback(&self, _arg_return_null: bool) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_return_null)?;
+    Ok(aidl_data)
+  }
+  fn read_response_GetCallback(&self, _arg_return_null: bool, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetCallback(_arg_return_null);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_FillOutStructuredParcelable(&self, _arg_parcel: &mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_parcel)?;
+    Ok(aidl_data)
+  }
+  fn read_response_FillOutStructuredParcelable(&self, _arg_parcel: &mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#FillOutStructuredParcelable(_arg_parcel);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    _aidl_reply.read_onto(_arg_parcel)?;
+    Ok(())
+  }
+  fn build_parcel_RepeatExtendableParcelable(&self, _arg_ep: &crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_ep)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatExtendableParcelable(&self, _arg_ep: &crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatExtendableParcelable(_arg_ep, _arg_ep2);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    _aidl_reply.read_onto(_arg_ep2)?;
+    Ok(())
+  }
+  fn build_parcel_ReverseList(&self, _arg_list: &crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_list)?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseList(&self, _arg_list: &crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseList(_arg_list);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseIBinderArray(&self, _arg_input: &[binder::SpIBinder], _arg_repeated: &mut Vec<Option<binder::SpIBinder>>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseIBinderArray(&self, _arg_input: &[binder::SpIBinder], _arg_repeated: &mut Vec<Option<binder::SpIBinder>>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<binder::SpIBinder>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseIBinderArray(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<binder::SpIBinder> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseNullableIBinderArray(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _arg_repeated: &mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    aidl_data.write_slice_size(_arg_repeated.as_deref())?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseNullableIBinderArray(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _arg_repeated: &mut Option<Vec<Option<binder::SpIBinder>>>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<binder::SpIBinder>>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseNullableIBinderArray(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<Option<binder::SpIBinder>>> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetOldNameInterface(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    Ok(aidl_data)
+  }
+  fn read_response_GetOldNameInterface(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetOldNameInterface();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetNewNameInterface(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    Ok(aidl_data)
+  }
+  fn read_response_GetNewNameInterface(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetNewNameInterface();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetUnionTags(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_GetUnionTags(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_5_Union], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetUnionTags(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetCppJavaTests(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    Ok(aidl_data)
+  }
+  fn read_response_GetCppJavaTests(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<binder::SpIBinder>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetCppJavaTests();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<binder::SpIBinder> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_getBackendType(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    Ok(aidl_data)
+  }
+  fn read_response_getBackendType(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#getBackendType();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_5_tests_11_BackendType = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetCircular(&self, _arg_cp: &mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    Ok(aidl_data)
+  }
+  fn read_response_GetCircular(&self, _arg_cp: &mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetCircular(_arg_cp);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_cp)?;
+    Ok(_aidl_return)
+  }
+}
+impl ITestService for BpTestService {
+  fn r#UnimplementedMethod(&self, _arg_arg: i32) -> binder::Result<i32> {
+    let _aidl_data = self.build_parcel_UnimplementedMethod(_arg_arg)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#UnimplementedMethod, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_UnimplementedMethod(_arg_arg, _aidl_reply)
+  }
+  fn r#Deprecated(&self) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_Deprecated()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#Deprecated, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_Deprecated(_aidl_reply)
+  }
+  fn r#TestOneway(&self) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_TestOneway()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#TestOneway, _aidl_data, binder::binder_impl::FLAG_ONEWAY | binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_TestOneway(_aidl_reply)
+  }
+  fn r#RepeatBoolean(&self, _arg_token: bool) -> binder::Result<bool> {
+    let _aidl_data = self.build_parcel_RepeatBoolean(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatBoolean, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatBoolean(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatByte(&self, _arg_token: i8) -> binder::Result<i8> {
+    let _aidl_data = self.build_parcel_RepeatByte(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatByte, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatByte(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatChar(&self, _arg_token: u16) -> binder::Result<u16> {
+    let _aidl_data = self.build_parcel_RepeatChar(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatChar, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatChar(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatInt(&self, _arg_token: i32) -> binder::Result<i32> {
+    let _aidl_data = self.build_parcel_RepeatInt(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatInt, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatInt(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatLong(&self, _arg_token: i64) -> binder::Result<i64> {
+    let _aidl_data = self.build_parcel_RepeatLong(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatLong, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatLong(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatFloat(&self, _arg_token: f32) -> binder::Result<f32> {
+    let _aidl_data = self.build_parcel_RepeatFloat(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatFloat, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatFloat(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatDouble(&self, _arg_token: f64) -> binder::Result<f64> {
+    let _aidl_data = self.build_parcel_RepeatDouble(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatDouble, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatDouble(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatString(&self, _arg_token: &str) -> binder::Result<String> {
+    let _aidl_data = self.build_parcel_RepeatString(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatString(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatByteEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum> {
+    let _aidl_data = self.build_parcel_RepeatByteEnum(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatByteEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatByteEnum(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatIntEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum> {
+    let _aidl_data = self.build_parcel_RepeatIntEnum(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatIntEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatIntEnum(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatLongEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum> {
+    let _aidl_data = self.build_parcel_RepeatLongEnum(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatLongEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatLongEnum(_arg_token, _aidl_reply)
+  }
+  fn r#ReverseBoolean(&self, _arg_input: &[bool], _arg_repeated: &mut Vec<bool>) -> binder::Result<Vec<bool>> {
+    let _aidl_data = self.build_parcel_ReverseBoolean(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseBoolean, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseBoolean(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseByte(&self, _arg_input: &[u8], _arg_repeated: &mut Vec<u8>) -> binder::Result<Vec<u8>> {
+    let _aidl_data = self.build_parcel_ReverseByte(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseByte, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseByte(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseChar(&self, _arg_input: &[u16], _arg_repeated: &mut Vec<u16>) -> binder::Result<Vec<u16>> {
+    let _aidl_data = self.build_parcel_ReverseChar(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseChar, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseChar(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseInt(&self, _arg_input: &[i32], _arg_repeated: &mut Vec<i32>) -> binder::Result<Vec<i32>> {
+    let _aidl_data = self.build_parcel_ReverseInt(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseInt, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseInt(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseLong(&self, _arg_input: &[i64], _arg_repeated: &mut Vec<i64>) -> binder::Result<Vec<i64>> {
+    let _aidl_data = self.build_parcel_ReverseLong(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseLong, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseLong(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseFloat(&self, _arg_input: &[f32], _arg_repeated: &mut Vec<f32>) -> binder::Result<Vec<f32>> {
+    let _aidl_data = self.build_parcel_ReverseFloat(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseFloat, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseFloat(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseDouble(&self, _arg_input: &[f64], _arg_repeated: &mut Vec<f64>) -> binder::Result<Vec<f64>> {
+    let _aidl_data = self.build_parcel_ReverseDouble(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseDouble, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseDouble(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+    let _aidl_data = self.build_parcel_ReverseString(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseString(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseByteEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>> {
+    let _aidl_data = self.build_parcel_ReverseByteEnum(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseByteEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseByteEnum(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseIntEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>> {
+    let _aidl_data = self.build_parcel_ReverseIntEnum(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseIntEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseIntEnum(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseLongEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>> {
+    let _aidl_data = self.build_parcel_ReverseLongEnum(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseLongEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseLongEnum(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#GetOtherTestService(&self, _arg_name: &str) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>> {
+    let _aidl_data = self.build_parcel_GetOtherTestService(_arg_name)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetOtherTestService, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetOtherTestService(_arg_name, _aidl_reply)
+  }
+  fn r#SetOtherTestService(&self, _arg_name: &str, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::Result<bool> {
+    let _aidl_data = self.build_parcel_SetOtherTestService(_arg_name, _arg_service)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#SetOtherTestService, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_SetOtherTestService(_arg_name, _arg_service, _aidl_reply)
+  }
+  fn r#VerifyName(&self, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &str) -> binder::Result<bool> {
+    let _aidl_data = self.build_parcel_VerifyName(_arg_service, _arg_name)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#VerifyName, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_VerifyName(_arg_service, _arg_name, _aidl_reply)
+  }
+  fn r#GetInterfaceArray(&self, _arg_names: &[String]) -> binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+    let _aidl_data = self.build_parcel_GetInterfaceArray(_arg_names)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetInterfaceArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetInterfaceArray(_arg_names, _aidl_reply)
+  }
+  fn r#VerifyNamesWithInterfaceArray(&self, _arg_services: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &[String]) -> binder::Result<bool> {
+    let _aidl_data = self.build_parcel_VerifyNamesWithInterfaceArray(_arg_services, _arg_names)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#VerifyNamesWithInterfaceArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_VerifyNamesWithInterfaceArray(_arg_services, _arg_names, _aidl_reply)
+  }
+  fn r#GetNullableInterfaceArray(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> {
+    let _aidl_data = self.build_parcel_GetNullableInterfaceArray(_arg_names)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetNullableInterfaceArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetNullableInterfaceArray(_arg_names, _aidl_reply)
+  }
+  fn r#VerifyNamesWithNullableInterfaceArray(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool> {
+    let _aidl_data = self.build_parcel_VerifyNamesWithNullableInterfaceArray(_arg_services, _arg_names)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#VerifyNamesWithNullableInterfaceArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_VerifyNamesWithNullableInterfaceArray(_arg_services, _arg_names, _aidl_reply)
+  }
+  fn r#GetInterfaceList(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> {
+    let _aidl_data = self.build_parcel_GetInterfaceList(_arg_names)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetInterfaceList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetInterfaceList(_arg_names, _aidl_reply)
+  }
+  fn r#VerifyNamesWithInterfaceList(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool> {
+    let _aidl_data = self.build_parcel_VerifyNamesWithInterfaceList(_arg_services, _arg_names)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#VerifyNamesWithInterfaceList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_VerifyNamesWithInterfaceList(_arg_services, _arg_names, _aidl_reply)
+  }
+  fn r#ReverseStringList(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+    let _aidl_data = self.build_parcel_ReverseStringList(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseStringList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseStringList(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#RepeatParcelFileDescriptor(&self, _arg_read: &binder::ParcelFileDescriptor) -> binder::Result<binder::ParcelFileDescriptor> {
+    let _aidl_data = self.build_parcel_RepeatParcelFileDescriptor(_arg_read)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatParcelFileDescriptor, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatParcelFileDescriptor(_arg_read, _aidl_reply)
+  }
+  fn r#ReverseParcelFileDescriptorArray(&self, _arg_input: &[binder::ParcelFileDescriptor], _arg_repeated: &mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::Result<Vec<binder::ParcelFileDescriptor>> {
+    let _aidl_data = self.build_parcel_ReverseParcelFileDescriptorArray(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseParcelFileDescriptorArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseParcelFileDescriptorArray(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ThrowServiceException(&self, _arg_code: i32) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_ThrowServiceException(_arg_code)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ThrowServiceException, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ThrowServiceException(_arg_code, _aidl_reply)
+  }
+  fn r#RepeatNullableIntArray(&self, _arg_input: Option<&[i32]>) -> binder::Result<Option<Vec<i32>>> {
+    let _aidl_data = self.build_parcel_RepeatNullableIntArray(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableIntArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableIntArray(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatNullableByteEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>> {
+    let _aidl_data = self.build_parcel_RepeatNullableByteEnumArray(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableByteEnumArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableByteEnumArray(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatNullableIntEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>> {
+    let _aidl_data = self.build_parcel_RepeatNullableIntEnumArray(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableIntEnumArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableIntEnumArray(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatNullableLongEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>> {
+    let _aidl_data = self.build_parcel_RepeatNullableLongEnumArray(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableLongEnumArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableLongEnumArray(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatNullableString(&self, _arg_input: Option<&str>) -> binder::Result<Option<String>> {
+    let _aidl_data = self.build_parcel_RepeatNullableString(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableString(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatNullableStringList(&self, _arg_input: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<String>>>> {
+    let _aidl_data = self.build_parcel_RepeatNullableStringList(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableStringList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableStringList(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatNullableParcelable(&self, _arg_input: Option<&crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>> {
+    let _aidl_data = self.build_parcel_RepeatNullableParcelable(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableParcelable, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableParcelable(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatNullableParcelableArray(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> {
+    let _aidl_data = self.build_parcel_RepeatNullableParcelableArray(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableParcelableArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableParcelableArray(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatNullableParcelableList(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> {
+    let _aidl_data = self.build_parcel_RepeatNullableParcelableList(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableParcelableList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableParcelableList(_arg_input, _aidl_reply)
+  }
+  fn r#TakesAnIBinder(&self, _arg_input: &binder::SpIBinder) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_TakesAnIBinder(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#TakesAnIBinder, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_TakesAnIBinder(_arg_input, _aidl_reply)
+  }
+  fn r#TakesANullableIBinder(&self, _arg_input: Option<&binder::SpIBinder>) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_TakesANullableIBinder(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#TakesANullableIBinder, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_TakesANullableIBinder(_arg_input, _aidl_reply)
+  }
+  fn r#TakesAnIBinderList(&self, _arg_input: &[binder::SpIBinder]) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_TakesAnIBinderList(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#TakesAnIBinderList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_TakesAnIBinderList(_arg_input, _aidl_reply)
+  }
+  fn r#TakesANullableIBinderList(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_TakesANullableIBinderList(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#TakesANullableIBinderList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_TakesANullableIBinderList(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatUtf8CppString(&self, _arg_token: &str) -> binder::Result<String> {
+    let _aidl_data = self.build_parcel_RepeatUtf8CppString(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatUtf8CppString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatUtf8CppString(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatNullableUtf8CppString(&self, _arg_token: Option<&str>) -> binder::Result<Option<String>> {
+    let _aidl_data = self.build_parcel_RepeatNullableUtf8CppString(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableUtf8CppString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableUtf8CppString(_arg_token, _aidl_reply)
+  }
+  fn r#ReverseUtf8CppString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+    let _aidl_data = self.build_parcel_ReverseUtf8CppString(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseUtf8CppString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseUtf8CppString(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseNullableUtf8CppString(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>> {
+    let _aidl_data = self.build_parcel_ReverseNullableUtf8CppString(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseNullableUtf8CppString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseNullableUtf8CppString(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseUtf8CppStringList(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>> {
+    let _aidl_data = self.build_parcel_ReverseUtf8CppStringList(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseUtf8CppStringList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseUtf8CppStringList(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#GetCallback(&self, _arg_return_null: bool) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+    let _aidl_data = self.build_parcel_GetCallback(_arg_return_null)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetCallback, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetCallback(_arg_return_null, _aidl_reply)
+  }
+  fn r#FillOutStructuredParcelable(&self, _arg_parcel: &mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_FillOutStructuredParcelable(_arg_parcel)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#FillOutStructuredParcelable, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_FillOutStructuredParcelable(_arg_parcel, _aidl_reply)
+  }
+  fn r#RepeatExtendableParcelable(&self, _arg_ep: &crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_RepeatExtendableParcelable(_arg_ep, _arg_ep2)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatExtendableParcelable, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatExtendableParcelable(_arg_ep, _arg_ep2, _aidl_reply)
+  }
+  fn r#ReverseList(&self, _arg_list: &crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList> {
+    let _aidl_data = self.build_parcel_ReverseList(_arg_list)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseList(_arg_list, _aidl_reply)
+  }
+  fn r#ReverseIBinderArray(&self, _arg_input: &[binder::SpIBinder], _arg_repeated: &mut Vec<Option<binder::SpIBinder>>) -> binder::Result<Vec<binder::SpIBinder>> {
+    let _aidl_data = self.build_parcel_ReverseIBinderArray(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseIBinderArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseIBinderArray(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseNullableIBinderArray(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _arg_repeated: &mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::Result<Option<Vec<Option<binder::SpIBinder>>>> {
+    let _aidl_data = self.build_parcel_ReverseNullableIBinderArray(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseNullableIBinderArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseNullableIBinderArray(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#GetOldNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>> {
+    let _aidl_data = self.build_parcel_GetOldNameInterface()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetOldNameInterface, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetOldNameInterface(_aidl_reply)
+  }
+  fn r#GetNewNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>> {
+    let _aidl_data = self.build_parcel_GetNewNameInterface()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetNewNameInterface, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetNewNameInterface(_aidl_reply)
+  }
+  fn r#GetUnionTags(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>> {
+    let _aidl_data = self.build_parcel_GetUnionTags(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetUnionTags, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetUnionTags(_arg_input, _aidl_reply)
+  }
+  fn r#GetCppJavaTests(&self) -> binder::Result<Option<binder::SpIBinder>> {
+    let _aidl_data = self.build_parcel_GetCppJavaTests()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetCppJavaTests, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetCppJavaTests(_aidl_reply)
+  }
+  fn r#getBackendType(&self) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType> {
+    let _aidl_data = self.build_parcel_getBackendType()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getBackendType, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getBackendType(_aidl_reply)
+  }
+  fn r#GetCircular(&self, _arg_cp: &mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>> {
+    let _aidl_data = self.build_parcel_GetCircular(_arg_cp)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetCircular, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetCircular(_arg_cp, _aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> ITestServiceAsync<P> for BpTestService {
+  fn r#UnimplementedMethod<'a>(&'a self, _arg_arg: i32) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_data = match self.build_parcel_UnimplementedMethod(_arg_arg) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#UnimplementedMethod, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_UnimplementedMethod(_arg_arg, _aidl_reply)
+      }
+    )
+  }
+  fn r#Deprecated<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_Deprecated() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#Deprecated, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_Deprecated(_aidl_reply)
+      }
+    )
+  }
+  fn r#TestOneway(&self) -> std::future::Ready<binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_TestOneway() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return std::future::ready(Err(err)),
+    };
+    let _aidl_reply = self.binder.submit_transact(transactions::r#TestOneway, _aidl_data, binder::binder_impl::FLAG_ONEWAY | binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    std::future::ready(self.read_response_TestOneway(_aidl_reply))
+  }
+  fn r#RepeatBoolean<'a>(&'a self, _arg_token: bool) -> binder::BoxFuture<'a, binder::Result<bool>> {
+    let _aidl_data = match self.build_parcel_RepeatBoolean(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatBoolean, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatBoolean(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatByte<'a>(&'a self, _arg_token: i8) -> binder::BoxFuture<'a, binder::Result<i8>> {
+    let _aidl_data = match self.build_parcel_RepeatByte(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatByte, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatByte(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatChar<'a>(&'a self, _arg_token: u16) -> binder::BoxFuture<'a, binder::Result<u16>> {
+    let _aidl_data = match self.build_parcel_RepeatChar(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatChar, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatChar(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatInt<'a>(&'a self, _arg_token: i32) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_data = match self.build_parcel_RepeatInt(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatInt, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatInt(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatLong<'a>(&'a self, _arg_token: i64) -> binder::BoxFuture<'a, binder::Result<i64>> {
+    let _aidl_data = match self.build_parcel_RepeatLong(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatLong, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatLong(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatFloat<'a>(&'a self, _arg_token: f32) -> binder::BoxFuture<'a, binder::Result<f32>> {
+    let _aidl_data = match self.build_parcel_RepeatFloat(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatFloat, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatFloat(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatDouble<'a>(&'a self, _arg_token: f64) -> binder::BoxFuture<'a, binder::Result<f64>> {
+    let _aidl_data = match self.build_parcel_RepeatDouble(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatDouble, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatDouble(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatString<'a>(&'a self, _arg_token: &'a str) -> binder::BoxFuture<'a, binder::Result<String>> {
+    let _aidl_data = match self.build_parcel_RepeatString(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatString(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatByteEnum<'a>(&'a self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>> {
+    let _aidl_data = match self.build_parcel_RepeatByteEnum(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatByteEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatByteEnum(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatIntEnum<'a>(&'a self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>> {
+    let _aidl_data = match self.build_parcel_RepeatIntEnum(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatIntEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatIntEnum(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatLongEnum<'a>(&'a self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>> {
+    let _aidl_data = match self.build_parcel_RepeatLongEnum(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatLongEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatLongEnum(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseBoolean<'a>(&'a self, _arg_input: &'a [bool], _arg_repeated: &'a mut Vec<bool>) -> binder::BoxFuture<'a, binder::Result<Vec<bool>>> {
+    let _aidl_data = match self.build_parcel_ReverseBoolean(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseBoolean, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseBoolean(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseByte<'a>(&'a self, _arg_input: &'a [u8], _arg_repeated: &'a mut Vec<u8>) -> binder::BoxFuture<'a, binder::Result<Vec<u8>>> {
+    let _aidl_data = match self.build_parcel_ReverseByte(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseByte, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseByte(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseChar<'a>(&'a self, _arg_input: &'a [u16], _arg_repeated: &'a mut Vec<u16>) -> binder::BoxFuture<'a, binder::Result<Vec<u16>>> {
+    let _aidl_data = match self.build_parcel_ReverseChar(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseChar, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseChar(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseInt<'a>(&'a self, _arg_input: &'a [i32], _arg_repeated: &'a mut Vec<i32>) -> binder::BoxFuture<'a, binder::Result<Vec<i32>>> {
+    let _aidl_data = match self.build_parcel_ReverseInt(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseInt, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseInt(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseLong<'a>(&'a self, _arg_input: &'a [i64], _arg_repeated: &'a mut Vec<i64>) -> binder::BoxFuture<'a, binder::Result<Vec<i64>>> {
+    let _aidl_data = match self.build_parcel_ReverseLong(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseLong, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseLong(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseFloat<'a>(&'a self, _arg_input: &'a [f32], _arg_repeated: &'a mut Vec<f32>) -> binder::BoxFuture<'a, binder::Result<Vec<f32>>> {
+    let _aidl_data = match self.build_parcel_ReverseFloat(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseFloat, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseFloat(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseDouble<'a>(&'a self, _arg_input: &'a [f64], _arg_repeated: &'a mut Vec<f64>) -> binder::BoxFuture<'a, binder::Result<Vec<f64>>> {
+    let _aidl_data = match self.build_parcel_ReverseDouble(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseDouble, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseDouble(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseString<'a>(&'a self, _arg_input: &'a [String], _arg_repeated: &'a mut Vec<String>) -> binder::BoxFuture<'a, binder::Result<Vec<String>>> {
+    let _aidl_data = match self.build_parcel_ReverseString(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseString(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseByteEnum<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &'a mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::BoxFuture<'a, binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>> {
+    let _aidl_data = match self.build_parcel_ReverseByteEnum(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseByteEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseByteEnum(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseIntEnum<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &'a mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::BoxFuture<'a, binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>> {
+    let _aidl_data = match self.build_parcel_ReverseIntEnum(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseIntEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseIntEnum(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseLongEnum<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &'a mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::BoxFuture<'a, binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>> {
+    let _aidl_data = match self.build_parcel_ReverseLongEnum(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseLongEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseLongEnum(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#GetOtherTestService<'a>(&'a self, _arg_name: &'a str) -> binder::BoxFuture<'a, binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+    let _aidl_data = match self.build_parcel_GetOtherTestService(_arg_name) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetOtherTestService, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetOtherTestService(_arg_name, _aidl_reply)
+      }
+    )
+  }
+  fn r#SetOtherTestService<'a>(&'a self, _arg_name: &'a str, _arg_service: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::BoxFuture<'a, binder::Result<bool>> {
+    let _aidl_data = match self.build_parcel_SetOtherTestService(_arg_name, _arg_service) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#SetOtherTestService, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_SetOtherTestService(_arg_name, _arg_service, _aidl_reply)
+      }
+    )
+  }
+  fn r#VerifyName<'a>(&'a self, _arg_service: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &'a str) -> binder::BoxFuture<'a, binder::Result<bool>> {
+    let _aidl_data = match self.build_parcel_VerifyName(_arg_service, _arg_name) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#VerifyName, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_VerifyName(_arg_service, _arg_name, _aidl_reply)
+      }
+    )
+  }
+  fn r#GetInterfaceArray<'a>(&'a self, _arg_names: &'a [String]) -> binder::BoxFuture<'a, binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>> {
+    let _aidl_data = match self.build_parcel_GetInterfaceArray(_arg_names) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetInterfaceArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetInterfaceArray(_arg_names, _aidl_reply)
+      }
+    )
+  }
+  fn r#VerifyNamesWithInterfaceArray<'a>(&'a self, _arg_services: &'a [binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &'a [String]) -> binder::BoxFuture<'a, binder::Result<bool>> {
+    let _aidl_data = match self.build_parcel_VerifyNamesWithInterfaceArray(_arg_services, _arg_names) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#VerifyNamesWithInterfaceArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_VerifyNamesWithInterfaceArray(_arg_services, _arg_names, _aidl_reply)
+      }
+    )
+  }
+  fn r#GetNullableInterfaceArray<'a>(&'a self, _arg_names: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>>> {
+    let _aidl_data = match self.build_parcel_GetNullableInterfaceArray(_arg_names) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetNullableInterfaceArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetNullableInterfaceArray(_arg_names, _aidl_reply)
+      }
+    )
+  }
+  fn r#VerifyNamesWithNullableInterfaceArray<'a>(&'a self, _arg_services: Option<&'a [Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<bool>> {
+    let _aidl_data = match self.build_parcel_VerifyNamesWithNullableInterfaceArray(_arg_services, _arg_names) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#VerifyNamesWithNullableInterfaceArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_VerifyNamesWithNullableInterfaceArray(_arg_services, _arg_names, _aidl_reply)
+      }
+    )
+  }
+  fn r#GetInterfaceList<'a>(&'a self, _arg_names: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>>> {
+    let _aidl_data = match self.build_parcel_GetInterfaceList(_arg_names) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetInterfaceList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetInterfaceList(_arg_names, _aidl_reply)
+      }
+    )
+  }
+  fn r#VerifyNamesWithInterfaceList<'a>(&'a self, _arg_services: Option<&'a [Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<bool>> {
+    let _aidl_data = match self.build_parcel_VerifyNamesWithInterfaceList(_arg_services, _arg_names) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#VerifyNamesWithInterfaceList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_VerifyNamesWithInterfaceList(_arg_services, _arg_names, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseStringList<'a>(&'a self, _arg_input: &'a [String], _arg_repeated: &'a mut Vec<String>) -> binder::BoxFuture<'a, binder::Result<Vec<String>>> {
+    let _aidl_data = match self.build_parcel_ReverseStringList(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseStringList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseStringList(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatParcelFileDescriptor<'a>(&'a self, _arg_read: &'a binder::ParcelFileDescriptor) -> binder::BoxFuture<'a, binder::Result<binder::ParcelFileDescriptor>> {
+    let _aidl_data = match self.build_parcel_RepeatParcelFileDescriptor(_arg_read) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatParcelFileDescriptor, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatParcelFileDescriptor(_arg_read, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseParcelFileDescriptorArray<'a>(&'a self, _arg_input: &'a [binder::ParcelFileDescriptor], _arg_repeated: &'a mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::BoxFuture<'a, binder::Result<Vec<binder::ParcelFileDescriptor>>> {
+    let _aidl_data = match self.build_parcel_ReverseParcelFileDescriptorArray(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseParcelFileDescriptorArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseParcelFileDescriptorArray(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ThrowServiceException<'a>(&'a self, _arg_code: i32) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_ThrowServiceException(_arg_code) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ThrowServiceException, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ThrowServiceException(_arg_code, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableIntArray<'a>(&'a self, _arg_input: Option<&'a [i32]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<i32>>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableIntArray(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableIntArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableIntArray(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableByteEnumArray<'a>(&'a self, _arg_input: Option<&'a [crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableByteEnumArray(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableByteEnumArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableByteEnumArray(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableIntEnumArray<'a>(&'a self, _arg_input: Option<&'a [crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableIntEnumArray(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableIntEnumArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableIntEnumArray(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableLongEnumArray<'a>(&'a self, _arg_input: Option<&'a [crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableLongEnumArray(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableLongEnumArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableLongEnumArray(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableString<'a>(&'a self, _arg_input: Option<&'a str>) -> binder::BoxFuture<'a, binder::Result<Option<String>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableString(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableString(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableStringList<'a>(&'a self, _arg_input: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<String>>>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableStringList(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableStringList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableStringList(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableParcelable<'a>(&'a self, _arg_input: Option<&'a crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::BoxFuture<'a, binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableParcelable(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableParcelable, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableParcelable(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableParcelableArray<'a>(&'a self, _arg_input: Option<&'a [Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableParcelableArray(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableParcelableArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableParcelableArray(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableParcelableList<'a>(&'a self, _arg_input: Option<&'a [Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableParcelableList(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableParcelableList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableParcelableList(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#TakesAnIBinder<'a>(&'a self, _arg_input: &'a binder::SpIBinder) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_TakesAnIBinder(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#TakesAnIBinder, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_TakesAnIBinder(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#TakesANullableIBinder<'a>(&'a self, _arg_input: Option<&'a binder::SpIBinder>) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_TakesANullableIBinder(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#TakesANullableIBinder, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_TakesANullableIBinder(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#TakesAnIBinderList<'a>(&'a self, _arg_input: &'a [binder::SpIBinder]) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_TakesAnIBinderList(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#TakesAnIBinderList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_TakesAnIBinderList(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#TakesANullableIBinderList<'a>(&'a self, _arg_input: Option<&'a [Option<binder::SpIBinder>]>) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_TakesANullableIBinderList(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#TakesANullableIBinderList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_TakesANullableIBinderList(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatUtf8CppString<'a>(&'a self, _arg_token: &'a str) -> binder::BoxFuture<'a, binder::Result<String>> {
+    let _aidl_data = match self.build_parcel_RepeatUtf8CppString(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatUtf8CppString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatUtf8CppString(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableUtf8CppString<'a>(&'a self, _arg_token: Option<&'a str>) -> binder::BoxFuture<'a, binder::Result<Option<String>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableUtf8CppString(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableUtf8CppString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableUtf8CppString(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseUtf8CppString<'a>(&'a self, _arg_input: &'a [String], _arg_repeated: &'a mut Vec<String>) -> binder::BoxFuture<'a, binder::Result<Vec<String>>> {
+    let _aidl_data = match self.build_parcel_ReverseUtf8CppString(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseUtf8CppString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseUtf8CppString(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseNullableUtf8CppString<'a>(&'a self, _arg_input: Option<&'a [Option<String>]>, _arg_repeated: &'a mut Option<Vec<Option<String>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<String>>>>> {
+    let _aidl_data = match self.build_parcel_ReverseNullableUtf8CppString(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseNullableUtf8CppString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseNullableUtf8CppString(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseUtf8CppStringList<'a>(&'a self, _arg_input: Option<&'a [Option<String>]>, _arg_repeated: &'a mut Option<Vec<Option<String>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<String>>>>> {
+    let _aidl_data = match self.build_parcel_ReverseUtf8CppStringList(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseUtf8CppStringList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseUtf8CppStringList(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#GetCallback<'a>(&'a self, _arg_return_null: bool) -> binder::BoxFuture<'a, binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>> {
+    let _aidl_data = match self.build_parcel_GetCallback(_arg_return_null) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetCallback, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetCallback(_arg_return_null, _aidl_reply)
+      }
+    )
+  }
+  fn r#FillOutStructuredParcelable<'a>(&'a self, _arg_parcel: &'a mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_FillOutStructuredParcelable(_arg_parcel) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#FillOutStructuredParcelable, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_FillOutStructuredParcelable(_arg_parcel, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatExtendableParcelable<'a>(&'a self, _arg_ep: &'a crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &'a mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_RepeatExtendableParcelable(_arg_ep, _arg_ep2) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatExtendableParcelable, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatExtendableParcelable(_arg_ep, _arg_ep2, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseList<'a>(&'a self, _arg_list: &'a crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList>> {
+    let _aidl_data = match self.build_parcel_ReverseList(_arg_list) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseList(_arg_list, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseIBinderArray<'a>(&'a self, _arg_input: &'a [binder::SpIBinder], _arg_repeated: &'a mut Vec<Option<binder::SpIBinder>>) -> binder::BoxFuture<'a, binder::Result<Vec<binder::SpIBinder>>> {
+    let _aidl_data = match self.build_parcel_ReverseIBinderArray(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseIBinderArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseIBinderArray(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseNullableIBinderArray<'a>(&'a self, _arg_input: Option<&'a [Option<binder::SpIBinder>]>, _arg_repeated: &'a mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::SpIBinder>>>>> {
+    let _aidl_data = match self.build_parcel_ReverseNullableIBinderArray(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseNullableIBinderArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseNullableIBinderArray(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#GetOldNameInterface<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>>> {
+    let _aidl_data = match self.build_parcel_GetOldNameInterface() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetOldNameInterface, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetOldNameInterface(_aidl_reply)
+      }
+    )
+  }
+  fn r#GetNewNameInterface<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>>> {
+    let _aidl_data = match self.build_parcel_GetNewNameInterface() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetNewNameInterface, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetNewNameInterface(_aidl_reply)
+      }
+    )
+  }
+  fn r#GetUnionTags<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::BoxFuture<'a, binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>>> {
+    let _aidl_data = match self.build_parcel_GetUnionTags(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetUnionTags, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetUnionTags(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#GetCppJavaTests<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<Option<binder::SpIBinder>>> {
+    let _aidl_data = match self.build_parcel_GetCppJavaTests() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetCppJavaTests, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetCppJavaTests(_aidl_reply)
+      }
+    )
+  }
+  fn r#getBackendType<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType>> {
+    let _aidl_data = match self.build_parcel_getBackendType() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getBackendType, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getBackendType(_aidl_reply)
+      }
+    )
+  }
+  fn r#GetCircular<'a>(&'a self, _arg_cp: &'a mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::BoxFuture<'a, binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>>> {
+    let _aidl_data = match self.build_parcel_GetCircular(_arg_cp) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetCircular, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetCircular(_arg_cp, _aidl_reply)
+      }
+    )
+  }
+}
+impl ITestService for binder::binder_impl::Binder<BnTestService> {
+  fn r#UnimplementedMethod(&self, _arg_arg: i32) -> binder::Result<i32> { self.0.r#UnimplementedMethod(_arg_arg) }
+  fn r#Deprecated(&self) -> binder::Result<()> { self.0.r#Deprecated() }
+  fn r#TestOneway(&self) -> binder::Result<()> { self.0.r#TestOneway() }
+  fn r#RepeatBoolean(&self, _arg_token: bool) -> binder::Result<bool> { self.0.r#RepeatBoolean(_arg_token) }
+  fn r#RepeatByte(&self, _arg_token: i8) -> binder::Result<i8> { self.0.r#RepeatByte(_arg_token) }
+  fn r#RepeatChar(&self, _arg_token: u16) -> binder::Result<u16> { self.0.r#RepeatChar(_arg_token) }
+  fn r#RepeatInt(&self, _arg_token: i32) -> binder::Result<i32> { self.0.r#RepeatInt(_arg_token) }
+  fn r#RepeatLong(&self, _arg_token: i64) -> binder::Result<i64> { self.0.r#RepeatLong(_arg_token) }
+  fn r#RepeatFloat(&self, _arg_token: f32) -> binder::Result<f32> { self.0.r#RepeatFloat(_arg_token) }
+  fn r#RepeatDouble(&self, _arg_token: f64) -> binder::Result<f64> { self.0.r#RepeatDouble(_arg_token) }
+  fn r#RepeatString(&self, _arg_token: &str) -> binder::Result<String> { self.0.r#RepeatString(_arg_token) }
+  fn r#RepeatByteEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum> { self.0.r#RepeatByteEnum(_arg_token) }
+  fn r#RepeatIntEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum> { self.0.r#RepeatIntEnum(_arg_token) }
+  fn r#RepeatLongEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum> { self.0.r#RepeatLongEnum(_arg_token) }
+  fn r#ReverseBoolean(&self, _arg_input: &[bool], _arg_repeated: &mut Vec<bool>) -> binder::Result<Vec<bool>> { self.0.r#ReverseBoolean(_arg_input, _arg_repeated) }
+  fn r#ReverseByte(&self, _arg_input: &[u8], _arg_repeated: &mut Vec<u8>) -> binder::Result<Vec<u8>> { self.0.r#ReverseByte(_arg_input, _arg_repeated) }
+  fn r#ReverseChar(&self, _arg_input: &[u16], _arg_repeated: &mut Vec<u16>) -> binder::Result<Vec<u16>> { self.0.r#ReverseChar(_arg_input, _arg_repeated) }
+  fn r#ReverseInt(&self, _arg_input: &[i32], _arg_repeated: &mut Vec<i32>) -> binder::Result<Vec<i32>> { self.0.r#ReverseInt(_arg_input, _arg_repeated) }
+  fn r#ReverseLong(&self, _arg_input: &[i64], _arg_repeated: &mut Vec<i64>) -> binder::Result<Vec<i64>> { self.0.r#ReverseLong(_arg_input, _arg_repeated) }
+  fn r#ReverseFloat(&self, _arg_input: &[f32], _arg_repeated: &mut Vec<f32>) -> binder::Result<Vec<f32>> { self.0.r#ReverseFloat(_arg_input, _arg_repeated) }
+  fn r#ReverseDouble(&self, _arg_input: &[f64], _arg_repeated: &mut Vec<f64>) -> binder::Result<Vec<f64>> { self.0.r#ReverseDouble(_arg_input, _arg_repeated) }
+  fn r#ReverseString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> { self.0.r#ReverseString(_arg_input, _arg_repeated) }
+  fn r#ReverseByteEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>> { self.0.r#ReverseByteEnum(_arg_input, _arg_repeated) }
+  fn r#ReverseIntEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>> { self.0.r#ReverseIntEnum(_arg_input, _arg_repeated) }
+  fn r#ReverseLongEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>> { self.0.r#ReverseLongEnum(_arg_input, _arg_repeated) }
+  fn r#GetOtherTestService(&self, _arg_name: &str) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>> { self.0.r#GetOtherTestService(_arg_name) }
+  fn r#SetOtherTestService(&self, _arg_name: &str, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::Result<bool> { self.0.r#SetOtherTestService(_arg_name, _arg_service) }
+  fn r#VerifyName(&self, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &str) -> binder::Result<bool> { self.0.r#VerifyName(_arg_service, _arg_name) }
+  fn r#GetInterfaceArray(&self, _arg_names: &[String]) -> binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> { self.0.r#GetInterfaceArray(_arg_names) }
+  fn r#VerifyNamesWithInterfaceArray(&self, _arg_services: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &[String]) -> binder::Result<bool> { self.0.r#VerifyNamesWithInterfaceArray(_arg_services, _arg_names) }
+  fn r#GetNullableInterfaceArray(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> { self.0.r#GetNullableInterfaceArray(_arg_names) }
+  fn r#VerifyNamesWithNullableInterfaceArray(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool> { self.0.r#VerifyNamesWithNullableInterfaceArray(_arg_services, _arg_names) }
+  fn r#GetInterfaceList(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> { self.0.r#GetInterfaceList(_arg_names) }
+  fn r#VerifyNamesWithInterfaceList(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool> { self.0.r#VerifyNamesWithInterfaceList(_arg_services, _arg_names) }
+  fn r#ReverseStringList(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> { self.0.r#ReverseStringList(_arg_input, _arg_repeated) }
+  fn r#RepeatParcelFileDescriptor(&self, _arg_read: &binder::ParcelFileDescriptor) -> binder::Result<binder::ParcelFileDescriptor> { self.0.r#RepeatParcelFileDescriptor(_arg_read) }
+  fn r#ReverseParcelFileDescriptorArray(&self, _arg_input: &[binder::ParcelFileDescriptor], _arg_repeated: &mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::Result<Vec<binder::ParcelFileDescriptor>> { self.0.r#ReverseParcelFileDescriptorArray(_arg_input, _arg_repeated) }
+  fn r#ThrowServiceException(&self, _arg_code: i32) -> binder::Result<()> { self.0.r#ThrowServiceException(_arg_code) }
+  fn r#RepeatNullableIntArray(&self, _arg_input: Option<&[i32]>) -> binder::Result<Option<Vec<i32>>> { self.0.r#RepeatNullableIntArray(_arg_input) }
+  fn r#RepeatNullableByteEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>> { self.0.r#RepeatNullableByteEnumArray(_arg_input) }
+  fn r#RepeatNullableIntEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>> { self.0.r#RepeatNullableIntEnumArray(_arg_input) }
+  fn r#RepeatNullableLongEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>> { self.0.r#RepeatNullableLongEnumArray(_arg_input) }
+  fn r#RepeatNullableString(&self, _arg_input: Option<&str>) -> binder::Result<Option<String>> { self.0.r#RepeatNullableString(_arg_input) }
+  fn r#RepeatNullableStringList(&self, _arg_input: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<String>>>> { self.0.r#RepeatNullableStringList(_arg_input) }
+  fn r#RepeatNullableParcelable(&self, _arg_input: Option<&crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>> { self.0.r#RepeatNullableParcelable(_arg_input) }
+  fn r#RepeatNullableParcelableArray(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> { self.0.r#RepeatNullableParcelableArray(_arg_input) }
+  fn r#RepeatNullableParcelableList(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> { self.0.r#RepeatNullableParcelableList(_arg_input) }
+  fn r#TakesAnIBinder(&self, _arg_input: &binder::SpIBinder) -> binder::Result<()> { self.0.r#TakesAnIBinder(_arg_input) }
+  fn r#TakesANullableIBinder(&self, _arg_input: Option<&binder::SpIBinder>) -> binder::Result<()> { self.0.r#TakesANullableIBinder(_arg_input) }
+  fn r#TakesAnIBinderList(&self, _arg_input: &[binder::SpIBinder]) -> binder::Result<()> { self.0.r#TakesAnIBinderList(_arg_input) }
+  fn r#TakesANullableIBinderList(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>) -> binder::Result<()> { self.0.r#TakesANullableIBinderList(_arg_input) }
+  fn r#RepeatUtf8CppString(&self, _arg_token: &str) -> binder::Result<String> { self.0.r#RepeatUtf8CppString(_arg_token) }
+  fn r#RepeatNullableUtf8CppString(&self, _arg_token: Option<&str>) -> binder::Result<Option<String>> { self.0.r#RepeatNullableUtf8CppString(_arg_token) }
+  fn r#ReverseUtf8CppString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> { self.0.r#ReverseUtf8CppString(_arg_input, _arg_repeated) }
+  fn r#ReverseNullableUtf8CppString(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>> { self.0.r#ReverseNullableUtf8CppString(_arg_input, _arg_repeated) }
+  fn r#ReverseUtf8CppStringList(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>> { self.0.r#ReverseUtf8CppStringList(_arg_input, _arg_repeated) }
+  fn r#GetCallback(&self, _arg_return_null: bool) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> { self.0.r#GetCallback(_arg_return_null) }
+  fn r#FillOutStructuredParcelable(&self, _arg_parcel: &mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::Result<()> { self.0.r#FillOutStructuredParcelable(_arg_parcel) }
+  fn r#RepeatExtendableParcelable(&self, _arg_ep: &crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::Result<()> { self.0.r#RepeatExtendableParcelable(_arg_ep, _arg_ep2) }
+  fn r#ReverseList(&self, _arg_list: &crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList> { self.0.r#ReverseList(_arg_list) }
+  fn r#ReverseIBinderArray(&self, _arg_input: &[binder::SpIBinder], _arg_repeated: &mut Vec<Option<binder::SpIBinder>>) -> binder::Result<Vec<binder::SpIBinder>> { self.0.r#ReverseIBinderArray(_arg_input, _arg_repeated) }
+  fn r#ReverseNullableIBinderArray(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _arg_repeated: &mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::Result<Option<Vec<Option<binder::SpIBinder>>>> { self.0.r#ReverseNullableIBinderArray(_arg_input, _arg_repeated) }
+  fn r#GetOldNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>> { self.0.r#GetOldNameInterface() }
+  fn r#GetNewNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>> { self.0.r#GetNewNameInterface() }
+  fn r#GetUnionTags(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>> { self.0.r#GetUnionTags(_arg_input) }
+  fn r#GetCppJavaTests(&self) -> binder::Result<Option<binder::SpIBinder>> { self.0.r#GetCppJavaTests() }
+  fn r#getBackendType(&self) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType> { self.0.r#getBackendType() }
+  fn r#GetCircular(&self, _arg_cp: &mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>> { self.0.r#GetCircular(_arg_cp) }
+}
+fn on_transact(_aidl_service: &dyn ITestService, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#UnimplementedMethod => {
+      let _arg_arg: i32 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#UnimplementedMethod(_arg_arg);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#Deprecated => {
+      let _aidl_return = _aidl_service.r#Deprecated();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#TestOneway => {
+      let _aidl_return = _aidl_service.r#TestOneway();
+      Ok(())
+    }
+    transactions::r#RepeatBoolean => {
+      let _arg_token: bool = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatBoolean(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatByte => {
+      let _arg_token: i8 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatByte(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatChar => {
+      let _arg_token: u16 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatChar(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatInt => {
+      let _arg_token: i32 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatInt(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatLong => {
+      let _arg_token: i64 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatLong(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatFloat => {
+      let _arg_token: f32 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatFloat(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatDouble => {
+      let _arg_token: f64 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatDouble(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatString => {
+      let _arg_token: String = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatString(&_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatByteEnum => {
+      let _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatByteEnum(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatIntEnum => {
+      let _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatIntEnum(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatLongEnum => {
+      let _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatLongEnum(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseBoolean => {
+      let _arg_input: Vec<bool> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<bool> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseBoolean(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseByte => {
+      let _arg_input: Vec<u8> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<u8> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseByte(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseChar => {
+      let _arg_input: Vec<u16> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<u16> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseChar(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseInt => {
+      let _arg_input: Vec<i32> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<i32> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseInt(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseLong => {
+      let _arg_input: Vec<i64> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<i64> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseLong(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseFloat => {
+      let _arg_input: Vec<f32> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<f32> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseFloat(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseDouble => {
+      let _arg_input: Vec<f64> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<f64> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseDouble(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseString => {
+      let _arg_input: Vec<String> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<String> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseString(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseByteEnum => {
+      let _arg_input: Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseByteEnum(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseIntEnum => {
+      let _arg_input: Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseIntEnum(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseLongEnum => {
+      let _arg_input: Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseLongEnum(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetOtherTestService => {
+      let _arg_name: String = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#GetOtherTestService(&_arg_name);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#SetOtherTestService => {
+      let _arg_name: String = _aidl_data.read()?;
+      let _arg_service: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#SetOtherTestService(&_arg_name, &_arg_service);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#VerifyName => {
+      let _arg_service: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback> = _aidl_data.read()?;
+      let _arg_name: String = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#VerifyName(&_arg_service, &_arg_name);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetInterfaceArray => {
+      let _arg_names: Vec<String> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#GetInterfaceArray(&_arg_names);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#VerifyNamesWithInterfaceArray => {
+      let _arg_services: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>> = _aidl_data.read()?;
+      let _arg_names: Vec<String> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#VerifyNamesWithInterfaceArray(&_arg_services, &_arg_names);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetNullableInterfaceArray => {
+      let _arg_names: Option<Vec<Option<String>>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#GetNullableInterfaceArray(_arg_names.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#VerifyNamesWithNullableInterfaceArray => {
+      let _arg_services: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>> = _aidl_data.read()?;
+      let _arg_names: Option<Vec<Option<String>>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#VerifyNamesWithNullableInterfaceArray(_arg_services.as_deref(), _arg_names.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetInterfaceList => {
+      let _arg_names: Option<Vec<Option<String>>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#GetInterfaceList(_arg_names.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#VerifyNamesWithInterfaceList => {
+      let _arg_services: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>> = _aidl_data.read()?;
+      let _arg_names: Option<Vec<Option<String>>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#VerifyNamesWithInterfaceList(_arg_services.as_deref(), _arg_names.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseStringList => {
+      let _arg_input: Vec<String> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<String> = Default::default();
+      let _aidl_return = _aidl_service.r#ReverseStringList(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatParcelFileDescriptor => {
+      let _arg_read: binder::ParcelFileDescriptor = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatParcelFileDescriptor(&_arg_read);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseParcelFileDescriptorArray => {
+      let _arg_input: Vec<binder::ParcelFileDescriptor> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<Option<binder::ParcelFileDescriptor>> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseParcelFileDescriptorArray(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          if _arg_repeated.iter().any(Option::is_none) { return Err(binder::StatusCode::UNEXPECTED_NULL); }
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ThrowServiceException => {
+      let _arg_code: i32 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#ThrowServiceException(_arg_code);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableIntArray => {
+      let _arg_input: Option<Vec<i32>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableIntArray(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableByteEnumArray => {
+      let _arg_input: Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableByteEnumArray(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableIntEnumArray => {
+      let _arg_input: Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableIntEnumArray(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableLongEnumArray => {
+      let _arg_input: Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableLongEnumArray(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableString => {
+      let _arg_input: Option<String> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableString(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableStringList => {
+      let _arg_input: Option<Vec<Option<String>>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableStringList(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableParcelable => {
+      let _arg_input: Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableParcelable(_arg_input.as_ref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableParcelableArray => {
+      let _arg_input: Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableParcelableArray(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableParcelableList => {
+      let _arg_input: Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableParcelableList(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#TakesAnIBinder => {
+      let _arg_input: binder::SpIBinder = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#TakesAnIBinder(&_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#TakesANullableIBinder => {
+      let _arg_input: Option<binder::SpIBinder> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#TakesANullableIBinder(_arg_input.as_ref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#TakesAnIBinderList => {
+      let _arg_input: Vec<binder::SpIBinder> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#TakesAnIBinderList(&_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#TakesANullableIBinderList => {
+      let _arg_input: Option<Vec<Option<binder::SpIBinder>>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#TakesANullableIBinderList(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatUtf8CppString => {
+      let _arg_token: String = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatUtf8CppString(&_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableUtf8CppString => {
+      let _arg_token: Option<String> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableUtf8CppString(_arg_token.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseUtf8CppString => {
+      let _arg_input: Vec<String> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<String> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseUtf8CppString(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseNullableUtf8CppString => {
+      let _arg_input: Option<Vec<Option<String>>> = _aidl_data.read()?;
+      let mut _arg_repeated: Option<Vec<Option<String>>> = Default::default();
+      _aidl_data.resize_nullable_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseNullableUtf8CppString(_arg_input.as_deref(), &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseUtf8CppStringList => {
+      let _arg_input: Option<Vec<Option<String>>> = _aidl_data.read()?;
+      let mut _arg_repeated: Option<Vec<Option<String>>> = Default::default();
+      let _aidl_return = _aidl_service.r#ReverseUtf8CppStringList(_arg_input.as_deref(), &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetCallback => {
+      let _arg_return_null: bool = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#GetCallback(_arg_return_null);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#FillOutStructuredParcelable => {
+      let mut _arg_parcel: crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#FillOutStructuredParcelable(&mut _arg_parcel);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(&_arg_parcel)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatExtendableParcelable => {
+      let _arg_ep: crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable = _aidl_data.read()?;
+      let mut _arg_ep2: crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable = Default::default();
+      let _aidl_return = _aidl_service.r#RepeatExtendableParcelable(&_arg_ep, &mut _arg_ep2);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(&_arg_ep2)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseList => {
+      let _arg_list: crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#ReverseList(&_arg_list);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseIBinderArray => {
+      let _arg_input: Vec<binder::SpIBinder> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<Option<binder::SpIBinder>> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseIBinderArray(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseNullableIBinderArray => {
+      let _arg_input: Option<Vec<Option<binder::SpIBinder>>> = _aidl_data.read()?;
+      let mut _arg_repeated: Option<Vec<Option<binder::SpIBinder>>> = Default::default();
+      _aidl_data.resize_nullable_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseNullableIBinderArray(_arg_input.as_deref(), &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetOldNameInterface => {
+      let _aidl_return = _aidl_service.r#GetOldNameInterface();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetNewNameInterface => {
+      let _aidl_return = _aidl_service.r#GetNewNameInterface();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetUnionTags => {
+      let _arg_input: Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#GetUnionTags(&_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetCppJavaTests => {
+      let _aidl_return = _aidl_service.r#GetCppJavaTests();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getBackendType => {
+      let _aidl_return = _aidl_service.r#getBackendType();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetCircular => {
+      let mut _arg_cp: crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable = Default::default();
+      let _aidl_return = _aidl_service.r#GetCircular(&mut _arg_cp);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_cp)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub mod r#Empty {
+  #[derive(Debug, Clone, PartialEq)]
+  pub struct r#Empty {
+  }
+  impl Default for r#Empty {
+    fn default() -> Self {
+      Self {
+      }
+    }
+  }
+  impl binder::Parcelable for r#Empty {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#Empty);
+  binder::impl_deserialize_for_parcelable!(r#Empty);
+  impl binder::binder_impl::ParcelableMetadata for r#Empty {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.ITestService.Empty" }
+  }
+}
+pub mod r#CompilerChecks {
+  #[derive(Debug)]
+  pub struct r#CompilerChecks {
+    pub r#binder: Option<binder::SpIBinder>,
+    pub r#nullable_binder: Option<binder::SpIBinder>,
+    pub r#binder_array: Vec<binder::SpIBinder>,
+    pub r#nullable_binder_array: Option<Vec<Option<binder::SpIBinder>>>,
+    pub r#binder_list: Vec<binder::SpIBinder>,
+    pub r#nullable_binder_list: Option<Vec<Option<binder::SpIBinder>>>,
+    pub r#pfd: Option<binder::ParcelFileDescriptor>,
+    pub r#nullable_pfd: Option<binder::ParcelFileDescriptor>,
+    pub r#pfd_array: Vec<binder::ParcelFileDescriptor>,
+    pub r#nullable_pfd_array: Option<Vec<Option<binder::ParcelFileDescriptor>>>,
+    pub r#pfd_list: Vec<binder::ParcelFileDescriptor>,
+    pub r#nullable_pfd_list: Option<Vec<Option<binder::ParcelFileDescriptor>>>,
+    pub r#parcel: crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty,
+    pub r#nullable_parcel: Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>,
+    pub r#parcel_array: Vec<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>,
+    pub r#nullable_parcel_array: Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>,
+    pub r#parcel_list: Vec<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>,
+    pub r#nullable_parcel_list: Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>,
+  }
+  impl Default for r#CompilerChecks {
+    fn default() -> Self {
+      Self {
+        r#binder: Default::default(),
+        r#nullable_binder: Default::default(),
+        r#binder_array: Default::default(),
+        r#nullable_binder_array: Default::default(),
+        r#binder_list: Default::default(),
+        r#nullable_binder_list: Default::default(),
+        r#pfd: Default::default(),
+        r#nullable_pfd: Default::default(),
+        r#pfd_array: Default::default(),
+        r#nullable_pfd_array: Default::default(),
+        r#pfd_list: Default::default(),
+        r#nullable_pfd_list: Default::default(),
+        r#parcel: Default::default(),
+        r#nullable_parcel: Default::default(),
+        r#parcel_array: Default::default(),
+        r#nullable_parcel_array: Default::default(),
+        r#parcel_list: Default::default(),
+        r#nullable_parcel_list: Default::default(),
+      }
+    }
+  }
+  impl binder::Parcelable for r#CompilerChecks {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        let __field_ref = self.r#binder.as_ref().ok_or(binder::StatusCode::UNEXPECTED_NULL)?;
+        subparcel.write(__field_ref)?;
+        subparcel.write(&self.r#nullable_binder)?;
+        subparcel.write(&self.r#binder_array)?;
+        subparcel.write(&self.r#nullable_binder_array)?;
+        subparcel.write(&self.r#binder_list)?;
+        subparcel.write(&self.r#nullable_binder_list)?;
+        let __field_ref = self.r#pfd.as_ref().ok_or(binder::StatusCode::UNEXPECTED_NULL)?;
+        subparcel.write(__field_ref)?;
+        subparcel.write(&self.r#nullable_pfd)?;
+        subparcel.write(&self.r#pfd_array)?;
+        subparcel.write(&self.r#nullable_pfd_array)?;
+        subparcel.write(&self.r#pfd_list)?;
+        subparcel.write(&self.r#nullable_pfd_list)?;
+        subparcel.write(&self.r#parcel)?;
+        subparcel.write(&self.r#nullable_parcel)?;
+        subparcel.write(&self.r#parcel_array)?;
+        subparcel.write(&self.r#nullable_parcel_array)?;
+        subparcel.write(&self.r#parcel_list)?;
+        subparcel.write(&self.r#nullable_parcel_list)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#binder = Some(subparcel.read()?);
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_binder = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#binder_array = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_binder_array = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#binder_list = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_binder_list = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#pfd = Some(subparcel.read()?);
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_pfd = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#pfd_array = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_pfd_array = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#pfd_list = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_pfd_list = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#parcel = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_parcel = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#parcel_array = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_parcel_array = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#parcel_list = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_parcel_list = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#CompilerChecks);
+  binder::impl_deserialize_for_parcelable!(r#CompilerChecks);
+  impl binder::binder_impl::ParcelableMetadata for r#CompilerChecks {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.ITestService.CompilerChecks" }
+  }
+  pub mod r#Foo {
+    #![allow(non_upper_case_globals)]
+    #![allow(non_snake_case)]
+    #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+    use binder::declare_binder_interface;
+    declare_binder_interface! {
+      IFoo["android.aidl.tests.ITestService.CompilerChecks.Foo"] {
+        native: BnFoo(on_transact),
+        proxy: BpFoo {
+        },
+        async: IFooAsync,
+      }
+    }
+    pub trait IFoo: binder::Interface + Send {
+      fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.Foo" }
+      fn getDefaultImpl() -> IFooDefaultRef where Self: Sized {
+        DEFAULT_IMPL.lock().unwrap().clone()
+      }
+      fn setDefaultImpl(d: IFooDefaultRef) -> IFooDefaultRef where Self: Sized {
+        std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+      }
+    }
+    pub trait IFooAsync<P>: binder::Interface + Send {
+      fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.Foo" }
+    }
+    #[::async_trait::async_trait]
+    pub trait IFooAsyncServer: binder::Interface + Send {
+      fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.Foo" }
+    }
+    impl BnFoo {
+      /// Create a new async binder service.
+      pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IFoo>
+      where
+        T: IFooAsyncServer + binder::Interface + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+        struct Wrapper<T, R> {
+          _inner: T,
+          _rt: R,
+        }
+        impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+          fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+          fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+        }
+        impl<T, R> IFoo for Wrapper<T, R>
+        where
+          T: IFooAsyncServer + Send + Sync + 'static,
+          R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+        {
+        }
+        let wrapped = Wrapper { _inner: inner, _rt: rt };
+        Self::new_binder(wrapped, features)
+      }
+    }
+    pub trait IFooDefault: Send + Sync {
+    }
+    pub mod transactions {
+    }
+    pub type IFooDefaultRef = Option<std::sync::Arc<dyn IFooDefault>>;
+    use lazy_static::lazy_static;
+    lazy_static! {
+      static ref DEFAULT_IMPL: std::sync::Mutex<IFooDefaultRef> = std::sync::Mutex::new(None);
+    }
+    impl BpFoo {
+    }
+    impl IFoo for BpFoo {
+    }
+    impl<P: binder::BinderAsyncPool> IFooAsync<P> for BpFoo {
+    }
+    impl IFoo for binder::binder_impl::Binder<BnFoo> {
+    }
+    fn on_transact(_aidl_service: &dyn IFoo, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+      match _aidl_code {
+        _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+      }
+    }
+  }
+  pub mod r#HasDeprecated {
+    #[derive(Debug)]
+    pub struct r#HasDeprecated {
+      #[deprecated = "field"]
+      pub r#deprecated: i32,
+    }
+    impl Default for r#HasDeprecated {
+      fn default() -> Self {
+        Self {
+          r#deprecated: 0,
+        }
+      }
+    }
+    impl binder::Parcelable for r#HasDeprecated {
+      fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+        parcel.sized_write(|subparcel| {
+          subparcel.write(&self.r#deprecated)?;
+          Ok(())
+        })
+      }
+      fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+        parcel.sized_read(|subparcel| {
+          if subparcel.has_more_data() {
+            self.r#deprecated = subparcel.read()?;
+          }
+          Ok(())
+        })
+      }
+    }
+    binder::impl_serialize_for_parcelable!(r#HasDeprecated);
+    binder::impl_deserialize_for_parcelable!(r#HasDeprecated);
+    impl binder::binder_impl::ParcelableMetadata for r#HasDeprecated {
+      fn get_descriptor() -> &'static str { "android.aidl.tests.ITestService.CompilerChecks.HasDeprecated" }
+    }
+  }
+  pub mod r#UsingHasDeprecated {
+    #[derive(Debug)]
+    pub enum r#UsingHasDeprecated {
+      N(i32),
+      M(crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_13_HasDeprecated),
+    }
+    impl Default for r#UsingHasDeprecated {
+      fn default() -> Self {
+        Self::N(0)
+      }
+    }
+    impl binder::Parcelable for r#UsingHasDeprecated {
+      fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+        match self {
+          Self::N(v) => {
+            parcel.write(&0i32)?;
+            parcel.write(v)
+          }
+          Self::M(v) => {
+            parcel.write(&1i32)?;
+            parcel.write(v)
+          }
+        }
+      }
+      fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+        let tag: i32 = parcel.read()?;
+        match tag {
+          0 => {
+            let value: i32 = parcel.read()?;
+            *self = Self::N(value);
+            Ok(())
+          }
+          1 => {
+            let value: crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_13_HasDeprecated = parcel.read()?;
+            *self = Self::M(value);
+            Ok(())
+          }
+          _ => {
+            Err(binder::StatusCode::BAD_VALUE)
+          }
+        }
+      }
+    }
+    binder::impl_serialize_for_parcelable!(r#UsingHasDeprecated);
+    binder::impl_deserialize_for_parcelable!(r#UsingHasDeprecated);
+    impl binder::binder_impl::ParcelableMetadata for r#UsingHasDeprecated {
+      fn get_descriptor() -> &'static str { "android.aidl.tests.ITestService.CompilerChecks.UsingHasDeprecated" }
+    }
+    pub mod r#Tag {
+      #![allow(non_upper_case_globals)]
+      use binder::declare_binder_enum;
+      declare_binder_enum! {
+        r#Tag : [i32; 2] {
+          r#n = 0,
+          r#m = 1,
+        }
+      }
+    }
+  }
+  pub mod r#NoPrefixInterface {
+    #![allow(non_upper_case_globals)]
+    #![allow(non_snake_case)]
+    #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+    use binder::declare_binder_interface;
+    declare_binder_interface! {
+      INoPrefixInterface["android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface"] {
+        native: BnNoPrefixInterface(on_transact),
+        proxy: BpNoPrefixInterface {
+        },
+        async: INoPrefixInterfaceAsync,
+      }
+    }
+    pub trait INoPrefixInterface: binder::Interface + Send {
+      fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface" }
+      fn r#foo(&self) -> binder::Result<()>;
+      fn getDefaultImpl() -> INoPrefixInterfaceDefaultRef where Self: Sized {
+        DEFAULT_IMPL.lock().unwrap().clone()
+      }
+      fn setDefaultImpl(d: INoPrefixInterfaceDefaultRef) -> INoPrefixInterfaceDefaultRef where Self: Sized {
+        std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+      }
+    }
+    pub trait INoPrefixInterfaceAsync<P>: binder::Interface + Send {
+      fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface" }
+      fn r#foo<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>>;
+    }
+    #[::async_trait::async_trait]
+    pub trait INoPrefixInterfaceAsyncServer: binder::Interface + Send {
+      fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface" }
+      async fn r#foo(&self) -> binder::Result<()>;
+    }
+    impl BnNoPrefixInterface {
+      /// Create a new async binder service.
+      pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn INoPrefixInterface>
+      where
+        T: INoPrefixInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+        struct Wrapper<T, R> {
+          _inner: T,
+          _rt: R,
+        }
+        impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+          fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+          fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+        }
+        impl<T, R> INoPrefixInterface for Wrapper<T, R>
+        where
+          T: INoPrefixInterfaceAsyncServer + Send + Sync + 'static,
+          R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+        {
+          fn r#foo(&self) -> binder::Result<()> {
+            self._rt.block_on(self._inner.r#foo())
+          }
+        }
+        let wrapped = Wrapper { _inner: inner, _rt: rt };
+        Self::new_binder(wrapped, features)
+      }
+    }
+    pub trait INoPrefixInterfaceDefault: Send + Sync {
+      fn r#foo(&self) -> binder::Result<()> {
+        Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+      }
+    }
+    pub mod transactions {
+      pub const r#foo: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+    }
+    pub type INoPrefixInterfaceDefaultRef = Option<std::sync::Arc<dyn INoPrefixInterfaceDefault>>;
+    use lazy_static::lazy_static;
+    lazy_static! {
+      static ref DEFAULT_IMPL: std::sync::Mutex<INoPrefixInterfaceDefaultRef> = std::sync::Mutex::new(None);
+    }
+    impl BpNoPrefixInterface {
+      fn build_parcel_foo(&self) -> binder::Result<binder::binder_impl::Parcel> {
+        let mut aidl_data = self.binder.prepare_transact()?;
+        Ok(aidl_data)
+      }
+      fn read_response_foo(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+        if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+          if let Some(_aidl_default_impl) = <Self as INoPrefixInterface>::getDefaultImpl() {
+            return _aidl_default_impl.r#foo();
+          }
+        }
+        let _aidl_reply = _aidl_reply?;
+        let _aidl_status: binder::Status = _aidl_reply.read()?;
+        if !_aidl_status.is_ok() { return Err(_aidl_status); }
+        Ok(())
+      }
+    }
+    impl INoPrefixInterface for BpNoPrefixInterface {
+      fn r#foo(&self) -> binder::Result<()> {
+        let _aidl_data = self.build_parcel_foo()?;
+        let _aidl_reply = self.binder.submit_transact(transactions::r#foo, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+        self.read_response_foo(_aidl_reply)
+      }
+    }
+    impl<P: binder::BinderAsyncPool> INoPrefixInterfaceAsync<P> for BpNoPrefixInterface {
+      fn r#foo<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>> {
+        let _aidl_data = match self.build_parcel_foo() {
+          Ok(_aidl_data) => _aidl_data,
+          Err(err) => return Box::pin(std::future::ready(Err(err))),
+        };
+        let binder = self.binder.clone();
+        P::spawn(
+          move || binder.submit_transact(transactions::r#foo, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+          move |_aidl_reply| async move {
+            self.read_response_foo(_aidl_reply)
+          }
+        )
+      }
+    }
+    impl INoPrefixInterface for binder::binder_impl::Binder<BnNoPrefixInterface> {
+      fn r#foo(&self) -> binder::Result<()> { self.0.r#foo() }
+    }
+    fn on_transact(_aidl_service: &dyn INoPrefixInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+      match _aidl_code {
+        transactions::r#foo => {
+          let _aidl_return = _aidl_service.r#foo();
+          match &_aidl_return {
+            Ok(_aidl_return) => {
+              _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            }
+            Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+          }
+          Ok(())
+        }
+        _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+      }
+    }
+    pub mod r#Nested {
+      #[derive(Debug)]
+      pub struct r#Nested {
+      }
+      impl Default for r#Nested {
+        fn default() -> Self {
+          Self {
+          }
+        }
+      }
+      impl binder::Parcelable for r#Nested {
+        fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+          parcel.sized_write(|subparcel| {
+            Ok(())
+          })
+        }
+        fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+          parcel.sized_read(|subparcel| {
+            Ok(())
+          })
+        }
+      }
+      binder::impl_serialize_for_parcelable!(r#Nested);
+      binder::impl_deserialize_for_parcelable!(r#Nested);
+      impl binder::binder_impl::ParcelableMetadata for r#Nested {
+        fn get_descriptor() -> &'static str { "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.Nested" }
+      }
+    }
+    pub mod r#NestedNoPrefixInterface {
+      #![allow(non_upper_case_globals)]
+      #![allow(non_snake_case)]
+      #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+      use binder::declare_binder_interface;
+      declare_binder_interface! {
+        INestedNoPrefixInterface["android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface"] {
+          native: BnNestedNoPrefixInterface(on_transact),
+          proxy: BpNestedNoPrefixInterface {
+          },
+          async: INestedNoPrefixInterfaceAsync,
+        }
+      }
+      pub trait INestedNoPrefixInterface: binder::Interface + Send {
+        fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface" }
+        fn r#foo(&self) -> binder::Result<()>;
+        fn getDefaultImpl() -> INestedNoPrefixInterfaceDefaultRef where Self: Sized {
+          DEFAULT_IMPL.lock().unwrap().clone()
+        }
+        fn setDefaultImpl(d: INestedNoPrefixInterfaceDefaultRef) -> INestedNoPrefixInterfaceDefaultRef where Self: Sized {
+          std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+        }
+      }
+      pub trait INestedNoPrefixInterfaceAsync<P>: binder::Interface + Send {
+        fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface" }
+        fn r#foo<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>>;
+      }
+      #[::async_trait::async_trait]
+      pub trait INestedNoPrefixInterfaceAsyncServer: binder::Interface + Send {
+        fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface" }
+        async fn r#foo(&self) -> binder::Result<()>;
+      }
+      impl BnNestedNoPrefixInterface {
+        /// Create a new async binder service.
+        pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn INestedNoPrefixInterface>
+        where
+          T: INestedNoPrefixInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+          R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+        {
+          struct Wrapper<T, R> {
+            _inner: T,
+            _rt: R,
+          }
+          impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+            fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+            fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+          }
+          impl<T, R> INestedNoPrefixInterface for Wrapper<T, R>
+          where
+            T: INestedNoPrefixInterfaceAsyncServer + Send + Sync + 'static,
+            R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+          {
+            fn r#foo(&self) -> binder::Result<()> {
+              self._rt.block_on(self._inner.r#foo())
+            }
+          }
+          let wrapped = Wrapper { _inner: inner, _rt: rt };
+          Self::new_binder(wrapped, features)
+        }
+      }
+      pub trait INestedNoPrefixInterfaceDefault: Send + Sync {
+        fn r#foo(&self) -> binder::Result<()> {
+          Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+        }
+      }
+      pub mod transactions {
+        pub const r#foo: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+      }
+      pub type INestedNoPrefixInterfaceDefaultRef = Option<std::sync::Arc<dyn INestedNoPrefixInterfaceDefault>>;
+      use lazy_static::lazy_static;
+      lazy_static! {
+        static ref DEFAULT_IMPL: std::sync::Mutex<INestedNoPrefixInterfaceDefaultRef> = std::sync::Mutex::new(None);
+      }
+      impl BpNestedNoPrefixInterface {
+        fn build_parcel_foo(&self) -> binder::Result<binder::binder_impl::Parcel> {
+          let mut aidl_data = self.binder.prepare_transact()?;
+          Ok(aidl_data)
+        }
+        fn read_response_foo(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+          if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+            if let Some(_aidl_default_impl) = <Self as INestedNoPrefixInterface>::getDefaultImpl() {
+              return _aidl_default_impl.r#foo();
+            }
+          }
+          let _aidl_reply = _aidl_reply?;
+          let _aidl_status: binder::Status = _aidl_reply.read()?;
+          if !_aidl_status.is_ok() { return Err(_aidl_status); }
+          Ok(())
+        }
+      }
+      impl INestedNoPrefixInterface for BpNestedNoPrefixInterface {
+        fn r#foo(&self) -> binder::Result<()> {
+          let _aidl_data = self.build_parcel_foo()?;
+          let _aidl_reply = self.binder.submit_transact(transactions::r#foo, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+          self.read_response_foo(_aidl_reply)
+        }
+      }
+      impl<P: binder::BinderAsyncPool> INestedNoPrefixInterfaceAsync<P> for BpNestedNoPrefixInterface {
+        fn r#foo<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>> {
+          let _aidl_data = match self.build_parcel_foo() {
+            Ok(_aidl_data) => _aidl_data,
+            Err(err) => return Box::pin(std::future::ready(Err(err))),
+          };
+          let binder = self.binder.clone();
+          P::spawn(
+            move || binder.submit_transact(transactions::r#foo, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+            move |_aidl_reply| async move {
+              self.read_response_foo(_aidl_reply)
+            }
+          )
+        }
+      }
+      impl INestedNoPrefixInterface for binder::binder_impl::Binder<BnNestedNoPrefixInterface> {
+        fn r#foo(&self) -> binder::Result<()> { self.0.r#foo() }
+      }
+      fn on_transact(_aidl_service: &dyn INestedNoPrefixInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+        match _aidl_code {
+          transactions::r#foo => {
+            let _aidl_return = _aidl_service.r#foo();
+            match &_aidl_return {
+              Ok(_aidl_return) => {
+                _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+              }
+              Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+            }
+            Ok(())
+          }
+          _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+        }
+      }
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ITestService as _7_android_4_aidl_5_tests_12_ITestService;
+ pub use super::r#Empty::r#Empty as _7_android_4_aidl_5_tests_12_ITestService_5_Empty;
+ pub use super::r#CompilerChecks::r#CompilerChecks as _7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks;
+ pub use super::r#CompilerChecks::r#Foo::r#IFoo as _7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_3_Foo;
+ pub use super::r#CompilerChecks::r#HasDeprecated::r#HasDeprecated as _7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_13_HasDeprecated;
+ pub use super::r#CompilerChecks::r#UsingHasDeprecated::r#UsingHasDeprecated as _7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_18_UsingHasDeprecated;
+ pub use super::r#CompilerChecks::r#UsingHasDeprecated::r#Tag::r#Tag as _7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_18_UsingHasDeprecated_3_Tag;
+ pub use super::r#CompilerChecks::r#NoPrefixInterface::r#INoPrefixInterface as _7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_17_NoPrefixInterface;
+ pub use super::r#CompilerChecks::r#NoPrefixInterface::r#Nested::r#Nested as _7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_17_NoPrefixInterface_6_Nested;
+ pub use super::r#CompilerChecks::r#NoPrefixInterface::r#NestedNoPrefixInterface::r#INestedNoPrefixInterface as _7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_17_NoPrefixInterface_23_NestedNoPrefixInterface;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs.d
new file mode 100644
index 0000000..80d694b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs : \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IntEnum.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IntEnum.rs
new file mode 100644
index 0000000..245465a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IntEnum.rs
@@ -0,0 +1,20 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/IntEnum.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+use binder::declare_binder_enum;
+declare_binder_enum! {
+  r#IntEnum : [i32; 4] {
+    r#FOO = 1000,
+    r#BAR = 2000,
+    r#BAZ = 2001,
+    #[deprecated = "do not use this"]
+    r#QUX = 2002,
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#IntEnum as _7_android_4_aidl_5_tests_7_IntEnum;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IntEnum.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IntEnum.rs.d
new file mode 100644
index 0000000..f90d6ac
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IntEnum.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/IntEnum.rs : \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs
new file mode 100644
index 0000000..b0b9b6c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs
@@ -0,0 +1,407 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#ListOfInterfaces {
+}
+impl Default for r#ListOfInterfaces {
+  fn default() -> Self {
+    Self {
+    }
+  }
+}
+impl binder::Parcelable for r#ListOfInterfaces {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#ListOfInterfaces);
+binder::impl_deserialize_for_parcelable!(r#ListOfInterfaces);
+impl binder::binder_impl::ParcelableMetadata for r#ListOfInterfaces {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.ListOfInterfaces" }
+}
+pub mod r#IEmptyInterface {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    IEmptyInterface["android.aidl.tests.ListOfInterfaces.IEmptyInterface"] {
+      native: BnEmptyInterface(on_transact),
+      proxy: BpEmptyInterface {
+      },
+      async: IEmptyInterfaceAsync,
+    }
+  }
+  pub trait IEmptyInterface: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ListOfInterfaces.IEmptyInterface" }
+    fn getDefaultImpl() -> IEmptyInterfaceDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: IEmptyInterfaceDefaultRef) -> IEmptyInterfaceDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait IEmptyInterfaceAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ListOfInterfaces.IEmptyInterface" }
+  }
+  #[::async_trait::async_trait]
+  pub trait IEmptyInterfaceAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ListOfInterfaces.IEmptyInterface" }
+  }
+  impl BnEmptyInterface {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IEmptyInterface>
+    where
+      T: IEmptyInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> IEmptyInterface for Wrapper<T, R>
+      where
+        T: IEmptyInterfaceAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait IEmptyInterfaceDefault: Send + Sync {
+  }
+  pub mod transactions {
+  }
+  pub type IEmptyInterfaceDefaultRef = Option<std::sync::Arc<dyn IEmptyInterfaceDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None);
+  }
+  impl BpEmptyInterface {
+  }
+  impl IEmptyInterface for BpEmptyInterface {
+  }
+  impl<P: binder::BinderAsyncPool> IEmptyInterfaceAsync<P> for BpEmptyInterface {
+  }
+  impl IEmptyInterface for binder::binder_impl::Binder<BnEmptyInterface> {
+  }
+  fn on_transact(_aidl_service: &dyn IEmptyInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub mod r#IMyInterface {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    IMyInterface["android.aidl.tests.ListOfInterfaces.IMyInterface"] {
+      native: BnMyInterface(on_transact),
+      proxy: BpMyInterface {
+      },
+      async: IMyInterfaceAsync,
+    }
+  }
+  pub trait IMyInterface: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ListOfInterfaces.IMyInterface" }
+    fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>>;
+    fn getDefaultImpl() -> IMyInterfaceDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: IMyInterfaceDefaultRef) -> IMyInterfaceDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait IMyInterfaceAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ListOfInterfaces.IMyInterface" }
+    fn r#methodWithInterfaces<'a>(&'a self, _arg_iface: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &'a [binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &'a mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &'a mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&'a [Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &'a mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &'a mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>>>;
+  }
+  #[::async_trait::async_trait]
+  pub trait IMyInterfaceAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ListOfInterfaces.IMyInterface" }
+    async fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>>;
+  }
+  impl BnMyInterface {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IMyInterface>
+    where
+      T: IMyInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> IMyInterface for Wrapper<T, R>
+      where
+        T: IMyInterfaceAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+        fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>> {
+          self._rt.block_on(self._inner.r#methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_list_in, _arg_iface_list_out, _arg_iface_list_inout, _arg_nullable_iface_list_in, _arg_nullable_iface_list_out, _arg_nullable_iface_list_inout))
+        }
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait IMyInterfaceDefault: Send + Sync {
+    fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+  }
+  pub mod transactions {
+    pub const r#methodWithInterfaces: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  }
+  pub type IMyInterfaceDefaultRef = Option<std::sync::Arc<dyn IMyInterfaceDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<IMyInterfaceDefaultRef> = std::sync::Mutex::new(None);
+  }
+  impl BpMyInterface {
+    fn build_parcel_methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_iface)?;
+      aidl_data.write(&_arg_nullable_iface)?;
+      aidl_data.write(_arg_iface_list_in)?;
+      aidl_data.write(_arg_iface_list_inout)?;
+      aidl_data.write(&_arg_nullable_iface_list_in)?;
+      aidl_data.write(_arg_nullable_iface_list_inout)?;
+      Ok(aidl_data)
+    }
+    fn read_response_methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyInterface>::getDefaultImpl() {
+          return _aidl_default_impl.r#methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_list_in, _arg_iface_list_out, _arg_iface_list_inout, _arg_nullable_iface_list_in, _arg_nullable_iface_list_out, _arg_nullable_iface_list_inout);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>> = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_iface_list_out)?;
+      _aidl_reply.read_onto(_arg_iface_list_inout)?;
+      _aidl_reply.read_onto(_arg_nullable_iface_list_out)?;
+      _aidl_reply.read_onto(_arg_nullable_iface_list_inout)?;
+      Ok(_aidl_return)
+    }
+  }
+  impl IMyInterface for BpMyInterface {
+    fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>> {
+      let _aidl_data = self.build_parcel_methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_list_in, _arg_iface_list_out, _arg_iface_list_inout, _arg_nullable_iface_list_in, _arg_nullable_iface_list_out, _arg_nullable_iface_list_inout)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#methodWithInterfaces, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_list_in, _arg_iface_list_out, _arg_iface_list_inout, _arg_nullable_iface_list_in, _arg_nullable_iface_list_out, _arg_nullable_iface_list_inout, _aidl_reply)
+    }
+  }
+  impl<P: binder::BinderAsyncPool> IMyInterfaceAsync<P> for BpMyInterface {
+    fn r#methodWithInterfaces<'a>(&'a self, _arg_iface: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &'a [binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &'a mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &'a mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&'a [Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &'a mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &'a mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>>> {
+      let _aidl_data = match self.build_parcel_methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_list_in, _arg_iface_list_out, _arg_iface_list_inout, _arg_nullable_iface_list_in, _arg_nullable_iface_list_out, _arg_nullable_iface_list_inout) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#methodWithInterfaces, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_list_in, _arg_iface_list_out, _arg_iface_list_inout, _arg_nullable_iface_list_in, _arg_nullable_iface_list_out, _arg_nullable_iface_list_inout, _aidl_reply)
+        }
+      )
+    }
+  }
+  impl IMyInterface for binder::binder_impl::Binder<BnMyInterface> {
+    fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>> { self.0.r#methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_list_in, _arg_iface_list_out, _arg_iface_list_inout, _arg_nullable_iface_list_in, _arg_nullable_iface_list_out, _arg_nullable_iface_list_inout) }
+  }
+  fn on_transact(_aidl_service: &dyn IMyInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      transactions::r#methodWithInterfaces => {
+        let _arg_iface: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface> = _aidl_data.read()?;
+        let _arg_nullable_iface: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>> = _aidl_data.read()?;
+        let _arg_iface_list_in: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>> = _aidl_data.read()?;
+        let mut _arg_iface_list_out: Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>> = Default::default();
+        let mut _arg_iface_list_inout: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>> = _aidl_data.read()?;
+        let _arg_nullable_iface_list_in: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>> = _aidl_data.read()?;
+        let mut _arg_nullable_iface_list_out: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>> = Default::default();
+        let mut _arg_nullable_iface_list_inout: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>> = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#methodWithInterfaces(&_arg_iface, _arg_nullable_iface.as_ref(), &_arg_iface_list_in, &mut _arg_iface_list_out, &mut _arg_iface_list_inout, _arg_nullable_iface_list_in.as_deref(), &mut _arg_nullable_iface_list_out, &mut _arg_nullable_iface_list_inout);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_iface_list_out)?;
+            _aidl_reply.write(&_arg_iface_list_inout)?;
+            _aidl_reply.write(&_arg_nullable_iface_list_out)?;
+            _aidl_reply.write(&_arg_nullable_iface_list_inout)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub mod r#MyParcelable {
+  #[derive(Debug)]
+  pub struct r#MyParcelable {
+    pub r#iface: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>,
+    pub r#nullable_iface: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>,
+    pub r#iface_list: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>,
+    pub r#nullable_iface_list: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>,
+  }
+  impl Default for r#MyParcelable {
+    fn default() -> Self {
+      Self {
+        r#iface: Default::default(),
+        r#nullable_iface: Default::default(),
+        r#iface_list: Default::default(),
+        r#nullable_iface_list: Default::default(),
+      }
+    }
+  }
+  impl binder::Parcelable for r#MyParcelable {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        let __field_ref = self.r#iface.as_ref().ok_or(binder::StatusCode::UNEXPECTED_NULL)?;
+        subparcel.write(__field_ref)?;
+        subparcel.write(&self.r#nullable_iface)?;
+        subparcel.write(&self.r#iface_list)?;
+        subparcel.write(&self.r#nullable_iface_list)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#iface = Some(subparcel.read()?);
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_iface = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#iface_list = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_iface_list = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyParcelable);
+  binder::impl_deserialize_for_parcelable!(r#MyParcelable);
+  impl binder::binder_impl::ParcelableMetadata for r#MyParcelable {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.ListOfInterfaces.MyParcelable" }
+  }
+}
+pub mod r#MyUnion {
+  #[derive(Debug)]
+  pub enum r#MyUnion {
+    Iface(Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>),
+    Nullable_iface(Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>),
+    Iface_list(Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>),
+    Nullable_iface_list(Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>),
+  }
+  impl Default for r#MyUnion {
+    fn default() -> Self {
+      Self::Iface(Default::default())
+    }
+  }
+  impl binder::Parcelable for r#MyUnion {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      match self {
+        Self::Iface(v) => {
+          parcel.write(&0i32)?;
+          let __field_ref = v.as_ref().ok_or(binder::StatusCode::UNEXPECTED_NULL)?;
+          parcel.write(__field_ref)
+        }
+        Self::Nullable_iface(v) => {
+          parcel.write(&1i32)?;
+          parcel.write(v)
+        }
+        Self::Iface_list(v) => {
+          parcel.write(&2i32)?;
+          parcel.write(v)
+        }
+        Self::Nullable_iface_list(v) => {
+          parcel.write(&3i32)?;
+          parcel.write(v)
+        }
+      }
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      let tag: i32 = parcel.read()?;
+      match tag {
+        0 => {
+          let value: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>> = Some(parcel.read()?);
+          *self = Self::Iface(value);
+          Ok(())
+        }
+        1 => {
+          let value: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>> = parcel.read()?;
+          *self = Self::Nullable_iface(value);
+          Ok(())
+        }
+        2 => {
+          let value: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>> = parcel.read()?;
+          *self = Self::Iface_list(value);
+          Ok(())
+        }
+        3 => {
+          let value: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>> = parcel.read()?;
+          *self = Self::Nullable_iface_list(value);
+          Ok(())
+        }
+        _ => {
+          Err(binder::StatusCode::BAD_VALUE)
+        }
+      }
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyUnion);
+  binder::impl_deserialize_for_parcelable!(r#MyUnion);
+  impl binder::binder_impl::ParcelableMetadata for r#MyUnion {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.ListOfInterfaces.MyUnion" }
+  }
+  pub mod r#Tag {
+    #![allow(non_upper_case_globals)]
+    use binder::declare_binder_enum;
+    declare_binder_enum! {
+      r#Tag : [i32; 4] {
+        r#iface = 0,
+        r#nullable_iface = 1,
+        r#iface_list = 2,
+        r#nullable_iface_list = 3,
+      }
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ListOfInterfaces as _7_android_4_aidl_5_tests_16_ListOfInterfaces;
+ pub use super::r#IEmptyInterface::r#IEmptyInterface as _7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface;
+ pub use super::r#IMyInterface::r#IMyInterface as _7_android_4_aidl_5_tests_16_ListOfInterfaces_12_IMyInterface;
+ pub use super::r#MyParcelable::r#MyParcelable as _7_android_4_aidl_5_tests_16_ListOfInterfaces_12_MyParcelable;
+ pub use super::r#MyUnion::r#MyUnion as _7_android_4_aidl_5_tests_16_ListOfInterfaces_7_MyUnion;
+ pub use super::r#MyUnion::r#Tag::r#Tag as _7_android_4_aidl_5_tests_16_ListOfInterfaces_7_MyUnion_3_Tag;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs.d
new file mode 100644
index 0000000..b965c9a
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs : \
+  system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/LongEnum.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/LongEnum.rs
new file mode 100644
index 0000000..38ebfdd
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/LongEnum.rs
@@ -0,0 +1,18 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/LongEnum.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+use binder::declare_binder_enum;
+declare_binder_enum! {
+  r#LongEnum : [i64; 3] {
+    r#FOO = 100000000000,
+    r#BAR = 200000000000,
+    r#BAZ = 200000000001,
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#LongEnum as _7_android_4_aidl_5_tests_8_LongEnum;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/LongEnum.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/LongEnum.rs.d
new file mode 100644
index 0000000..41f9bc3
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/LongEnum.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/LongEnum.rs : \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/OtherParcelableForToString.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/OtherParcelableForToString.rs
new file mode 100644
index 0000000..473a5b7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/OtherParcelableForToString.rs
@@ -0,0 +1,41 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/OtherParcelableForToString.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#OtherParcelableForToString {
+  pub r#field: String,
+}
+impl Default for r#OtherParcelableForToString {
+  fn default() -> Self {
+    Self {
+      r#field: Default::default(),
+    }
+  }
+}
+impl binder::Parcelable for r#OtherParcelableForToString {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#field)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#field = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#OtherParcelableForToString);
+binder::impl_deserialize_for_parcelable!(r#OtherParcelableForToString);
+impl binder::binder_impl::ParcelableMetadata for r#OtherParcelableForToString {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.OtherParcelableForToString" }
+}
+pub(crate) mod mangled {
+ pub use super::r#OtherParcelableForToString as _7_android_4_aidl_5_tests_26_OtherParcelableForToString;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/OtherParcelableForToString.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/OtherParcelableForToString.rs.d
new file mode 100644
index 0000000..cc95ae1
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/OtherParcelableForToString.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/OtherParcelableForToString.rs : \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ParcelableForToString.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ParcelableForToString.rs
new file mode 100644
index 0000000..744fadb
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ParcelableForToString.rs
@@ -0,0 +1,173 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ParcelableForToString.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#ParcelableForToString {
+  pub r#intValue: i32,
+  pub r#intArray: Vec<i32>,
+  pub r#longValue: i64,
+  pub r#longArray: Vec<i64>,
+  pub r#doubleValue: f64,
+  pub r#doubleArray: Vec<f64>,
+  pub r#floatValue: f32,
+  pub r#floatArray: Vec<f32>,
+  pub r#byteValue: i8,
+  pub r#byteArray: Vec<u8>,
+  pub r#booleanValue: bool,
+  pub r#booleanArray: Vec<bool>,
+  pub r#stringValue: String,
+  pub r#stringArray: Vec<String>,
+  pub r#stringList: Vec<String>,
+  pub r#parcelableValue: crate::mangled::_7_android_4_aidl_5_tests_26_OtherParcelableForToString,
+  pub r#parcelableArray: Vec<crate::mangled::_7_android_4_aidl_5_tests_26_OtherParcelableForToString>,
+  pub r#enumValue: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum,
+  pub r#enumArray: Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>,
+  pub r#nullArray: Vec<String>,
+  pub r#nullList: Vec<String>,
+  pub r#parcelableGeneric: crate::mangled::_7_android_4_aidl_5_tests_27_GenericStructuredParcelable<i32,crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable,crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum,>,
+  pub r#unionValue: crate::mangled::_7_android_4_aidl_5_tests_5_Union,
+}
+impl Default for r#ParcelableForToString {
+  fn default() -> Self {
+    Self {
+      r#intValue: 0,
+      r#intArray: Default::default(),
+      r#longValue: 0,
+      r#longArray: Default::default(),
+      r#doubleValue: 0.000000f64,
+      r#doubleArray: Default::default(),
+      r#floatValue: 0.000000f32,
+      r#floatArray: Default::default(),
+      r#byteValue: 0,
+      r#byteArray: Default::default(),
+      r#booleanValue: false,
+      r#booleanArray: Default::default(),
+      r#stringValue: Default::default(),
+      r#stringArray: Default::default(),
+      r#stringList: Default::default(),
+      r#parcelableValue: Default::default(),
+      r#parcelableArray: Default::default(),
+      r#enumValue: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum::FOO,
+      r#enumArray: Default::default(),
+      r#nullArray: Default::default(),
+      r#nullList: Default::default(),
+      r#parcelableGeneric: Default::default(),
+      r#unionValue: Default::default(),
+    }
+  }
+}
+impl binder::Parcelable for r#ParcelableForToString {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#intValue)?;
+      subparcel.write(&self.r#intArray)?;
+      subparcel.write(&self.r#longValue)?;
+      subparcel.write(&self.r#longArray)?;
+      subparcel.write(&self.r#doubleValue)?;
+      subparcel.write(&self.r#doubleArray)?;
+      subparcel.write(&self.r#floatValue)?;
+      subparcel.write(&self.r#floatArray)?;
+      subparcel.write(&self.r#byteValue)?;
+      subparcel.write(&self.r#byteArray)?;
+      subparcel.write(&self.r#booleanValue)?;
+      subparcel.write(&self.r#booleanArray)?;
+      subparcel.write(&self.r#stringValue)?;
+      subparcel.write(&self.r#stringArray)?;
+      subparcel.write(&self.r#stringList)?;
+      subparcel.write(&self.r#parcelableValue)?;
+      subparcel.write(&self.r#parcelableArray)?;
+      subparcel.write(&self.r#enumValue)?;
+      subparcel.write(&self.r#enumArray)?;
+      subparcel.write(&self.r#nullArray)?;
+      subparcel.write(&self.r#nullList)?;
+      subparcel.write(&self.r#parcelableGeneric)?;
+      subparcel.write(&self.r#unionValue)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#intValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#doubleValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#doubleArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#floatValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#floatArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#booleanValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#booleanArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#stringValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#stringArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#stringList = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#parcelableValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#parcelableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#enumValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#enumArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#nullArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#nullList = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#parcelableGeneric = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#unionValue = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#ParcelableForToString);
+binder::impl_deserialize_for_parcelable!(r#ParcelableForToString);
+impl binder::binder_impl::ParcelableMetadata for r#ParcelableForToString {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.ParcelableForToString" }
+}
+pub(crate) mod mangled {
+ pub use super::r#ParcelableForToString as _7_android_4_aidl_5_tests_21_ParcelableForToString;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ParcelableForToString.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ParcelableForToString.rs.d
new file mode 100644
index 0000000..5471bd0
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ParcelableForToString.rs.d
@@ -0,0 +1,10 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ParcelableForToString.rs : \
+  system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/RecursiveList.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/RecursiveList.rs
new file mode 100644
index 0000000..a68a3e7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/RecursiveList.rs
@@ -0,0 +1,47 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/RecursiveList.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#RecursiveList {
+  pub r#value: i32,
+  pub r#next: Option<Box<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList>>,
+}
+impl Default for r#RecursiveList {
+  fn default() -> Self {
+    Self {
+      r#value: 0,
+      r#next: Default::default(),
+    }
+  }
+}
+impl binder::Parcelable for r#RecursiveList {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#value)?;
+      subparcel.write(&self.r#next)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#value = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#next = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#RecursiveList);
+binder::impl_deserialize_for_parcelable!(r#RecursiveList);
+impl binder::binder_impl::ParcelableMetadata for r#RecursiveList {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.RecursiveList" }
+}
+pub(crate) mod mangled {
+ pub use super::r#RecursiveList as _7_android_4_aidl_5_tests_13_RecursiveList;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/RecursiveList.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/RecursiveList.rs.d
new file mode 100644
index 0000000..f0dd6cf
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/RecursiveList.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/RecursiveList.rs : \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/StructuredParcelable.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/StructuredParcelable.rs
new file mode 100644
index 0000000..079431d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/StructuredParcelable.rs
@@ -0,0 +1,397 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/StructuredParcelable.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug, Clone, PartialEq)]
+pub struct r#StructuredParcelable {
+  pub r#shouldContainThreeFs: Vec<i32>,
+  pub r#f: i32,
+  pub r#shouldBeJerry: String,
+  pub r#shouldBeByteBar: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum,
+  pub r#shouldBeIntBar: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum,
+  pub r#shouldBeLongBar: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum,
+  pub r#shouldContainTwoByteFoos: Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>,
+  pub r#shouldContainTwoIntFoos: Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>,
+  pub r#shouldContainTwoLongFoos: Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>,
+  pub r#stringDefaultsToFoo: String,
+  pub r#byteDefaultsToFour: i8,
+  pub r#intDefaultsToFive: i32,
+  pub r#longDefaultsToNegativeSeven: i64,
+  pub r#booleanDefaultsToTrue: bool,
+  pub r#charDefaultsToC: u16,
+  pub r#floatDefaultsToPi: f32,
+  pub r#doubleWithDefault: f64,
+  pub r#arrayDefaultsTo123: Vec<i32>,
+  pub r#arrayDefaultsToEmpty: Vec<i32>,
+  pub r#boolDefault: bool,
+  pub r#byteDefault: i8,
+  pub r#intDefault: i32,
+  pub r#longDefault: i64,
+  pub r#floatDefault: f32,
+  pub r#doubleDefault: f64,
+  pub r#checkDoubleFromFloat: f64,
+  pub r#checkStringArray1: Vec<String>,
+  pub r#checkStringArray2: Vec<String>,
+  pub r#int32_min: i32,
+  pub r#int32_max: i32,
+  pub r#int64_max: i64,
+  pub r#hexInt32_neg_1: i32,
+  pub r#ibinder: Option<binder::SpIBinder>,
+  pub r#empty: crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable_5_Empty,
+  pub r#int8_1: Vec<u8>,
+  pub r#int32_1: Vec<i32>,
+  pub r#int64_1: Vec<i64>,
+  pub r#hexInt32_pos_1: i32,
+  pub r#hexInt64_pos_1: i32,
+  pub r#const_exprs_1: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_2: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_3: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_4: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_5: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_6: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_7: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_8: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_9: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_10: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#addString1: String,
+  pub r#addString2: String,
+  pub r#shouldSetBit0AndBit2: i32,
+  pub r#u: Option<crate::mangled::_7_android_4_aidl_5_tests_5_Union>,
+  pub r#shouldBeConstS1: Option<crate::mangled::_7_android_4_aidl_5_tests_5_Union>,
+  pub r#defaultWithFoo: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum,
+}
+pub const r#BIT0: i32 = 1;
+pub const r#BIT1: i32 = 2;
+pub const r#BIT2: i32 = 4;
+impl Default for r#StructuredParcelable {
+  fn default() -> Self {
+    Self {
+      r#shouldContainThreeFs: Default::default(),
+      r#f: 0,
+      r#shouldBeJerry: Default::default(),
+      r#shouldBeByteBar: Default::default(),
+      r#shouldBeIntBar: Default::default(),
+      r#shouldBeLongBar: Default::default(),
+      r#shouldContainTwoByteFoos: Default::default(),
+      r#shouldContainTwoIntFoos: Default::default(),
+      r#shouldContainTwoLongFoos: Default::default(),
+      r#stringDefaultsToFoo: "foo".into(),
+      r#byteDefaultsToFour: 4,
+      r#intDefaultsToFive: 5,
+      r#longDefaultsToNegativeSeven: -7,
+      r#booleanDefaultsToTrue: true,
+      r#charDefaultsToC: 'C' as u16,
+      r#floatDefaultsToPi: 3.140000f32,
+      r#doubleWithDefault: -314000000000000000.000000f64,
+      r#arrayDefaultsTo123: vec![1, 2, 3],
+      r#arrayDefaultsToEmpty: vec![],
+      r#boolDefault: false,
+      r#byteDefault: 0,
+      r#intDefault: 0,
+      r#longDefault: 0,
+      r#floatDefault: 0.000000f32,
+      r#doubleDefault: 0.000000f64,
+      r#checkDoubleFromFloat: 3.140000f64,
+      r#checkStringArray1: vec!["a".into(), "b".into()],
+      r#checkStringArray2: vec!["a".into(), "b".into()],
+      r#int32_min: -2147483648,
+      r#int32_max: 2147483647,
+      r#int64_max: 9223372036854775807,
+      r#hexInt32_neg_1: -1,
+      r#ibinder: Default::default(),
+      r#empty: Default::default(),
+      r#int8_1: vec![1, 1, 1, 1, 1],
+      r#int32_1: vec![1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+      r#int64_1: vec![1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+      r#hexInt32_pos_1: 1,
+      r#hexInt64_pos_1: 1,
+      r#const_exprs_1: Default::default(),
+      r#const_exprs_2: Default::default(),
+      r#const_exprs_3: Default::default(),
+      r#const_exprs_4: Default::default(),
+      r#const_exprs_5: Default::default(),
+      r#const_exprs_6: Default::default(),
+      r#const_exprs_7: Default::default(),
+      r#const_exprs_8: Default::default(),
+      r#const_exprs_9: Default::default(),
+      r#const_exprs_10: Default::default(),
+      r#addString1: "hello world!".into(),
+      r#addString2: "The quick brown fox jumps over the lazy dog.".into(),
+      r#shouldSetBit0AndBit2: 0,
+      r#u: Default::default(),
+      r#shouldBeConstS1: Default::default(),
+      r#defaultWithFoo: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum::FOO,
+    }
+  }
+}
+impl binder::Parcelable for r#StructuredParcelable {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#shouldContainThreeFs)?;
+      subparcel.write(&self.r#f)?;
+      subparcel.write(&self.r#shouldBeJerry)?;
+      subparcel.write(&self.r#shouldBeByteBar)?;
+      subparcel.write(&self.r#shouldBeIntBar)?;
+      subparcel.write(&self.r#shouldBeLongBar)?;
+      subparcel.write(&self.r#shouldContainTwoByteFoos)?;
+      subparcel.write(&self.r#shouldContainTwoIntFoos)?;
+      subparcel.write(&self.r#shouldContainTwoLongFoos)?;
+      subparcel.write(&self.r#stringDefaultsToFoo)?;
+      subparcel.write(&self.r#byteDefaultsToFour)?;
+      subparcel.write(&self.r#intDefaultsToFive)?;
+      subparcel.write(&self.r#longDefaultsToNegativeSeven)?;
+      subparcel.write(&self.r#booleanDefaultsToTrue)?;
+      subparcel.write(&self.r#charDefaultsToC)?;
+      subparcel.write(&self.r#floatDefaultsToPi)?;
+      subparcel.write(&self.r#doubleWithDefault)?;
+      subparcel.write(&self.r#arrayDefaultsTo123)?;
+      subparcel.write(&self.r#arrayDefaultsToEmpty)?;
+      subparcel.write(&self.r#boolDefault)?;
+      subparcel.write(&self.r#byteDefault)?;
+      subparcel.write(&self.r#intDefault)?;
+      subparcel.write(&self.r#longDefault)?;
+      subparcel.write(&self.r#floatDefault)?;
+      subparcel.write(&self.r#doubleDefault)?;
+      subparcel.write(&self.r#checkDoubleFromFloat)?;
+      subparcel.write(&self.r#checkStringArray1)?;
+      subparcel.write(&self.r#checkStringArray2)?;
+      subparcel.write(&self.r#int32_min)?;
+      subparcel.write(&self.r#int32_max)?;
+      subparcel.write(&self.r#int64_max)?;
+      subparcel.write(&self.r#hexInt32_neg_1)?;
+      subparcel.write(&self.r#ibinder)?;
+      subparcel.write(&self.r#empty)?;
+      subparcel.write(&self.r#int8_1)?;
+      subparcel.write(&self.r#int32_1)?;
+      subparcel.write(&self.r#int64_1)?;
+      subparcel.write(&self.r#hexInt32_pos_1)?;
+      subparcel.write(&self.r#hexInt64_pos_1)?;
+      subparcel.write(&self.r#const_exprs_1)?;
+      subparcel.write(&self.r#const_exprs_2)?;
+      subparcel.write(&self.r#const_exprs_3)?;
+      subparcel.write(&self.r#const_exprs_4)?;
+      subparcel.write(&self.r#const_exprs_5)?;
+      subparcel.write(&self.r#const_exprs_6)?;
+      subparcel.write(&self.r#const_exprs_7)?;
+      subparcel.write(&self.r#const_exprs_8)?;
+      subparcel.write(&self.r#const_exprs_9)?;
+      subparcel.write(&self.r#const_exprs_10)?;
+      subparcel.write(&self.r#addString1)?;
+      subparcel.write(&self.r#addString2)?;
+      subparcel.write(&self.r#shouldSetBit0AndBit2)?;
+      subparcel.write(&self.r#u)?;
+      subparcel.write(&self.r#shouldBeConstS1)?;
+      subparcel.write(&self.r#defaultWithFoo)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#shouldContainThreeFs = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#f = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldBeJerry = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldBeByteBar = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldBeIntBar = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldBeLongBar = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldContainTwoByteFoos = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldContainTwoIntFoos = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldContainTwoLongFoos = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#stringDefaultsToFoo = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteDefaultsToFour = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intDefaultsToFive = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longDefaultsToNegativeSeven = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#booleanDefaultsToTrue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#charDefaultsToC = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#floatDefaultsToPi = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#doubleWithDefault = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#arrayDefaultsTo123 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#arrayDefaultsToEmpty = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#boolDefault = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteDefault = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intDefault = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longDefault = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#floatDefault = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#doubleDefault = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#checkDoubleFromFloat = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#checkStringArray1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#checkStringArray2 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#int32_min = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#int32_max = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#int64_max = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#hexInt32_neg_1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#ibinder = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#empty = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#int8_1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#int32_1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#int64_1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#hexInt32_pos_1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#hexInt64_pos_1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_2 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_3 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_4 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_5 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_6 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_7 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_8 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_9 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_10 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#addString1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#addString2 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldSetBit0AndBit2 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#u = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldBeConstS1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#defaultWithFoo = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#StructuredParcelable);
+binder::impl_deserialize_for_parcelable!(r#StructuredParcelable);
+impl binder::binder_impl::ParcelableMetadata for r#StructuredParcelable {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.StructuredParcelable" }
+}
+pub mod r#Empty {
+  #[derive(Debug, Clone, PartialEq)]
+  pub struct r#Empty {
+  }
+  impl Default for r#Empty {
+    fn default() -> Self {
+      Self {
+      }
+    }
+  }
+  impl binder::Parcelable for r#Empty {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#Empty);
+  binder::impl_deserialize_for_parcelable!(r#Empty);
+  impl binder::binder_impl::ParcelableMetadata for r#Empty {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.StructuredParcelable.Empty" }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#StructuredParcelable as _7_android_4_aidl_5_tests_20_StructuredParcelable;
+ pub use super::r#Empty::r#Empty as _7_android_4_aidl_5_tests_20_StructuredParcelable_5_Empty;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/StructuredParcelable.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/StructuredParcelable.rs.d
new file mode 100644
index 0000000..7b17725
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/StructuredParcelable.rs.d
@@ -0,0 +1,7 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/StructuredParcelable.rs : \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/Union.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/Union.rs
new file mode 100644
index 0000000..2ae8287
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/Union.rs
@@ -0,0 +1,123 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/Union.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug, Clone, PartialEq)]
+pub enum r#Union {
+  Ns(Vec<i32>),
+  N(i32),
+  M(i32),
+  S(String),
+  Ibinder(Option<binder::SpIBinder>),
+  Ss(Vec<String>),
+  Be(crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum),
+}
+pub const r#S1: &str = "a string constant in union";
+impl Default for r#Union {
+  fn default() -> Self {
+    Self::Ns(vec![])
+  }
+}
+impl binder::Parcelable for r#Union {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    match self {
+      Self::Ns(v) => {
+        parcel.write(&0i32)?;
+        parcel.write(v)
+      }
+      Self::N(v) => {
+        parcel.write(&1i32)?;
+        parcel.write(v)
+      }
+      Self::M(v) => {
+        parcel.write(&2i32)?;
+        parcel.write(v)
+      }
+      Self::S(v) => {
+        parcel.write(&3i32)?;
+        parcel.write(v)
+      }
+      Self::Ibinder(v) => {
+        parcel.write(&4i32)?;
+        parcel.write(v)
+      }
+      Self::Ss(v) => {
+        parcel.write(&5i32)?;
+        parcel.write(v)
+      }
+      Self::Be(v) => {
+        parcel.write(&6i32)?;
+        parcel.write(v)
+      }
+    }
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    let tag: i32 = parcel.read()?;
+    match tag {
+      0 => {
+        let value: Vec<i32> = parcel.read()?;
+        *self = Self::Ns(value);
+        Ok(())
+      }
+      1 => {
+        let value: i32 = parcel.read()?;
+        *self = Self::N(value);
+        Ok(())
+      }
+      2 => {
+        let value: i32 = parcel.read()?;
+        *self = Self::M(value);
+        Ok(())
+      }
+      3 => {
+        let value: String = parcel.read()?;
+        *self = Self::S(value);
+        Ok(())
+      }
+      4 => {
+        let value: Option<binder::SpIBinder> = parcel.read()?;
+        *self = Self::Ibinder(value);
+        Ok(())
+      }
+      5 => {
+        let value: Vec<String> = parcel.read()?;
+        *self = Self::Ss(value);
+        Ok(())
+      }
+      6 => {
+        let value: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum = parcel.read()?;
+        *self = Self::Be(value);
+        Ok(())
+      }
+      _ => {
+        Err(binder::StatusCode::BAD_VALUE)
+      }
+    }
+  }
+}
+binder::impl_serialize_for_parcelable!(r#Union);
+binder::impl_deserialize_for_parcelable!(r#Union);
+impl binder::binder_impl::ParcelableMetadata for r#Union {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.Union" }
+}
+pub mod r#Tag {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#Tag : [i32; 7] {
+      r#ns = 0,
+      r#n = 1,
+      r#m = 2,
+      r#s = 3,
+      r#ibinder = 4,
+      r#ss = 5,
+      r#be = 6,
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#Union as _7_android_4_aidl_5_tests_5_Union;
+ pub use super::r#Tag::r#Tag as _7_android_4_aidl_5_tests_5_Union_3_Tag;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/Union.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/Union.rs.d
new file mode 100644
index 0000000..1519482
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/Union.rs.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/Union.rs : \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/UnionWithFd.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/UnionWithFd.rs
new file mode 100644
index 0000000..1104da6
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/UnionWithFd.rs
@@ -0,0 +1,68 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/UnionWithFd.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub enum r#UnionWithFd {
+  Num(i32),
+  Pfd(Option<binder::ParcelFileDescriptor>),
+}
+impl Default for r#UnionWithFd {
+  fn default() -> Self {
+    Self::Num(0)
+  }
+}
+impl binder::Parcelable for r#UnionWithFd {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    match self {
+      Self::Num(v) => {
+        parcel.write(&0i32)?;
+        parcel.write(v)
+      }
+      Self::Pfd(v) => {
+        parcel.write(&1i32)?;
+        let __field_ref = v.as_ref().ok_or(binder::StatusCode::UNEXPECTED_NULL)?;
+        parcel.write(__field_ref)
+      }
+    }
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    let tag: i32 = parcel.read()?;
+    match tag {
+      0 => {
+        let value: i32 = parcel.read()?;
+        *self = Self::Num(value);
+        Ok(())
+      }
+      1 => {
+        let value: Option<binder::ParcelFileDescriptor> = Some(parcel.read()?);
+        *self = Self::Pfd(value);
+        Ok(())
+      }
+      _ => {
+        Err(binder::StatusCode::BAD_VALUE)
+      }
+    }
+  }
+}
+binder::impl_serialize_for_parcelable!(r#UnionWithFd);
+binder::impl_deserialize_for_parcelable!(r#UnionWithFd);
+impl binder::binder_impl::ParcelableMetadata for r#UnionWithFd {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.UnionWithFd" }
+}
+pub mod r#Tag {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#Tag : [i32; 2] {
+      r#num = 0,
+      r#pfd = 1,
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#UnionWithFd as _7_android_4_aidl_5_tests_11_UnionWithFd;
+ pub use super::r#Tag::r#Tag as _7_android_4_aidl_5_tests_11_UnionWithFd_3_Tag;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/UnionWithFd.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/UnionWithFd.rs.d
new file mode 100644
index 0000000..f8e20d7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/UnionWithFd.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/UnionWithFd.rs : \
+  system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/ExtendableParcelable.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/ExtendableParcelable.rs
new file mode 100644
index 0000000..44c7002
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/ExtendableParcelable.rs
@@ -0,0 +1,65 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/ExtendableParcelable.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#ExtendableParcelable {
+  pub r#a: i32,
+  pub r#b: String,
+  pub r#ext: binder::ParcelableHolder,
+  pub r#c: i64,
+  pub r#ext2: binder::ParcelableHolder,
+}
+impl Default for r#ExtendableParcelable {
+  fn default() -> Self {
+    Self {
+      r#a: 0,
+      r#b: Default::default(),
+      r#ext: binder::ParcelableHolder::new(binder::binder_impl::Stability::Local),
+      r#c: 0,
+      r#ext2: binder::ParcelableHolder::new(binder::binder_impl::Stability::Local),
+    }
+  }
+}
+impl binder::Parcelable for r#ExtendableParcelable {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#a)?;
+      subparcel.write(&self.r#b)?;
+      subparcel.write(&self.r#ext)?;
+      subparcel.write(&self.r#c)?;
+      subparcel.write(&self.r#ext2)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#a = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#b = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#ext = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#c = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#ext2 = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#ExtendableParcelable);
+binder::impl_deserialize_for_parcelable!(r#ExtendableParcelable);
+impl binder::binder_impl::ParcelableMetadata for r#ExtendableParcelable {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.extension.ExtendableParcelable" }
+}
+pub(crate) mod mangled {
+ pub use super::r#ExtendableParcelable as _7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/ExtendableParcelable.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/ExtendableParcelable.rs.d
new file mode 100644
index 0000000..8c891a1
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/ExtendableParcelable.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/ExtendableParcelable.rs : \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt.rs
new file mode 100644
index 0000000..81dd0e2
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt.rs
@@ -0,0 +1,47 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#MyExt {
+  pub r#a: i32,
+  pub r#b: String,
+}
+impl Default for r#MyExt {
+  fn default() -> Self {
+    Self {
+      r#a: 0,
+      r#b: Default::default(),
+    }
+  }
+}
+impl binder::Parcelable for r#MyExt {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#a)?;
+      subparcel.write(&self.r#b)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#a = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#b = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#MyExt);
+binder::impl_deserialize_for_parcelable!(r#MyExt);
+impl binder::binder_impl::ParcelableMetadata for r#MyExt {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.extension.MyExt" }
+}
+pub(crate) mod mangled {
+ pub use super::r#MyExt as _7_android_4_aidl_5_tests_9_extension_5_MyExt;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt.rs.d
new file mode 100644
index 0000000..6f83175
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt.rs : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt2.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt2.rs
new file mode 100644
index 0000000..7e872f4
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt2.rs
@@ -0,0 +1,53 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt2.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#MyExt2 {
+  pub r#a: i32,
+  pub r#b: crate::mangled::_7_android_4_aidl_5_tests_9_extension_5_MyExt,
+  pub r#c: String,
+}
+impl Default for r#MyExt2 {
+  fn default() -> Self {
+    Self {
+      r#a: 0,
+      r#b: Default::default(),
+      r#c: Default::default(),
+    }
+  }
+}
+impl binder::Parcelable for r#MyExt2 {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#a)?;
+      subparcel.write(&self.r#b)?;
+      subparcel.write(&self.r#c)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#a = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#b = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#c = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#MyExt2);
+binder::impl_deserialize_for_parcelable!(r#MyExt2);
+impl binder::binder_impl::ParcelableMetadata for r#MyExt2 {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.extension.MyExt2" }
+}
+pub(crate) mod mangled {
+ pub use super::r#MyExt2 as _7_android_4_aidl_5_tests_9_extension_6_MyExt2;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt2.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt2.rs.d
new file mode 100644
index 0000000..7e58f61
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt2.rs.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt2.rs : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExtLike.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExtLike.rs
new file mode 100644
index 0000000..776470c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExtLike.rs
@@ -0,0 +1,47 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExtLike.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#MyExtLike {
+  pub r#a: i32,
+  pub r#b: String,
+}
+impl Default for r#MyExtLike {
+  fn default() -> Self {
+    Self {
+      r#a: 0,
+      r#b: Default::default(),
+    }
+  }
+}
+impl binder::Parcelable for r#MyExtLike {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#a)?;
+      subparcel.write(&self.r#b)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#a = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#b = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#MyExtLike);
+binder::impl_deserialize_for_parcelable!(r#MyExtLike);
+impl binder::binder_impl::ParcelableMetadata for r#MyExtLike {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.extension.MyExtLike" }
+}
+pub(crate) mod mangled {
+ pub use super::r#MyExtLike as _7_android_4_aidl_5_tests_9_extension_9_MyExtLike;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExtLike.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExtLike.rs.d
new file mode 100644
index 0000000..4e904d6
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExtLike.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExtLike.rs : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/DeeplyNested.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/DeeplyNested.rs
new file mode 100644
index 0000000..7b6b5f3
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/DeeplyNested.rs
@@ -0,0 +1,167 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/DeeplyNested.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#DeeplyNested {
+}
+impl Default for r#DeeplyNested {
+  fn default() -> Self {
+    Self {
+    }
+  }
+}
+impl binder::Parcelable for r#DeeplyNested {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#DeeplyNested);
+binder::impl_deserialize_for_parcelable!(r#DeeplyNested);
+impl binder::binder_impl::ParcelableMetadata for r#DeeplyNested {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.nested.DeeplyNested" }
+}
+pub mod r#A {
+  #[derive(Debug)]
+  pub struct r#A {
+    pub r#e: crate::mangled::_7_android_4_aidl_5_tests_6_nested_12_DeeplyNested_1_B_1_C_1_D_1_E,
+  }
+  impl Default for r#A {
+    fn default() -> Self {
+      Self {
+        r#e: crate::mangled::_7_android_4_aidl_5_tests_6_nested_12_DeeplyNested_1_B_1_C_1_D_1_E::OK,
+      }
+    }
+  }
+  impl binder::Parcelable for r#A {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        subparcel.write(&self.r#e)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#e = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#A);
+  binder::impl_deserialize_for_parcelable!(r#A);
+  impl binder::binder_impl::ParcelableMetadata for r#A {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.nested.DeeplyNested.A" }
+  }
+}
+pub mod r#B {
+  #[derive(Debug)]
+  pub struct r#B {
+  }
+  impl Default for r#B {
+    fn default() -> Self {
+      Self {
+      }
+    }
+  }
+  impl binder::Parcelable for r#B {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#B);
+  binder::impl_deserialize_for_parcelable!(r#B);
+  impl binder::binder_impl::ParcelableMetadata for r#B {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.nested.DeeplyNested.B" }
+  }
+  pub mod r#C {
+    #[derive(Debug)]
+    pub struct r#C {
+    }
+    impl Default for r#C {
+      fn default() -> Self {
+        Self {
+        }
+      }
+    }
+    impl binder::Parcelable for r#C {
+      fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+        parcel.sized_write(|subparcel| {
+          Ok(())
+        })
+      }
+      fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+        parcel.sized_read(|subparcel| {
+          Ok(())
+        })
+      }
+    }
+    binder::impl_serialize_for_parcelable!(r#C);
+    binder::impl_deserialize_for_parcelable!(r#C);
+    impl binder::binder_impl::ParcelableMetadata for r#C {
+      fn get_descriptor() -> &'static str { "android.aidl.tests.nested.DeeplyNested.B.C" }
+    }
+    pub mod r#D {
+      #[derive(Debug)]
+      pub struct r#D {
+      }
+      impl Default for r#D {
+        fn default() -> Self {
+          Self {
+          }
+        }
+      }
+      impl binder::Parcelable for r#D {
+        fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+          parcel.sized_write(|subparcel| {
+            Ok(())
+          })
+        }
+        fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+          parcel.sized_read(|subparcel| {
+            Ok(())
+          })
+        }
+      }
+      binder::impl_serialize_for_parcelable!(r#D);
+      binder::impl_deserialize_for_parcelable!(r#D);
+      impl binder::binder_impl::ParcelableMetadata for r#D {
+        fn get_descriptor() -> &'static str { "android.aidl.tests.nested.DeeplyNested.B.C.D" }
+      }
+      pub mod r#E {
+        #![allow(non_upper_case_globals)]
+        use binder::declare_binder_enum;
+        declare_binder_enum! {
+          r#E : [i8; 1] {
+            r#OK = 0,
+          }
+        }
+      }
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#DeeplyNested as _7_android_4_aidl_5_tests_6_nested_12_DeeplyNested;
+ pub use super::r#A::r#A as _7_android_4_aidl_5_tests_6_nested_12_DeeplyNested_1_A;
+ pub use super::r#B::r#B as _7_android_4_aidl_5_tests_6_nested_12_DeeplyNested_1_B;
+ pub use super::r#B::r#C::r#C as _7_android_4_aidl_5_tests_6_nested_12_DeeplyNested_1_B_1_C;
+ pub use super::r#B::r#C::r#D::r#D as _7_android_4_aidl_5_tests_6_nested_12_DeeplyNested_1_B_1_C_1_D;
+ pub use super::r#B::r#C::r#D::r#E::r#E as _7_android_4_aidl_5_tests_6_nested_12_DeeplyNested_1_B_1_C_1_D_1_E;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/DeeplyNested.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/DeeplyNested.rs.d
new file mode 100644
index 0000000..cfee6a4
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/DeeplyNested.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/DeeplyNested.rs : \
+  system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs
new file mode 100644
index 0000000..c91df68
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs
@@ -0,0 +1,369 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  INestedService["android.aidl.tests.nested.INestedService"] {
+    native: BnNestedService(on_transact),
+    proxy: BpNestedService {
+    },
+    async: INestedServiceAsync,
+  }
+}
+pub trait INestedService: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.nested.INestedService" }
+  fn r#flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result>;
+  fn r#flipStatusWithCallback(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::Result<()>;
+  fn getDefaultImpl() -> INestedServiceDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: INestedServiceDefaultRef) -> INestedServiceDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait INestedServiceAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.nested.INestedService" }
+  fn r#flipStatus<'a>(&'a self, _arg_p: &'a crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result>>;
+  fn r#flipStatusWithCallback<'a>(&'a self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::BoxFuture<'a, binder::Result<()>>;
+}
+#[::async_trait::async_trait]
+pub trait INestedServiceAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.nested.INestedService" }
+  async fn r#flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result>;
+  async fn r#flipStatusWithCallback(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::Result<()>;
+}
+impl BnNestedService {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn INestedService>
+  where
+    T: INestedServiceAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> INestedService for Wrapper<T, R>
+    where
+      T: INestedServiceAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result> {
+        self._rt.block_on(self._inner.r#flipStatus(_arg_p))
+      }
+      fn r#flipStatusWithCallback(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#flipStatusWithCallback(_arg_status, _arg_cb))
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait INestedServiceDefault: Send + Sync {
+  fn r#flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#flipStatusWithCallback(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#flipStatus: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  pub const r#flipStatusWithCallback: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+}
+pub type INestedServiceDefaultRef = Option<std::sync::Arc<dyn INestedServiceDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<INestedServiceDefaultRef> = std::sync::Mutex::new(None);
+}
+impl BpNestedService {
+  fn build_parcel_flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_p)?;
+    Ok(aidl_data)
+  }
+  fn read_response_flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as INestedService>::getDefaultImpl() {
+        return _aidl_default_impl.r#flipStatus(_arg_p);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_flipStatusWithCallback(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(&_arg_status)?;
+    aidl_data.write(_arg_cb)?;
+    Ok(aidl_data)
+  }
+  fn read_response_flipStatusWithCallback(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as INestedService>::getDefaultImpl() {
+        return _aidl_default_impl.r#flipStatusWithCallback(_arg_status, _arg_cb);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+}
+impl INestedService for BpNestedService {
+  fn r#flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result> {
+    let _aidl_data = self.build_parcel_flipStatus(_arg_p)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#flipStatus, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_flipStatus(_arg_p, _aidl_reply)
+  }
+  fn r#flipStatusWithCallback(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_flipStatusWithCallback(_arg_status, _arg_cb)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#flipStatusWithCallback, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_flipStatusWithCallback(_arg_status, _arg_cb, _aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> INestedServiceAsync<P> for BpNestedService {
+  fn r#flipStatus<'a>(&'a self, _arg_p: &'a crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result>> {
+    let _aidl_data = match self.build_parcel_flipStatus(_arg_p) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#flipStatus, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_flipStatus(_arg_p, _aidl_reply)
+      }
+    )
+  }
+  fn r#flipStatusWithCallback<'a>(&'a self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_flipStatusWithCallback(_arg_status, _arg_cb) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#flipStatusWithCallback, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_flipStatusWithCallback(_arg_status, _arg_cb, _aidl_reply)
+      }
+    )
+  }
+}
+impl INestedService for binder::binder_impl::Binder<BnNestedService> {
+  fn r#flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result> { self.0.r#flipStatus(_arg_p) }
+  fn r#flipStatusWithCallback(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::Result<()> { self.0.r#flipStatusWithCallback(_arg_status, _arg_cb) }
+}
+fn on_transact(_aidl_service: &dyn INestedService, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#flipStatus => {
+      let _arg_p: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#flipStatus(&_arg_p);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#flipStatusWithCallback => {
+      let _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status = _aidl_data.read()?;
+      let _arg_cb: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#flipStatusWithCallback(_arg_status, &_arg_cb);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub mod r#Result {
+  #[derive(Debug, PartialEq)]
+  pub struct r#Result {
+    pub r#status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status,
+  }
+  impl Default for r#Result {
+    fn default() -> Self {
+      Self {
+        r#status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status::OK,
+      }
+    }
+  }
+  impl binder::Parcelable for r#Result {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        subparcel.write(&self.r#status)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#status = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#Result);
+  binder::impl_deserialize_for_parcelable!(r#Result);
+  impl binder::binder_impl::ParcelableMetadata for r#Result {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.nested.INestedService.Result" }
+  }
+}
+pub mod r#ICallback {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    ICallback["android.aidl.tests.nested.INestedService.ICallback"] {
+      native: BnCallback(on_transact),
+      proxy: BpCallback {
+      },
+      async: ICallbackAsync,
+    }
+  }
+  pub trait ICallback: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.nested.INestedService.ICallback" }
+    fn r#done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::Result<()>;
+    fn getDefaultImpl() -> ICallbackDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: ICallbackDefaultRef) -> ICallbackDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait ICallbackAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.nested.INestedService.ICallback" }
+    fn r#done<'a>(&'a self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::BoxFuture<'a, binder::Result<()>>;
+  }
+  #[::async_trait::async_trait]
+  pub trait ICallbackAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.nested.INestedService.ICallback" }
+    async fn r#done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::Result<()>;
+  }
+  impl BnCallback {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn ICallback>
+    where
+      T: ICallbackAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> ICallback for Wrapper<T, R>
+      where
+        T: ICallbackAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+        fn r#done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::Result<()> {
+          self._rt.block_on(self._inner.r#done(_arg_status))
+        }
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait ICallbackDefault: Send + Sync {
+    fn r#done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::Result<()> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+  }
+  pub mod transactions {
+    pub const r#done: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  }
+  pub type ICallbackDefaultRef = Option<std::sync::Arc<dyn ICallbackDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<ICallbackDefaultRef> = std::sync::Mutex::new(None);
+  }
+  impl BpCallback {
+    fn build_parcel_done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(&_arg_status)?;
+      Ok(aidl_data)
+    }
+    fn read_response_done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as ICallback>::getDefaultImpl() {
+          return _aidl_default_impl.r#done(_arg_status);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      Ok(())
+    }
+  }
+  impl ICallback for BpCallback {
+    fn r#done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::Result<()> {
+      let _aidl_data = self.build_parcel_done(_arg_status)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#done, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_done(_arg_status, _aidl_reply)
+    }
+  }
+  impl<P: binder::BinderAsyncPool> ICallbackAsync<P> for BpCallback {
+    fn r#done<'a>(&'a self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::BoxFuture<'a, binder::Result<()>> {
+      let _aidl_data = match self.build_parcel_done(_arg_status) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#done, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_done(_arg_status, _aidl_reply)
+        }
+      )
+    }
+  }
+  impl ICallback for binder::binder_impl::Binder<BnCallback> {
+    fn r#done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::Result<()> { self.0.r#done(_arg_status) }
+  }
+  fn on_transact(_aidl_service: &dyn ICallback, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      transactions::r#done => {
+        let _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#done(_arg_status);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#INestedService as _7_android_4_aidl_5_tests_6_nested_14_INestedService;
+ pub use super::r#Result::r#Result as _7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result;
+ pub use super::r#ICallback::r#ICallback as _7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs.d
new file mode 100644
index 0000000..d2839d2
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs : \
+  system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/ParcelableWithNested.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/ParcelableWithNested.rs
new file mode 100644
index 0000000..e193fb2
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/ParcelableWithNested.rs
@@ -0,0 +1,52 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/ParcelableWithNested.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#ParcelableWithNested {
+  pub r#status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status,
+}
+impl Default for r#ParcelableWithNested {
+  fn default() -> Self {
+    Self {
+      r#status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status::OK,
+    }
+  }
+}
+impl binder::Parcelable for r#ParcelableWithNested {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#status)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#status = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#ParcelableWithNested);
+binder::impl_deserialize_for_parcelable!(r#ParcelableWithNested);
+impl binder::binder_impl::ParcelableMetadata for r#ParcelableWithNested {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.nested.ParcelableWithNested" }
+}
+pub mod r#Status {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#Status : [i8; 2] {
+      r#OK = 0,
+      r#NOT_OK = 1,
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ParcelableWithNested as _7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested;
+ pub use super::r#Status::r#Status as _7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/ParcelableWithNested.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/ParcelableWithNested.rs.d
new file mode 100644
index 0000000..d91414e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/ParcelableWithNested.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/ParcelableWithNested.rs : \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/EnumUnion.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/EnumUnion.rs
new file mode 100644
index 0000000..db652f9
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/EnumUnion.rs
@@ -0,0 +1,80 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/EnumUnion.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug, Clone, PartialEq)]
+pub enum r#EnumUnion {
+  IntEnum(crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum),
+  LongEnum(crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum),
+  #[deprecated = "do not use this"]
+  DeprecatedField(i32),
+}
+impl Default for r#EnumUnion {
+  fn default() -> Self {
+    Self::IntEnum(crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum::FOO)
+  }
+}
+impl binder::Parcelable for r#EnumUnion {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    match self {
+      Self::IntEnum(v) => {
+        parcel.write(&0i32)?;
+        parcel.write(v)
+      }
+      Self::LongEnum(v) => {
+        parcel.write(&1i32)?;
+        parcel.write(v)
+      }
+      Self::DeprecatedField(v) => {
+        parcel.write(&2i32)?;
+        parcel.write(v)
+      }
+    }
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    let tag: i32 = parcel.read()?;
+    match tag {
+      0 => {
+        let value: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum = parcel.read()?;
+        *self = Self::IntEnum(value);
+        Ok(())
+      }
+      1 => {
+        let value: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum = parcel.read()?;
+        *self = Self::LongEnum(value);
+        Ok(())
+      }
+      2 => {
+        let value: i32 = parcel.read()?;
+        *self = Self::DeprecatedField(value);
+        Ok(())
+      }
+      _ => {
+        Err(binder::StatusCode::BAD_VALUE)
+      }
+    }
+  }
+}
+binder::impl_serialize_for_parcelable!(r#EnumUnion);
+binder::impl_deserialize_for_parcelable!(r#EnumUnion);
+impl binder::binder_impl::ParcelableMetadata for r#EnumUnion {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.unions.EnumUnion" }
+}
+pub mod r#Tag {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#Tag : [i32; 3] {
+      r#intEnum = 0,
+      r#longEnum = 1,
+      #[deprecated = "do not use this"]
+      r#deprecatedField = 2,
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#EnumUnion as _7_android_4_aidl_5_tests_6_unions_9_EnumUnion;
+ pub use super::r#Tag::r#Tag as _7_android_4_aidl_5_tests_6_unions_9_EnumUnion_3_Tag;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/EnumUnion.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/EnumUnion.rs.d
new file mode 100644
index 0000000..40e3a24
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/EnumUnion.rs.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/EnumUnion.rs : \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/UnionInUnion.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/UnionInUnion.rs
new file mode 100644
index 0000000..ac2a6e9
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/UnionInUnion.rs
@@ -0,0 +1,67 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/UnionInUnion.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug, Clone, PartialEq)]
+pub enum r#UnionInUnion {
+  First(crate::mangled::_7_android_4_aidl_5_tests_6_unions_9_EnumUnion),
+  Second(i32),
+}
+impl Default for r#UnionInUnion {
+  fn default() -> Self {
+    Self::First(Default::default())
+  }
+}
+impl binder::Parcelable for r#UnionInUnion {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    match self {
+      Self::First(v) => {
+        parcel.write(&0i32)?;
+        parcel.write(v)
+      }
+      Self::Second(v) => {
+        parcel.write(&1i32)?;
+        parcel.write(v)
+      }
+    }
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    let tag: i32 = parcel.read()?;
+    match tag {
+      0 => {
+        let value: crate::mangled::_7_android_4_aidl_5_tests_6_unions_9_EnumUnion = parcel.read()?;
+        *self = Self::First(value);
+        Ok(())
+      }
+      1 => {
+        let value: i32 = parcel.read()?;
+        *self = Self::Second(value);
+        Ok(())
+      }
+      _ => {
+        Err(binder::StatusCode::BAD_VALUE)
+      }
+    }
+  }
+}
+binder::impl_serialize_for_parcelable!(r#UnionInUnion);
+binder::impl_deserialize_for_parcelable!(r#UnionInUnion);
+impl binder::binder_impl::ParcelableMetadata for r#UnionInUnion {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.unions.UnionInUnion" }
+}
+pub mod r#Tag {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#Tag : [i32; 2] {
+      r#first = 0,
+      r#second = 1,
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#UnionInUnion as _7_android_4_aidl_5_tests_6_unions_12_UnionInUnion;
+ pub use super::r#Tag::r#Tag as _7_android_4_aidl_5_tests_6_unions_12_UnionInUnion_3_Tag;
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/UnionInUnion.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/UnionInUnion.rs.d
new file mode 100644
index 0000000..2376cf5
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/UnionInUnion.rs.d
@@ -0,0 +1,5 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/UnionInUnion.rs : \
+  system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/timestamp b/tests/golden_output/aidl-test-interface-rust-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp
new file mode 100644
index 0000000..47e5a86
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp
@@ -0,0 +1,40 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#include <android/aidl/versioned/tests/BazUnion.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+::android::status_t BazUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case intNum: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<intNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intNum>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t BazUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case intNum: return _aidl_parcel->writeInt32(get<intNum>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
new file mode 100644
index 0000000..616884b
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp
new file mode 100644
index 0000000..16a42bd
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp
@@ -0,0 +1,38 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#include <android/aidl/versioned/tests/Foo.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+::android::status_t Foo::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t Foo::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d
new file mode 100644
index 0000000..637f847
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
new file mode 100644
index 0000000..ef89093
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
@@ -0,0 +1,411 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#include <android/aidl/versioned/tests/IFooInterface.h>
+#include <android/aidl/versioned/tests/BpFooInterface.h>
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(FooInterface, "android.aidl.versioned.tests.IFooInterface")
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/versioned/tests/BpFooInterface.h>
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+
+BpFooInterface::BpFooInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IFooInterface>(_aidl_impl){
+}
+
+::android::binder::Status BpFooInterface::originalApi() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::originalApi::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_originalApi, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->originalApi();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::acceptUnionAndReturnString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(u);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_acceptUnionAndReturnString, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->acceptUnionAndReturnString(u, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8FromUtf16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::ignoreParcelablesAndRepeatInt::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(inFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(*inoutFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(value);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_ignoreParcelablesAndRepeatInt, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->ignoreParcelablesAndRepeatInt(inFoo, inoutFoo, outFoo, value, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(inoutFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(outFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::returnsLengthOfFooArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelableVector(foos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_returnsLengthOfFooArray, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->returnsLengthOfFooArray(foos, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+int32_t BpFooInterface::getInterfaceVersion() {
+  if (cached_version_ == -1) {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnFooInterface::TRANSACTION_getInterfaceVersion, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        cached_version_ = reply.readInt32();
+      }
+    }
+  }
+  return cached_version_;
+}
+
+
+std::string BpFooInterface::getInterfaceHash() {
+  std::lock_guard<std::mutex> lockGuard(cached_hash_mutex_);
+  if (cached_hash_ == "-1") {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnFooInterface::TRANSACTION_getInterfaceHash, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        reply.readUtf8FromUtf16(&cached_hash_);
+      }
+    }
+  }
+  return cached_hash_;
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+
+BnFooInterface::BnFooInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnFooInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnFooInterface::TRANSACTION_originalApi:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::originalApi::cppServer");
+    ::android::binder::Status _aidl_status(originalApi());
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_acceptUnionAndReturnString:
+  {
+    ::android::aidl::versioned::tests::BazUnion in_u;
+    ::std::string _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::acceptUnionAndReturnString::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_u);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(acceptUnionAndReturnString(in_u, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8AsUtf16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_ignoreParcelablesAndRepeatInt:
+  {
+    ::android::aidl::versioned::tests::Foo in_inFoo;
+    ::android::aidl::versioned::tests::Foo in_inoutFoo;
+    ::android::aidl::versioned::tests::Foo out_outFoo;
+    int32_t in_value;
+    int32_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::ignoreParcelablesAndRepeatInt::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_inFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readParcelable(&in_inoutFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readInt32(&in_value);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ignoreParcelablesAndRepeatInt(in_inFoo, &in_inoutFoo, &out_outFoo, in_value, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(in_inoutFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(out_outFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_returnsLengthOfFooArray:
+  {
+    ::std::vector<::android::aidl::versioned::tests::Foo> in_foos;
+    int32_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::returnsLengthOfFooArray::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelableVector(&in_foos);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(returnsLengthOfFooArray(in_foos, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_getInterfaceVersion:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeInt32(IFooInterface::VERSION);
+  }
+  break;
+  case BnFooInterface::TRANSACTION_getInterfaceHash:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeUtf8AsUtf16(IFooInterface::HASH);
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+int32_t BnFooInterface::getInterfaceVersion() {
+  return IFooInterface::VERSION;
+}
+std::string BnFooInterface::getInterfaceHash() {
+  return IFooInterface::HASH;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
new file mode 100644
index 0000000..9bee1b6
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h
new file mode 100644
index 0000000..941ecac
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h
@@ -0,0 +1,148 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BazUnion : public ::android::Parcelable {
+public:
+  enum class Tag : int32_t {
+    intNum = 0,
+  };
+  // Expose tag symbols for legacy code
+  static const inline Tag intNum = Tag::intNum;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, BazUnion>;
+
+  BazUnion() : _value(std::in_place_index<static_cast<size_t>(intNum)>, int32_t(0)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr BazUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit BazUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static BazUnion make(_Tp&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static BazUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  inline bool operator!=(const BazUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const BazUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const BazUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const BazUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const BazUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const BazUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.versioned.tests.BazUnion");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "BazUnion{";
+    switch (getTag()) {
+    case intNum: os << "intNum: " << ::android::internal::ToString(get<intNum>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t> _value;
+};  // class BazUnion
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+[[nodiscard]] static inline std::string toString(BazUnion::Tag val) {
+  switch(val) {
+  case BazUnion::Tag::intNum:
+    return "intNum";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::versioned::tests::BazUnion::Tag, 1> enum_values<::android::aidl::versioned::tests::BazUnion::Tag> = {
+  ::android::aidl::versioned::tests::BazUnion::Tag::intNum,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h
new file mode 100644
index 0000000..cae14cc
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h
new file mode 100644
index 0000000..d3dd4b5
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h
new file mode 100644
index 0000000..22baaa9
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h
@@ -0,0 +1,62 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/versioned/tests/IFooInterface.h>
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BnFooInterface : public ::android::BnInterface<IFooInterface> {
+public:
+  static constexpr uint32_t TRANSACTION_originalApi = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_acceptUnionAndReturnString = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_ignoreParcelablesAndRepeatInt = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_returnsLengthOfFooArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_getInterfaceVersion = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777214;
+  static constexpr uint32_t TRANSACTION_getInterfaceHash = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777213;
+  explicit BnFooInterface();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  int32_t getInterfaceVersion();
+  std::string getInterfaceHash();
+};  // class BnFooInterface
+
+class IFooInterfaceDelegator : public BnFooInterface {
+public:
+  explicit IFooInterfaceDelegator(const ::android::sp<IFooInterface> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<IFooInterface> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status originalApi() override {
+    return _aidl_delegate->originalApi();
+  }
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) override {
+    return _aidl_delegate->acceptUnionAndReturnString(u, _aidl_return);
+  }
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) override {
+    return _aidl_delegate->ignoreParcelablesAndRepeatInt(inFoo, inoutFoo, outFoo, value, _aidl_return);
+  }
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) override {
+    return _aidl_delegate->returnsLengthOfFooArray(foos, _aidl_return);
+  }
+  int32_t getInterfaceVersion() override {
+    int32_t _delegator_ver = BnFooInterface::getInterfaceVersion();
+    int32_t _impl_ver = _aidl_delegate->getInterfaceVersion();
+    return _delegator_ver < _impl_ver ? _delegator_ver : _impl_ver;
+  }
+  std::string getInterfaceHash() override {
+    return _aidl_delegate->getInterfaceHash();
+  }
+private:
+  ::android::sp<IFooInterface> _aidl_delegate;
+};  // class IFooInterfaceDelegator
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h
new file mode 100644
index 0000000..dd8bdb4
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h
new file mode 100644
index 0000000..d81b356
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h
new file mode 100644
index 0000000..e3f84ea
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h
@@ -0,0 +1,34 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/versioned/tests/IFooInterface.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BpFooInterface : public ::android::BpInterface<IFooInterface> {
+public:
+  explicit BpFooInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpFooInterface() = default;
+  ::android::binder::Status originalApi() override;
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) override;
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) override;
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) override;
+  int32_t getInterfaceVersion() override;
+  std::string getInterfaceHash() override;
+private:
+  int32_t cached_version_ = -1;
+  std::string cached_hash_ = "-1";
+  std::mutex cached_hash_mutex_;
+};  // class BpFooInterface
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h
new file mode 100644
index 0000000..8929dbb
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h
@@ -0,0 +1,54 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class Foo : public ::android::Parcelable {
+public:
+  inline bool operator!=(const Foo&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const Foo&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const Foo&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const Foo&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const Foo&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const Foo&) const {
+    return std::tie() >= std::tie();
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.versioned.tests.Foo");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Foo{";
+    os << "}";
+    return os.str();
+  }
+};  // class Foo
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h
new file mode 100644
index 0000000..e7eb4be
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h
@@ -0,0 +1,69 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <android/aidl/versioned/tests/BazUnion.h>
+#include <android/aidl/versioned/tests/Foo.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cstdint>
+#include <string>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <vector>
+
+namespace android::aidl::versioned::tests {
+class Foo;
+}  // namespace android::aidl::versioned::tests
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class IFooInterfaceDelegator;
+
+class IFooInterface : public ::android::IInterface {
+public:
+  typedef IFooInterfaceDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(FooInterface)
+  static inline const int32_t VERSION = 1;
+  static inline const std::string HASH = "9e7be1859820c59d9d55dd133e71a3687b5d2e5b";
+  virtual ::android::binder::Status originalApi() = 0;
+  virtual ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) = 0;
+  virtual ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) = 0;
+  virtual ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) = 0;
+  virtual int32_t getInterfaceVersion() = 0;
+  virtual std::string getInterfaceHash() = 0;
+};  // class IFooInterface
+
+class IFooInterfaceDefault : public IFooInterface {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status originalApi() override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& /*u*/, ::std::string* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& /*inFoo*/, ::android::aidl::versioned::tests::Foo* /*inoutFoo*/, ::android::aidl::versioned::tests::Foo* /*outFoo*/, int32_t /*value*/, int32_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& /*foos*/, int32_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  int32_t getInterfaceVersion() override {
+    return 0;
+  }
+  std::string getInterfaceHash() override {
+    return "";
+  }
+};  // class IFooInterfaceDefault
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/timestamp b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-cpp-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/BazUnion.java b/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/BazUnion.java
new file mode 100644
index 0000000..0428d1d
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/BazUnion.java
@@ -0,0 +1,109 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+package android.aidl.versioned.tests;
+public final class BazUnion implements android.os.Parcelable {
+  // tags for union fields
+  public final static int intNum = 0;  // int intNum;
+
+  private int _tag;
+  private Object _value;
+
+  public BazUnion() {
+    int _value = 0;
+    this._tag = intNum;
+    this._value = _value;
+  }
+
+  private BazUnion(android.os.Parcel _aidl_parcel) {
+    readFromParcel(_aidl_parcel);
+  }
+
+  private BazUnion(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+
+  public int getTag() {
+    return _tag;
+  }
+
+  // int intNum;
+
+  public static BazUnion intNum(int _value) {
+    return new BazUnion(intNum, _value);
+  }
+
+  public int getIntNum() {
+    _assertTag(intNum);
+    return (int) _value;
+  }
+
+  public void setIntNum(int _value) {
+    _set(intNum, _value);
+  }
+
+  public static final android.os.Parcelable.Creator<BazUnion> CREATOR = new android.os.Parcelable.Creator<BazUnion>() {
+    @Override
+    public BazUnion createFromParcel(android.os.Parcel _aidl_source) {
+      return new BazUnion(_aidl_source);
+    }
+    @Override
+    public BazUnion[] newArray(int _aidl_size) {
+      return new BazUnion[_aidl_size];
+    }
+  };
+
+  @Override
+  public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+    _aidl_parcel.writeInt(_tag);
+    switch (_tag) {
+    case intNum:
+      _aidl_parcel.writeInt(getIntNum());
+      break;
+    }
+  }
+
+  public void readFromParcel(android.os.Parcel _aidl_parcel) {
+    int _aidl_tag;
+    _aidl_tag = _aidl_parcel.readInt();
+    switch (_aidl_tag) {
+    case intNum: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    }
+    throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+  }
+
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    switch (getTag()) {
+    }
+    return _mask;
+  }
+
+  private void _assertTag(int tag) {
+    if (getTag() != tag) {
+      throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+    }
+  }
+
+  private String _tagString(int _tag) {
+    switch (_tag) {
+    case intNum: return "intNum";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+
+  private void _set(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+  public static @interface Tag {
+    public static final int intNum = 0;
+  }
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d b/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d
new file mode 100644
index 0000000..1c7895a
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/BazUnion.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/Foo.java b/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/Foo.java
new file mode 100644
index 0000000..aa95b5a
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/Foo.java
@@ -0,0 +1,47 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/Foo.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+package android.aidl.versioned.tests;
+public class Foo implements android.os.Parcelable
+{
+  public static final android.os.Parcelable.Creator<Foo> CREATOR = new android.os.Parcelable.Creator<Foo>() {
+    @Override
+    public Foo createFromParcel(android.os.Parcel _aidl_source) {
+      Foo _aidl_out = new Foo();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public Foo[] newArray(int _aidl_size) {
+      return new Foo[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/Foo.java.d b/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/Foo.java.d
new file mode 100644
index 0000000..23763bb
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/Foo.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/Foo.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/IFooInterface.java b/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/IFooInterface.java
new file mode 100644
index 0000000..94fbb81
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/IFooInterface.java
@@ -0,0 +1,301 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+package android.aidl.versioned.tests;
+public interface IFooInterface extends android.os.IInterface
+{
+  /**
+   * The version of this interface that the caller is built against.
+   * This might be different from what {@link #getInterfaceVersion()
+   * getInterfaceVersion} returns as that is the version of the interface
+   * that the remote object is implementing.
+   */
+  public static final int VERSION = 1;
+  public static final String HASH = "9e7be1859820c59d9d55dd133e71a3687b5d2e5b";
+  /** Default implementation for IFooInterface. */
+  public static class Default implements android.aidl.versioned.tests.IFooInterface
+  {
+    @Override public void originalApi() throws android.os.RemoteException
+    {
+    }
+    @Override public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override
+    public int getInterfaceVersion() {
+      return 0;
+    }
+    @Override
+    public String getInterfaceHash() {
+      return "";
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.versioned.tests.IFooInterface
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.versioned.tests.IFooInterface interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.versioned.tests.IFooInterface asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.versioned.tests.IFooInterface))) {
+        return ((android.aidl.versioned.tests.IFooInterface)iin);
+      }
+      return new android.aidl.versioned.tests.IFooInterface.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceVersion) {
+        reply.writeNoException();
+        reply.writeInt(getInterfaceVersion());
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceHash) {
+        reply.writeNoException();
+        reply.writeString(getInterfaceHash());
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_originalApi:
+        {
+          this.originalApi();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_acceptUnionAndReturnString:
+        {
+          android.aidl.versioned.tests.BazUnion _arg0;
+          _arg0 = data.readTypedObject(android.aidl.versioned.tests.BazUnion.CREATOR);
+          data.enforceNoDataAvail();
+          java.lang.String _result = this.acceptUnionAndReturnString(_arg0);
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        case TRANSACTION_ignoreParcelablesAndRepeatInt:
+        {
+          android.aidl.versioned.tests.Foo _arg0;
+          _arg0 = data.readTypedObject(android.aidl.versioned.tests.Foo.CREATOR);
+          android.aidl.versioned.tests.Foo _arg1;
+          _arg1 = data.readTypedObject(android.aidl.versioned.tests.Foo.CREATOR);
+          android.aidl.versioned.tests.Foo _arg2;
+          _arg2 = new android.aidl.versioned.tests.Foo();
+          int _arg3;
+          _arg3 = data.readInt();
+          data.enforceNoDataAvail();
+          int _result = this.ignoreParcelablesAndRepeatInt(_arg0, _arg1, _arg2, _arg3);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          reply.writeTypedObject(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          reply.writeTypedObject(_arg2, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_returnsLengthOfFooArray:
+        {
+          android.aidl.versioned.tests.Foo[] _arg0;
+          _arg0 = data.createTypedArray(android.aidl.versioned.tests.Foo.CREATOR);
+          data.enforceNoDataAvail();
+          int _result = this.returnsLengthOfFooArray(_arg0);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.versioned.tests.IFooInterface
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      private int mCachedVersion = -1;
+      private String mCachedHash = "-1";
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public void originalApi() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_originalApi, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method originalApi is unimplemented.");
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(u, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_acceptUnionAndReturnString, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method acceptUnionAndReturnString is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(inFoo, 0);
+          _data.writeTypedObject(inoutFoo, 0);
+          _data.writeInt(value);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ignoreParcelablesAndRepeatInt, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method ignoreParcelablesAndRepeatInt is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+          if ((0!=_reply.readInt())) {
+            inoutFoo.readFromParcel(_reply);
+          }
+          if ((0!=_reply.readInt())) {
+            outFoo.readFromParcel(_reply);
+          }
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedArray(foos, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_returnsLengthOfFooArray, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method returnsLengthOfFooArray is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override
+      public int getInterfaceVersion() throws android.os.RemoteException {
+        if (mCachedVersion == -1) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceVersion, data, reply, 0);
+            reply.readException();
+            mCachedVersion = reply.readInt();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedVersion;
+      }
+      @Override
+      public synchronized String getInterfaceHash() throws android.os.RemoteException {
+        if ("-1".equals(mCachedHash)) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceHash, data, reply, 0);
+            reply.readException();
+            mCachedHash = reply.readString();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedHash;
+      }
+    }
+    static final int TRANSACTION_originalApi = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    static final int TRANSACTION_acceptUnionAndReturnString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    static final int TRANSACTION_ignoreParcelablesAndRepeatInt = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+    static final int TRANSACTION_returnsLengthOfFooArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+    static final int TRANSACTION_getInterfaceVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777214);
+    static final int TRANSACTION_getInterfaceHash = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777213);
+  }
+  public static final java.lang.String DESCRIPTOR = "android$aidl$versioned$tests$IFooInterface".replace('$', '.');
+  public void originalApi() throws android.os.RemoteException;
+  public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException;
+  public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException;
+  public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException;
+  public int getInterfaceVersion() throws android.os.RemoteException;
+  public String getInterfaceHash() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d b/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d
new file mode 100644
index 0000000..6875917
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/IFooInterface.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/timestamp b/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-java-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp
new file mode 100644
index 0000000..5750f92
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp
@@ -0,0 +1,47 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/BazUnion.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+const char* BazUnion::descriptor = "android.aidl.versioned.tests.BazUnion";
+
+binder_status_t BazUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case intNum: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<intNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intNum>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t BazUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case intNum: return ::ndk::AParcel_writeData(_parcel, get<intNum>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
new file mode 100644
index 0000000..b4581bd
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp
new file mode 100644
index 0000000..07e8efe
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp
@@ -0,0 +1,45 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/Foo.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+const char* Foo::descriptor = "android.aidl.versioned.tests.Foo";
+
+binder_status_t Foo::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t Foo::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d
new file mode 100644
index 0000000..df963e3
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
new file mode 100644
index 0000000..aec8e2c
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
@@ -0,0 +1,496 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/versioned/tests/BnFooInterface.h>
+#include <aidl/android/aidl/versioned/tests/BpFooInterface.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+static binder_status_t _aidl_android_aidl_versioned_tests_IFooInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnFooInterface> _aidl_impl = std::static_pointer_cast<BnFooInterface>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*originalApi*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->originalApi();
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*acceptUnionAndReturnString*/): {
+      ::aidl::android::aidl::versioned::tests::BazUnion in_u;
+      std::string _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_u);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->acceptUnionAndReturnString(in_u, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*ignoreParcelablesAndRepeatInt*/): {
+      ::aidl::android::aidl::versioned::tests::Foo in_inFoo;
+      ::aidl::android::aidl::versioned::tests::Foo in_inoutFoo;
+      ::aidl::android::aidl::versioned::tests::Foo out_outFoo;
+      int32_t in_value;
+      int32_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_inFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_inoutFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_value);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ignoreParcelablesAndRepeatInt(in_inFoo, &in_inoutFoo, &out_outFoo, in_value, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_inoutFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_outFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 3 /*returnsLengthOfFooArray*/): {
+      std::vector<::aidl::android::aidl::versioned::tests::Foo> in_foos;
+      int32_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_foos);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->returnsLengthOfFooArray(in_foos, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): {
+      int32_t _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): {
+      std::string _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_versioned_tests_IFooInterface_clazz = ::ndk::ICInterface::defineClass(IFooInterface::descriptor, _aidl_android_aidl_versioned_tests_IFooInterface_onTransact);
+
+BpFooInterface::BpFooInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpFooInterface::~BpFooInterface() {}
+
+::ndk::ScopedAStatus BpFooInterface::originalApi() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*originalApi*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->originalApi();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_u);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*acceptUnionAndReturnString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->acceptUnionAndReturnString(in_u, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_inFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_inoutFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_value);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*ignoreParcelablesAndRepeatInt*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->ignoreParcelablesAndRepeatInt(in_inFoo, in_inoutFoo, out_outFoo, in_value, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_inoutFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_outFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_foos);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 3 /*returnsLengthOfFooArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->returnsLengthOfFooArray(in_foos, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::getInterfaceVersion(int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  if (_aidl_cached_version != -1) {
+    *_aidl_return = _aidl_cached_version;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->getInterfaceVersion(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_version = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::getInterfaceHash(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex);
+  if (_aidl_cached_hash != "-1") {
+    *_aidl_return = _aidl_cached_hash;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->getInterfaceHash(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_hash = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnFooInterface
+BnFooInterface::BnFooInterface() {}
+BnFooInterface::~BnFooInterface() {}
+::ndk::SpAIBinder BnFooInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_versioned_tests_IFooInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+::ndk::ScopedAStatus BnFooInterface::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = IFooInterface::version;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus BnFooInterface::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = IFooInterface::hash;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+// Source for IFooInterface
+const char* IFooInterface::descriptor = "android.aidl.versioned.tests.IFooInterface";
+IFooInterface::IFooInterface() {}
+IFooInterface::~IFooInterface() {}
+
+
+std::shared_ptr<IFooInterface> IFooInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_versioned_tests_IFooInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpFooInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IFooInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpFooInterface>(binder);
+}
+
+binder_status_t IFooInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<IFooInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t IFooInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<IFooInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IFooInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool IFooInterface::setDefaultImpl(const std::shared_ptr<IFooInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IFooInterface::default_impl);
+  if (impl) {
+    IFooInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<IFooInterface>& IFooInterface::getDefaultImpl() {
+  return IFooInterface::default_impl;
+}
+std::shared_ptr<IFooInterface> IFooInterface::default_impl = nullptr;
+::ndk::ScopedAStatus IFooInterfaceDefault::originalApi() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& /*in_u*/, std::string* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& /*in_inFoo*/, ::aidl::android::aidl::versioned::tests::Foo* /*in_inoutFoo*/, ::aidl::android::aidl::versioned::tests::Foo* /*out_outFoo*/, int32_t /*in_value*/, int32_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& /*in_foos*/, int32_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = 0;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = "";
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::SpAIBinder IFooInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool IFooInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
new file mode 100644
index 0000000..762b47b
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h
new file mode 100644
index 0000000..c3fdf63
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h
@@ -0,0 +1,159 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BazUnion {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Tag : int32_t {
+    intNum = 0,
+  };
+
+  // Expose tag symbols for legacy code
+  static const inline Tag intNum = Tag::intNum;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, BazUnion>;
+
+  BazUnion() : _value(std::in_place_index<static_cast<size_t>(intNum)>, int32_t(0)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr BazUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit BazUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static BazUnion make(_Tp&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static BazUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  binder_status_t readFromParcel(const AParcel* _parcel);
+  binder_status_t writeToParcel(AParcel* _parcel) const;
+
+  inline bool operator!=(const BazUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const BazUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const BazUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const BazUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const BazUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const BazUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "BazUnion{";
+    switch (getTag()) {
+    case intNum: os << "intNum: " << ::android::internal::ToString(get<intNum>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t> _value;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+[[nodiscard]] static inline std::string toString(BazUnion::Tag val) {
+  switch(val) {
+  case BazUnion::Tag::intNum:
+    return "intNum";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::versioned::tests::BazUnion::Tag, 1> enum_values<aidl::android::aidl::versioned::tests::BazUnion::Tag> = {
+  aidl::android::aidl::versioned::tests::BazUnion::Tag::intNum,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h
new file mode 100644
index 0000000..44bef24
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h
new file mode 100644
index 0000000..0f14b41
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h
new file mode 100644
index 0000000..13db93c
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h
@@ -0,0 +1,66 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BnFooInterface : public ::ndk::BnCInterface<IFooInterface> {
+public:
+  BnFooInterface();
+  virtual ~BnFooInterface();
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) final;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) final;
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class IFooInterfaceDelegator : public BnFooInterface {
+public:
+  explicit IFooInterfaceDelegator(const std::shared_ptr<IFooInterface> &impl) : _impl(impl) {
+     int32_t _impl_ver = 0;
+     if (!impl->getInterfaceVersion(&_impl_ver).isOk()) {;
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Delegator failed to get version of the implementation.");
+     }
+     if (_impl_ver != IFooInterface::version) {
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Mismatched versions of delegator and implementation is not allowed.");
+     }
+  }
+
+  ::ndk::ScopedAStatus originalApi() override {
+    return _impl->originalApi();
+  }
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override {
+    return _impl->acceptUnionAndReturnString(in_u, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override {
+    return _impl->ignoreParcelablesAndRepeatInt(in_inFoo, in_inoutFoo, out_outFoo, in_value, _aidl_return);
+  }
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override {
+    return _impl->returnsLengthOfFooArray(in_foos, _aidl_return);
+  }
+protected:
+private:
+  std::shared_ptr<IFooInterface> _impl;
+};
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h
new file mode 100644
index 0000000..d772c0c
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h
new file mode 100644
index 0000000..6fc1f80
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h
new file mode 100644
index 0000000..2cac137
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h
@@ -0,0 +1,35 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BpFooInterface : public ::ndk::BpCInterface<IFooInterface> {
+public:
+  explicit BpFooInterface(const ::ndk::SpAIBinder& binder);
+  virtual ~BpFooInterface();
+
+  ::ndk::ScopedAStatus originalApi() override;
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  int32_t _aidl_cached_version = -1;
+  std::string _aidl_cached_hash = "-1";
+  std::mutex _aidl_cached_hash_mutex;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h
new file mode 100644
index 0000000..fd7b3ab
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h
@@ -0,0 +1,64 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class Foo {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const Foo&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const Foo&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const Foo&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const Foo&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const Foo&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const Foo&) const {
+    return std::tie() >= std::tie();
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Foo{";
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h
new file mode 100644
index 0000000..0d39f1d
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h
@@ -0,0 +1,72 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <aidl/android/aidl/versioned/tests/BazUnion.h>
+#include <aidl/android/aidl/versioned/tests/Foo.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::versioned::tests {
+class Foo;
+}  // namespace aidl::android::aidl::versioned::tests
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class IFooInterfaceDelegator;
+
+class IFooInterface : public ::ndk::ICInterface {
+public:
+  typedef IFooInterfaceDelegator DefaultDelegator;
+  static const char* descriptor;
+  IFooInterface();
+  virtual ~IFooInterface();
+
+  static inline const int32_t version = 1;
+  static inline const std::string hash = "9e7be1859820c59d9d55dd133e71a3687b5d2e5b";
+  static constexpr uint32_t TRANSACTION_originalApi = FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_acceptUnionAndReturnString = FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_ignoreParcelablesAndRepeatInt = FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_returnsLengthOfFooArray = FIRST_CALL_TRANSACTION + 3;
+
+  static std::shared_ptr<IFooInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IFooInterface>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IFooInterface>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<IFooInterface>& impl);
+  static const std::shared_ptr<IFooInterface>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus originalApi() = 0;
+  virtual ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) = 0;
+private:
+  static std::shared_ptr<IFooInterface> default_impl;
+};
+class IFooInterfaceDefault : public IFooInterface {
+public:
+  ::ndk::ScopedAStatus originalApi() override;
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/timestamp b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-ndk-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs b/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs
new file mode 100644
index 0000000..42879be
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs
@@ -0,0 +1,56 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub enum r#BazUnion {
+  IntNum(i32),
+}
+impl Default for r#BazUnion {
+  fn default() -> Self {
+    Self::IntNum(0)
+  }
+}
+impl binder::Parcelable for r#BazUnion {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    match self {
+      Self::IntNum(v) => {
+        parcel.write(&0i32)?;
+        parcel.write(v)
+      }
+    }
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    let tag: i32 = parcel.read()?;
+    match tag {
+      0 => {
+        let value: i32 = parcel.read()?;
+        *self = Self::IntNum(value);
+        Ok(())
+      }
+      _ => {
+        Err(binder::StatusCode::BAD_VALUE)
+      }
+    }
+  }
+}
+binder::impl_serialize_for_parcelable!(r#BazUnion);
+binder::impl_deserialize_for_parcelable!(r#BazUnion);
+impl binder::binder_impl::ParcelableMetadata for r#BazUnion {
+  fn get_descriptor() -> &'static str { "android.aidl.versioned.tests.BazUnion" }
+}
+pub mod r#Tag {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#Tag : [i32; 1] {
+      r#intNum = 0,
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#BazUnion as _7_android_4_aidl_9_versioned_5_tests_8_BazUnion;
+ pub use super::r#Tag::r#Tag as _7_android_4_aidl_9_versioned_5_tests_8_BazUnion_3_Tag;
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d b/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d
new file mode 100644
index 0000000..d46cd01
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/Foo.rs b/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/Foo.rs
new file mode 100644
index 0000000..231c94d
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/Foo.rs
@@ -0,0 +1,35 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#Foo {
+}
+impl Default for r#Foo {
+  fn default() -> Self {
+    Self {
+    }
+  }
+}
+impl binder::Parcelable for r#Foo {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#Foo);
+binder::impl_deserialize_for_parcelable!(r#Foo);
+impl binder::binder_impl::ParcelableMetadata for r#Foo {
+  fn get_descriptor() -> &'static str { "android.aidl.versioned.tests.Foo" }
+}
+pub(crate) mod mangled {
+ pub use super::r#Foo as _7_android_4_aidl_9_versioned_5_tests_3_Foo;
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d b/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d
new file mode 100644
index 0000000..f8b09de
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/Foo.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs b/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs
new file mode 100644
index 0000000..7a58017
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs
@@ -0,0 +1,439 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  IFooInterface["android.aidl.versioned.tests.IFooInterface"] {
+    native: BnFooInterface(on_transact),
+    proxy: BpFooInterface {
+      cached_version: std::sync::atomic::AtomicI32 = std::sync::atomic::AtomicI32::new(-1),
+      cached_hash: std::sync::Mutex<Option<String>> = std::sync::Mutex::new(None)
+    },
+    async: IFooInterfaceAsync,
+  }
+}
+pub trait IFooInterface: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  fn r#originalApi(&self) -> binder::Result<()>;
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String>;
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32>;
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32>;
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    Ok(VERSION)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    Ok(HASH.into())
+  }
+  fn getDefaultImpl() -> IFooInterfaceDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: IFooInterfaceDefaultRef) -> IFooInterfaceDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait IFooInterfaceAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  fn r#originalApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#acceptUnionAndReturnString<'a>(&'a self, _arg_u: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::BoxFuture<'a, binder::Result<String>>;
+  fn r#ignoreParcelablesAndRepeatInt<'a>(&'a self, _arg_inFoo: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::BoxFuture<'a, binder::Result<i32>>;
+  fn r#returnsLengthOfFooArray<'a>(&'a self, _arg_foos: &'a [crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::BoxFuture<'a, binder::Result<i32>>;
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    Box::pin(async move { Ok(VERSION) })
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    Box::pin(async move { Ok(HASH.into()) })
+  }
+}
+#[::async_trait::async_trait]
+pub trait IFooInterfaceAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  async fn r#originalApi(&self) -> binder::Result<()>;
+  async fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String>;
+  async fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32>;
+  async fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32>;
+}
+impl BnFooInterface {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IFooInterface>
+  where
+    T: IFooInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> IFooInterface for Wrapper<T, R>
+    where
+      T: IFooInterfaceAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#originalApi(&self) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#originalApi())
+      }
+      fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+        self._rt.block_on(self._inner.r#acceptUnionAndReturnString(_arg_u))
+      }
+      fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+        self._rt.block_on(self._inner.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value))
+      }
+      fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+        self._rt.block_on(self._inner.r#returnsLengthOfFooArray(_arg_foos))
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait IFooInterfaceDefault: Send + Sync {
+  fn r#originalApi(&self) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#originalApi: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  pub const r#acceptUnionAndReturnString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+  pub const r#ignoreParcelablesAndRepeatInt: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+  pub const r#returnsLengthOfFooArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 3;
+  pub const r#getInterfaceVersion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777214;
+  pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213;
+}
+pub type IFooInterfaceDefaultRef = Option<std::sync::Arc<dyn IFooInterfaceDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None);
+}
+pub const VERSION: i32 = 1;
+pub const HASH: &str = "9e7be1859820c59d9d55dd133e71a3687b5d2e5b";
+impl BpFooInterface {
+  fn build_parcel_originalApi(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_originalApi(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#originalApi();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_u)?;
+    Ok(aidl_data)
+  }
+  fn read_response_acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#acceptUnionAndReturnString(_arg_u);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_inFoo)?;
+    aidl_data.write(_arg_inoutFoo)?;
+    aidl_data.write(&_arg_value)?;
+    Ok(aidl_data)
+  }
+  fn read_response_ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_inoutFoo)?;
+    _aidl_reply.read_onto(_arg_outFoo)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_foos)?;
+    Ok(aidl_data)
+  }
+  fn read_response_returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#returnsLengthOfFooArray(_arg_foos);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_getInterfaceVersion(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceVersion(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    self.cached_version.store(_aidl_return, std::sync::atomic::Ordering::Relaxed);
+    Ok(_aidl_return)
+  }
+  fn build_parcel_getInterfaceHash(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceHash(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    *self.cached_hash.lock().unwrap() = Some(_aidl_return.clone());
+    Ok(_aidl_return)
+  }
+}
+impl IFooInterface for BpFooInterface {
+  fn r#originalApi(&self) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_originalApi()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#originalApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_originalApi(_aidl_reply)
+  }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+    let _aidl_data = self.build_parcel_acceptUnionAndReturnString(_arg_u)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#acceptUnionAndReturnString, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_acceptUnionAndReturnString(_arg_u, _aidl_reply)
+  }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+    let _aidl_data = self.build_parcel_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ignoreParcelablesAndRepeatInt, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value, _aidl_reply)
+  }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+    let _aidl_data = self.build_parcel_returnsLengthOfFooArray(_arg_foos)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#returnsLengthOfFooArray, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_returnsLengthOfFooArray(_arg_foos, _aidl_reply)
+  }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Ok(_aidl_version); }
+    let _aidl_data = self.build_parcel_getInterfaceVersion()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceVersion(_aidl_reply)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Ok(_aidl_hash.clone());
+      }
+    }
+    let _aidl_data = self.build_parcel_getInterfaceHash()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceHash(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> IFooInterfaceAsync<P> for BpFooInterface {
+  fn r#originalApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_originalApi() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#originalApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_originalApi(_aidl_reply)
+      }
+    )
+  }
+  fn r#acceptUnionAndReturnString<'a>(&'a self, _arg_u: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::BoxFuture<'a, binder::Result<String>> {
+    let _aidl_data = match self.build_parcel_acceptUnionAndReturnString(_arg_u) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#acceptUnionAndReturnString, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_acceptUnionAndReturnString(_arg_u, _aidl_reply)
+      }
+    )
+  }
+  fn r#ignoreParcelablesAndRepeatInt<'a>(&'a self, _arg_inFoo: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_data = match self.build_parcel_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ignoreParcelablesAndRepeatInt, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value, _aidl_reply)
+      }
+    )
+  }
+  fn r#returnsLengthOfFooArray<'a>(&'a self, _arg_foos: &'a [crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_data = match self.build_parcel_returnsLengthOfFooArray(_arg_foos) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#returnsLengthOfFooArray, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_returnsLengthOfFooArray(_arg_foos, _aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Box::pin(std::future::ready(Ok(_aidl_version))); }
+    let _aidl_data = match self.build_parcel_getInterfaceVersion() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceVersion(_aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Box::pin(std::future::ready(Ok(_aidl_hash.clone())));
+      }
+    }
+    let _aidl_data = match self.build_parcel_getInterfaceHash() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceHash(_aidl_reply)
+      }
+    )
+  }
+}
+impl IFooInterface for binder::binder_impl::Binder<BnFooInterface> {
+  fn r#originalApi(&self) -> binder::Result<()> { self.0.r#originalApi() }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> { self.0.r#acceptUnionAndReturnString(_arg_u) }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> { self.0.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value) }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> { self.0.r#returnsLengthOfFooArray(_arg_foos) }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> { self.0.r#getInterfaceVersion() }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> { self.0.r#getInterfaceHash() }
+}
+fn on_transact(_aidl_service: &dyn IFooInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#originalApi => {
+      let _aidl_return = _aidl_service.r#originalApi();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#acceptUnionAndReturnString => {
+      let _arg_u: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#acceptUnionAndReturnString(&_arg_u);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ignoreParcelablesAndRepeatInt => {
+      let _arg_inFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = _aidl_data.read()?;
+      let mut _arg_inoutFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = _aidl_data.read()?;
+      let mut _arg_outFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = Default::default();
+      let _arg_value: i32 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#ignoreParcelablesAndRepeatInt(&_arg_inFoo, &mut _arg_inoutFoo, &mut _arg_outFoo, _arg_value);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_inoutFoo)?;
+          _aidl_reply.write(&_arg_outFoo)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#returnsLengthOfFooArray => {
+      let _arg_foos: Vec<crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#returnsLengthOfFooArray(&_arg_foos);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceVersion => {
+      let _aidl_return = _aidl_service.r#getInterfaceVersion();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceHash => {
+      let _aidl_return = _aidl_service.r#getInterfaceHash();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#IFooInterface as _7_android_4_aidl_9_versioned_5_tests_13_IFooInterface;
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d b/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d
new file mode 100644
index 0000000..b93c4ba
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/timestamp b/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp
new file mode 100644
index 0000000..29c1cf0
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp
@@ -0,0 +1,51 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#include <android/aidl/versioned/tests/BazUnion.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+::android::status_t BazUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case intNum: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<intNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intNum>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case longNum: {
+    int64_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt64(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int64_t>) {
+      set<longNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<longNum>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t BazUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case intNum: return _aidl_parcel->writeInt32(get<intNum>());
+  case longNum: return _aidl_parcel->writeInt64(get<longNum>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
new file mode 100644
index 0000000..a78cf5d
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp
new file mode 100644
index 0000000..92018e9
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp
@@ -0,0 +1,50 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#include <android/aidl/versioned/tests/Foo.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+::android::status_t Foo::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&intDefault42);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t Foo::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(intDefault42);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d
new file mode 100644
index 0000000..b6961af
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
new file mode 100644
index 0000000..02a0d11
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
@@ -0,0 +1,458 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#include <android/aidl/versioned/tests/IFooInterface.h>
+#include <android/aidl/versioned/tests/BpFooInterface.h>
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(FooInterface, "android.aidl.versioned.tests.IFooInterface")
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/versioned/tests/BpFooInterface.h>
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+
+BpFooInterface::BpFooInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IFooInterface>(_aidl_impl){
+}
+
+::android::binder::Status BpFooInterface::originalApi() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::originalApi::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_originalApi, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->originalApi();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::acceptUnionAndReturnString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(u);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_acceptUnionAndReturnString, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->acceptUnionAndReturnString(u, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8FromUtf16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::ignoreParcelablesAndRepeatInt::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(inFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(*inoutFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(value);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_ignoreParcelablesAndRepeatInt, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->ignoreParcelablesAndRepeatInt(inFoo, inoutFoo, outFoo, value, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(inoutFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(outFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::returnsLengthOfFooArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelableVector(foos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_returnsLengthOfFooArray, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->returnsLengthOfFooArray(foos, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::newApi() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::newApi::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_newApi, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->newApi();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+int32_t BpFooInterface::getInterfaceVersion() {
+  if (cached_version_ == -1) {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnFooInterface::TRANSACTION_getInterfaceVersion, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        cached_version_ = reply.readInt32();
+      }
+    }
+  }
+  return cached_version_;
+}
+
+
+std::string BpFooInterface::getInterfaceHash() {
+  std::lock_guard<std::mutex> lockGuard(cached_hash_mutex_);
+  if (cached_hash_ == "-1") {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnFooInterface::TRANSACTION_getInterfaceHash, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        reply.readUtf8FromUtf16(&cached_hash_);
+      }
+    }
+  }
+  return cached_hash_;
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+
+BnFooInterface::BnFooInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnFooInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnFooInterface::TRANSACTION_originalApi:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::originalApi::cppServer");
+    ::android::binder::Status _aidl_status(originalApi());
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_acceptUnionAndReturnString:
+  {
+    ::android::aidl::versioned::tests::BazUnion in_u;
+    ::std::string _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::acceptUnionAndReturnString::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_u);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(acceptUnionAndReturnString(in_u, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8AsUtf16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_ignoreParcelablesAndRepeatInt:
+  {
+    ::android::aidl::versioned::tests::Foo in_inFoo;
+    ::android::aidl::versioned::tests::Foo in_inoutFoo;
+    ::android::aidl::versioned::tests::Foo out_outFoo;
+    int32_t in_value;
+    int32_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::ignoreParcelablesAndRepeatInt::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_inFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readParcelable(&in_inoutFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readInt32(&in_value);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ignoreParcelablesAndRepeatInt(in_inFoo, &in_inoutFoo, &out_outFoo, in_value, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(in_inoutFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(out_outFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_returnsLengthOfFooArray:
+  {
+    ::std::vector<::android::aidl::versioned::tests::Foo> in_foos;
+    int32_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::returnsLengthOfFooArray::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelableVector(&in_foos);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(returnsLengthOfFooArray(in_foos, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_newApi:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::newApi::cppServer");
+    ::android::binder::Status _aidl_status(newApi());
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_getInterfaceVersion:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeInt32(IFooInterface::VERSION);
+  }
+  break;
+  case BnFooInterface::TRANSACTION_getInterfaceHash:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeUtf8AsUtf16(IFooInterface::HASH);
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+int32_t BnFooInterface::getInterfaceVersion() {
+  return IFooInterface::VERSION;
+}
+std::string BnFooInterface::getInterfaceHash() {
+  return IFooInterface::HASH;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
new file mode 100644
index 0000000..35cdb4f
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h
new file mode 100644
index 0000000..92adb13
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h
@@ -0,0 +1,154 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BazUnion : public ::android::Parcelable {
+public:
+  enum class Tag : int32_t {
+    intNum = 0,
+    longNum = 1,
+  };
+  // Expose tag symbols for legacy code
+  static const inline Tag intNum = Tag::intNum;
+  static const inline Tag longNum = Tag::longNum;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, BazUnion>;
+
+  BazUnion() : _value(std::in_place_index<static_cast<size_t>(intNum)>, int32_t(0)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr BazUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit BazUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static BazUnion make(_Tp&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static BazUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  inline bool operator!=(const BazUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const BazUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const BazUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const BazUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const BazUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const BazUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.versioned.tests.BazUnion");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "BazUnion{";
+    switch (getTag()) {
+    case intNum: os << "intNum: " << ::android::internal::ToString(get<intNum>()); break;
+    case longNum: os << "longNum: " << ::android::internal::ToString(get<longNum>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t, int64_t> _value;
+};  // class BazUnion
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+[[nodiscard]] static inline std::string toString(BazUnion::Tag val) {
+  switch(val) {
+  case BazUnion::Tag::intNum:
+    return "intNum";
+  case BazUnion::Tag::longNum:
+    return "longNum";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::versioned::tests::BazUnion::Tag, 2> enum_values<::android::aidl::versioned::tests::BazUnion::Tag> = {
+  ::android::aidl::versioned::tests::BazUnion::Tag::intNum,
+  ::android::aidl::versioned::tests::BazUnion::Tag::longNum,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h
new file mode 100644
index 0000000..ed912f9
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h
new file mode 100644
index 0000000..809a4d1
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h
new file mode 100644
index 0000000..69b229e
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h
@@ -0,0 +1,66 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/versioned/tests/IFooInterface.h>
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BnFooInterface : public ::android::BnInterface<IFooInterface> {
+public:
+  static constexpr uint32_t TRANSACTION_originalApi = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_acceptUnionAndReturnString = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_ignoreParcelablesAndRepeatInt = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_returnsLengthOfFooArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_newApi = ::android::IBinder::FIRST_CALL_TRANSACTION + 4;
+  static constexpr uint32_t TRANSACTION_getInterfaceVersion = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777214;
+  static constexpr uint32_t TRANSACTION_getInterfaceHash = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777213;
+  explicit BnFooInterface();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  int32_t getInterfaceVersion();
+  std::string getInterfaceHash();
+};  // class BnFooInterface
+
+class IFooInterfaceDelegator : public BnFooInterface {
+public:
+  explicit IFooInterfaceDelegator(const ::android::sp<IFooInterface> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<IFooInterface> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status originalApi() override {
+    return _aidl_delegate->originalApi();
+  }
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) override {
+    return _aidl_delegate->acceptUnionAndReturnString(u, _aidl_return);
+  }
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) override {
+    return _aidl_delegate->ignoreParcelablesAndRepeatInt(inFoo, inoutFoo, outFoo, value, _aidl_return);
+  }
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) override {
+    return _aidl_delegate->returnsLengthOfFooArray(foos, _aidl_return);
+  }
+  ::android::binder::Status newApi() override {
+    return _aidl_delegate->newApi();
+  }
+  int32_t getInterfaceVersion() override {
+    int32_t _delegator_ver = BnFooInterface::getInterfaceVersion();
+    int32_t _impl_ver = _aidl_delegate->getInterfaceVersion();
+    return _delegator_ver < _impl_ver ? _delegator_ver : _impl_ver;
+  }
+  std::string getInterfaceHash() override {
+    return _aidl_delegate->getInterfaceHash();
+  }
+private:
+  ::android::sp<IFooInterface> _aidl_delegate;
+};  // class IFooInterfaceDelegator
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h
new file mode 100644
index 0000000..b570cba
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h
new file mode 100644
index 0000000..2d9b299
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h
new file mode 100644
index 0000000..91570e5
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h
@@ -0,0 +1,35 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/versioned/tests/IFooInterface.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BpFooInterface : public ::android::BpInterface<IFooInterface> {
+public:
+  explicit BpFooInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpFooInterface() = default;
+  ::android::binder::Status originalApi() override;
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) override;
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) override;
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) override;
+  ::android::binder::Status newApi() override;
+  int32_t getInterfaceVersion() override;
+  std::string getInterfaceHash() override;
+private:
+  int32_t cached_version_ = -1;
+  std::string cached_hash_ = "-1";
+  std::mutex cached_hash_mutex_;
+};  // class BpFooInterface
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h
new file mode 100644
index 0000000..a8cae5c
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class Foo : public ::android::Parcelable {
+public:
+  int32_t intDefault42 = 42;
+  inline bool operator!=(const Foo& rhs) const {
+    return std::tie(intDefault42) != std::tie(rhs.intDefault42);
+  }
+  inline bool operator<(const Foo& rhs) const {
+    return std::tie(intDefault42) < std::tie(rhs.intDefault42);
+  }
+  inline bool operator<=(const Foo& rhs) const {
+    return std::tie(intDefault42) <= std::tie(rhs.intDefault42);
+  }
+  inline bool operator==(const Foo& rhs) const {
+    return std::tie(intDefault42) == std::tie(rhs.intDefault42);
+  }
+  inline bool operator>(const Foo& rhs) const {
+    return std::tie(intDefault42) > std::tie(rhs.intDefault42);
+  }
+  inline bool operator>=(const Foo& rhs) const {
+    return std::tie(intDefault42) >= std::tie(rhs.intDefault42);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.versioned.tests.Foo");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Foo{";
+    os << "intDefault42: " << ::android::internal::ToString(intDefault42);
+    os << "}";
+    return os.str();
+  }
+};  // class Foo
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h
new file mode 100644
index 0000000..e50a31f
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h
@@ -0,0 +1,73 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <android/aidl/versioned/tests/BazUnion.h>
+#include <android/aidl/versioned/tests/Foo.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cstdint>
+#include <string>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <vector>
+
+namespace android::aidl::versioned::tests {
+class Foo;
+}  // namespace android::aidl::versioned::tests
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class IFooInterfaceDelegator;
+
+class IFooInterface : public ::android::IInterface {
+public:
+  typedef IFooInterfaceDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(FooInterface)
+  static inline const int32_t VERSION = 2;
+  static inline const std::string HASH = "da8c4bc94ca7feff0e0a65563a466787698b5891";
+  virtual ::android::binder::Status originalApi() = 0;
+  virtual ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) = 0;
+  virtual ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) = 0;
+  virtual ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) = 0;
+  virtual ::android::binder::Status newApi() = 0;
+  virtual int32_t getInterfaceVersion() = 0;
+  virtual std::string getInterfaceHash() = 0;
+};  // class IFooInterface
+
+class IFooInterfaceDefault : public IFooInterface {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status originalApi() override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& /*u*/, ::std::string* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& /*inFoo*/, ::android::aidl::versioned::tests::Foo* /*inoutFoo*/, ::android::aidl::versioned::tests::Foo* /*outFoo*/, int32_t /*value*/, int32_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& /*foos*/, int32_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status newApi() override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  int32_t getInterfaceVersion() override {
+    return 0;
+  }
+  std::string getInterfaceHash() override {
+    return "";
+  }
+};  // class IFooInterfaceDefault
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/timestamp b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-cpp-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/BazUnion.java b/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/BazUnion.java
new file mode 100644
index 0000000..5342547
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/BazUnion.java
@@ -0,0 +1,135 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+package android.aidl.versioned.tests;
+public final class BazUnion implements android.os.Parcelable {
+  // tags for union fields
+  public final static int intNum = 0;  // int intNum;
+  public final static int longNum = 1;  // long longNum;
+
+  private int _tag;
+  private Object _value;
+
+  public BazUnion() {
+    int _value = 0;
+    this._tag = intNum;
+    this._value = _value;
+  }
+
+  private BazUnion(android.os.Parcel _aidl_parcel) {
+    readFromParcel(_aidl_parcel);
+  }
+
+  private BazUnion(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+
+  public int getTag() {
+    return _tag;
+  }
+
+  // int intNum;
+
+  public static BazUnion intNum(int _value) {
+    return new BazUnion(intNum, _value);
+  }
+
+  public int getIntNum() {
+    _assertTag(intNum);
+    return (int) _value;
+  }
+
+  public void setIntNum(int _value) {
+    _set(intNum, _value);
+  }
+
+  // long longNum;
+
+  public static BazUnion longNum(long _value) {
+    return new BazUnion(longNum, _value);
+  }
+
+  public long getLongNum() {
+    _assertTag(longNum);
+    return (long) _value;
+  }
+
+  public void setLongNum(long _value) {
+    _set(longNum, _value);
+  }
+
+  public static final android.os.Parcelable.Creator<BazUnion> CREATOR = new android.os.Parcelable.Creator<BazUnion>() {
+    @Override
+    public BazUnion createFromParcel(android.os.Parcel _aidl_source) {
+      return new BazUnion(_aidl_source);
+    }
+    @Override
+    public BazUnion[] newArray(int _aidl_size) {
+      return new BazUnion[_aidl_size];
+    }
+  };
+
+  @Override
+  public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+    _aidl_parcel.writeInt(_tag);
+    switch (_tag) {
+    case intNum:
+      _aidl_parcel.writeInt(getIntNum());
+      break;
+    case longNum:
+      _aidl_parcel.writeLong(getLongNum());
+      break;
+    }
+  }
+
+  public void readFromParcel(android.os.Parcel _aidl_parcel) {
+    int _aidl_tag;
+    _aidl_tag = _aidl_parcel.readInt();
+    switch (_aidl_tag) {
+    case intNum: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case longNum: {
+      long _aidl_value;
+      _aidl_value = _aidl_parcel.readLong();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    }
+    throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+  }
+
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    switch (getTag()) {
+    }
+    return _mask;
+  }
+
+  private void _assertTag(int tag) {
+    if (getTag() != tag) {
+      throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+    }
+  }
+
+  private String _tagString(int _tag) {
+    switch (_tag) {
+    case intNum: return "intNum";
+    case longNum: return "longNum";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+
+  private void _set(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+  public static @interface Tag {
+    public static final int intNum = 0;
+    public static final int longNum = 1;
+  }
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d b/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d
new file mode 100644
index 0000000..68d7b75
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/BazUnion.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/Foo.java b/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/Foo.java
new file mode 100644
index 0000000..1f1df27
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/Foo.java
@@ -0,0 +1,51 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/Foo.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+package android.aidl.versioned.tests;
+public class Foo implements android.os.Parcelable
+{
+  public int intDefault42 = 42;
+  public static final android.os.Parcelable.Creator<Foo> CREATOR = new android.os.Parcelable.Creator<Foo>() {
+    @Override
+    public Foo createFromParcel(android.os.Parcel _aidl_source) {
+      Foo _aidl_out = new Foo();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public Foo[] newArray(int _aidl_size) {
+      return new Foo[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(intDefault42);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intDefault42 = _aidl_parcel.readInt();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/Foo.java.d b/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/Foo.java.d
new file mode 100644
index 0000000..b7db41a
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/Foo.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/Foo.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/IFooInterface.java b/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/IFooInterface.java
new file mode 100644
index 0000000..a932100
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/IFooInterface.java
@@ -0,0 +1,329 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+package android.aidl.versioned.tests;
+public interface IFooInterface extends android.os.IInterface
+{
+  /**
+   * The version of this interface that the caller is built against.
+   * This might be different from what {@link #getInterfaceVersion()
+   * getInterfaceVersion} returns as that is the version of the interface
+   * that the remote object is implementing.
+   */
+  public static final int VERSION = 2;
+  public static final String HASH = "da8c4bc94ca7feff0e0a65563a466787698b5891";
+  /** Default implementation for IFooInterface. */
+  public static class Default implements android.aidl.versioned.tests.IFooInterface
+  {
+    @Override public void originalApi() throws android.os.RemoteException
+    {
+    }
+    @Override public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public void newApi() throws android.os.RemoteException
+    {
+    }
+    @Override
+    public int getInterfaceVersion() {
+      return 0;
+    }
+    @Override
+    public String getInterfaceHash() {
+      return "";
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.versioned.tests.IFooInterface
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.versioned.tests.IFooInterface interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.versioned.tests.IFooInterface asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.versioned.tests.IFooInterface))) {
+        return ((android.aidl.versioned.tests.IFooInterface)iin);
+      }
+      return new android.aidl.versioned.tests.IFooInterface.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceVersion) {
+        reply.writeNoException();
+        reply.writeInt(getInterfaceVersion());
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceHash) {
+        reply.writeNoException();
+        reply.writeString(getInterfaceHash());
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_originalApi:
+        {
+          this.originalApi();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_acceptUnionAndReturnString:
+        {
+          android.aidl.versioned.tests.BazUnion _arg0;
+          _arg0 = data.readTypedObject(android.aidl.versioned.tests.BazUnion.CREATOR);
+          data.enforceNoDataAvail();
+          java.lang.String _result = this.acceptUnionAndReturnString(_arg0);
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        case TRANSACTION_ignoreParcelablesAndRepeatInt:
+        {
+          android.aidl.versioned.tests.Foo _arg0;
+          _arg0 = data.readTypedObject(android.aidl.versioned.tests.Foo.CREATOR);
+          android.aidl.versioned.tests.Foo _arg1;
+          _arg1 = data.readTypedObject(android.aidl.versioned.tests.Foo.CREATOR);
+          android.aidl.versioned.tests.Foo _arg2;
+          _arg2 = new android.aidl.versioned.tests.Foo();
+          int _arg3;
+          _arg3 = data.readInt();
+          data.enforceNoDataAvail();
+          int _result = this.ignoreParcelablesAndRepeatInt(_arg0, _arg1, _arg2, _arg3);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          reply.writeTypedObject(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          reply.writeTypedObject(_arg2, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_returnsLengthOfFooArray:
+        {
+          android.aidl.versioned.tests.Foo[] _arg0;
+          _arg0 = data.createTypedArray(android.aidl.versioned.tests.Foo.CREATOR);
+          data.enforceNoDataAvail();
+          int _result = this.returnsLengthOfFooArray(_arg0);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          break;
+        }
+        case TRANSACTION_newApi:
+        {
+          this.newApi();
+          reply.writeNoException();
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.versioned.tests.IFooInterface
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      private int mCachedVersion = -1;
+      private String mCachedHash = "-1";
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public void originalApi() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_originalApi, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method originalApi is unimplemented.");
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(u, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_acceptUnionAndReturnString, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method acceptUnionAndReturnString is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(inFoo, 0);
+          _data.writeTypedObject(inoutFoo, 0);
+          _data.writeInt(value);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ignoreParcelablesAndRepeatInt, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method ignoreParcelablesAndRepeatInt is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+          if ((0!=_reply.readInt())) {
+            inoutFoo.readFromParcel(_reply);
+          }
+          if ((0!=_reply.readInt())) {
+            outFoo.readFromParcel(_reply);
+          }
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedArray(foos, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_returnsLengthOfFooArray, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method returnsLengthOfFooArray is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public void newApi() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_newApi, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method newApi is unimplemented.");
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override
+      public int getInterfaceVersion() throws android.os.RemoteException {
+        if (mCachedVersion == -1) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceVersion, data, reply, 0);
+            reply.readException();
+            mCachedVersion = reply.readInt();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedVersion;
+      }
+      @Override
+      public synchronized String getInterfaceHash() throws android.os.RemoteException {
+        if ("-1".equals(mCachedHash)) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceHash, data, reply, 0);
+            reply.readException();
+            mCachedHash = reply.readString();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedHash;
+      }
+    }
+    static final int TRANSACTION_originalApi = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    static final int TRANSACTION_acceptUnionAndReturnString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    static final int TRANSACTION_ignoreParcelablesAndRepeatInt = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+    static final int TRANSACTION_returnsLengthOfFooArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+    static final int TRANSACTION_newApi = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
+    static final int TRANSACTION_getInterfaceVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777214);
+    static final int TRANSACTION_getInterfaceHash = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777213);
+  }
+  public static final java.lang.String DESCRIPTOR = "android$aidl$versioned$tests$IFooInterface".replace('$', '.');
+  public void originalApi() throws android.os.RemoteException;
+  public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException;
+  public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException;
+  public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException;
+  public void newApi() throws android.os.RemoteException;
+  public int getInterfaceVersion() throws android.os.RemoteException;
+  public String getInterfaceHash() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d b/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d
new file mode 100644
index 0000000..b6dd541
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/IFooInterface.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/timestamp b/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-java-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp
new file mode 100644
index 0000000..03207cf
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp
@@ -0,0 +1,58 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/BazUnion.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+const char* BazUnion::descriptor = "android.aidl.versioned.tests.BazUnion";
+
+binder_status_t BazUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case intNum: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<intNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intNum>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case longNum: {
+    int64_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int64_t>) {
+      set<longNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<longNum>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t BazUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case intNum: return ::ndk::AParcel_writeData(_parcel, get<intNum>());
+  case longNum: return ::ndk::AParcel_writeData(_parcel, get<longNum>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
new file mode 100644
index 0000000..827a692
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp
new file mode 100644
index 0000000..0cce783
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp
@@ -0,0 +1,55 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/Foo.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+const char* Foo::descriptor = "android.aidl.versioned.tests.Foo";
+
+binder_status_t Foo::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intDefault42);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t Foo::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intDefault42);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d
new file mode 100644
index 0000000..c4f0bfb
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
new file mode 100644
index 0000000..aafb98e
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
@@ -0,0 +1,545 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/versioned/tests/BnFooInterface.h>
+#include <aidl/android/aidl/versioned/tests/BpFooInterface.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+static binder_status_t _aidl_android_aidl_versioned_tests_IFooInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnFooInterface> _aidl_impl = std::static_pointer_cast<BnFooInterface>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*originalApi*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->originalApi();
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*acceptUnionAndReturnString*/): {
+      ::aidl::android::aidl::versioned::tests::BazUnion in_u;
+      std::string _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_u);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->acceptUnionAndReturnString(in_u, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*ignoreParcelablesAndRepeatInt*/): {
+      ::aidl::android::aidl::versioned::tests::Foo in_inFoo;
+      ::aidl::android::aidl::versioned::tests::Foo in_inoutFoo;
+      ::aidl::android::aidl::versioned::tests::Foo out_outFoo;
+      int32_t in_value;
+      int32_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_inFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_inoutFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_value);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ignoreParcelablesAndRepeatInt(in_inFoo, &in_inoutFoo, &out_outFoo, in_value, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_inoutFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_outFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 3 /*returnsLengthOfFooArray*/): {
+      std::vector<::aidl::android::aidl::versioned::tests::Foo> in_foos;
+      int32_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_foos);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->returnsLengthOfFooArray(in_foos, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 4 /*newApi*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->newApi();
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): {
+      int32_t _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): {
+      std::string _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_versioned_tests_IFooInterface_clazz = ::ndk::ICInterface::defineClass(IFooInterface::descriptor, _aidl_android_aidl_versioned_tests_IFooInterface_onTransact);
+
+BpFooInterface::BpFooInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpFooInterface::~BpFooInterface() {}
+
+::ndk::ScopedAStatus BpFooInterface::originalApi() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*originalApi*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->originalApi();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_u);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*acceptUnionAndReturnString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->acceptUnionAndReturnString(in_u, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_inFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_inoutFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_value);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*ignoreParcelablesAndRepeatInt*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->ignoreParcelablesAndRepeatInt(in_inFoo, in_inoutFoo, out_outFoo, in_value, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_inoutFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_outFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_foos);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 3 /*returnsLengthOfFooArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->returnsLengthOfFooArray(in_foos, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::newApi() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 4 /*newApi*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->newApi();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::getInterfaceVersion(int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  if (_aidl_cached_version != -1) {
+    *_aidl_return = _aidl_cached_version;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->getInterfaceVersion(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_version = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::getInterfaceHash(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex);
+  if (_aidl_cached_hash != "-1") {
+    *_aidl_return = _aidl_cached_hash;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->getInterfaceHash(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_hash = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnFooInterface
+BnFooInterface::BnFooInterface() {}
+BnFooInterface::~BnFooInterface() {}
+::ndk::SpAIBinder BnFooInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_versioned_tests_IFooInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+::ndk::ScopedAStatus BnFooInterface::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = IFooInterface::version;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus BnFooInterface::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = IFooInterface::hash;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+// Source for IFooInterface
+const char* IFooInterface::descriptor = "android.aidl.versioned.tests.IFooInterface";
+IFooInterface::IFooInterface() {}
+IFooInterface::~IFooInterface() {}
+
+
+std::shared_ptr<IFooInterface> IFooInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_versioned_tests_IFooInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpFooInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IFooInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpFooInterface>(binder);
+}
+
+binder_status_t IFooInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<IFooInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t IFooInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<IFooInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IFooInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool IFooInterface::setDefaultImpl(const std::shared_ptr<IFooInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IFooInterface::default_impl);
+  if (impl) {
+    IFooInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<IFooInterface>& IFooInterface::getDefaultImpl() {
+  return IFooInterface::default_impl;
+}
+std::shared_ptr<IFooInterface> IFooInterface::default_impl = nullptr;
+::ndk::ScopedAStatus IFooInterfaceDefault::originalApi() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& /*in_u*/, std::string* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& /*in_inFoo*/, ::aidl::android::aidl::versioned::tests::Foo* /*in_inoutFoo*/, ::aidl::android::aidl::versioned::tests::Foo* /*out_outFoo*/, int32_t /*in_value*/, int32_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& /*in_foos*/, int32_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::newApi() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = 0;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = "";
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::SpAIBinder IFooInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool IFooInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
new file mode 100644
index 0000000..73bd3a8
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h
new file mode 100644
index 0000000..5d52d70
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h
@@ -0,0 +1,165 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BazUnion {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Tag : int32_t {
+    intNum = 0,
+    longNum = 1,
+  };
+
+  // Expose tag symbols for legacy code
+  static const inline Tag intNum = Tag::intNum;
+  static const inline Tag longNum = Tag::longNum;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, BazUnion>;
+
+  BazUnion() : _value(std::in_place_index<static_cast<size_t>(intNum)>, int32_t(0)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr BazUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit BazUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static BazUnion make(_Tp&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static BazUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  binder_status_t readFromParcel(const AParcel* _parcel);
+  binder_status_t writeToParcel(AParcel* _parcel) const;
+
+  inline bool operator!=(const BazUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const BazUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const BazUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const BazUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const BazUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const BazUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "BazUnion{";
+    switch (getTag()) {
+    case intNum: os << "intNum: " << ::android::internal::ToString(get<intNum>()); break;
+    case longNum: os << "longNum: " << ::android::internal::ToString(get<longNum>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t, int64_t> _value;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+[[nodiscard]] static inline std::string toString(BazUnion::Tag val) {
+  switch(val) {
+  case BazUnion::Tag::intNum:
+    return "intNum";
+  case BazUnion::Tag::longNum:
+    return "longNum";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::versioned::tests::BazUnion::Tag, 2> enum_values<aidl::android::aidl::versioned::tests::BazUnion::Tag> = {
+  aidl::android::aidl::versioned::tests::BazUnion::Tag::intNum,
+  aidl::android::aidl::versioned::tests::BazUnion::Tag::longNum,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h
new file mode 100644
index 0000000..478933b
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h
new file mode 100644
index 0000000..940ba87
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h
new file mode 100644
index 0000000..fcc70c8
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h
@@ -0,0 +1,69 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BnFooInterface : public ::ndk::BnCInterface<IFooInterface> {
+public:
+  BnFooInterface();
+  virtual ~BnFooInterface();
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) final;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) final;
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class IFooInterfaceDelegator : public BnFooInterface {
+public:
+  explicit IFooInterfaceDelegator(const std::shared_ptr<IFooInterface> &impl) : _impl(impl) {
+     int32_t _impl_ver = 0;
+     if (!impl->getInterfaceVersion(&_impl_ver).isOk()) {;
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Delegator failed to get version of the implementation.");
+     }
+     if (_impl_ver != IFooInterface::version) {
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Mismatched versions of delegator and implementation is not allowed.");
+     }
+  }
+
+  ::ndk::ScopedAStatus originalApi() override {
+    return _impl->originalApi();
+  }
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override {
+    return _impl->acceptUnionAndReturnString(in_u, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override {
+    return _impl->ignoreParcelablesAndRepeatInt(in_inFoo, in_inoutFoo, out_outFoo, in_value, _aidl_return);
+  }
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override {
+    return _impl->returnsLengthOfFooArray(in_foos, _aidl_return);
+  }
+  ::ndk::ScopedAStatus newApi() override {
+    return _impl->newApi();
+  }
+protected:
+private:
+  std::shared_ptr<IFooInterface> _impl;
+};
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h
new file mode 100644
index 0000000..c0d906f
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h
new file mode 100644
index 0000000..bbbfe53
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h
new file mode 100644
index 0000000..80cfee6
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h
@@ -0,0 +1,36 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BpFooInterface : public ::ndk::BpCInterface<IFooInterface> {
+public:
+  explicit BpFooInterface(const ::ndk::SpAIBinder& binder);
+  virtual ~BpFooInterface();
+
+  ::ndk::ScopedAStatus originalApi() override;
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus newApi() override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  int32_t _aidl_cached_version = -1;
+  std::string _aidl_cached_hash = "-1";
+  std::mutex _aidl_cached_hash_mutex;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h
new file mode 100644
index 0000000..2fc3c6b
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h
@@ -0,0 +1,66 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class Foo {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t intDefault42 = 42;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const Foo& rhs) const {
+    return std::tie(intDefault42) != std::tie(rhs.intDefault42);
+  }
+  inline bool operator<(const Foo& rhs) const {
+    return std::tie(intDefault42) < std::tie(rhs.intDefault42);
+  }
+  inline bool operator<=(const Foo& rhs) const {
+    return std::tie(intDefault42) <= std::tie(rhs.intDefault42);
+  }
+  inline bool operator==(const Foo& rhs) const {
+    return std::tie(intDefault42) == std::tie(rhs.intDefault42);
+  }
+  inline bool operator>(const Foo& rhs) const {
+    return std::tie(intDefault42) > std::tie(rhs.intDefault42);
+  }
+  inline bool operator>=(const Foo& rhs) const {
+    return std::tie(intDefault42) >= std::tie(rhs.intDefault42);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Foo{";
+    os << "intDefault42: " << ::android::internal::ToString(intDefault42);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h
new file mode 100644
index 0000000..2896675
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h
@@ -0,0 +1,75 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <aidl/android/aidl/versioned/tests/BazUnion.h>
+#include <aidl/android/aidl/versioned/tests/Foo.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::versioned::tests {
+class Foo;
+}  // namespace aidl::android::aidl::versioned::tests
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class IFooInterfaceDelegator;
+
+class IFooInterface : public ::ndk::ICInterface {
+public:
+  typedef IFooInterfaceDelegator DefaultDelegator;
+  static const char* descriptor;
+  IFooInterface();
+  virtual ~IFooInterface();
+
+  static inline const int32_t version = 2;
+  static inline const std::string hash = "da8c4bc94ca7feff0e0a65563a466787698b5891";
+  static constexpr uint32_t TRANSACTION_originalApi = FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_acceptUnionAndReturnString = FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_ignoreParcelablesAndRepeatInt = FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_returnsLengthOfFooArray = FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_newApi = FIRST_CALL_TRANSACTION + 4;
+
+  static std::shared_ptr<IFooInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IFooInterface>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IFooInterface>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<IFooInterface>& impl);
+  static const std::shared_ptr<IFooInterface>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus originalApi() = 0;
+  virtual ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus newApi() = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) = 0;
+private:
+  static std::shared_ptr<IFooInterface> default_impl;
+};
+class IFooInterfaceDefault : public IFooInterface {
+public:
+  ::ndk::ScopedAStatus originalApi() override;
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus newApi() override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/timestamp b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-ndk-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs b/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs
new file mode 100644
index 0000000..2af9086
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs
@@ -0,0 +1,67 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub enum r#BazUnion {
+  IntNum(i32),
+  LongNum(i64),
+}
+impl Default for r#BazUnion {
+  fn default() -> Self {
+    Self::IntNum(0)
+  }
+}
+impl binder::Parcelable for r#BazUnion {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    match self {
+      Self::IntNum(v) => {
+        parcel.write(&0i32)?;
+        parcel.write(v)
+      }
+      Self::LongNum(v) => {
+        parcel.write(&1i32)?;
+        parcel.write(v)
+      }
+    }
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    let tag: i32 = parcel.read()?;
+    match tag {
+      0 => {
+        let value: i32 = parcel.read()?;
+        *self = Self::IntNum(value);
+        Ok(())
+      }
+      1 => {
+        let value: i64 = parcel.read()?;
+        *self = Self::LongNum(value);
+        Ok(())
+      }
+      _ => {
+        Err(binder::StatusCode::BAD_VALUE)
+      }
+    }
+  }
+}
+binder::impl_serialize_for_parcelable!(r#BazUnion);
+binder::impl_deserialize_for_parcelable!(r#BazUnion);
+impl binder::binder_impl::ParcelableMetadata for r#BazUnion {
+  fn get_descriptor() -> &'static str { "android.aidl.versioned.tests.BazUnion" }
+}
+pub mod r#Tag {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#Tag : [i32; 2] {
+      r#intNum = 0,
+      r#longNum = 1,
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#BazUnion as _7_android_4_aidl_9_versioned_5_tests_8_BazUnion;
+ pub use super::r#Tag::r#Tag as _7_android_4_aidl_9_versioned_5_tests_8_BazUnion_3_Tag;
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d b/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d
new file mode 100644
index 0000000..507d2af
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/Foo.rs b/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/Foo.rs
new file mode 100644
index 0000000..d5fe918
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/Foo.rs
@@ -0,0 +1,41 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#Foo {
+  pub r#intDefault42: i32,
+}
+impl Default for r#Foo {
+  fn default() -> Self {
+    Self {
+      r#intDefault42: 42,
+    }
+  }
+}
+impl binder::Parcelable for r#Foo {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#intDefault42)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#intDefault42 = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#Foo);
+binder::impl_deserialize_for_parcelable!(r#Foo);
+impl binder::binder_impl::ParcelableMetadata for r#Foo {
+  fn get_descriptor() -> &'static str { "android.aidl.versioned.tests.Foo" }
+}
+pub(crate) mod mangled {
+ pub use super::r#Foo as _7_android_4_aidl_9_versioned_5_tests_3_Foo;
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d b/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d
new file mode 100644
index 0000000..96d8873
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/Foo.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs b/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs
new file mode 100644
index 0000000..6b7f8b4
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs
@@ -0,0 +1,493 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  IFooInterface["android.aidl.versioned.tests.IFooInterface"] {
+    native: BnFooInterface(on_transact),
+    proxy: BpFooInterface {
+      cached_version: std::sync::atomic::AtomicI32 = std::sync::atomic::AtomicI32::new(-1),
+      cached_hash: std::sync::Mutex<Option<String>> = std::sync::Mutex::new(None)
+    },
+    async: IFooInterfaceAsync,
+  }
+}
+pub trait IFooInterface: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  fn r#originalApi(&self) -> binder::Result<()>;
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String>;
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32>;
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32>;
+  fn r#newApi(&self) -> binder::Result<()>;
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    Ok(VERSION)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    Ok(HASH.into())
+  }
+  fn getDefaultImpl() -> IFooInterfaceDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: IFooInterfaceDefaultRef) -> IFooInterfaceDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait IFooInterfaceAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  fn r#originalApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#acceptUnionAndReturnString<'a>(&'a self, _arg_u: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::BoxFuture<'a, binder::Result<String>>;
+  fn r#ignoreParcelablesAndRepeatInt<'a>(&'a self, _arg_inFoo: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::BoxFuture<'a, binder::Result<i32>>;
+  fn r#returnsLengthOfFooArray<'a>(&'a self, _arg_foos: &'a [crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::BoxFuture<'a, binder::Result<i32>>;
+  fn r#newApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    Box::pin(async move { Ok(VERSION) })
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    Box::pin(async move { Ok(HASH.into()) })
+  }
+}
+#[::async_trait::async_trait]
+pub trait IFooInterfaceAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  async fn r#originalApi(&self) -> binder::Result<()>;
+  async fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String>;
+  async fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32>;
+  async fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32>;
+  async fn r#newApi(&self) -> binder::Result<()>;
+}
+impl BnFooInterface {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IFooInterface>
+  where
+    T: IFooInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> IFooInterface for Wrapper<T, R>
+    where
+      T: IFooInterfaceAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#originalApi(&self) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#originalApi())
+      }
+      fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+        self._rt.block_on(self._inner.r#acceptUnionAndReturnString(_arg_u))
+      }
+      fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+        self._rt.block_on(self._inner.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value))
+      }
+      fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+        self._rt.block_on(self._inner.r#returnsLengthOfFooArray(_arg_foos))
+      }
+      fn r#newApi(&self) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#newApi())
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait IFooInterfaceDefault: Send + Sync {
+  fn r#originalApi(&self) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#newApi(&self) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#originalApi: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  pub const r#acceptUnionAndReturnString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+  pub const r#ignoreParcelablesAndRepeatInt: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+  pub const r#returnsLengthOfFooArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 3;
+  pub const r#newApi: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 4;
+  pub const r#getInterfaceVersion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777214;
+  pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213;
+}
+pub type IFooInterfaceDefaultRef = Option<std::sync::Arc<dyn IFooInterfaceDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None);
+}
+pub const VERSION: i32 = 2;
+pub const HASH: &str = "da8c4bc94ca7feff0e0a65563a466787698b5891";
+impl BpFooInterface {
+  fn build_parcel_originalApi(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_originalApi(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#originalApi();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_u)?;
+    Ok(aidl_data)
+  }
+  fn read_response_acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#acceptUnionAndReturnString(_arg_u);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_inFoo)?;
+    aidl_data.write(_arg_inoutFoo)?;
+    aidl_data.write(&_arg_value)?;
+    Ok(aidl_data)
+  }
+  fn read_response_ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_inoutFoo)?;
+    _aidl_reply.read_onto(_arg_outFoo)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_foos)?;
+    Ok(aidl_data)
+  }
+  fn read_response_returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#returnsLengthOfFooArray(_arg_foos);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_newApi(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_newApi(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#newApi();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_getInterfaceVersion(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceVersion(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    self.cached_version.store(_aidl_return, std::sync::atomic::Ordering::Relaxed);
+    Ok(_aidl_return)
+  }
+  fn build_parcel_getInterfaceHash(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceHash(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    *self.cached_hash.lock().unwrap() = Some(_aidl_return.clone());
+    Ok(_aidl_return)
+  }
+}
+impl IFooInterface for BpFooInterface {
+  fn r#originalApi(&self) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_originalApi()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#originalApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_originalApi(_aidl_reply)
+  }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+    let _aidl_data = self.build_parcel_acceptUnionAndReturnString(_arg_u)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#acceptUnionAndReturnString, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_acceptUnionAndReturnString(_arg_u, _aidl_reply)
+  }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+    let _aidl_data = self.build_parcel_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ignoreParcelablesAndRepeatInt, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value, _aidl_reply)
+  }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+    let _aidl_data = self.build_parcel_returnsLengthOfFooArray(_arg_foos)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#returnsLengthOfFooArray, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_returnsLengthOfFooArray(_arg_foos, _aidl_reply)
+  }
+  fn r#newApi(&self) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_newApi()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#newApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_newApi(_aidl_reply)
+  }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Ok(_aidl_version); }
+    let _aidl_data = self.build_parcel_getInterfaceVersion()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceVersion(_aidl_reply)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Ok(_aidl_hash.clone());
+      }
+    }
+    let _aidl_data = self.build_parcel_getInterfaceHash()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceHash(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> IFooInterfaceAsync<P> for BpFooInterface {
+  fn r#originalApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_originalApi() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#originalApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_originalApi(_aidl_reply)
+      }
+    )
+  }
+  fn r#acceptUnionAndReturnString<'a>(&'a self, _arg_u: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::BoxFuture<'a, binder::Result<String>> {
+    let _aidl_data = match self.build_parcel_acceptUnionAndReturnString(_arg_u) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#acceptUnionAndReturnString, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_acceptUnionAndReturnString(_arg_u, _aidl_reply)
+      }
+    )
+  }
+  fn r#ignoreParcelablesAndRepeatInt<'a>(&'a self, _arg_inFoo: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_data = match self.build_parcel_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ignoreParcelablesAndRepeatInt, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value, _aidl_reply)
+      }
+    )
+  }
+  fn r#returnsLengthOfFooArray<'a>(&'a self, _arg_foos: &'a [crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_data = match self.build_parcel_returnsLengthOfFooArray(_arg_foos) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#returnsLengthOfFooArray, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_returnsLengthOfFooArray(_arg_foos, _aidl_reply)
+      }
+    )
+  }
+  fn r#newApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_newApi() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#newApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_newApi(_aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Box::pin(std::future::ready(Ok(_aidl_version))); }
+    let _aidl_data = match self.build_parcel_getInterfaceVersion() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceVersion(_aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Box::pin(std::future::ready(Ok(_aidl_hash.clone())));
+      }
+    }
+    let _aidl_data = match self.build_parcel_getInterfaceHash() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceHash(_aidl_reply)
+      }
+    )
+  }
+}
+impl IFooInterface for binder::binder_impl::Binder<BnFooInterface> {
+  fn r#originalApi(&self) -> binder::Result<()> { self.0.r#originalApi() }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> { self.0.r#acceptUnionAndReturnString(_arg_u) }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> { self.0.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value) }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> { self.0.r#returnsLengthOfFooArray(_arg_foos) }
+  fn r#newApi(&self) -> binder::Result<()> { self.0.r#newApi() }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> { self.0.r#getInterfaceVersion() }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> { self.0.r#getInterfaceHash() }
+}
+fn on_transact(_aidl_service: &dyn IFooInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#originalApi => {
+      let _aidl_return = _aidl_service.r#originalApi();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#acceptUnionAndReturnString => {
+      let _arg_u: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#acceptUnionAndReturnString(&_arg_u);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ignoreParcelablesAndRepeatInt => {
+      let _arg_inFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = _aidl_data.read()?;
+      let mut _arg_inoutFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = _aidl_data.read()?;
+      let mut _arg_outFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = Default::default();
+      let _arg_value: i32 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#ignoreParcelablesAndRepeatInt(&_arg_inFoo, &mut _arg_inoutFoo, &mut _arg_outFoo, _arg_value);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_inoutFoo)?;
+          _aidl_reply.write(&_arg_outFoo)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#returnsLengthOfFooArray => {
+      let _arg_foos: Vec<crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#returnsLengthOfFooArray(&_arg_foos);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#newApi => {
+      let _aidl_return = _aidl_service.r#newApi();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceVersion => {
+      let _aidl_return = _aidl_service.r#getInterfaceVersion();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceHash => {
+      let _aidl_return = _aidl_service.r#getInterfaceHash();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#IFooInterface as _7_android_4_aidl_9_versioned_5_tests_13_IFooInterface;
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d b/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d
new file mode 100644
index 0000000..d6407bd
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/timestamp b/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp
new file mode 100644
index 0000000..be86461
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp
@@ -0,0 +1,51 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#include <android/aidl/versioned/tests/BazUnion.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+::android::status_t BazUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case intNum: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<intNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intNum>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case longNum: {
+    int64_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt64(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int64_t>) {
+      set<longNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<longNum>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t BazUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case intNum: return _aidl_parcel->writeInt32(get<intNum>());
+  case longNum: return _aidl_parcel->writeInt64(get<longNum>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
new file mode 100644
index 0000000..45d9df0
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp
new file mode 100644
index 0000000..2b99d05
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp
@@ -0,0 +1,50 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#include <android/aidl/versioned/tests/Foo.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+::android::status_t Foo::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&intDefault42);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t Foo::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(intDefault42);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d
new file mode 100644
index 0000000..ab65cfc
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
new file mode 100644
index 0000000..27be6ea
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
@@ -0,0 +1,458 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#include <android/aidl/versioned/tests/IFooInterface.h>
+#include <android/aidl/versioned/tests/BpFooInterface.h>
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(FooInterface, "android.aidl.versioned.tests.IFooInterface")
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/versioned/tests/BpFooInterface.h>
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+
+BpFooInterface::BpFooInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IFooInterface>(_aidl_impl){
+}
+
+::android::binder::Status BpFooInterface::originalApi() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::originalApi::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_originalApi, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->originalApi();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::acceptUnionAndReturnString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(u);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_acceptUnionAndReturnString, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->acceptUnionAndReturnString(u, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8FromUtf16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::ignoreParcelablesAndRepeatInt::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(inFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(*inoutFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(value);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_ignoreParcelablesAndRepeatInt, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->ignoreParcelablesAndRepeatInt(inFoo, inoutFoo, outFoo, value, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(inoutFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(outFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::returnsLengthOfFooArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelableVector(foos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_returnsLengthOfFooArray, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->returnsLengthOfFooArray(foos, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::newApi() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::newApi::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_newApi, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->newApi();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+int32_t BpFooInterface::getInterfaceVersion() {
+  if (cached_version_ == -1) {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnFooInterface::TRANSACTION_getInterfaceVersion, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        cached_version_ = reply.readInt32();
+      }
+    }
+  }
+  return cached_version_;
+}
+
+
+std::string BpFooInterface::getInterfaceHash() {
+  std::lock_guard<std::mutex> lockGuard(cached_hash_mutex_);
+  if (cached_hash_ == "-1") {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnFooInterface::TRANSACTION_getInterfaceHash, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        reply.readUtf8FromUtf16(&cached_hash_);
+      }
+    }
+  }
+  return cached_hash_;
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+
+BnFooInterface::BnFooInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnFooInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnFooInterface::TRANSACTION_originalApi:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::originalApi::cppServer");
+    ::android::binder::Status _aidl_status(originalApi());
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_acceptUnionAndReturnString:
+  {
+    ::android::aidl::versioned::tests::BazUnion in_u;
+    ::std::string _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::acceptUnionAndReturnString::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_u);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(acceptUnionAndReturnString(in_u, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8AsUtf16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_ignoreParcelablesAndRepeatInt:
+  {
+    ::android::aidl::versioned::tests::Foo in_inFoo;
+    ::android::aidl::versioned::tests::Foo in_inoutFoo;
+    ::android::aidl::versioned::tests::Foo out_outFoo;
+    int32_t in_value;
+    int32_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::ignoreParcelablesAndRepeatInt::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_inFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readParcelable(&in_inoutFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readInt32(&in_value);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ignoreParcelablesAndRepeatInt(in_inFoo, &in_inoutFoo, &out_outFoo, in_value, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(in_inoutFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(out_outFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_returnsLengthOfFooArray:
+  {
+    ::std::vector<::android::aidl::versioned::tests::Foo> in_foos;
+    int32_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::returnsLengthOfFooArray::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelableVector(&in_foos);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(returnsLengthOfFooArray(in_foos, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_newApi:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::newApi::cppServer");
+    ::android::binder::Status _aidl_status(newApi());
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_getInterfaceVersion:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeInt32(IFooInterface::VERSION);
+  }
+  break;
+  case BnFooInterface::TRANSACTION_getInterfaceHash:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeUtf8AsUtf16(IFooInterface::HASH);
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+int32_t BnFooInterface::getInterfaceVersion() {
+  return IFooInterface::VERSION;
+}
+std::string BnFooInterface::getInterfaceHash() {
+  return IFooInterface::HASH;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
new file mode 100644
index 0000000..ef37bb7
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h
new file mode 100644
index 0000000..3087e6f
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h
@@ -0,0 +1,154 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BazUnion : public ::android::Parcelable {
+public:
+  enum class Tag : int32_t {
+    intNum = 0,
+    longNum = 1,
+  };
+  // Expose tag symbols for legacy code
+  static const inline Tag intNum = Tag::intNum;
+  static const inline Tag longNum = Tag::longNum;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, BazUnion>;
+
+  BazUnion() : _value(std::in_place_index<static_cast<size_t>(intNum)>, int32_t(0)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr BazUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit BazUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static BazUnion make(_Tp&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static BazUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  inline bool operator!=(const BazUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const BazUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const BazUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const BazUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const BazUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const BazUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.versioned.tests.BazUnion");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "BazUnion{";
+    switch (getTag()) {
+    case intNum: os << "intNum: " << ::android::internal::ToString(get<intNum>()); break;
+    case longNum: os << "longNum: " << ::android::internal::ToString(get<longNum>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t, int64_t> _value;
+};  // class BazUnion
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+[[nodiscard]] static inline std::string toString(BazUnion::Tag val) {
+  switch(val) {
+  case BazUnion::Tag::intNum:
+    return "intNum";
+  case BazUnion::Tag::longNum:
+    return "longNum";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::versioned::tests::BazUnion::Tag, 2> enum_values<::android::aidl::versioned::tests::BazUnion::Tag> = {
+  ::android::aidl::versioned::tests::BazUnion::Tag::intNum,
+  ::android::aidl::versioned::tests::BazUnion::Tag::longNum,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h
new file mode 100644
index 0000000..e2fc1f2
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h
new file mode 100644
index 0000000..78934bf
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h
new file mode 100644
index 0000000..892b163
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h
@@ -0,0 +1,66 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/versioned/tests/IFooInterface.h>
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BnFooInterface : public ::android::BnInterface<IFooInterface> {
+public:
+  static constexpr uint32_t TRANSACTION_originalApi = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_acceptUnionAndReturnString = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_ignoreParcelablesAndRepeatInt = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_returnsLengthOfFooArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_newApi = ::android::IBinder::FIRST_CALL_TRANSACTION + 4;
+  static constexpr uint32_t TRANSACTION_getInterfaceVersion = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777214;
+  static constexpr uint32_t TRANSACTION_getInterfaceHash = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777213;
+  explicit BnFooInterface();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  int32_t getInterfaceVersion();
+  std::string getInterfaceHash();
+};  // class BnFooInterface
+
+class IFooInterfaceDelegator : public BnFooInterface {
+public:
+  explicit IFooInterfaceDelegator(const ::android::sp<IFooInterface> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<IFooInterface> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status originalApi() override {
+    return _aidl_delegate->originalApi();
+  }
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) override {
+    return _aidl_delegate->acceptUnionAndReturnString(u, _aidl_return);
+  }
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) override {
+    return _aidl_delegate->ignoreParcelablesAndRepeatInt(inFoo, inoutFoo, outFoo, value, _aidl_return);
+  }
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) override {
+    return _aidl_delegate->returnsLengthOfFooArray(foos, _aidl_return);
+  }
+  ::android::binder::Status newApi() override {
+    return _aidl_delegate->newApi();
+  }
+  int32_t getInterfaceVersion() override {
+    int32_t _delegator_ver = BnFooInterface::getInterfaceVersion();
+    int32_t _impl_ver = _aidl_delegate->getInterfaceVersion();
+    return _delegator_ver < _impl_ver ? _delegator_ver : _impl_ver;
+  }
+  std::string getInterfaceHash() override {
+    return _aidl_delegate->getInterfaceHash();
+  }
+private:
+  ::android::sp<IFooInterface> _aidl_delegate;
+};  // class IFooInterfaceDelegator
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h
new file mode 100644
index 0000000..bd9c58b
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h
new file mode 100644
index 0000000..49fba3e
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h
new file mode 100644
index 0000000..20b29c6
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h
@@ -0,0 +1,35 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/versioned/tests/IFooInterface.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BpFooInterface : public ::android::BpInterface<IFooInterface> {
+public:
+  explicit BpFooInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpFooInterface() = default;
+  ::android::binder::Status originalApi() override;
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) override;
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) override;
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) override;
+  ::android::binder::Status newApi() override;
+  int32_t getInterfaceVersion() override;
+  std::string getInterfaceHash() override;
+private:
+  int32_t cached_version_ = -1;
+  std::string cached_hash_ = "-1";
+  std::mutex cached_hash_mutex_;
+};  // class BpFooInterface
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h
new file mode 100644
index 0000000..ab97ca9
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class Foo : public ::android::Parcelable {
+public:
+  int32_t intDefault42 = 42;
+  inline bool operator!=(const Foo& rhs) const {
+    return std::tie(intDefault42) != std::tie(rhs.intDefault42);
+  }
+  inline bool operator<(const Foo& rhs) const {
+    return std::tie(intDefault42) < std::tie(rhs.intDefault42);
+  }
+  inline bool operator<=(const Foo& rhs) const {
+    return std::tie(intDefault42) <= std::tie(rhs.intDefault42);
+  }
+  inline bool operator==(const Foo& rhs) const {
+    return std::tie(intDefault42) == std::tie(rhs.intDefault42);
+  }
+  inline bool operator>(const Foo& rhs) const {
+    return std::tie(intDefault42) > std::tie(rhs.intDefault42);
+  }
+  inline bool operator>=(const Foo& rhs) const {
+    return std::tie(intDefault42) >= std::tie(rhs.intDefault42);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.versioned.tests.Foo");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Foo{";
+    os << "intDefault42: " << ::android::internal::ToString(intDefault42);
+    os << "}";
+    return os.str();
+  }
+};  // class Foo
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h
new file mode 100644
index 0000000..aa5add2
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h
@@ -0,0 +1,73 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <android/aidl/versioned/tests/BazUnion.h>
+#include <android/aidl/versioned/tests/Foo.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cstdint>
+#include <string>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <vector>
+
+namespace android::aidl::versioned::tests {
+class Foo;
+}  // namespace android::aidl::versioned::tests
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class IFooInterfaceDelegator;
+
+class IFooInterface : public ::android::IInterface {
+public:
+  typedef IFooInterfaceDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(FooInterface)
+  static inline const int32_t VERSION = 3;
+  static inline const std::string HASH = "70d76c61eb0c82288e924862c10b910d1b7d8cf8";
+  virtual ::android::binder::Status originalApi() = 0;
+  virtual ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) = 0;
+  virtual ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) = 0;
+  virtual ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) = 0;
+  virtual ::android::binder::Status newApi() = 0;
+  virtual int32_t getInterfaceVersion() = 0;
+  virtual std::string getInterfaceHash() = 0;
+};  // class IFooInterface
+
+class IFooInterfaceDefault : public IFooInterface {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status originalApi() override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& /*u*/, ::std::string* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& /*inFoo*/, ::android::aidl::versioned::tests::Foo* /*inoutFoo*/, ::android::aidl::versioned::tests::Foo* /*outFoo*/, int32_t /*value*/, int32_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& /*foos*/, int32_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status newApi() override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  int32_t getInterfaceVersion() override {
+    return 0;
+  }
+  std::string getInterfaceHash() override {
+    return "";
+  }
+};  // class IFooInterfaceDefault
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/timestamp b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-cpp-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/BazUnion.java b/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/BazUnion.java
new file mode 100644
index 0000000..2420076
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/BazUnion.java
@@ -0,0 +1,135 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+package android.aidl.versioned.tests;
+public final class BazUnion implements android.os.Parcelable {
+  // tags for union fields
+  public final static int intNum = 0;  // int intNum;
+  public final static int longNum = 1;  // long longNum;
+
+  private int _tag;
+  private Object _value;
+
+  public BazUnion() {
+    int _value = 0;
+    this._tag = intNum;
+    this._value = _value;
+  }
+
+  private BazUnion(android.os.Parcel _aidl_parcel) {
+    readFromParcel(_aidl_parcel);
+  }
+
+  private BazUnion(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+
+  public int getTag() {
+    return _tag;
+  }
+
+  // int intNum;
+
+  public static BazUnion intNum(int _value) {
+    return new BazUnion(intNum, _value);
+  }
+
+  public int getIntNum() {
+    _assertTag(intNum);
+    return (int) _value;
+  }
+
+  public void setIntNum(int _value) {
+    _set(intNum, _value);
+  }
+
+  // long longNum;
+
+  public static BazUnion longNum(long _value) {
+    return new BazUnion(longNum, _value);
+  }
+
+  public long getLongNum() {
+    _assertTag(longNum);
+    return (long) _value;
+  }
+
+  public void setLongNum(long _value) {
+    _set(longNum, _value);
+  }
+
+  public static final android.os.Parcelable.Creator<BazUnion> CREATOR = new android.os.Parcelable.Creator<BazUnion>() {
+    @Override
+    public BazUnion createFromParcel(android.os.Parcel _aidl_source) {
+      return new BazUnion(_aidl_source);
+    }
+    @Override
+    public BazUnion[] newArray(int _aidl_size) {
+      return new BazUnion[_aidl_size];
+    }
+  };
+
+  @Override
+  public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+    _aidl_parcel.writeInt(_tag);
+    switch (_tag) {
+    case intNum:
+      _aidl_parcel.writeInt(getIntNum());
+      break;
+    case longNum:
+      _aidl_parcel.writeLong(getLongNum());
+      break;
+    }
+  }
+
+  public void readFromParcel(android.os.Parcel _aidl_parcel) {
+    int _aidl_tag;
+    _aidl_tag = _aidl_parcel.readInt();
+    switch (_aidl_tag) {
+    case intNum: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case longNum: {
+      long _aidl_value;
+      _aidl_value = _aidl_parcel.readLong();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    }
+    throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+  }
+
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    switch (getTag()) {
+    }
+    return _mask;
+  }
+
+  private void _assertTag(int tag) {
+    if (getTag() != tag) {
+      throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+    }
+  }
+
+  private String _tagString(int _tag) {
+    switch (_tag) {
+    case intNum: return "intNum";
+    case longNum: return "longNum";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+
+  private void _set(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+  public static @interface Tag {
+    public static final int intNum = 0;
+    public static final int longNum = 1;
+  }
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d b/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d
new file mode 100644
index 0000000..dd0c612
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/BazUnion.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/Foo.java b/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/Foo.java
new file mode 100644
index 0000000..721aa11
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/Foo.java
@@ -0,0 +1,52 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/Foo.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+package android.aidl.versioned.tests;
+@android.annotation.SuppressLint(value = {"NewApi"})
+public class Foo implements android.os.Parcelable
+{
+  public int intDefault42 = 42;
+  public static final android.os.Parcelable.Creator<Foo> CREATOR = new android.os.Parcelable.Creator<Foo>() {
+    @Override
+    public Foo createFromParcel(android.os.Parcel _aidl_source) {
+      Foo _aidl_out = new Foo();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public Foo[] newArray(int _aidl_size) {
+      return new Foo[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(intDefault42);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intDefault42 = _aidl_parcel.readInt();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/Foo.java.d b/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/Foo.java.d
new file mode 100644
index 0000000..b24806e
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/Foo.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/Foo.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/IFooInterface.java b/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/IFooInterface.java
new file mode 100644
index 0000000..b4568b7
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/IFooInterface.java
@@ -0,0 +1,366 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+package android.aidl.versioned.tests;
+public interface IFooInterface extends android.os.IInterface
+{
+  /**
+   * The version of this interface that the caller is built against.
+   * This might be different from what {@link #getInterfaceVersion()
+   * getInterfaceVersion} returns as that is the version of the interface
+   * that the remote object is implementing.
+   */
+  public static final int VERSION = 3;
+  public static final String HASH = "70d76c61eb0c82288e924862c10b910d1b7d8cf8";
+  /** Default implementation for IFooInterface. */
+  public static class Default implements android.aidl.versioned.tests.IFooInterface
+  {
+    @Override public void originalApi() throws android.os.RemoteException
+    {
+    }
+    @Override public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public void newApi() throws android.os.RemoteException
+    {
+    }
+    @Override
+    public int getInterfaceVersion() {
+      return 0;
+    }
+    @Override
+    public String getInterfaceHash() {
+      return "";
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Delegator implementation for IFooInterface. */
+  public static class Delegator extends android.aidl.versioned.tests.IFooInterface.Stub
+  {
+    public Delegator(android.aidl.versioned.tests.IFooInterface impl) {
+      this.mImpl = impl;
+    }
+    @Override
+    public String getInterfaceHash() throws android.os.RemoteException {
+      return mImpl.getInterfaceHash();
+    }
+    @Override
+    public int getInterfaceVersion() throws android.os.RemoteException {
+      int implVer = mImpl.getInterfaceVersion();
+      return VERSION < implVer ? VERSION : implVer;
+    }
+    @Override public void originalApi() throws android.os.RemoteException
+    {
+      mImpl.originalApi();
+    }
+    @Override public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException
+    {
+      return mImpl.acceptUnionAndReturnString(u);
+    }
+    @Override public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException
+    {
+      return mImpl.ignoreParcelablesAndRepeatInt(inFoo,inoutFoo,outFoo,value);
+    }
+    @Override public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException
+    {
+      return mImpl.returnsLengthOfFooArray(foos);
+    }
+    @Override public void newApi() throws android.os.RemoteException
+    {
+      mImpl.newApi();
+    }
+    android.aidl.versioned.tests.IFooInterface mImpl;
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.versioned.tests.IFooInterface
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.versioned.tests.IFooInterface interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.versioned.tests.IFooInterface asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.versioned.tests.IFooInterface))) {
+        return ((android.aidl.versioned.tests.IFooInterface)iin);
+      }
+      return new android.aidl.versioned.tests.IFooInterface.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceVersion) {
+        reply.writeNoException();
+        reply.writeInt(getInterfaceVersion());
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceHash) {
+        reply.writeNoException();
+        reply.writeString(getInterfaceHash());
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_originalApi:
+        {
+          this.originalApi();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_acceptUnionAndReturnString:
+        {
+          android.aidl.versioned.tests.BazUnion _arg0;
+          _arg0 = data.readTypedObject(android.aidl.versioned.tests.BazUnion.CREATOR);
+          data.enforceNoDataAvail();
+          java.lang.String _result = this.acceptUnionAndReturnString(_arg0);
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        case TRANSACTION_ignoreParcelablesAndRepeatInt:
+        {
+          android.aidl.versioned.tests.Foo _arg0;
+          _arg0 = data.readTypedObject(android.aidl.versioned.tests.Foo.CREATOR);
+          android.aidl.versioned.tests.Foo _arg1;
+          _arg1 = data.readTypedObject(android.aidl.versioned.tests.Foo.CREATOR);
+          android.aidl.versioned.tests.Foo _arg2;
+          _arg2 = new android.aidl.versioned.tests.Foo();
+          int _arg3;
+          _arg3 = data.readInt();
+          data.enforceNoDataAvail();
+          int _result = this.ignoreParcelablesAndRepeatInt(_arg0, _arg1, _arg2, _arg3);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          reply.writeTypedObject(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          reply.writeTypedObject(_arg2, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_returnsLengthOfFooArray:
+        {
+          android.aidl.versioned.tests.Foo[] _arg0;
+          _arg0 = data.createTypedArray(android.aidl.versioned.tests.Foo.CREATOR);
+          data.enforceNoDataAvail();
+          int _result = this.returnsLengthOfFooArray(_arg0);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          break;
+        }
+        case TRANSACTION_newApi:
+        {
+          this.newApi();
+          reply.writeNoException();
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.versioned.tests.IFooInterface
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      private int mCachedVersion = -1;
+      private String mCachedHash = "-1";
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public void originalApi() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_originalApi, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method originalApi is unimplemented.");
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(u, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_acceptUnionAndReturnString, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method acceptUnionAndReturnString is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(inFoo, 0);
+          _data.writeTypedObject(inoutFoo, 0);
+          _data.writeInt(value);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ignoreParcelablesAndRepeatInt, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method ignoreParcelablesAndRepeatInt is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+          if ((0!=_reply.readInt())) {
+            inoutFoo.readFromParcel(_reply);
+          }
+          if ((0!=_reply.readInt())) {
+            outFoo.readFromParcel(_reply);
+          }
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedArray(foos, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_returnsLengthOfFooArray, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method returnsLengthOfFooArray is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public void newApi() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_newApi, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method newApi is unimplemented.");
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override
+      public int getInterfaceVersion() throws android.os.RemoteException {
+        if (mCachedVersion == -1) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceVersion, data, reply, 0);
+            reply.readException();
+            mCachedVersion = reply.readInt();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedVersion;
+      }
+      @Override
+      public synchronized String getInterfaceHash() throws android.os.RemoteException {
+        if ("-1".equals(mCachedHash)) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceHash, data, reply, 0);
+            reply.readException();
+            mCachedHash = reply.readString();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedHash;
+      }
+    }
+    static final int TRANSACTION_originalApi = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    static final int TRANSACTION_acceptUnionAndReturnString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    static final int TRANSACTION_ignoreParcelablesAndRepeatInt = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+    static final int TRANSACTION_returnsLengthOfFooArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+    static final int TRANSACTION_newApi = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
+    static final int TRANSACTION_getInterfaceVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777214);
+    static final int TRANSACTION_getInterfaceHash = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777213);
+  }
+  public static final java.lang.String DESCRIPTOR = "android$aidl$versioned$tests$IFooInterface".replace('$', '.');
+  public void originalApi() throws android.os.RemoteException;
+  public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException;
+  public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException;
+  public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException;
+  public void newApi() throws android.os.RemoteException;
+  public int getInterfaceVersion() throws android.os.RemoteException;
+  public String getInterfaceHash() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d b/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d
new file mode 100644
index 0000000..e23927f
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/IFooInterface.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/timestamp b/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-java-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp
new file mode 100644
index 0000000..36af17f
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp
@@ -0,0 +1,58 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/BazUnion.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+const char* BazUnion::descriptor = "android.aidl.versioned.tests.BazUnion";
+
+binder_status_t BazUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case intNum: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<intNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intNum>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case longNum: {
+    int64_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int64_t>) {
+      set<longNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<longNum>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t BazUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case intNum: return ::ndk::AParcel_writeData(_parcel, get<intNum>());
+  case longNum: return ::ndk::AParcel_writeData(_parcel, get<longNum>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
new file mode 100644
index 0000000..1f76fcd
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp
new file mode 100644
index 0000000..5dd8104
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp
@@ -0,0 +1,55 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/Foo.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+const char* Foo::descriptor = "android.aidl.versioned.tests.Foo";
+
+binder_status_t Foo::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intDefault42);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t Foo::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intDefault42);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d
new file mode 100644
index 0000000..4804e39
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
new file mode 100644
index 0000000..ecc887e
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
@@ -0,0 +1,545 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/versioned/tests/BnFooInterface.h>
+#include <aidl/android/aidl/versioned/tests/BpFooInterface.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+static binder_status_t _aidl_android_aidl_versioned_tests_IFooInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnFooInterface> _aidl_impl = std::static_pointer_cast<BnFooInterface>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*originalApi*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->originalApi();
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*acceptUnionAndReturnString*/): {
+      ::aidl::android::aidl::versioned::tests::BazUnion in_u;
+      std::string _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_u);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->acceptUnionAndReturnString(in_u, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*ignoreParcelablesAndRepeatInt*/): {
+      ::aidl::android::aidl::versioned::tests::Foo in_inFoo;
+      ::aidl::android::aidl::versioned::tests::Foo in_inoutFoo;
+      ::aidl::android::aidl::versioned::tests::Foo out_outFoo;
+      int32_t in_value;
+      int32_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_inFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_inoutFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_value);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ignoreParcelablesAndRepeatInt(in_inFoo, &in_inoutFoo, &out_outFoo, in_value, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_inoutFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_outFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 3 /*returnsLengthOfFooArray*/): {
+      std::vector<::aidl::android::aidl::versioned::tests::Foo> in_foos;
+      int32_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_foos);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->returnsLengthOfFooArray(in_foos, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 4 /*newApi*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->newApi();
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): {
+      int32_t _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): {
+      std::string _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_versioned_tests_IFooInterface_clazz = ::ndk::ICInterface::defineClass(IFooInterface::descriptor, _aidl_android_aidl_versioned_tests_IFooInterface_onTransact);
+
+BpFooInterface::BpFooInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpFooInterface::~BpFooInterface() {}
+
+::ndk::ScopedAStatus BpFooInterface::originalApi() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*originalApi*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->originalApi();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_u);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*acceptUnionAndReturnString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->acceptUnionAndReturnString(in_u, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_inFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_inoutFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_value);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*ignoreParcelablesAndRepeatInt*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->ignoreParcelablesAndRepeatInt(in_inFoo, in_inoutFoo, out_outFoo, in_value, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_inoutFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_outFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_foos);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 3 /*returnsLengthOfFooArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->returnsLengthOfFooArray(in_foos, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::newApi() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 4 /*newApi*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->newApi();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::getInterfaceVersion(int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  if (_aidl_cached_version != -1) {
+    *_aidl_return = _aidl_cached_version;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->getInterfaceVersion(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_version = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::getInterfaceHash(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex);
+  if (_aidl_cached_hash != "-1") {
+    *_aidl_return = _aidl_cached_hash;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->getInterfaceHash(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_hash = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnFooInterface
+BnFooInterface::BnFooInterface() {}
+BnFooInterface::~BnFooInterface() {}
+::ndk::SpAIBinder BnFooInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_versioned_tests_IFooInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+::ndk::ScopedAStatus BnFooInterface::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = IFooInterface::version;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus BnFooInterface::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = IFooInterface::hash;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+// Source for IFooInterface
+const char* IFooInterface::descriptor = "android.aidl.versioned.tests.IFooInterface";
+IFooInterface::IFooInterface() {}
+IFooInterface::~IFooInterface() {}
+
+
+std::shared_ptr<IFooInterface> IFooInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_versioned_tests_IFooInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpFooInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IFooInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpFooInterface>(binder);
+}
+
+binder_status_t IFooInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<IFooInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t IFooInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<IFooInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IFooInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool IFooInterface::setDefaultImpl(const std::shared_ptr<IFooInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IFooInterface::default_impl);
+  if (impl) {
+    IFooInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<IFooInterface>& IFooInterface::getDefaultImpl() {
+  return IFooInterface::default_impl;
+}
+std::shared_ptr<IFooInterface> IFooInterface::default_impl = nullptr;
+::ndk::ScopedAStatus IFooInterfaceDefault::originalApi() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& /*in_u*/, std::string* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& /*in_inFoo*/, ::aidl::android::aidl::versioned::tests::Foo* /*in_inoutFoo*/, ::aidl::android::aidl::versioned::tests::Foo* /*out_outFoo*/, int32_t /*in_value*/, int32_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& /*in_foos*/, int32_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::newApi() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = 0;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = "";
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::SpAIBinder IFooInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool IFooInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
new file mode 100644
index 0000000..ef86f46
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h
new file mode 100644
index 0000000..9093489
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h
@@ -0,0 +1,165 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BazUnion {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Tag : int32_t {
+    intNum = 0,
+    longNum = 1,
+  };
+
+  // Expose tag symbols for legacy code
+  static const inline Tag intNum = Tag::intNum;
+  static const inline Tag longNum = Tag::longNum;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, BazUnion>;
+
+  BazUnion() : _value(std::in_place_index<static_cast<size_t>(intNum)>, int32_t(0)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr BazUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit BazUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static BazUnion make(_Tp&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static BazUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  binder_status_t readFromParcel(const AParcel* _parcel);
+  binder_status_t writeToParcel(AParcel* _parcel) const;
+
+  inline bool operator!=(const BazUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const BazUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const BazUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const BazUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const BazUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const BazUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "BazUnion{";
+    switch (getTag()) {
+    case intNum: os << "intNum: " << ::android::internal::ToString(get<intNum>()); break;
+    case longNum: os << "longNum: " << ::android::internal::ToString(get<longNum>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t, int64_t> _value;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+[[nodiscard]] static inline std::string toString(BazUnion::Tag val) {
+  switch(val) {
+  case BazUnion::Tag::intNum:
+    return "intNum";
+  case BazUnion::Tag::longNum:
+    return "longNum";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::versioned::tests::BazUnion::Tag, 2> enum_values<aidl::android::aidl::versioned::tests::BazUnion::Tag> = {
+  aidl::android::aidl::versioned::tests::BazUnion::Tag::intNum,
+  aidl::android::aidl::versioned::tests::BazUnion::Tag::longNum,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h
new file mode 100644
index 0000000..3bb5a11
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h
new file mode 100644
index 0000000..c6d06ac
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h
new file mode 100644
index 0000000..069e441
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h
@@ -0,0 +1,69 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BnFooInterface : public ::ndk::BnCInterface<IFooInterface> {
+public:
+  BnFooInterface();
+  virtual ~BnFooInterface();
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) final;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) final;
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class IFooInterfaceDelegator : public BnFooInterface {
+public:
+  explicit IFooInterfaceDelegator(const std::shared_ptr<IFooInterface> &impl) : _impl(impl) {
+     int32_t _impl_ver = 0;
+     if (!impl->getInterfaceVersion(&_impl_ver).isOk()) {;
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Delegator failed to get version of the implementation.");
+     }
+     if (_impl_ver != IFooInterface::version) {
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Mismatched versions of delegator and implementation is not allowed.");
+     }
+  }
+
+  ::ndk::ScopedAStatus originalApi() override {
+    return _impl->originalApi();
+  }
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override {
+    return _impl->acceptUnionAndReturnString(in_u, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override {
+    return _impl->ignoreParcelablesAndRepeatInt(in_inFoo, in_inoutFoo, out_outFoo, in_value, _aidl_return);
+  }
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override {
+    return _impl->returnsLengthOfFooArray(in_foos, _aidl_return);
+  }
+  ::ndk::ScopedAStatus newApi() override {
+    return _impl->newApi();
+  }
+protected:
+private:
+  std::shared_ptr<IFooInterface> _impl;
+};
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h
new file mode 100644
index 0000000..3e223c3
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h
new file mode 100644
index 0000000..f49a40a
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h
new file mode 100644
index 0000000..a3cfec1
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h
@@ -0,0 +1,36 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BpFooInterface : public ::ndk::BpCInterface<IFooInterface> {
+public:
+  explicit BpFooInterface(const ::ndk::SpAIBinder& binder);
+  virtual ~BpFooInterface();
+
+  ::ndk::ScopedAStatus originalApi() override;
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus newApi() override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  int32_t _aidl_cached_version = -1;
+  std::string _aidl_cached_hash = "-1";
+  std::mutex _aidl_cached_hash_mutex;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h
new file mode 100644
index 0000000..25ac236
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h
@@ -0,0 +1,66 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class Foo {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t intDefault42 = 42;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const Foo& rhs) const {
+    return std::tie(intDefault42) != std::tie(rhs.intDefault42);
+  }
+  inline bool operator<(const Foo& rhs) const {
+    return std::tie(intDefault42) < std::tie(rhs.intDefault42);
+  }
+  inline bool operator<=(const Foo& rhs) const {
+    return std::tie(intDefault42) <= std::tie(rhs.intDefault42);
+  }
+  inline bool operator==(const Foo& rhs) const {
+    return std::tie(intDefault42) == std::tie(rhs.intDefault42);
+  }
+  inline bool operator>(const Foo& rhs) const {
+    return std::tie(intDefault42) > std::tie(rhs.intDefault42);
+  }
+  inline bool operator>=(const Foo& rhs) const {
+    return std::tie(intDefault42) >= std::tie(rhs.intDefault42);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Foo{";
+    os << "intDefault42: " << ::android::internal::ToString(intDefault42);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h
new file mode 100644
index 0000000..a282516
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h
@@ -0,0 +1,75 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <aidl/android/aidl/versioned/tests/BazUnion.h>
+#include <aidl/android/aidl/versioned/tests/Foo.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::versioned::tests {
+class Foo;
+}  // namespace aidl::android::aidl::versioned::tests
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class IFooInterfaceDelegator;
+
+class IFooInterface : public ::ndk::ICInterface {
+public:
+  typedef IFooInterfaceDelegator DefaultDelegator;
+  static const char* descriptor;
+  IFooInterface();
+  virtual ~IFooInterface();
+
+  static inline const int32_t version = 3;
+  static inline const std::string hash = "70d76c61eb0c82288e924862c10b910d1b7d8cf8";
+  static constexpr uint32_t TRANSACTION_originalApi = FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_acceptUnionAndReturnString = FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_ignoreParcelablesAndRepeatInt = FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_returnsLengthOfFooArray = FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_newApi = FIRST_CALL_TRANSACTION + 4;
+
+  static std::shared_ptr<IFooInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IFooInterface>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IFooInterface>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<IFooInterface>& impl);
+  static const std::shared_ptr<IFooInterface>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus originalApi() = 0;
+  virtual ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus newApi() = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) = 0;
+private:
+  static std::shared_ptr<IFooInterface> default_impl;
+};
+class IFooInterfaceDefault : public IFooInterface {
+public:
+  ::ndk::ScopedAStatus originalApi() override;
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus newApi() override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/timestamp b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-ndk-source/gen/timestamp
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs b/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs
new file mode 100644
index 0000000..3cf76d9
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs
@@ -0,0 +1,67 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub enum r#BazUnion {
+  IntNum(i32),
+  LongNum(i64),
+}
+impl Default for r#BazUnion {
+  fn default() -> Self {
+    Self::IntNum(0)
+  }
+}
+impl binder::Parcelable for r#BazUnion {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    match self {
+      Self::IntNum(v) => {
+        parcel.write(&0i32)?;
+        parcel.write(v)
+      }
+      Self::LongNum(v) => {
+        parcel.write(&1i32)?;
+        parcel.write(v)
+      }
+    }
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    let tag: i32 = parcel.read()?;
+    match tag {
+      0 => {
+        let value: i32 = parcel.read()?;
+        *self = Self::IntNum(value);
+        Ok(())
+      }
+      1 => {
+        let value: i64 = parcel.read()?;
+        *self = Self::LongNum(value);
+        Ok(())
+      }
+      _ => {
+        Err(binder::StatusCode::BAD_VALUE)
+      }
+    }
+  }
+}
+binder::impl_serialize_for_parcelable!(r#BazUnion);
+binder::impl_deserialize_for_parcelable!(r#BazUnion);
+impl binder::binder_impl::ParcelableMetadata for r#BazUnion {
+  fn get_descriptor() -> &'static str { "android.aidl.versioned.tests.BazUnion" }
+}
+pub mod r#Tag {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#Tag : [i32; 2] {
+      r#intNum = 0,
+      r#longNum = 1,
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#BazUnion as _7_android_4_aidl_9_versioned_5_tests_8_BazUnion;
+ pub use super::r#Tag::r#Tag as _7_android_4_aidl_9_versioned_5_tests_8_BazUnion_3_Tag;
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d b/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d
new file mode 100644
index 0000000..8689dce
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/Foo.rs b/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/Foo.rs
new file mode 100644
index 0000000..7fc28b7
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/Foo.rs
@@ -0,0 +1,41 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#Foo {
+  pub r#intDefault42: i32,
+}
+impl Default for r#Foo {
+  fn default() -> Self {
+    Self {
+      r#intDefault42: 42,
+    }
+  }
+}
+impl binder::Parcelable for r#Foo {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#intDefault42)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#intDefault42 = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#Foo);
+binder::impl_deserialize_for_parcelable!(r#Foo);
+impl binder::binder_impl::ParcelableMetadata for r#Foo {
+  fn get_descriptor() -> &'static str { "android.aidl.versioned.tests.Foo" }
+}
+pub(crate) mod mangled {
+ pub use super::r#Foo as _7_android_4_aidl_9_versioned_5_tests_3_Foo;
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d b/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d
new file mode 100644
index 0000000..1146377
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/Foo.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs b/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs
new file mode 100644
index 0000000..7f7786e
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs
@@ -0,0 +1,493 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  IFooInterface["android.aidl.versioned.tests.IFooInterface"] {
+    native: BnFooInterface(on_transact),
+    proxy: BpFooInterface {
+      cached_version: std::sync::atomic::AtomicI32 = std::sync::atomic::AtomicI32::new(-1),
+      cached_hash: std::sync::Mutex<Option<String>> = std::sync::Mutex::new(None)
+    },
+    async: IFooInterfaceAsync,
+  }
+}
+pub trait IFooInterface: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  fn r#originalApi(&self) -> binder::Result<()>;
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String>;
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32>;
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32>;
+  fn r#newApi(&self) -> binder::Result<()>;
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    Ok(VERSION)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    Ok(HASH.into())
+  }
+  fn getDefaultImpl() -> IFooInterfaceDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: IFooInterfaceDefaultRef) -> IFooInterfaceDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait IFooInterfaceAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  fn r#originalApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#acceptUnionAndReturnString<'a>(&'a self, _arg_u: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::BoxFuture<'a, binder::Result<String>>;
+  fn r#ignoreParcelablesAndRepeatInt<'a>(&'a self, _arg_inFoo: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::BoxFuture<'a, binder::Result<i32>>;
+  fn r#returnsLengthOfFooArray<'a>(&'a self, _arg_foos: &'a [crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::BoxFuture<'a, binder::Result<i32>>;
+  fn r#newApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    Box::pin(async move { Ok(VERSION) })
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    Box::pin(async move { Ok(HASH.into()) })
+  }
+}
+#[::async_trait::async_trait]
+pub trait IFooInterfaceAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  async fn r#originalApi(&self) -> binder::Result<()>;
+  async fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String>;
+  async fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32>;
+  async fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32>;
+  async fn r#newApi(&self) -> binder::Result<()>;
+}
+impl BnFooInterface {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IFooInterface>
+  where
+    T: IFooInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> IFooInterface for Wrapper<T, R>
+    where
+      T: IFooInterfaceAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#originalApi(&self) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#originalApi())
+      }
+      fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+        self._rt.block_on(self._inner.r#acceptUnionAndReturnString(_arg_u))
+      }
+      fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+        self._rt.block_on(self._inner.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value))
+      }
+      fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+        self._rt.block_on(self._inner.r#returnsLengthOfFooArray(_arg_foos))
+      }
+      fn r#newApi(&self) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#newApi())
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait IFooInterfaceDefault: Send + Sync {
+  fn r#originalApi(&self) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#newApi(&self) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#originalApi: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  pub const r#acceptUnionAndReturnString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+  pub const r#ignoreParcelablesAndRepeatInt: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+  pub const r#returnsLengthOfFooArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 3;
+  pub const r#newApi: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 4;
+  pub const r#getInterfaceVersion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777214;
+  pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213;
+}
+pub type IFooInterfaceDefaultRef = Option<std::sync::Arc<dyn IFooInterfaceDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None);
+}
+pub const VERSION: i32 = 3;
+pub const HASH: &str = "70d76c61eb0c82288e924862c10b910d1b7d8cf8";
+impl BpFooInterface {
+  fn build_parcel_originalApi(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_originalApi(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#originalApi();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_u)?;
+    Ok(aidl_data)
+  }
+  fn read_response_acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#acceptUnionAndReturnString(_arg_u);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_inFoo)?;
+    aidl_data.write(_arg_inoutFoo)?;
+    aidl_data.write(&_arg_value)?;
+    Ok(aidl_data)
+  }
+  fn read_response_ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_inoutFoo)?;
+    _aidl_reply.read_onto(_arg_outFoo)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_foos)?;
+    Ok(aidl_data)
+  }
+  fn read_response_returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#returnsLengthOfFooArray(_arg_foos);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_newApi(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_newApi(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#newApi();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_getInterfaceVersion(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceVersion(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    self.cached_version.store(_aidl_return, std::sync::atomic::Ordering::Relaxed);
+    Ok(_aidl_return)
+  }
+  fn build_parcel_getInterfaceHash(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceHash(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    *self.cached_hash.lock().unwrap() = Some(_aidl_return.clone());
+    Ok(_aidl_return)
+  }
+}
+impl IFooInterface for BpFooInterface {
+  fn r#originalApi(&self) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_originalApi()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#originalApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_originalApi(_aidl_reply)
+  }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+    let _aidl_data = self.build_parcel_acceptUnionAndReturnString(_arg_u)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#acceptUnionAndReturnString, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_acceptUnionAndReturnString(_arg_u, _aidl_reply)
+  }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+    let _aidl_data = self.build_parcel_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ignoreParcelablesAndRepeatInt, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value, _aidl_reply)
+  }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+    let _aidl_data = self.build_parcel_returnsLengthOfFooArray(_arg_foos)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#returnsLengthOfFooArray, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_returnsLengthOfFooArray(_arg_foos, _aidl_reply)
+  }
+  fn r#newApi(&self) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_newApi()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#newApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_newApi(_aidl_reply)
+  }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Ok(_aidl_version); }
+    let _aidl_data = self.build_parcel_getInterfaceVersion()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceVersion(_aidl_reply)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Ok(_aidl_hash.clone());
+      }
+    }
+    let _aidl_data = self.build_parcel_getInterfaceHash()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceHash(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> IFooInterfaceAsync<P> for BpFooInterface {
+  fn r#originalApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_originalApi() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#originalApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_originalApi(_aidl_reply)
+      }
+    )
+  }
+  fn r#acceptUnionAndReturnString<'a>(&'a self, _arg_u: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::BoxFuture<'a, binder::Result<String>> {
+    let _aidl_data = match self.build_parcel_acceptUnionAndReturnString(_arg_u) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#acceptUnionAndReturnString, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_acceptUnionAndReturnString(_arg_u, _aidl_reply)
+      }
+    )
+  }
+  fn r#ignoreParcelablesAndRepeatInt<'a>(&'a self, _arg_inFoo: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_data = match self.build_parcel_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ignoreParcelablesAndRepeatInt, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value, _aidl_reply)
+      }
+    )
+  }
+  fn r#returnsLengthOfFooArray<'a>(&'a self, _arg_foos: &'a [crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_data = match self.build_parcel_returnsLengthOfFooArray(_arg_foos) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#returnsLengthOfFooArray, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_returnsLengthOfFooArray(_arg_foos, _aidl_reply)
+      }
+    )
+  }
+  fn r#newApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_newApi() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#newApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_newApi(_aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Box::pin(std::future::ready(Ok(_aidl_version))); }
+    let _aidl_data = match self.build_parcel_getInterfaceVersion() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceVersion(_aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Box::pin(std::future::ready(Ok(_aidl_hash.clone())));
+      }
+    }
+    let _aidl_data = match self.build_parcel_getInterfaceHash() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceHash(_aidl_reply)
+      }
+    )
+  }
+}
+impl IFooInterface for binder::binder_impl::Binder<BnFooInterface> {
+  fn r#originalApi(&self) -> binder::Result<()> { self.0.r#originalApi() }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> { self.0.r#acceptUnionAndReturnString(_arg_u) }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> { self.0.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value) }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> { self.0.r#returnsLengthOfFooArray(_arg_foos) }
+  fn r#newApi(&self) -> binder::Result<()> { self.0.r#newApi() }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> { self.0.r#getInterfaceVersion() }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> { self.0.r#getInterfaceHash() }
+}
+fn on_transact(_aidl_service: &dyn IFooInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#originalApi => {
+      let _aidl_return = _aidl_service.r#originalApi();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#acceptUnionAndReturnString => {
+      let _arg_u: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#acceptUnionAndReturnString(&_arg_u);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ignoreParcelablesAndRepeatInt => {
+      let _arg_inFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = _aidl_data.read()?;
+      let mut _arg_inoutFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = _aidl_data.read()?;
+      let mut _arg_outFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = Default::default();
+      let _arg_value: i32 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#ignoreParcelablesAndRepeatInt(&_arg_inFoo, &mut _arg_inoutFoo, &mut _arg_outFoo, _arg_value);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_inoutFoo)?;
+          _aidl_reply.write(&_arg_outFoo)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#returnsLengthOfFooArray => {
+      let _arg_foos: Vec<crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#returnsLengthOfFooArray(&_arg_foos);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#newApi => {
+      let _aidl_return = _aidl_service.r#newApi();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceVersion => {
+      let _aidl_return = _aidl_service.r#getInterfaceVersion();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceHash => {
+      let _aidl_return = _aidl_service.r#getInterfaceHash();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#IFooInterface as _7_android_4_aidl_9_versioned_5_tests_13_IFooInterface;
+}
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d b/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d
new file mode 100644
index 0000000..8d46fc6
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/timestamp b/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/timestamp
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Data.cpp b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Data.cpp
new file mode 100644
index 0000000..ced4029
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Data.cpp
@@ -0,0 +1,84 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Data.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+#include <android/aidl/loggable/Data.h>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+::android::status_t Data::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&num);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&str);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&nestedUnion);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(reinterpret_cast<int8_t *>(&nestedEnum));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t Data::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(num);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeUtf8AsUtf16(str);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(nestedUnion);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeByte(static_cast<int8_t>(nestedEnum));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Data.cpp.d b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Data.cpp.d
new file mode 100644
index 0000000..7397bf0
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Data.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Data.cpp : \
+  system/tools/aidl/tests/android/aidl/loggable/Data.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Enum.cpp b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Enum.cpp
new file mode 100644
index 0000000..8dd4fd4
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Enum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Enum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Enum.cpp.d b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Enum.cpp.d
new file mode 100644
index 0000000..56840c6
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Enum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Enum.cpp : \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/ILoggableInterface.cpp b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/ILoggableInterface.cpp
new file mode 100644
index 0000000..d41aa9f
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/ILoggableInterface.cpp
@@ -0,0 +1,663 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/ILoggableInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+#include <android/aidl/loggable/ILoggableInterface.h>
+#include <android/aidl/loggable/BpLoggableInterface.h>
+namespace android {
+namespace aidl {
+namespace loggable {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(LoggableInterface, "android.aidl.loggable.ILoggableInterface")
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/loggable/BpLoggableInterface.h>
+#include <android/aidl/loggable/BnLoggableInterface.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+
+BpLoggableInterface::BpLoggableInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<ILoggableInterface>(_aidl_impl){
+}
+
+std::function<void(const BpLoggableInterface::TransactionLog&)> BpLoggableInterface::logFunc;
+
+::android::binder::Status BpLoggableInterface::LogThis(bool boolValue, ::std::vector<bool>* boolArray, int8_t byteValue, ::std::vector<uint8_t>* byteArray, char16_t charValue, ::std::vector<char16_t>* charArray, int32_t intValue, ::std::vector<int32_t>* intArray, int64_t longValue, ::std::vector<int64_t>* longArray, float floatValue, ::std::vector<float>* floatArray, double doubleValue, ::std::vector<double>* doubleArray, const ::android::String16& stringValue, ::std::vector<::android::String16>* stringArray, ::std::vector<::android::String16>* listValue, const ::android::aidl::loggable::Data& dataValue, const ::android::sp<::android::IBinder>& binderValue, ::std::optional<::android::os::ParcelFileDescriptor>* pfdValue, ::std::vector<::android::os::ParcelFileDescriptor>* pfdArray, ::std::vector<::android::String16>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ILoggableInterface::LogThis::cppClient");
+  BpLoggableInterface::TransactionLog _transaction_log;
+  if (BpLoggableInterface::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("boolValue", ::android::internal::ToString(boolValue));
+    _transaction_log.input_args.emplace_back("boolArray", ::android::internal::ToString(*boolArray));
+    _transaction_log.input_args.emplace_back("byteValue", ::android::internal::ToString(byteValue));
+    _transaction_log.input_args.emplace_back("byteArray", ::android::internal::ToString(*byteArray));
+    _transaction_log.input_args.emplace_back("charValue", ::android::internal::ToString(charValue));
+    _transaction_log.input_args.emplace_back("charArray", ::android::internal::ToString(*charArray));
+    _transaction_log.input_args.emplace_back("intValue", ::android::internal::ToString(intValue));
+    _transaction_log.input_args.emplace_back("intArray", ::android::internal::ToString(*intArray));
+    _transaction_log.input_args.emplace_back("longValue", ::android::internal::ToString(longValue));
+    _transaction_log.input_args.emplace_back("longArray", ::android::internal::ToString(*longArray));
+    _transaction_log.input_args.emplace_back("floatValue", ::android::internal::ToString(floatValue));
+    _transaction_log.input_args.emplace_back("floatArray", ::android::internal::ToString(*floatArray));
+    _transaction_log.input_args.emplace_back("doubleValue", ::android::internal::ToString(doubleValue));
+    _transaction_log.input_args.emplace_back("doubleArray", ::android::internal::ToString(*doubleArray));
+    _transaction_log.input_args.emplace_back("stringValue", ::android::internal::ToString(stringValue));
+    _transaction_log.input_args.emplace_back("stringArray", ::android::internal::ToString(*stringArray));
+    _transaction_log.input_args.emplace_back("listValue", ::android::internal::ToString(*listValue));
+    _transaction_log.input_args.emplace_back("dataValue", ::android::internal::ToString(dataValue));
+    _transaction_log.input_args.emplace_back("binderValue", ::android::internal::ToString(binderValue));
+    _transaction_log.input_args.emplace_back("pfdValue", ::android::internal::ToString(*pfdValue));
+    _transaction_log.input_args.emplace_back("pfdArray", ::android::internal::ToString(*pfdArray));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeBool(boolValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeBoolVector(*boolArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(byteValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByteVector(*byteArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeChar(charValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeCharVector(*charArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(intValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32Vector(*intArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt64(longValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt64Vector(*longArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFloat(floatValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFloatVector(*floatArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeDouble(doubleValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeDoubleVector(*doubleArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16(stringValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(*stringArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(*listValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(dataValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(binderValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeNullableParcelable(*pfdValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelableVector(*pfdArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnLoggableInterface::TRANSACTION_LogThis, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ILoggableInterface::getDefaultImpl())) {
+     return ILoggableInterface::getDefaultImpl()->LogThis(boolValue, boolArray, byteValue, byteArray, charValue, charArray, intValue, intArray, longValue, longArray, floatValue, floatArray, doubleValue, doubleArray, stringValue, stringArray, listValue, dataValue, binderValue, pfdValue, pfdArray, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readBoolVector(boolArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readByteVector(byteArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readCharVector(charArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32Vector(intArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readInt64Vector(longArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFloatVector(floatArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readDoubleVector(doubleArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readString16Vector(stringArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readString16Vector(listValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(pfdValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelableVector(pfdArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpLoggableInterface::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.loggable.ILoggableInterface";
+    _transaction_log.method_name = "LogThis";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.output_args.emplace_back("boolArray", ::android::internal::ToString(*boolArray));
+    _transaction_log.output_args.emplace_back("byteArray", ::android::internal::ToString(*byteArray));
+    _transaction_log.output_args.emplace_back("charArray", ::android::internal::ToString(*charArray));
+    _transaction_log.output_args.emplace_back("intArray", ::android::internal::ToString(*intArray));
+    _transaction_log.output_args.emplace_back("longArray", ::android::internal::ToString(*longArray));
+    _transaction_log.output_args.emplace_back("floatArray", ::android::internal::ToString(*floatArray));
+    _transaction_log.output_args.emplace_back("doubleArray", ::android::internal::ToString(*doubleArray));
+    _transaction_log.output_args.emplace_back("stringArray", ::android::internal::ToString(*stringArray));
+    _transaction_log.output_args.emplace_back("listValue", ::android::internal::ToString(*listValue));
+    _transaction_log.output_args.emplace_back("pfdValue", ::android::internal::ToString(*pfdValue));
+    _transaction_log.output_args.emplace_back("pfdArray", ::android::internal::ToString(*pfdArray));
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpLoggableInterface::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/loggable/BnLoggableInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+
+BnLoggableInterface::BnLoggableInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnLoggableInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnLoggableInterface::TRANSACTION_LogThis:
+  {
+    bool in_boolValue;
+    ::std::vector<bool> in_boolArray;
+    int8_t in_byteValue;
+    ::std::vector<uint8_t> in_byteArray;
+    char16_t in_charValue;
+    ::std::vector<char16_t> in_charArray;
+    int32_t in_intValue;
+    ::std::vector<int32_t> in_intArray;
+    int64_t in_longValue;
+    ::std::vector<int64_t> in_longArray;
+    float in_floatValue;
+    ::std::vector<float> in_floatArray;
+    double in_doubleValue;
+    ::std::vector<double> in_doubleArray;
+    ::android::String16 in_stringValue;
+    ::std::vector<::android::String16> in_stringArray;
+    ::std::vector<::android::String16> in_listValue;
+    ::android::aidl::loggable::Data in_dataValue;
+    ::android::sp<::android::IBinder> in_binderValue;
+    ::std::optional<::android::os::ParcelFileDescriptor> in_pfdValue;
+    ::std::vector<::android::os::ParcelFileDescriptor> in_pfdArray;
+    ::std::vector<::android::String16> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ILoggableInterface::LogThis::cppServer");
+    _aidl_ret_status = _aidl_data.readBool(&in_boolValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readBoolVector(&in_boolArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readByte(&in_byteValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readByteVector(&in_byteArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readChar(&in_charValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readCharVector(&in_charArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readInt32(&in_intValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readInt32Vector(&in_intArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readInt64(&in_longValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readInt64Vector(&in_longArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readFloat(&in_floatValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readFloatVector(&in_floatArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readDouble(&in_doubleValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readDoubleVector(&in_doubleArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readString16(&in_stringValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_stringArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_listValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readParcelable(&in_dataValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readNullableStrongBinder(&in_binderValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readParcelable(&in_pfdValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readParcelableVector(&in_pfdArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnLoggableInterface::TransactionLog _transaction_log;
+    if (BnLoggableInterface::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_boolValue", ::android::internal::ToString(in_boolValue));
+      _transaction_log.input_args.emplace_back("in_boolArray", ::android::internal::ToString(in_boolArray));
+      _transaction_log.input_args.emplace_back("in_byteValue", ::android::internal::ToString(in_byteValue));
+      _transaction_log.input_args.emplace_back("in_byteArray", ::android::internal::ToString(in_byteArray));
+      _transaction_log.input_args.emplace_back("in_charValue", ::android::internal::ToString(in_charValue));
+      _transaction_log.input_args.emplace_back("in_charArray", ::android::internal::ToString(in_charArray));
+      _transaction_log.input_args.emplace_back("in_intValue", ::android::internal::ToString(in_intValue));
+      _transaction_log.input_args.emplace_back("in_intArray", ::android::internal::ToString(in_intArray));
+      _transaction_log.input_args.emplace_back("in_longValue", ::android::internal::ToString(in_longValue));
+      _transaction_log.input_args.emplace_back("in_longArray", ::android::internal::ToString(in_longArray));
+      _transaction_log.input_args.emplace_back("in_floatValue", ::android::internal::ToString(in_floatValue));
+      _transaction_log.input_args.emplace_back("in_floatArray", ::android::internal::ToString(in_floatArray));
+      _transaction_log.input_args.emplace_back("in_doubleValue", ::android::internal::ToString(in_doubleValue));
+      _transaction_log.input_args.emplace_back("in_doubleArray", ::android::internal::ToString(in_doubleArray));
+      _transaction_log.input_args.emplace_back("in_stringValue", ::android::internal::ToString(in_stringValue));
+      _transaction_log.input_args.emplace_back("in_stringArray", ::android::internal::ToString(in_stringArray));
+      _transaction_log.input_args.emplace_back("in_listValue", ::android::internal::ToString(in_listValue));
+      _transaction_log.input_args.emplace_back("in_dataValue", ::android::internal::ToString(in_dataValue));
+      _transaction_log.input_args.emplace_back("in_binderValue", ::android::internal::ToString(in_binderValue));
+      _transaction_log.input_args.emplace_back("in_pfdValue", ::android::internal::ToString(in_pfdValue));
+      _transaction_log.input_args.emplace_back("in_pfdArray", ::android::internal::ToString(in_pfdArray));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(LogThis(in_boolValue, &in_boolArray, in_byteValue, &in_byteArray, in_charValue, &in_charArray, in_intValue, &in_intArray, in_longValue, &in_longArray, in_floatValue, &in_floatArray, in_doubleValue, &in_doubleArray, in_stringValue, &in_stringArray, &in_listValue, in_dataValue, in_binderValue, &in_pfdValue, &in_pfdArray, &_aidl_return));
+    if (BnLoggableInterface::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.loggable.ILoggableInterface";
+      _transaction_log.method_name = "LogThis";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.output_args.emplace_back("in_boolArray", ::android::internal::ToString(in_boolArray));
+      _transaction_log.output_args.emplace_back("in_byteArray", ::android::internal::ToString(in_byteArray));
+      _transaction_log.output_args.emplace_back("in_charArray", ::android::internal::ToString(in_charArray));
+      _transaction_log.output_args.emplace_back("in_intArray", ::android::internal::ToString(in_intArray));
+      _transaction_log.output_args.emplace_back("in_longArray", ::android::internal::ToString(in_longArray));
+      _transaction_log.output_args.emplace_back("in_floatArray", ::android::internal::ToString(in_floatArray));
+      _transaction_log.output_args.emplace_back("in_doubleArray", ::android::internal::ToString(in_doubleArray));
+      _transaction_log.output_args.emplace_back("in_stringArray", ::android::internal::ToString(in_stringArray));
+      _transaction_log.output_args.emplace_back("in_listValue", ::android::internal::ToString(in_listValue));
+      _transaction_log.output_args.emplace_back("in_pfdValue", ::android::internal::ToString(in_pfdValue));
+      _transaction_log.output_args.emplace_back("in_pfdArray", ::android::internal::ToString(in_pfdArray));
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      BnLoggableInterface::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBoolVector(in_boolArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByteVector(in_byteArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeCharVector(in_charArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32Vector(in_intArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt64Vector(in_longArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFloatVector(in_floatArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeDoubleVector(in_doubleArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16Vector(in_stringArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16Vector(in_listValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeNullableParcelable(in_pfdValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelableVector(in_pfdArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+std::function<void(const BnLoggableInterface::TransactionLog&)> BnLoggableInterface::logFunc;
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/loggable/ILoggableInterface.h>
+#include <android/aidl/loggable/ILoggableInterface.h>
+namespace android {
+namespace aidl {
+namespace loggable {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ILoggableInterface, Sub, "android.aidl.loggable.ILoggableInterface.ISub")
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/loggable/ILoggableInterface.h>
+#include <android/aidl/loggable/ILoggableInterface.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+
+ILoggableInterface::BpSub::BpSub(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<ISub>(_aidl_impl){
+}
+
+std::function<void(const ILoggableInterface::BpSub::TransactionLog&)> ILoggableInterface::BpSub::logFunc;
+
+::android::binder::Status ILoggableInterface::BpSub::Log(int32_t value) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ISub::Log::cppClient");
+  ILoggableInterface::BpSub::TransactionLog _transaction_log;
+  if (ILoggableInterface::BpSub::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("value", ::android::internal::ToString(value));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(value);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ILoggableInterface::BnSub::TRANSACTION_Log, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ISub::getDefaultImpl())) {
+     return ISub::getDefaultImpl()->Log(value);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (ILoggableInterface::BpSub::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.loggable.ILoggableInterface.ISub";
+    _transaction_log.method_name = "Log";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    ILoggableInterface::BpSub::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/loggable/ILoggableInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+
+ILoggableInterface::BnSub::BnSub()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ILoggableInterface::BnSub::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnSub::TRANSACTION_Log:
+  {
+    int32_t in_value;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ISub::Log::cppServer");
+    _aidl_ret_status = _aidl_data.readInt32(&in_value);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    ILoggableInterface::BnSub::TransactionLog _transaction_log;
+    if (ILoggableInterface::BnSub::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_value", ::android::internal::ToString(in_value));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(Log(in_value));
+    if (ILoggableInterface::BnSub::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.loggable.ILoggableInterface.ISub";
+      _transaction_log.method_name = "Log";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      ILoggableInterface::BnSub::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+std::function<void(const ILoggableInterface::BnSub::TransactionLog&)> ILoggableInterface::BnSub::logFunc;
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/ILoggableInterface.cpp.d b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/ILoggableInterface.cpp.d
new file mode 100644
index 0000000..ac79ae8
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/ILoggableInterface.cpp.d
@@ -0,0 +1,5 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/ILoggableInterface.cpp : \
+  system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Data.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Union.cpp b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Union.cpp
new file mode 100644
index 0000000..416cbdc
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Union.cpp
@@ -0,0 +1,49 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+#include <android/aidl/loggable/Union.h>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+::android::status_t Union::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case num: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<num>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<num>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case str: {
+    ::std::string _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::std::string>) {
+      set<str>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<str>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t Union::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case num: return _aidl_parcel->writeInt32(get<num>());
+  case str: return _aidl_parcel->writeUtf8AsUtf16(get<str>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Union.cpp.d b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Union.cpp.d
new file mode 100644
index 0000000..b8cc8a5
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Union.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Union.cpp : \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnData.h b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnData.h
new file mode 100644
index 0000000..ad100b0
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnData.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Data.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnEnum.h b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnEnum.h
new file mode 100644
index 0000000..0dfbfb9
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Enum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnLoggableInterface.h b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnLoggableInterface.h
new file mode 100644
index 0000000..8aa6cce
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnLoggableInterface.h
@@ -0,0 +1,54 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/ILoggableInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/loggable/ILoggableInterface.h>
+#include <functional>
+#include <android/binder_to_string.h>
+#include <android/aidl/loggable/BnLoggableInterface.h>
+#include <android/aidl/loggable/ILoggableInterface.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace loggable {
+class BnLoggableInterface : public ::android::BnInterface<ILoggableInterface> {
+public:
+  static constexpr uint32_t TRANSACTION_LogThis = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  explicit BnLoggableInterface();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+};  // class BnLoggableInterface
+
+class ILoggableInterfaceDelegator : public BnLoggableInterface {
+public:
+  explicit ILoggableInterfaceDelegator(const ::android::sp<ILoggableInterface> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<ILoggableInterface> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status LogThis(bool boolValue, ::std::vector<bool>* boolArray, int8_t byteValue, ::std::vector<uint8_t>* byteArray, char16_t charValue, ::std::vector<char16_t>* charArray, int32_t intValue, ::std::vector<int32_t>* intArray, int64_t longValue, ::std::vector<int64_t>* longArray, float floatValue, ::std::vector<float>* floatArray, double doubleValue, ::std::vector<double>* doubleArray, const ::android::String16& stringValue, ::std::vector<::android::String16>* stringArray, ::std::vector<::android::String16>* listValue, const ::android::aidl::loggable::Data& dataValue, const ::android::sp<::android::IBinder>& binderValue, ::std::optional<::android::os::ParcelFileDescriptor>* pfdValue, ::std::vector<::android::os::ParcelFileDescriptor>* pfdArray, ::std::vector<::android::String16>* _aidl_return) override {
+    return _aidl_delegate->LogThis(boolValue, boolArray, byteValue, byteArray, charValue, charArray, intValue, intArray, longValue, longArray, floatValue, floatArray, doubleValue, doubleArray, stringValue, stringArray, listValue, dataValue, binderValue, pfdValue, pfdArray, _aidl_return);
+  }
+private:
+  ::android::sp<ILoggableInterface> _aidl_delegate;
+};  // class ILoggableInterfaceDelegator
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnUnion.h b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnUnion.h
new file mode 100644
index 0000000..08b0b5f
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpData.h b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpData.h
new file mode 100644
index 0000000..c9cdd22
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpData.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Data.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpEnum.h b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpEnum.h
new file mode 100644
index 0000000..135a2fc
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Enum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpLoggableInterface.h b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpLoggableInterface.h
new file mode 100644
index 0000000..6b8e370
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpLoggableInterface.h
@@ -0,0 +1,40 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/ILoggableInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/loggable/ILoggableInterface.h>
+#include <functional>
+#include <android/binder_to_string.h>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+class BpLoggableInterface : public ::android::BpInterface<ILoggableInterface> {
+public:
+  explicit BpLoggableInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpLoggableInterface() = default;
+  ::android::binder::Status LogThis(bool boolValue, ::std::vector<bool>* boolArray, int8_t byteValue, ::std::vector<uint8_t>* byteArray, char16_t charValue, ::std::vector<char16_t>* charArray, int32_t intValue, ::std::vector<int32_t>* intArray, int64_t longValue, ::std::vector<int64_t>* longArray, float floatValue, ::std::vector<float>* floatArray, double doubleValue, ::std::vector<double>* doubleArray, const ::android::String16& stringValue, ::std::vector<::android::String16>* stringArray, ::std::vector<::android::String16>* listValue, const ::android::aidl::loggable::Data& dataValue, const ::android::sp<::android::IBinder>& binderValue, ::std::optional<::android::os::ParcelFileDescriptor>* pfdValue, ::std::vector<::android::os::ParcelFileDescriptor>* pfdArray, ::std::vector<::android::String16>* _aidl_return) override;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+};  // class BpLoggableInterface
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpUnion.h b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpUnion.h
new file mode 100644
index 0000000..30144bf
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Data.h b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Data.h
new file mode 100644
index 0000000..08fb469
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Data.h
@@ -0,0 +1,64 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Data.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+#pragma once
+
+#include <android/aidl/loggable/Enum.h>
+#include <android/aidl/loggable/Union.h>
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <string>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+class Data : public ::android::Parcelable {
+public:
+  int32_t num = 0;
+  ::std::string str;
+  ::android::aidl::loggable::Union nestedUnion;
+  ::android::aidl::loggable::Enum nestedEnum = ::android::aidl::loggable::Enum::FOO;
+  inline bool operator!=(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) != std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator<(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) < std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator<=(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) <= std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator==(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) == std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator>(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) > std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator>=(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) >= std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.loggable.Data");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Data{";
+    os << "num: " << ::android::internal::ToString(num);
+    os << ", str: " << ::android::internal::ToString(str);
+    os << ", nestedUnion: " << ::android::internal::ToString(nestedUnion);
+    os << ", nestedEnum: " << ::android::internal::ToString(nestedEnum);
+    os << "}";
+    return os.str();
+  }
+};  // class Data
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Enum.h b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Enum.h
new file mode 100644
index 0000000..c9fbc1a
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Enum.h
@@ -0,0 +1,45 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Enum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <binder/Enums.h>
+#include <cstdint>
+#include <string>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+enum class Enum : int8_t {
+  FOO = 42,
+};
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace loggable {
+[[nodiscard]] static inline std::string toString(Enum val) {
+  switch(val) {
+  case Enum::FOO:
+    return "FOO";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::loggable::Enum, 1> enum_values<::android::aidl::loggable::Enum> = {
+  ::android::aidl::loggable::Enum::FOO,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/ILoggableInterface.h b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/ILoggableInterface.h
new file mode 100644
index 0000000..8c766f7
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/ILoggableInterface.h
@@ -0,0 +1,120 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/ILoggableInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+#pragma once
+
+#include <android/aidl/loggable/Data.h>
+#include <android/binder_to_string.h>
+#include <binder/Delegate.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/ParcelFileDescriptor.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cstdint>
+#include <functional>
+#include <optional>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <vector>
+
+namespace android::aidl::loggable {
+class Data;
+}  // namespace android::aidl::loggable
+namespace android {
+namespace aidl {
+namespace loggable {
+class ILoggableInterfaceDelegator;
+
+class ILoggableInterface : public ::android::IInterface {
+public:
+  typedef ILoggableInterfaceDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(LoggableInterface)
+  class ISubDelegator;
+
+  class ISub : public ::android::IInterface {
+  public:
+    typedef ISubDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(Sub)
+    virtual ::android::binder::Status Log(int32_t value) = 0;
+  };  // class ISub
+
+  class ISubDefault : public ISub {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+    ::android::binder::Status Log(int32_t /*value*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+  };  // class ISubDefault
+  class BpSub : public ::android::BpInterface<ISub> {
+  public:
+    explicit BpSub(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpSub() = default;
+    ::android::binder::Status Log(int32_t value) override;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  };  // class BpSub
+  class BnSub : public ::android::BnInterface<ISub> {
+  public:
+    static constexpr uint32_t TRANSACTION_Log = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+    explicit BnSub();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  };  // class BnSub
+
+  class ISubDelegator : public BnSub {
+  public:
+    explicit ISubDelegator(const ::android::sp<ISub> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<ISub> getImpl() { return _aidl_delegate; }
+    ::android::binder::Status Log(int32_t value) override {
+      return _aidl_delegate->Log(value);
+    }
+  private:
+    ::android::sp<ISub> _aidl_delegate;
+  };  // class ISubDelegator
+  virtual ::android::binder::Status LogThis(bool boolValue, ::std::vector<bool>* boolArray, int8_t byteValue, ::std::vector<uint8_t>* byteArray, char16_t charValue, ::std::vector<char16_t>* charArray, int32_t intValue, ::std::vector<int32_t>* intArray, int64_t longValue, ::std::vector<int64_t>* longArray, float floatValue, ::std::vector<float>* floatArray, double doubleValue, ::std::vector<double>* doubleArray, const ::android::String16& stringValue, ::std::vector<::android::String16>* stringArray, ::std::vector<::android::String16>* listValue, const ::android::aidl::loggable::Data& dataValue, const ::android::sp<::android::IBinder>& binderValue, ::std::optional<::android::os::ParcelFileDescriptor>* pfdValue, ::std::vector<::android::os::ParcelFileDescriptor>* pfdArray, ::std::vector<::android::String16>* _aidl_return) = 0;
+};  // class ILoggableInterface
+
+class ILoggableInterfaceDefault : public ILoggableInterface {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status LogThis(bool /*boolValue*/, ::std::vector<bool>* /*boolArray*/, int8_t /*byteValue*/, ::std::vector<uint8_t>* /*byteArray*/, char16_t /*charValue*/, ::std::vector<char16_t>* /*charArray*/, int32_t /*intValue*/, ::std::vector<int32_t>* /*intArray*/, int64_t /*longValue*/, ::std::vector<int64_t>* /*longArray*/, float /*floatValue*/, ::std::vector<float>* /*floatArray*/, double /*doubleValue*/, ::std::vector<double>* /*doubleArray*/, const ::android::String16& /*stringValue*/, ::std::vector<::android::String16>* /*stringArray*/, ::std::vector<::android::String16>* /*listValue*/, const ::android::aidl::loggable::Data& /*dataValue*/, const ::android::sp<::android::IBinder>& /*binderValue*/, ::std::optional<::android::os::ParcelFileDescriptor>* /*pfdValue*/, ::std::vector<::android::os::ParcelFileDescriptor>* /*pfdArray*/, ::std::vector<::android::String16>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+};  // class ILoggableInterfaceDefault
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Union.h b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Union.h
new file mode 100644
index 0000000..083c9f2
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Union.h
@@ -0,0 +1,150 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace loggable {
+class Union : public ::android::Parcelable {
+public:
+  enum class Tag : int32_t {
+    num = 0,
+    str = 1,
+  };
+  // Expose tag symbols for legacy code
+  static const inline Tag num = Tag::num;
+  static const inline Tag str = Tag::str;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, Union>;
+
+  Union() : _value(std::in_place_index<static_cast<size_t>(num)>, int32_t(43)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr Union(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit Union(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static Union make(_Tp&&... _args) {
+    return Union(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static Union make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return Union(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  inline bool operator!=(const Union& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const Union& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const Union& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const Union& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const Union& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const Union& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.loggable.Union");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Union{";
+    switch (getTag()) {
+    case num: os << "num: " << ::android::internal::ToString(get<num>()); break;
+    case str: os << "str: " << ::android::internal::ToString(get<str>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t, ::std::string> _value;
+};  // class Union
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace loggable {
+[[nodiscard]] static inline std::string toString(Union::Tag val) {
+  switch(val) {
+  case Union::Tag::num:
+    return "num";
+  case Union::Tag::str:
+    return "str";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::loggable::Union::Tag, 2> enum_values<::android::aidl::loggable::Union::Tag> = {
+  ::android::aidl::loggable::Union::Tag::num,
+  ::android::aidl::loggable::Union::Tag::str,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/timestamp b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-cpp-source/gen/timestamp
diff --git a/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Data.java b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Data.java
new file mode 100644
index 0000000..823be4d
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Data.java
@@ -0,0 +1,71 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Data.java.d -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+package android.aidl.loggable;
+public class Data implements android.os.Parcelable
+{
+  public int num = 0;
+  public java.lang.String str;
+  public android.aidl.loggable.Union nestedUnion;
+  public byte nestedEnum = android.aidl.loggable.Enum.FOO;
+  public static final android.os.Parcelable.Creator<Data> CREATOR = new android.os.Parcelable.Creator<Data>() {
+    @Override
+    public Data createFromParcel(android.os.Parcel _aidl_source) {
+      Data _aidl_out = new Data();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public Data[] newArray(int _aidl_size) {
+      return new Data[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(num);
+    _aidl_parcel.writeString(str);
+    _aidl_parcel.writeTypedObject(nestedUnion, _aidl_flag);
+    _aidl_parcel.writeByte(nestedEnum);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      num = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      str = _aidl_parcel.readString();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      nestedUnion = _aidl_parcel.readTypedObject(android.aidl.loggable.Union.CREATOR);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      nestedEnum = _aidl_parcel.readByte();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    _mask |= describeContents(nestedUnion);
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+}
diff --git a/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Data.java.d b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Data.java.d
new file mode 100644
index 0000000..61f3c1e
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Data.java.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Data.java : \
+  system/tools/aidl/tests/android/aidl/loggable/Data.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Enum.java b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Enum.java
new file mode 100644
index 0000000..8720f37
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Enum.java
@@ -0,0 +1,8 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Enum.java.d -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+package android.aidl.loggable;
+public @interface Enum {
+  public static final byte FOO = 42;
+}
diff --git a/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Enum.java.d b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Enum.java.d
new file mode 100644
index 0000000..0f2fb6f
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Enum.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Enum.java : \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/ILoggableInterface.java b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/ILoggableInterface.java
new file mode 100644
index 0000000..c716605
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/ILoggableInterface.java
@@ -0,0 +1,352 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/ILoggableInterface.java.d -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+package android.aidl.loggable;
+public interface ILoggableInterface extends android.os.IInterface
+{
+  /** Default implementation for ILoggableInterface. */
+  public static class Default implements android.aidl.loggable.ILoggableInterface
+  {
+    @Override public java.lang.String[] LogThis(boolean boolValue, boolean[] boolArray, byte byteValue, byte[] byteArray, char charValue, char[] charArray, int intValue, int[] intArray, long longValue, long[] longArray, float floatValue, float[] floatArray, double doubleValue, double[] doubleArray, java.lang.String stringValue, java.lang.String[] stringArray, java.util.List<java.lang.String> listValue, android.aidl.loggable.Data dataValue, android.os.IBinder binderValue, android.os.ParcelFileDescriptor pfdValue, android.os.ParcelFileDescriptor[] pfdArray) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.loggable.ILoggableInterface
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.loggable.ILoggableInterface interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.loggable.ILoggableInterface asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.loggable.ILoggableInterface))) {
+        return ((android.aidl.loggable.ILoggableInterface)iin);
+      }
+      return new android.aidl.loggable.ILoggableInterface.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_LogThis:
+        {
+          return "LogThis";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_LogThis:
+        {
+          boolean _arg0;
+          _arg0 = data.readBoolean();
+          boolean[] _arg1;
+          _arg1 = data.createBooleanArray();
+          byte _arg2;
+          _arg2 = data.readByte();
+          byte[] _arg3;
+          _arg3 = data.createByteArray();
+          char _arg4;
+          _arg4 = (char)data.readInt();
+          char[] _arg5;
+          _arg5 = data.createCharArray();
+          int _arg6;
+          _arg6 = data.readInt();
+          int[] _arg7;
+          _arg7 = data.createIntArray();
+          long _arg8;
+          _arg8 = data.readLong();
+          long[] _arg9;
+          _arg9 = data.createLongArray();
+          float _arg10;
+          _arg10 = data.readFloat();
+          float[] _arg11;
+          _arg11 = data.createFloatArray();
+          double _arg12;
+          _arg12 = data.readDouble();
+          double[] _arg13;
+          _arg13 = data.createDoubleArray();
+          java.lang.String _arg14;
+          _arg14 = data.readString();
+          java.lang.String[] _arg15;
+          _arg15 = data.createStringArray();
+          java.util.List<java.lang.String> _arg16;
+          _arg16 = data.createStringArrayList();
+          android.aidl.loggable.Data _arg17;
+          _arg17 = data.readTypedObject(android.aidl.loggable.Data.CREATOR);
+          android.os.IBinder _arg18;
+          _arg18 = data.readStrongBinder();
+          android.os.ParcelFileDescriptor _arg19;
+          _arg19 = data.readTypedObject(android.os.ParcelFileDescriptor.CREATOR);
+          android.os.ParcelFileDescriptor[] _arg20;
+          _arg20 = data.createTypedArray(android.os.ParcelFileDescriptor.CREATOR);
+          data.enforceNoDataAvail();
+          java.lang.String[] _result = this.LogThis(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, _arg18, _arg19, _arg20);
+          reply.writeNoException();
+          reply.writeStringArray(_result);
+          reply.writeBooleanArray(_arg1);
+          reply.writeByteArray(_arg3);
+          reply.writeCharArray(_arg5);
+          reply.writeIntArray(_arg7);
+          reply.writeLongArray(_arg9);
+          reply.writeFloatArray(_arg11);
+          reply.writeDoubleArray(_arg13);
+          reply.writeStringArray(_arg15);
+          reply.writeStringList(_arg16);
+          reply.writeTypedObject(_arg19, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          reply.writeTypedArray(_arg20, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.loggable.ILoggableInterface
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public java.lang.String[] LogThis(boolean boolValue, boolean[] boolArray, byte byteValue, byte[] byteArray, char charValue, char[] charArray, int intValue, int[] intArray, long longValue, long[] longArray, float floatValue, float[] floatArray, double doubleValue, double[] doubleArray, java.lang.String stringValue, java.lang.String[] stringArray, java.util.List<java.lang.String> listValue, android.aidl.loggable.Data dataValue, android.os.IBinder binderValue, android.os.ParcelFileDescriptor pfdValue, android.os.ParcelFileDescriptor[] pfdArray) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeBoolean(boolValue);
+          _data.writeBooleanArray(boolArray);
+          _data.writeByte(byteValue);
+          _data.writeByteArray(byteArray);
+          _data.writeInt(((int)charValue));
+          _data.writeCharArray(charArray);
+          _data.writeInt(intValue);
+          _data.writeIntArray(intArray);
+          _data.writeLong(longValue);
+          _data.writeLongArray(longArray);
+          _data.writeFloat(floatValue);
+          _data.writeFloatArray(floatArray);
+          _data.writeDouble(doubleValue);
+          _data.writeDoubleArray(doubleArray);
+          _data.writeString(stringValue);
+          _data.writeStringArray(stringArray);
+          _data.writeStringList(listValue);
+          _data.writeTypedObject(dataValue, 0);
+          _data.writeStrongBinder(binderValue);
+          _data.writeTypedObject(pfdValue, 0);
+          _data.writeTypedArray(pfdArray, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_LogThis, _data, _reply, 0);
+          _reply.readException();
+          _result = _reply.createStringArray();
+          _reply.readBooleanArray(boolArray);
+          _reply.readByteArray(byteArray);
+          _reply.readCharArray(charArray);
+          _reply.readIntArray(intArray);
+          _reply.readLongArray(longArray);
+          _reply.readFloatArray(floatArray);
+          _reply.readDoubleArray(doubleArray);
+          _reply.readStringArray(stringArray);
+          _reply.readStringList(listValue);
+          if ((0!=_reply.readInt())) {
+            pfdValue = android.os.ParcelFileDescriptor.CREATOR.createFromParcel(_reply);
+          }
+          _reply.readTypedArray(pfdArray, android.os.ParcelFileDescriptor.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+    }
+    static final int TRANSACTION_LogThis = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 0;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.loggable.ILoggableInterface";
+  public java.lang.String[] LogThis(boolean boolValue, boolean[] boolArray, byte byteValue, byte[] byteArray, char charValue, char[] charArray, int intValue, int[] intArray, long longValue, long[] longArray, float floatValue, float[] floatArray, double doubleValue, double[] doubleArray, java.lang.String stringValue, java.lang.String[] stringArray, java.util.List<java.lang.String> listValue, android.aidl.loggable.Data dataValue, android.os.IBinder binderValue, android.os.ParcelFileDescriptor pfdValue, android.os.ParcelFileDescriptor[] pfdArray) throws android.os.RemoteException;
+  public interface ISub extends android.os.IInterface
+  {
+    /** Default implementation for ISub. */
+    public static class Default implements android.aidl.loggable.ILoggableInterface.ISub
+    {
+      @Override public void Log(int value) throws android.os.RemoteException
+      {
+      }
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.loggable.ILoggableInterface.ISub
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.loggable.ILoggableInterface.ISub interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.loggable.ILoggableInterface.ISub asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.loggable.ILoggableInterface.ISub))) {
+          return ((android.aidl.loggable.ILoggableInterface.ISub)iin);
+        }
+        return new android.aidl.loggable.ILoggableInterface.ISub.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      /** @hide */
+      public static java.lang.String getDefaultTransactionName(int transactionCode)
+      {
+        switch (transactionCode)
+        {
+          case TRANSACTION_Log:
+          {
+            return "Log";
+          }
+          default:
+          {
+            return null;
+          }
+        }
+      }
+      /** @hide */
+      public java.lang.String getTransactionName(int transactionCode)
+      {
+        return this.getDefaultTransactionName(transactionCode);
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+          data.enforceInterface(descriptor);
+        }
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        switch (code)
+        {
+          case TRANSACTION_Log:
+          {
+            int _arg0;
+            _arg0 = data.readInt();
+            data.enforceNoDataAvail();
+            this.Log(_arg0);
+            reply.writeNoException();
+            break;
+          }
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+        return true;
+      }
+      private static class Proxy implements android.aidl.loggable.ILoggableInterface.ISub
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+        @Override public void Log(int value) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeInt(value);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_Log, _data, _reply, 0);
+            _reply.readException();
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+        }
+      }
+      static final int TRANSACTION_Log = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+      /** @hide */
+      public int getMaxTransactionId()
+      {
+        return 0;
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android.aidl.loggable.ILoggableInterface.ISub";
+    public void Log(int value) throws android.os.RemoteException;
+  }
+}
diff --git a/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/ILoggableInterface.java.d b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/ILoggableInterface.java.d
new file mode 100644
index 0000000..670f2c1
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/ILoggableInterface.java.d
@@ -0,0 +1,5 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/ILoggableInterface.java : \
+  system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Data.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Union.java b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Union.java
new file mode 100644
index 0000000..999c2c9
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Union.java
@@ -0,0 +1,135 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Union.java.d -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+package android.aidl.loggable;
+public final class Union implements android.os.Parcelable {
+  // tags for union fields
+  public final static int num = 0;  // int num;
+  public final static int str = 1;  // String str;
+
+  private int _tag;
+  private Object _value;
+
+  public Union() {
+    int _value = 43;
+    this._tag = num;
+    this._value = _value;
+  }
+
+  private Union(android.os.Parcel _aidl_parcel) {
+    readFromParcel(_aidl_parcel);
+  }
+
+  private Union(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+
+  public int getTag() {
+    return _tag;
+  }
+
+  // int num;
+
+  public static Union num(int _value) {
+    return new Union(num, _value);
+  }
+
+  public int getNum() {
+    _assertTag(num);
+    return (int) _value;
+  }
+
+  public void setNum(int _value) {
+    _set(num, _value);
+  }
+
+  // String str;
+
+  public static Union str(java.lang.String _value) {
+    return new Union(str, _value);
+  }
+
+  public java.lang.String getStr() {
+    _assertTag(str);
+    return (java.lang.String) _value;
+  }
+
+  public void setStr(java.lang.String _value) {
+    _set(str, _value);
+  }
+
+  public static final android.os.Parcelable.Creator<Union> CREATOR = new android.os.Parcelable.Creator<Union>() {
+    @Override
+    public Union createFromParcel(android.os.Parcel _aidl_source) {
+      return new Union(_aidl_source);
+    }
+    @Override
+    public Union[] newArray(int _aidl_size) {
+      return new Union[_aidl_size];
+    }
+  };
+
+  @Override
+  public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+    _aidl_parcel.writeInt(_tag);
+    switch (_tag) {
+    case num:
+      _aidl_parcel.writeInt(getNum());
+      break;
+    case str:
+      _aidl_parcel.writeString(getStr());
+      break;
+    }
+  }
+
+  public void readFromParcel(android.os.Parcel _aidl_parcel) {
+    int _aidl_tag;
+    _aidl_tag = _aidl_parcel.readInt();
+    switch (_aidl_tag) {
+    case num: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case str: {
+      java.lang.String _aidl_value;
+      _aidl_value = _aidl_parcel.readString();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    }
+    throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+  }
+
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    switch (getTag()) {
+    }
+    return _mask;
+  }
+
+  private void _assertTag(int tag) {
+    if (getTag() != tag) {
+      throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+    }
+  }
+
+  private String _tagString(int _tag) {
+    switch (_tag) {
+    case num: return "num";
+    case str: return "str";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+
+  private void _set(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+  public static @interface Tag {
+    public static final int num = 0;
+    public static final int str = 1;
+  }
+}
diff --git a/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Union.java.d b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Union.java.d
new file mode 100644
index 0000000..2059f00
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Union.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Union.java : \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-java-source/gen/timestamp b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-java-source/gen/timestamp
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Data.cpp b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Data.cpp
new file mode 100644
index 0000000..9236aa9
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Data.cpp
@@ -0,0 +1,83 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Data.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+#include "aidl/android/aidl/loggable/Data.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+const char* Data::descriptor = "android.aidl.loggable.Data";
+
+binder_status_t Data::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &num);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &str);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &nestedUnion);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &nestedEnum);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t Data::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, num);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, str);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, nestedUnion);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, nestedEnum);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Data.cpp.d b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Data.cpp.d
new file mode 100644
index 0000000..fbb8a7e
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Data.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Data.cpp : \
+  system/tools/aidl/tests/android/aidl/loggable/Data.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Enum.cpp b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Enum.cpp
new file mode 100644
index 0000000..2064dc0
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Enum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Enum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Enum.cpp.d b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Enum.cpp.d
new file mode 100644
index 0000000..2060e60
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Enum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Enum.cpp : \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/ILoggableInterface.cpp b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/ILoggableInterface.cpp
new file mode 100644
index 0000000..0207903
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/ILoggableInterface.cpp
@@ -0,0 +1,663 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/ILoggableInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+#include "aidl/android/aidl/loggable/ILoggableInterface.h"
+
+#include <android/binder_parcel_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/loggable/BnLoggableInterface.h>
+#include <aidl/android/aidl/loggable/BpLoggableInterface.h>
+
+namespace {
+struct ScopedTrace {
+  inline explicit ScopedTrace(const char* name) { ATrace_beginSection(name); }
+  inline ~ScopedTrace() { ATrace_endSection(); }
+};
+}  // namespace
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+static binder_status_t _aidl_android_aidl_loggable_ILoggableInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnLoggableInterface> _aidl_impl = std::static_pointer_cast<BnLoggableInterface>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*LogThis*/): {
+      bool in_boolValue;
+      std::vector<bool> in_boolArray;
+      int8_t in_byteValue;
+      std::vector<uint8_t> in_byteArray;
+      char16_t in_charValue;
+      std::vector<char16_t> in_charArray;
+      int32_t in_intValue;
+      std::vector<int32_t> in_intArray;
+      int64_t in_longValue;
+      std::vector<int64_t> in_longArray;
+      float in_floatValue;
+      std::vector<float> in_floatArray;
+      double in_doubleValue;
+      std::vector<double> in_doubleArray;
+      std::string in_stringValue;
+      std::vector<std::string> in_stringArray;
+      std::vector<std::string> in_listValue;
+      ::aidl::android::aidl::loggable::Data in_dataValue;
+      ::ndk::SpAIBinder in_binderValue;
+      ::ndk::ScopedFileDescriptor in_pfdValue;
+      std::vector<::ndk::ScopedFileDescriptor> in_pfdArray;
+      std::vector<std::string> _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ILoggableInterface::LogThis::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_boolValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_boolArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_byteValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_byteArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_charValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_charArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_intValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_intArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_longValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_longArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_floatValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_floatArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_doubleValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_doubleArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_stringValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_stringArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_listValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_dataValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_binderValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_pfdValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_pfdArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnLoggableInterface::TransactionLog _transaction_log;
+      if (BnLoggableInterface::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_boolValue", ::android::internal::ToString(in_boolValue));
+        _transaction_log.input_args.emplace_back("in_boolArray", ::android::internal::ToString(in_boolArray));
+        _transaction_log.input_args.emplace_back("in_byteValue", ::android::internal::ToString(in_byteValue));
+        _transaction_log.input_args.emplace_back("in_byteArray", ::android::internal::ToString(in_byteArray));
+        _transaction_log.input_args.emplace_back("in_charValue", ::android::internal::ToString(in_charValue));
+        _transaction_log.input_args.emplace_back("in_charArray", ::android::internal::ToString(in_charArray));
+        _transaction_log.input_args.emplace_back("in_intValue", ::android::internal::ToString(in_intValue));
+        _transaction_log.input_args.emplace_back("in_intArray", ::android::internal::ToString(in_intArray));
+        _transaction_log.input_args.emplace_back("in_longValue", ::android::internal::ToString(in_longValue));
+        _transaction_log.input_args.emplace_back("in_longArray", ::android::internal::ToString(in_longArray));
+        _transaction_log.input_args.emplace_back("in_floatValue", ::android::internal::ToString(in_floatValue));
+        _transaction_log.input_args.emplace_back("in_floatArray", ::android::internal::ToString(in_floatArray));
+        _transaction_log.input_args.emplace_back("in_doubleValue", ::android::internal::ToString(in_doubleValue));
+        _transaction_log.input_args.emplace_back("in_doubleArray", ::android::internal::ToString(in_doubleArray));
+        _transaction_log.input_args.emplace_back("in_stringValue", ::android::internal::ToString(in_stringValue));
+        _transaction_log.input_args.emplace_back("in_stringArray", ::android::internal::ToString(in_stringArray));
+        _transaction_log.input_args.emplace_back("in_listValue", ::android::internal::ToString(in_listValue));
+        _transaction_log.input_args.emplace_back("in_dataValue", ::android::internal::ToString(in_dataValue));
+        _transaction_log.input_args.emplace_back("in_binderValue", ::android::internal::ToString(in_binderValue));
+        _transaction_log.input_args.emplace_back("in_pfdValue", ::android::internal::ToString(in_pfdValue));
+        _transaction_log.input_args.emplace_back("in_pfdArray", ::android::internal::ToString(in_pfdArray));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->LogThis(in_boolValue, &in_boolArray, in_byteValue, &in_byteArray, in_charValue, &in_charArray, in_intValue, &in_intArray, in_longValue, &in_longArray, in_floatValue, &in_floatArray, in_doubleValue, &in_doubleArray, in_stringValue, &in_stringArray, &in_listValue, in_dataValue, in_binderValue, &in_pfdValue, &in_pfdArray, &_aidl_return);
+      if (BnLoggableInterface::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.loggable.ILoggableInterface";
+        _transaction_log.method_name = "LogThis";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.output_args.emplace_back("in_boolArray", ::android::internal::ToString(in_boolArray));
+        _transaction_log.output_args.emplace_back("in_byteArray", ::android::internal::ToString(in_byteArray));
+        _transaction_log.output_args.emplace_back("in_charArray", ::android::internal::ToString(in_charArray));
+        _transaction_log.output_args.emplace_back("in_intArray", ::android::internal::ToString(in_intArray));
+        _transaction_log.output_args.emplace_back("in_longArray", ::android::internal::ToString(in_longArray));
+        _transaction_log.output_args.emplace_back("in_floatArray", ::android::internal::ToString(in_floatArray));
+        _transaction_log.output_args.emplace_back("in_doubleArray", ::android::internal::ToString(in_doubleArray));
+        _transaction_log.output_args.emplace_back("in_stringArray", ::android::internal::ToString(in_stringArray));
+        _transaction_log.output_args.emplace_back("in_listValue", ::android::internal::ToString(in_listValue));
+        _transaction_log.output_args.emplace_back("in_pfdValue", ::android::internal::ToString(in_pfdValue));
+        _transaction_log.output_args.emplace_back("in_pfdArray", ::android::internal::ToString(in_pfdArray));
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnLoggableInterface::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_boolArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_byteArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_charArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_intArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_longArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_floatArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_doubleArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_stringArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_listValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, in_pfdValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_pfdArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_loggable_ILoggableInterface_clazz = ::ndk::ICInterface::defineClass(ILoggableInterface::descriptor, _aidl_android_aidl_loggable_ILoggableInterface_onTransact);
+
+BpLoggableInterface::BpLoggableInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpLoggableInterface::~BpLoggableInterface() {}
+std::function<void(const BpLoggableInterface::TransactionLog&)> BpLoggableInterface::logFunc;
+
+::ndk::ScopedAStatus BpLoggableInterface::LogThis(bool in_boolValue, std::vector<bool>* in_boolArray, int8_t in_byteValue, std::vector<uint8_t>* in_byteArray, char16_t in_charValue, std::vector<char16_t>* in_charArray, int32_t in_intValue, std::vector<int32_t>* in_intArray, int64_t in_longValue, std::vector<int64_t>* in_longArray, float in_floatValue, std::vector<float>* in_floatArray, double in_doubleValue, std::vector<double>* in_doubleArray, const std::string& in_stringValue, std::vector<std::string>* in_stringArray, std::vector<std::string>* in_listValue, const ::aidl::android::aidl::loggable::Data& in_dataValue, const ::ndk::SpAIBinder& in_binderValue, ::ndk::ScopedFileDescriptor* in_pfdValue, std::vector<::ndk::ScopedFileDescriptor>* in_pfdArray, std::vector<std::string>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpLoggableInterface::TransactionLog _transaction_log;
+  if (BpLoggableInterface::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_boolValue", ::android::internal::ToString(in_boolValue));
+    _transaction_log.input_args.emplace_back("in_boolArray", ::android::internal::ToString(*in_boolArray));
+    _transaction_log.input_args.emplace_back("in_byteValue", ::android::internal::ToString(in_byteValue));
+    _transaction_log.input_args.emplace_back("in_byteArray", ::android::internal::ToString(*in_byteArray));
+    _transaction_log.input_args.emplace_back("in_charValue", ::android::internal::ToString(in_charValue));
+    _transaction_log.input_args.emplace_back("in_charArray", ::android::internal::ToString(*in_charArray));
+    _transaction_log.input_args.emplace_back("in_intValue", ::android::internal::ToString(in_intValue));
+    _transaction_log.input_args.emplace_back("in_intArray", ::android::internal::ToString(*in_intArray));
+    _transaction_log.input_args.emplace_back("in_longValue", ::android::internal::ToString(in_longValue));
+    _transaction_log.input_args.emplace_back("in_longArray", ::android::internal::ToString(*in_longArray));
+    _transaction_log.input_args.emplace_back("in_floatValue", ::android::internal::ToString(in_floatValue));
+    _transaction_log.input_args.emplace_back("in_floatArray", ::android::internal::ToString(*in_floatArray));
+    _transaction_log.input_args.emplace_back("in_doubleValue", ::android::internal::ToString(in_doubleValue));
+    _transaction_log.input_args.emplace_back("in_doubleArray", ::android::internal::ToString(*in_doubleArray));
+    _transaction_log.input_args.emplace_back("in_stringValue", ::android::internal::ToString(in_stringValue));
+    _transaction_log.input_args.emplace_back("in_stringArray", ::android::internal::ToString(*in_stringArray));
+    _transaction_log.input_args.emplace_back("in_listValue", ::android::internal::ToString(*in_listValue));
+    _transaction_log.input_args.emplace_back("in_dataValue", ::android::internal::ToString(in_dataValue));
+    _transaction_log.input_args.emplace_back("in_binderValue", ::android::internal::ToString(in_binderValue));
+    _transaction_log.input_args.emplace_back("in_pfdValue", ::android::internal::ToString(*in_pfdValue));
+    _transaction_log.input_args.emplace_back("in_pfdArray", ::android::internal::ToString(*in_pfdArray));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ILoggableInterface::LogThis::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_boolValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_boolArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_byteValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_byteArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_charValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_charArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_intValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_intArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_longValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_longArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_floatValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_floatArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_doubleValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_doubleArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_stringValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_stringArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_listValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_dataValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_binderValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), *in_pfdValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_pfdArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*LogThis*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ILoggableInterface::getDefaultImpl()) {
+    _aidl_status = ILoggableInterface::getDefaultImpl()->LogThis(in_boolValue, in_boolArray, in_byteValue, in_byteArray, in_charValue, in_charArray, in_intValue, in_intArray, in_longValue, in_longArray, in_floatValue, in_floatArray, in_doubleValue, in_doubleArray, in_stringValue, in_stringArray, in_listValue, in_dataValue, in_binderValue, in_pfdValue, in_pfdArray, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_boolArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_byteArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_charArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_intArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_longArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_floatArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_doubleArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_stringArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_listValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), in_pfdValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_pfdArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpLoggableInterface::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.loggable.ILoggableInterface";
+    _transaction_log.method_name = "LogThis";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.output_args.emplace_back("in_boolArray", ::android::internal::ToString(*in_boolArray));
+    _transaction_log.output_args.emplace_back("in_byteArray", ::android::internal::ToString(*in_byteArray));
+    _transaction_log.output_args.emplace_back("in_charArray", ::android::internal::ToString(*in_charArray));
+    _transaction_log.output_args.emplace_back("in_intArray", ::android::internal::ToString(*in_intArray));
+    _transaction_log.output_args.emplace_back("in_longArray", ::android::internal::ToString(*in_longArray));
+    _transaction_log.output_args.emplace_back("in_floatArray", ::android::internal::ToString(*in_floatArray));
+    _transaction_log.output_args.emplace_back("in_doubleArray", ::android::internal::ToString(*in_doubleArray));
+    _transaction_log.output_args.emplace_back("in_stringArray", ::android::internal::ToString(*in_stringArray));
+    _transaction_log.output_args.emplace_back("in_listValue", ::android::internal::ToString(*in_listValue));
+    _transaction_log.output_args.emplace_back("in_pfdValue", ::android::internal::ToString(*in_pfdValue));
+    _transaction_log.output_args.emplace_back("in_pfdArray", ::android::internal::ToString(*in_pfdArray));
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpLoggableInterface::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+// Source for BnLoggableInterface
+BnLoggableInterface::BnLoggableInterface() {}
+BnLoggableInterface::~BnLoggableInterface() {}
+std::function<void(const BnLoggableInterface::TransactionLog&)> BnLoggableInterface::logFunc;
+::ndk::SpAIBinder BnLoggableInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_loggable_ILoggableInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for ILoggableInterface
+const char* ILoggableInterface::descriptor = "android.aidl.loggable.ILoggableInterface";
+ILoggableInterface::ILoggableInterface() {}
+ILoggableInterface::~ILoggableInterface() {}
+
+
+std::shared_ptr<ILoggableInterface> ILoggableInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_loggable_ILoggableInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpLoggableInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<ILoggableInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpLoggableInterface>(binder);
+}
+
+binder_status_t ILoggableInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<ILoggableInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ILoggableInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<ILoggableInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = ILoggableInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ILoggableInterface::setDefaultImpl(const std::shared_ptr<ILoggableInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!ILoggableInterface::default_impl);
+  if (impl) {
+    ILoggableInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ILoggableInterface>& ILoggableInterface::getDefaultImpl() {
+  return ILoggableInterface::default_impl;
+}
+std::shared_ptr<ILoggableInterface> ILoggableInterface::default_impl = nullptr;
+::ndk::ScopedAStatus ILoggableInterfaceDefault::LogThis(bool /*in_boolValue*/, std::vector<bool>* /*in_boolArray*/, int8_t /*in_byteValue*/, std::vector<uint8_t>* /*in_byteArray*/, char16_t /*in_charValue*/, std::vector<char16_t>* /*in_charArray*/, int32_t /*in_intValue*/, std::vector<int32_t>* /*in_intArray*/, int64_t /*in_longValue*/, std::vector<int64_t>* /*in_longArray*/, float /*in_floatValue*/, std::vector<float>* /*in_floatArray*/, double /*in_doubleValue*/, std::vector<double>* /*in_doubleArray*/, const std::string& /*in_stringValue*/, std::vector<std::string>* /*in_stringArray*/, std::vector<std::string>* /*in_listValue*/, const ::aidl::android::aidl::loggable::Data& /*in_dataValue*/, const ::ndk::SpAIBinder& /*in_binderValue*/, ::ndk::ScopedFileDescriptor* /*in_pfdValue*/, std::vector<::ndk::ScopedFileDescriptor>* /*in_pfdArray*/, std::vector<std::string>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder ILoggableInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ILoggableInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+static binder_status_t _aidl_android_aidl_loggable_ILoggableInterface_ISub_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<ILoggableInterface::BnSub> _aidl_impl = std::static_pointer_cast<ILoggableInterface::BnSub>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*Log*/): {
+      int32_t in_value;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ISub::Log::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_value);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ILoggableInterface::BnSub::TransactionLog _transaction_log;
+      if (ILoggableInterface::BnSub::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_value", ::android::internal::ToString(in_value));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->Log(in_value);
+      if (ILoggableInterface::BnSub::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.loggable.ILoggableInterface.ISub";
+        _transaction_log.method_name = "Log";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        ILoggableInterface::BnSub::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_loggable_ILoggableInterface_ISub_clazz = ::ndk::ICInterface::defineClass(ILoggableInterface::ISub::descriptor, _aidl_android_aidl_loggable_ILoggableInterface_ISub_onTransact);
+
+ILoggableInterface::BpSub::BpSub(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ILoggableInterface::BpSub::~BpSub() {}
+std::function<void(const ILoggableInterface::BpSub::TransactionLog&)> ILoggableInterface::BpSub::logFunc;
+
+::ndk::ScopedAStatus ILoggableInterface::BpSub::Log(int32_t in_value) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ILoggableInterface::BpSub::TransactionLog _transaction_log;
+  if (ILoggableInterface::BpSub::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_value", ::android::internal::ToString(in_value));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ISub::Log::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_value);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*Log*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ISub::getDefaultImpl()) {
+    _aidl_status = ISub::getDefaultImpl()->Log(in_value);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ILoggableInterface::BpSub::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.loggable.ILoggableInterface.ISub";
+    _transaction_log.method_name = "Log";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    ILoggableInterface::BpSub::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+// Source for BnSub
+ILoggableInterface::BnSub::BnSub() {}
+ILoggableInterface::BnSub::~BnSub() {}
+std::function<void(const ILoggableInterface::BnSub::TransactionLog&)> ILoggableInterface::BnSub::logFunc;
+::ndk::SpAIBinder ILoggableInterface::BnSub::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_loggable_ILoggableInterface_ISub_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for ISub
+const char* ILoggableInterface::ISub::descriptor = "android.aidl.loggable.ILoggableInterface.ISub";
+ILoggableInterface::ISub::ISub() {}
+ILoggableInterface::ISub::~ISub() {}
+
+
+std::shared_ptr<ILoggableInterface::ISub> ILoggableInterface::ISub::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_loggable_ILoggableInterface_ISub_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ILoggableInterface::BpSub>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<ISub>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ILoggableInterface::BpSub>(binder);
+}
+
+binder_status_t ILoggableInterface::ISub::writeToParcel(AParcel* parcel, const std::shared_ptr<ISub>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ILoggableInterface::ISub::readFromParcel(const AParcel* parcel, std::shared_ptr<ISub>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = ISub::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ILoggableInterface::ISub::setDefaultImpl(const std::shared_ptr<ISub>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!ISub::default_impl);
+  if (impl) {
+    ISub::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ILoggableInterface::ISub>& ILoggableInterface::ISub::getDefaultImpl() {
+  return ISub::default_impl;
+}
+std::shared_ptr<ILoggableInterface::ISub> ILoggableInterface::ISub::default_impl = nullptr;
+::ndk::ScopedAStatus ILoggableInterface::ISubDefault::Log(int32_t /*in_value*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder ILoggableInterface::ISubDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ILoggableInterface::ISubDefault::isRemote() {
+  return false;
+}
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/ILoggableInterface.cpp.d b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/ILoggableInterface.cpp.d
new file mode 100644
index 0000000..3bcdcd4
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/ILoggableInterface.cpp.d
@@ -0,0 +1,5 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/ILoggableInterface.cpp : \
+  system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Data.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Union.cpp b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Union.cpp
new file mode 100644
index 0000000..cf59dea
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Union.cpp
@@ -0,0 +1,56 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+#include "aidl/android/aidl/loggable/Union.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+const char* Union::descriptor = "android.aidl.loggable.Union";
+
+binder_status_t Union::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case num: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<num>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<num>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case str: {
+    std::string _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::string>) {
+      set<str>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<str>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t Union::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case num: return ::ndk::AParcel_writeData(_parcel, get<num>());
+  case str: return ::ndk::AParcel_writeData(_parcel, get<str>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Union.cpp.d b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Union.cpp.d
new file mode 100644
index 0000000..2dba0dc
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Union.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Union.cpp : \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnData.h b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnData.h
new file mode 100644
index 0000000..0853c35
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnData.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Data.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnEnum.h b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnEnum.h
new file mode 100644
index 0000000..4667de9
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Enum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnLoggableInterface.h b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnLoggableInterface.h
new file mode 100644
index 0000000..cff5548
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnLoggableInterface.h
@@ -0,0 +1,61 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/ILoggableInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/loggable/ILoggableInterface.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+class BnLoggableInterface : public ::ndk::BnCInterface<ILoggableInterface> {
+public:
+  BnLoggableInterface();
+  virtual ~BnLoggableInterface();
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class ILoggableInterfaceDelegator : public BnLoggableInterface {
+public:
+  explicit ILoggableInterfaceDelegator(const std::shared_ptr<ILoggableInterface> &impl) : _impl(impl) {
+  }
+
+  ::ndk::ScopedAStatus LogThis(bool in_boolValue, std::vector<bool>* in_boolArray, int8_t in_byteValue, std::vector<uint8_t>* in_byteArray, char16_t in_charValue, std::vector<char16_t>* in_charArray, int32_t in_intValue, std::vector<int32_t>* in_intArray, int64_t in_longValue, std::vector<int64_t>* in_longArray, float in_floatValue, std::vector<float>* in_floatArray, double in_doubleValue, std::vector<double>* in_doubleArray, const std::string& in_stringValue, std::vector<std::string>* in_stringArray, std::vector<std::string>* in_listValue, const ::aidl::android::aidl::loggable::Data& in_dataValue, const ::ndk::SpAIBinder& in_binderValue, ::ndk::ScopedFileDescriptor* in_pfdValue, std::vector<::ndk::ScopedFileDescriptor>* in_pfdArray, std::vector<std::string>* _aidl_return) override {
+    return _impl->LogThis(in_boolValue, in_boolArray, in_byteValue, in_byteArray, in_charValue, in_charArray, in_intValue, in_intArray, in_longValue, in_longArray, in_floatValue, in_floatArray, in_doubleValue, in_doubleArray, in_stringValue, in_stringArray, in_listValue, in_dataValue, in_binderValue, in_pfdValue, in_pfdArray, _aidl_return);
+  }
+protected:
+private:
+  std::shared_ptr<ILoggableInterface> _impl;
+};
+
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnUnion.h b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnUnion.h
new file mode 100644
index 0000000..75ce96d
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpData.h b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpData.h
new file mode 100644
index 0000000..e6ae909
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpData.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Data.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpEnum.h b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpEnum.h
new file mode 100644
index 0000000..18ce96a
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Enum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpLoggableInterface.h b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpLoggableInterface.h
new file mode 100644
index 0000000..c86c907
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpLoggableInterface.h
@@ -0,0 +1,44 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/ILoggableInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/loggable/ILoggableInterface.h"
+
+#include <android/binder_ibinder.h>
+#include <functional>
+#include <chrono>
+#include <sstream>
+#include <android/trace.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+class BpLoggableInterface : public ::ndk::BpCInterface<ILoggableInterface> {
+public:
+  explicit BpLoggableInterface(const ::ndk::SpAIBinder& binder);
+  virtual ~BpLoggableInterface();
+
+  ::ndk::ScopedAStatus LogThis(bool in_boolValue, std::vector<bool>* in_boolArray, int8_t in_byteValue, std::vector<uint8_t>* in_byteArray, char16_t in_charValue, std::vector<char16_t>* in_charArray, int32_t in_intValue, std::vector<int32_t>* in_intArray, int64_t in_longValue, std::vector<int64_t>* in_longArray, float in_floatValue, std::vector<float>* in_floatArray, double in_doubleValue, std::vector<double>* in_doubleArray, const std::string& in_stringValue, std::vector<std::string>* in_stringArray, std::vector<std::string>* in_listValue, const ::aidl::android::aidl::loggable::Data& in_dataValue, const ::ndk::SpAIBinder& in_binderValue, ::ndk::ScopedFileDescriptor* in_pfdValue, std::vector<::ndk::ScopedFileDescriptor>* in_pfdArray, std::vector<std::string>* _aidl_return) override;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+};
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpUnion.h b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpUnion.h
new file mode 100644
index 0000000..5b286fc
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Data.h b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Data.h
new file mode 100644
index 0000000..4801d23
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Data.h
@@ -0,0 +1,72 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Data.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/loggable/Enum.h>
+#include <aidl/android/aidl/loggable/Union.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+class Data {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t num = 0;
+  std::string str;
+  ::aidl::android::aidl::loggable::Union nestedUnion;
+  ::aidl::android::aidl::loggable::Enum nestedEnum = ::aidl::android::aidl::loggable::Enum::FOO;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) != std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator<(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) < std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator<=(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) <= std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator==(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) == std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator>(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) > std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator>=(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) >= std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Data{";
+    os << "num: " << ::android::internal::ToString(num);
+    os << ", str: " << ::android::internal::ToString(str);
+    os << ", nestedUnion: " << ::android::internal::ToString(nestedUnion);
+    os << ", nestedEnum: " << ::android::internal::ToString(nestedEnum);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Enum.h b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Enum.h
new file mode 100644
index 0000000..36bbeb5
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Enum.h
@@ -0,0 +1,56 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Enum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+enum class Enum : int8_t {
+  FOO = 42,
+};
+
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+[[nodiscard]] static inline std::string toString(Enum val) {
+  switch(val) {
+  case Enum::FOO:
+    return "FOO";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::loggable::Enum, 1> enum_values<aidl::android::aidl::loggable::Enum> = {
+  aidl::android::aidl::loggable::Enum::FOO,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/ILoggableInterface.h b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/ILoggableInterface.h
new file mode 100644
index 0000000..121100a
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/ILoggableInterface.h
@@ -0,0 +1,130 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/ILoggableInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+#pragma once
+
+#include <chrono>
+#include <cstdint>
+#include <functional>
+#include <memory>
+#include <optional>
+#include <sstream>
+#include <string>
+#include <vector>
+#include <android/binder_ibinder.h>
+#include <android/binder_interface_utils.h>
+#include <android/trace.h>
+#include <aidl/android/aidl/loggable/Data.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::loggable {
+class Data;
+}  // namespace aidl::android::aidl::loggable
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+class ILoggableInterfaceDelegator;
+
+class ILoggableInterface : public ::ndk::ICInterface {
+public:
+  typedef ILoggableInterfaceDelegator DefaultDelegator;
+  static const char* descriptor;
+  ILoggableInterface();
+  virtual ~ILoggableInterface();
+
+  class ISubDelegator;
+
+  class ISub : public ::ndk::ICInterface {
+  public:
+    typedef ISubDelegator DefaultDelegator;
+    static const char* descriptor;
+    ISub();
+    virtual ~ISub();
+
+    static constexpr uint32_t TRANSACTION_Log = FIRST_CALL_TRANSACTION + 0;
+
+    static std::shared_ptr<ISub> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<ISub>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<ISub>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<ISub>& impl);
+    static const std::shared_ptr<ISub>& getDefaultImpl();
+    virtual ::ndk::ScopedAStatus Log(int32_t in_value) = 0;
+  private:
+    static std::shared_ptr<ISub> default_impl;
+  };
+  class ISubDefault : public ISub {
+  public:
+    ::ndk::ScopedAStatus Log(int32_t in_value) override;
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpSub : public ::ndk::BpCInterface<ISub> {
+  public:
+    explicit BpSub(const ::ndk::SpAIBinder& binder);
+    virtual ~BpSub();
+
+    ::ndk::ScopedAStatus Log(int32_t in_value) override;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  };
+  class BnSub : public ::ndk::BnCInterface<ISub> {
+  public:
+    BnSub();
+    virtual ~BnSub();
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  static constexpr uint32_t TRANSACTION_LogThis = FIRST_CALL_TRANSACTION + 0;
+
+  static std::shared_ptr<ILoggableInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<ILoggableInterface>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<ILoggableInterface>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<ILoggableInterface>& impl);
+  static const std::shared_ptr<ILoggableInterface>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus LogThis(bool in_boolValue, std::vector<bool>* in_boolArray, int8_t in_byteValue, std::vector<uint8_t>* in_byteArray, char16_t in_charValue, std::vector<char16_t>* in_charArray, int32_t in_intValue, std::vector<int32_t>* in_intArray, int64_t in_longValue, std::vector<int64_t>* in_longArray, float in_floatValue, std::vector<float>* in_floatArray, double in_doubleValue, std::vector<double>* in_doubleArray, const std::string& in_stringValue, std::vector<std::string>* in_stringArray, std::vector<std::string>* in_listValue, const ::aidl::android::aidl::loggable::Data& in_dataValue, const ::ndk::SpAIBinder& in_binderValue, ::ndk::ScopedFileDescriptor* in_pfdValue, std::vector<::ndk::ScopedFileDescriptor>* in_pfdArray, std::vector<std::string>* _aidl_return) = 0;
+private:
+  static std::shared_ptr<ILoggableInterface> default_impl;
+};
+class ILoggableInterfaceDefault : public ILoggableInterface {
+public:
+  ::ndk::ScopedAStatus LogThis(bool in_boolValue, std::vector<bool>* in_boolArray, int8_t in_byteValue, std::vector<uint8_t>* in_byteArray, char16_t in_charValue, std::vector<char16_t>* in_charArray, int32_t in_intValue, std::vector<int32_t>* in_intArray, int64_t in_longValue, std::vector<int64_t>* in_longArray, float in_floatValue, std::vector<float>* in_floatArray, double in_doubleValue, std::vector<double>* in_doubleArray, const std::string& in_stringValue, std::vector<std::string>* in_stringArray, std::vector<std::string>* in_listValue, const ::aidl::android::aidl::loggable::Data& in_dataValue, const ::ndk::SpAIBinder& in_binderValue, ::ndk::ScopedFileDescriptor* in_pfdValue, std::vector<::ndk::ScopedFileDescriptor>* in_pfdArray, std::vector<std::string>* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Union.h b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Union.h
new file mode 100644
index 0000000..2ed86aa
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Union.h
@@ -0,0 +1,161 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+class Union {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Tag : int32_t {
+    num = 0,
+    str = 1,
+  };
+
+  // Expose tag symbols for legacy code
+  static const inline Tag num = Tag::num;
+  static const inline Tag str = Tag::str;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, Union>;
+
+  Union() : _value(std::in_place_index<static_cast<size_t>(num)>, int32_t(43)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr Union(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit Union(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static Union make(_Tp&&... _args) {
+    return Union(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static Union make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return Union(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  binder_status_t readFromParcel(const AParcel* _parcel);
+  binder_status_t writeToParcel(AParcel* _parcel) const;
+
+  inline bool operator!=(const Union& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const Union& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const Union& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const Union& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const Union& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const Union& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Union{";
+    switch (getTag()) {
+    case num: os << "num: " << ::android::internal::ToString(get<num>()); break;
+    case str: os << "str: " << ::android::internal::ToString(get<str>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t, std::string> _value;
+};
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+[[nodiscard]] static inline std::string toString(Union::Tag val) {
+  switch(val) {
+  case Union::Tag::num:
+    return "num";
+  case Union::Tag::str:
+    return "str";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::loggable::Union::Tag, 2> enum_values<aidl::android::aidl::loggable::Union::Tag> = {
+  aidl::android::aidl::loggable::Union::Tag::num,
+  aidl::android::aidl::loggable::Union::Tag::str,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/timestamp b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/aidl_test_loggable_interface-ndk-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp b/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp
new file mode 100644
index 0000000..b96e90d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp
@@ -0,0 +1,1476 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/staging/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+::android::status_t FixedSizeArrayExample::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&int2x3);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&boolArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&byteArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&charArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&intArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&longArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&floatArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&doubleArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&stringArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&byteEnumArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&intEnumArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&longEnumArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&parcelableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&boolMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&byteMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&charMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&intMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&longMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&floatMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&doubleMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&stringMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&byteEnumMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&intEnumMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&longEnumMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&parcelableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&boolNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&byteNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&charNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&intNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&longNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&floatNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&doubleNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&stringNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&byteEnumNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&intEnumNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&longEnumNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&binderNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&pfdNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&parcelableNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&interfaceNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&boolNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&byteNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&charNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&intNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&longNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&floatNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&doubleNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&stringNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&byteEnumNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&intEnumNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&longEnumNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&binderNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&pfdNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&parcelableNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFixedArray(&interfaceNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t FixedSizeArrayExample::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(int2x3);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(boolArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(byteArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(charArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(intArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(longArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(floatArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(doubleArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(stringArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(byteEnumArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(intEnumArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(longEnumArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(parcelableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(boolMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(byteMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(charMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(intMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(longMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(floatMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(doubleMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(stringMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(byteEnumMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(intEnumMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(longEnumMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(parcelableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(boolNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(byteNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(charNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(intNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(longNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(floatNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(doubleNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(stringNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(byteEnumNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(intEnumNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(longEnumNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(binderNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(pfdNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(parcelableNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(interfaceNullableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(boolNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(byteNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(charNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(intNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(longNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(floatNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(doubleNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(stringNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(byteEnumNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(intEnumNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(longEnumNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(binderNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(pfdNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(parcelableNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFixedArray(interfaceNullableMatrix);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(FixedSizeArrayExample, RepeatFixedSizeArray, "android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray")
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+
+FixedSizeArrayExample::BpRepeatFixedSizeArray::BpRepeatFixedSizeArray(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IRepeatFixedSizeArray>(_aidl_impl){
+}
+
+::android::binder::Status FixedSizeArrayExample::BpRepeatFixedSizeArray::RepeatBytes(const std::array<uint8_t, 3>& input, std::array<uint8_t, 3>* repeated, std::array<uint8_t, 3>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::RepeatBytes::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFixedArray(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(FixedSizeArrayExample::BnRepeatFixedSizeArray::TRANSACTION_RepeatBytes, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl())) {
+     return IRepeatFixedSizeArray::getDefaultImpl()->RepeatBytes(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status FixedSizeArrayExample::BpRepeatFixedSizeArray::RepeatInts(const std::array<int32_t, 3>& input, std::array<int32_t, 3>* repeated, std::array<int32_t, 3>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::RepeatInts::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFixedArray(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(FixedSizeArrayExample::BnRepeatFixedSizeArray::TRANSACTION_RepeatInts, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl())) {
+     return IRepeatFixedSizeArray::getDefaultImpl()->RepeatInts(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status FixedSizeArrayExample::BpRepeatFixedSizeArray::RepeatBinders(const std::array<::android::sp<::android::IBinder>, 3>& input, std::array<::android::sp<::android::IBinder>, 3>* repeated, std::array<::android::sp<::android::IBinder>, 3>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::RepeatBinders::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFixedArray(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(FixedSizeArrayExample::BnRepeatFixedSizeArray::TRANSACTION_RepeatBinders, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl())) {
+     return IRepeatFixedSizeArray::getDefaultImpl()->RepeatBinders(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status FixedSizeArrayExample::BpRepeatFixedSizeArray::RepeatParcelables(const std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& input, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* repeated, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::RepeatParcelables::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFixedArray(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(FixedSizeArrayExample::BnRepeatFixedSizeArray::TRANSACTION_RepeatParcelables, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl())) {
+     return IRepeatFixedSizeArray::getDefaultImpl()->RepeatParcelables(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status FixedSizeArrayExample::BpRepeatFixedSizeArray::Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& input, std::array<std::array<uint8_t, 3>, 2>* repeated, std::array<std::array<uint8_t, 3>, 2>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::Repeat2dBytes::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFixedArray(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(FixedSizeArrayExample::BnRepeatFixedSizeArray::TRANSACTION_Repeat2dBytes, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl())) {
+     return IRepeatFixedSizeArray::getDefaultImpl()->Repeat2dBytes(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status FixedSizeArrayExample::BpRepeatFixedSizeArray::Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& input, std::array<std::array<int32_t, 3>, 2>* repeated, std::array<std::array<int32_t, 3>, 2>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::Repeat2dInts::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFixedArray(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(FixedSizeArrayExample::BnRepeatFixedSizeArray::TRANSACTION_Repeat2dInts, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl())) {
+     return IRepeatFixedSizeArray::getDefaultImpl()->Repeat2dInts(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status FixedSizeArrayExample::BpRepeatFixedSizeArray::Repeat2dBinders(const std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>& input, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* repeated, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::Repeat2dBinders::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFixedArray(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(FixedSizeArrayExample::BnRepeatFixedSizeArray::TRANSACTION_Repeat2dBinders, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl())) {
+     return IRepeatFixedSizeArray::getDefaultImpl()->Repeat2dBinders(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status FixedSizeArrayExample::BpRepeatFixedSizeArray::Repeat2dParcelables(const std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& input, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* repeated, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::Repeat2dParcelables::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFixedArray(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(FixedSizeArrayExample::BnRepeatFixedSizeArray::TRANSACTION_Repeat2dParcelables, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl())) {
+     return IRepeatFixedSizeArray::getDefaultImpl()->Repeat2dParcelables(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFixedArray(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+
+FixedSizeArrayExample::BnRepeatFixedSizeArray::BnRepeatFixedSizeArray()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t FixedSizeArrayExample::BnRepeatFixedSizeArray::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnRepeatFixedSizeArray::TRANSACTION_RepeatBytes:
+  {
+    std::array<uint8_t, 3> in_input;
+    std::array<uint8_t, 3> out_repeated;
+    std::array<uint8_t, 3> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::RepeatBytes::cppServer");
+    _aidl_ret_status = _aidl_data.readFixedArray(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatBytes(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnRepeatFixedSizeArray::TRANSACTION_RepeatInts:
+  {
+    std::array<int32_t, 3> in_input;
+    std::array<int32_t, 3> out_repeated;
+    std::array<int32_t, 3> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::RepeatInts::cppServer");
+    _aidl_ret_status = _aidl_data.readFixedArray(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatInts(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnRepeatFixedSizeArray::TRANSACTION_RepeatBinders:
+  {
+    std::array<::android::sp<::android::IBinder>, 3> in_input;
+    std::array<::android::sp<::android::IBinder>, 3> out_repeated;
+    std::array<::android::sp<::android::IBinder>, 3> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::RepeatBinders::cppServer");
+    _aidl_ret_status = _aidl_data.readFixedArray(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatBinders(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnRepeatFixedSizeArray::TRANSACTION_RepeatParcelables:
+  {
+    std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3> in_input;
+    std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3> out_repeated;
+    std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::RepeatParcelables::cppServer");
+    _aidl_ret_status = _aidl_data.readFixedArray(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatParcelables(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnRepeatFixedSizeArray::TRANSACTION_Repeat2dBytes:
+  {
+    std::array<std::array<uint8_t, 3>, 2> in_input;
+    std::array<std::array<uint8_t, 3>, 2> out_repeated;
+    std::array<std::array<uint8_t, 3>, 2> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::Repeat2dBytes::cppServer");
+    _aidl_ret_status = _aidl_data.readFixedArray(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(Repeat2dBytes(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnRepeatFixedSizeArray::TRANSACTION_Repeat2dInts:
+  {
+    std::array<std::array<int32_t, 3>, 2> in_input;
+    std::array<std::array<int32_t, 3>, 2> out_repeated;
+    std::array<std::array<int32_t, 3>, 2> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::Repeat2dInts::cppServer");
+    _aidl_ret_status = _aidl_data.readFixedArray(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(Repeat2dInts(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnRepeatFixedSizeArray::TRANSACTION_Repeat2dBinders:
+  {
+    std::array<std::array<::android::sp<::android::IBinder>, 3>, 2> in_input;
+    std::array<std::array<::android::sp<::android::IBinder>, 3>, 2> out_repeated;
+    std::array<std::array<::android::sp<::android::IBinder>, 3>, 2> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::Repeat2dBinders::cppServer");
+    _aidl_ret_status = _aidl_data.readFixedArray(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(Repeat2dBinders(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnRepeatFixedSizeArray::TRANSACTION_Repeat2dParcelables:
+  {
+    std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2> in_input;
+    std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2> out_repeated;
+    std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IRepeatFixedSizeArray::Repeat2dParcelables::cppServer");
+    _aidl_ret_status = _aidl_data.readFixedArray(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(Repeat2dParcelables(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFixedArray(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+::android::status_t FixedSizeArrayExample::IntParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&value);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t FixedSizeArrayExample::IntParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(value);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(FixedSizeArrayExample, EmptyInterface, "android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface")
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+
+FixedSizeArrayExample::BpEmptyInterface::BpEmptyInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IEmptyInterface>(_aidl_impl){
+}
+
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+
+FixedSizeArrayExample::BnEmptyInterface::BnEmptyInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t FixedSizeArrayExample::BnEmptyInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d b/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d
new file mode 100644
index 0000000..940e183
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp : \
+  system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/BnFixedSizeArrayExample.h b/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/BnFixedSizeArrayExample.h
new file mode 100644
index 0000000..7c80743
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/BnFixedSizeArrayExample.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/staging/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/BpFixedSizeArrayExample.h b/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/BpFixedSizeArrayExample.h
new file mode 100644
index 0000000..a997b4a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/BpFixedSizeArrayExample.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/staging/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/FixedSizeArrayExample.h b/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/FixedSizeArrayExample.h
new file mode 100644
index 0000000..1679c3e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/include/android/aidl/fixedsizearray/FixedSizeArrayExample.h
@@ -0,0 +1,432 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/staging/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#pragma once
+
+#include <android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Delegate.h>
+#include <binder/Enums.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Parcel.h>
+#include <binder/ParcelFileDescriptor.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cstdint>
+#include <optional>
+#include <string>
+#include <tuple>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+class FixedSizeArrayExample : public ::android::Parcelable {
+public:
+  class IntParcelable : public ::android::Parcelable {
+  public:
+    int32_t value = 0;
+    inline bool operator!=(const IntParcelable& rhs) const {
+      return std::tie(value) != std::tie(rhs.value);
+    }
+    inline bool operator<(const IntParcelable& rhs) const {
+      return std::tie(value) < std::tie(rhs.value);
+    }
+    inline bool operator<=(const IntParcelable& rhs) const {
+      return std::tie(value) <= std::tie(rhs.value);
+    }
+    inline bool operator==(const IntParcelable& rhs) const {
+      return std::tie(value) == std::tie(rhs.value);
+    }
+    inline bool operator>(const IntParcelable& rhs) const {
+      return std::tie(value) > std::tie(rhs.value);
+    }
+    inline bool operator>=(const IntParcelable& rhs) const {
+      return std::tie(value) >= std::tie(rhs.value);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "IntParcelable{";
+      os << "value: " << ::android::internal::ToString(value);
+      os << "}";
+      return os.str();
+    }
+  };  // class IntParcelable
+  class IRepeatFixedSizeArrayDelegator;
+
+  class IRepeatFixedSizeArray : public ::android::IInterface {
+  public:
+    typedef IRepeatFixedSizeArrayDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(RepeatFixedSizeArray)
+    virtual ::android::binder::Status RepeatBytes(const std::array<uint8_t, 3>& input, std::array<uint8_t, 3>* repeated, std::array<uint8_t, 3>* _aidl_return) = 0;
+    virtual ::android::binder::Status RepeatInts(const std::array<int32_t, 3>& input, std::array<int32_t, 3>* repeated, std::array<int32_t, 3>* _aidl_return) = 0;
+    virtual ::android::binder::Status RepeatBinders(const std::array<::android::sp<::android::IBinder>, 3>& input, std::array<::android::sp<::android::IBinder>, 3>* repeated, std::array<::android::sp<::android::IBinder>, 3>* _aidl_return) = 0;
+    virtual ::android::binder::Status RepeatParcelables(const std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& input, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* repeated, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) = 0;
+    virtual ::android::binder::Status Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& input, std::array<std::array<uint8_t, 3>, 2>* repeated, std::array<std::array<uint8_t, 3>, 2>* _aidl_return) = 0;
+    virtual ::android::binder::Status Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& input, std::array<std::array<int32_t, 3>, 2>* repeated, std::array<std::array<int32_t, 3>, 2>* _aidl_return) = 0;
+    virtual ::android::binder::Status Repeat2dBinders(const std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>& input, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* repeated, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* _aidl_return) = 0;
+    virtual ::android::binder::Status Repeat2dParcelables(const std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& input, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* repeated, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) = 0;
+  };  // class IRepeatFixedSizeArray
+
+  class IRepeatFixedSizeArrayDefault : public IRepeatFixedSizeArray {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+    ::android::binder::Status RepeatBytes(const std::array<uint8_t, 3>& /*input*/, std::array<uint8_t, 3>* /*repeated*/, std::array<uint8_t, 3>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status RepeatInts(const std::array<int32_t, 3>& /*input*/, std::array<int32_t, 3>* /*repeated*/, std::array<int32_t, 3>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status RepeatBinders(const std::array<::android::sp<::android::IBinder>, 3>& /*input*/, std::array<::android::sp<::android::IBinder>, 3>* /*repeated*/, std::array<::android::sp<::android::IBinder>, 3>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status RepeatParcelables(const std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& /*input*/, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* /*repeated*/, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& /*input*/, std::array<std::array<uint8_t, 3>, 2>* /*repeated*/, std::array<std::array<uint8_t, 3>, 2>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& /*input*/, std::array<std::array<int32_t, 3>, 2>* /*repeated*/, std::array<std::array<int32_t, 3>, 2>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status Repeat2dBinders(const std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>& /*input*/, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* /*repeated*/, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status Repeat2dParcelables(const std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& /*input*/, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* /*repeated*/, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+  };  // class IRepeatFixedSizeArrayDefault
+  class BpRepeatFixedSizeArray : public ::android::BpInterface<IRepeatFixedSizeArray> {
+  public:
+    explicit BpRepeatFixedSizeArray(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpRepeatFixedSizeArray() = default;
+    ::android::binder::Status RepeatBytes(const std::array<uint8_t, 3>& input, std::array<uint8_t, 3>* repeated, std::array<uint8_t, 3>* _aidl_return) override;
+    ::android::binder::Status RepeatInts(const std::array<int32_t, 3>& input, std::array<int32_t, 3>* repeated, std::array<int32_t, 3>* _aidl_return) override;
+    ::android::binder::Status RepeatBinders(const std::array<::android::sp<::android::IBinder>, 3>& input, std::array<::android::sp<::android::IBinder>, 3>* repeated, std::array<::android::sp<::android::IBinder>, 3>* _aidl_return) override;
+    ::android::binder::Status RepeatParcelables(const std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& input, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* repeated, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) override;
+    ::android::binder::Status Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& input, std::array<std::array<uint8_t, 3>, 2>* repeated, std::array<std::array<uint8_t, 3>, 2>* _aidl_return) override;
+    ::android::binder::Status Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& input, std::array<std::array<int32_t, 3>, 2>* repeated, std::array<std::array<int32_t, 3>, 2>* _aidl_return) override;
+    ::android::binder::Status Repeat2dBinders(const std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>& input, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* repeated, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* _aidl_return) override;
+    ::android::binder::Status Repeat2dParcelables(const std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& input, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* repeated, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) override;
+  };  // class BpRepeatFixedSizeArray
+  class BnRepeatFixedSizeArray : public ::android::BnInterface<IRepeatFixedSizeArray> {
+  public:
+    static constexpr uint32_t TRANSACTION_RepeatBytes = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+    static constexpr uint32_t TRANSACTION_RepeatInts = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+    static constexpr uint32_t TRANSACTION_RepeatBinders = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+    static constexpr uint32_t TRANSACTION_RepeatParcelables = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
+    static constexpr uint32_t TRANSACTION_Repeat2dBytes = ::android::IBinder::FIRST_CALL_TRANSACTION + 4;
+    static constexpr uint32_t TRANSACTION_Repeat2dInts = ::android::IBinder::FIRST_CALL_TRANSACTION + 5;
+    static constexpr uint32_t TRANSACTION_Repeat2dBinders = ::android::IBinder::FIRST_CALL_TRANSACTION + 6;
+    static constexpr uint32_t TRANSACTION_Repeat2dParcelables = ::android::IBinder::FIRST_CALL_TRANSACTION + 7;
+    explicit BnRepeatFixedSizeArray();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  };  // class BnRepeatFixedSizeArray
+
+  class IRepeatFixedSizeArrayDelegator : public BnRepeatFixedSizeArray {
+  public:
+    explicit IRepeatFixedSizeArrayDelegator(const ::android::sp<IRepeatFixedSizeArray> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<IRepeatFixedSizeArray> getImpl() { return _aidl_delegate; }
+    ::android::binder::Status RepeatBytes(const std::array<uint8_t, 3>& input, std::array<uint8_t, 3>* repeated, std::array<uint8_t, 3>* _aidl_return) override {
+      return _aidl_delegate->RepeatBytes(input, repeated, _aidl_return);
+    }
+    ::android::binder::Status RepeatInts(const std::array<int32_t, 3>& input, std::array<int32_t, 3>* repeated, std::array<int32_t, 3>* _aidl_return) override {
+      return _aidl_delegate->RepeatInts(input, repeated, _aidl_return);
+    }
+    ::android::binder::Status RepeatBinders(const std::array<::android::sp<::android::IBinder>, 3>& input, std::array<::android::sp<::android::IBinder>, 3>* repeated, std::array<::android::sp<::android::IBinder>, 3>* _aidl_return) override {
+      return _aidl_delegate->RepeatBinders(input, repeated, _aidl_return);
+    }
+    ::android::binder::Status RepeatParcelables(const std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& input, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* repeated, std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) override {
+      return _aidl_delegate->RepeatParcelables(input, repeated, _aidl_return);
+    }
+    ::android::binder::Status Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& input, std::array<std::array<uint8_t, 3>, 2>* repeated, std::array<std::array<uint8_t, 3>, 2>* _aidl_return) override {
+      return _aidl_delegate->Repeat2dBytes(input, repeated, _aidl_return);
+    }
+    ::android::binder::Status Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& input, std::array<std::array<int32_t, 3>, 2>* repeated, std::array<std::array<int32_t, 3>, 2>* _aidl_return) override {
+      return _aidl_delegate->Repeat2dInts(input, repeated, _aidl_return);
+    }
+    ::android::binder::Status Repeat2dBinders(const std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>& input, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* repeated, std::array<std::array<::android::sp<::android::IBinder>, 3>, 2>* _aidl_return) override {
+      return _aidl_delegate->Repeat2dBinders(input, repeated, _aidl_return);
+    }
+    ::android::binder::Status Repeat2dParcelables(const std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& input, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* repeated, std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) override {
+      return _aidl_delegate->Repeat2dParcelables(input, repeated, _aidl_return);
+    }
+  private:
+    ::android::sp<IRepeatFixedSizeArray> _aidl_delegate;
+  };  // class IRepeatFixedSizeArrayDelegator
+  enum class ByteEnum : int8_t {
+    A = 0,
+  };
+  enum class IntEnum : int32_t {
+    A = 0,
+  };
+  enum class LongEnum : int64_t {
+    A = 0L,
+  };
+  class IEmptyInterfaceDelegator;
+
+  class IEmptyInterface : public ::android::IInterface {
+  public:
+    typedef IEmptyInterfaceDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(EmptyInterface)
+  };  // class IEmptyInterface
+
+  class IEmptyInterfaceDefault : public IEmptyInterface {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+  };  // class IEmptyInterfaceDefault
+  class BpEmptyInterface : public ::android::BpInterface<IEmptyInterface> {
+  public:
+    explicit BpEmptyInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpEmptyInterface() = default;
+  };  // class BpEmptyInterface
+  class BnEmptyInterface : public ::android::BnInterface<IEmptyInterface> {
+  public:
+    explicit BnEmptyInterface();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  };  // class BnEmptyInterface
+
+  class IEmptyInterfaceDelegator : public BnEmptyInterface {
+  public:
+    explicit IEmptyInterfaceDelegator(const ::android::sp<IEmptyInterface> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<IEmptyInterface> getImpl() { return _aidl_delegate; }
+  private:
+    ::android::sp<IEmptyInterface> _aidl_delegate;
+  };  // class IEmptyInterfaceDelegator
+  std::array<std::array<int32_t, 3>, 2> int2x3 = {{{{1, 2, 3}}, {{4, 5, 6}}}};
+  std::array<bool, 2> boolArray = {{}};
+  std::array<uint8_t, 2> byteArray = {{}};
+  std::array<char16_t, 2> charArray = {{}};
+  std::array<int32_t, 2> intArray = {{}};
+  std::array<int64_t, 2> longArray = {{}};
+  std::array<float, 2> floatArray = {{}};
+  std::array<double, 2> doubleArray = {{}};
+  std::array<::std::string, 2> stringArray = {{"hello", "world"}};
+  std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 2> byteEnumArray = {{}};
+  std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 2> intEnumArray = {{}};
+  std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 2> longEnumArray = {{}};
+  std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 2> parcelableArray = {{}};
+  std::array<std::array<bool, 2>, 2> boolMatrix = {{}};
+  std::array<std::array<uint8_t, 2>, 2> byteMatrix = {{}};
+  std::array<std::array<char16_t, 2>, 2> charMatrix = {{}};
+  std::array<std::array<int32_t, 2>, 2> intMatrix = {{}};
+  std::array<std::array<int64_t, 2>, 2> longMatrix = {{}};
+  std::array<std::array<float, 2>, 2> floatMatrix = {{}};
+  std::array<std::array<double, 2>, 2> doubleMatrix = {{}};
+  std::array<std::array<::std::string, 2>, 2> stringMatrix = {{{{"hello", "world"}}, {{"Ciao", "mondo"}}}};
+  std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 2>, 2> byteEnumMatrix = {{}};
+  std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 2>, 2> intEnumMatrix = {{}};
+  std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 2>, 2> longEnumMatrix = {{}};
+  std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 2>, 2> parcelableMatrix = {{}};
+  ::std::optional<std::array<bool, 2>> boolNullableArray;
+  ::std::optional<std::array<uint8_t, 2>> byteNullableArray;
+  ::std::optional<std::array<char16_t, 2>> charNullableArray;
+  ::std::optional<std::array<int32_t, 2>> intNullableArray;
+  ::std::optional<std::array<int64_t, 2>> longNullableArray;
+  ::std::optional<std::array<float, 2>> floatNullableArray;
+  ::std::optional<std::array<double, 2>> doubleNullableArray;
+  ::std::optional<std::array<::std::optional<::std::string>, 2>> stringNullableArray = {{{"hello", "world"}}};
+  ::std::optional<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 2>> byteEnumNullableArray;
+  ::std::optional<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 2>> intEnumNullableArray;
+  ::std::optional<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 2>> longEnumNullableArray;
+  ::std::optional<std::array<::android::sp<::android::IBinder>, 2>> binderNullableArray;
+  ::std::optional<std::array<::std::optional<::android::os::ParcelFileDescriptor>, 2>> pfdNullableArray;
+  ::std::optional<std::array<::std::optional<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable>, 2>> parcelableNullableArray;
+  ::std::optional<std::array<::android::sp<::android::aidl::fixedsizearray::FixedSizeArrayExample::IEmptyInterface>, 2>> interfaceNullableArray;
+  ::std::optional<std::array<std::array<bool, 2>, 2>> boolNullableMatrix;
+  ::std::optional<std::array<std::array<uint8_t, 2>, 2>> byteNullableMatrix;
+  ::std::optional<std::array<std::array<char16_t, 2>, 2>> charNullableMatrix;
+  ::std::optional<std::array<std::array<int32_t, 2>, 2>> intNullableMatrix;
+  ::std::optional<std::array<std::array<int64_t, 2>, 2>> longNullableMatrix;
+  ::std::optional<std::array<std::array<float, 2>, 2>> floatNullableMatrix;
+  ::std::optional<std::array<std::array<double, 2>, 2>> doubleNullableMatrix;
+  ::std::optional<std::array<std::array<::std::optional<::std::string>, 2>, 2>> stringNullableMatrix = {{{{{"hello", "world"}}, {{"Ciao", "mondo"}}}}};
+  ::std::optional<std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 2>, 2>> byteEnumNullableMatrix;
+  ::std::optional<std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 2>, 2>> intEnumNullableMatrix;
+  ::std::optional<std::array<std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 2>, 2>> longEnumNullableMatrix;
+  ::std::optional<std::array<std::array<::android::sp<::android::IBinder>, 2>, 2>> binderNullableMatrix;
+  ::std::optional<std::array<std::array<::std::optional<::android::os::ParcelFileDescriptor>, 2>, 2>> pfdNullableMatrix;
+  ::std::optional<std::array<std::array<::std::optional<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable>, 2>, 2>> parcelableNullableMatrix;
+  ::std::optional<std::array<std::array<::android::sp<::android::aidl::fixedsizearray::FixedSizeArrayExample::IEmptyInterface>, 2>, 2>> interfaceNullableMatrix;
+  inline bool operator!=(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) != std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator<(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) < std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator<=(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) <= std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator==(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) == std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator>(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) > std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator>=(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) >= std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.fixedsizearray.FixedSizeArrayExample");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "FixedSizeArrayExample{";
+    os << "int2x3: " << ::android::internal::ToString(int2x3);
+    os << ", boolArray: " << ::android::internal::ToString(boolArray);
+    os << ", byteArray: " << ::android::internal::ToString(byteArray);
+    os << ", charArray: " << ::android::internal::ToString(charArray);
+    os << ", intArray: " << ::android::internal::ToString(intArray);
+    os << ", longArray: " << ::android::internal::ToString(longArray);
+    os << ", floatArray: " << ::android::internal::ToString(floatArray);
+    os << ", doubleArray: " << ::android::internal::ToString(doubleArray);
+    os << ", stringArray: " << ::android::internal::ToString(stringArray);
+    os << ", byteEnumArray: " << ::android::internal::ToString(byteEnumArray);
+    os << ", intEnumArray: " << ::android::internal::ToString(intEnumArray);
+    os << ", longEnumArray: " << ::android::internal::ToString(longEnumArray);
+    os << ", parcelableArray: " << ::android::internal::ToString(parcelableArray);
+    os << ", boolMatrix: " << ::android::internal::ToString(boolMatrix);
+    os << ", byteMatrix: " << ::android::internal::ToString(byteMatrix);
+    os << ", charMatrix: " << ::android::internal::ToString(charMatrix);
+    os << ", intMatrix: " << ::android::internal::ToString(intMatrix);
+    os << ", longMatrix: " << ::android::internal::ToString(longMatrix);
+    os << ", floatMatrix: " << ::android::internal::ToString(floatMatrix);
+    os << ", doubleMatrix: " << ::android::internal::ToString(doubleMatrix);
+    os << ", stringMatrix: " << ::android::internal::ToString(stringMatrix);
+    os << ", byteEnumMatrix: " << ::android::internal::ToString(byteEnumMatrix);
+    os << ", intEnumMatrix: " << ::android::internal::ToString(intEnumMatrix);
+    os << ", longEnumMatrix: " << ::android::internal::ToString(longEnumMatrix);
+    os << ", parcelableMatrix: " << ::android::internal::ToString(parcelableMatrix);
+    os << ", boolNullableArray: " << ::android::internal::ToString(boolNullableArray);
+    os << ", byteNullableArray: " << ::android::internal::ToString(byteNullableArray);
+    os << ", charNullableArray: " << ::android::internal::ToString(charNullableArray);
+    os << ", intNullableArray: " << ::android::internal::ToString(intNullableArray);
+    os << ", longNullableArray: " << ::android::internal::ToString(longNullableArray);
+    os << ", floatNullableArray: " << ::android::internal::ToString(floatNullableArray);
+    os << ", doubleNullableArray: " << ::android::internal::ToString(doubleNullableArray);
+    os << ", stringNullableArray: " << ::android::internal::ToString(stringNullableArray);
+    os << ", byteEnumNullableArray: " << ::android::internal::ToString(byteEnumNullableArray);
+    os << ", intEnumNullableArray: " << ::android::internal::ToString(intEnumNullableArray);
+    os << ", longEnumNullableArray: " << ::android::internal::ToString(longEnumNullableArray);
+    os << ", binderNullableArray: " << ::android::internal::ToString(binderNullableArray);
+    os << ", pfdNullableArray: " << ::android::internal::ToString(pfdNullableArray);
+    os << ", parcelableNullableArray: " << ::android::internal::ToString(parcelableNullableArray);
+    os << ", interfaceNullableArray: " << ::android::internal::ToString(interfaceNullableArray);
+    os << ", boolNullableMatrix: " << ::android::internal::ToString(boolNullableMatrix);
+    os << ", byteNullableMatrix: " << ::android::internal::ToString(byteNullableMatrix);
+    os << ", charNullableMatrix: " << ::android::internal::ToString(charNullableMatrix);
+    os << ", intNullableMatrix: " << ::android::internal::ToString(intNullableMatrix);
+    os << ", longNullableMatrix: " << ::android::internal::ToString(longNullableMatrix);
+    os << ", floatNullableMatrix: " << ::android::internal::ToString(floatNullableMatrix);
+    os << ", doubleNullableMatrix: " << ::android::internal::ToString(doubleNullableMatrix);
+    os << ", stringNullableMatrix: " << ::android::internal::ToString(stringNullableMatrix);
+    os << ", byteEnumNullableMatrix: " << ::android::internal::ToString(byteEnumNullableMatrix);
+    os << ", intEnumNullableMatrix: " << ::android::internal::ToString(intEnumNullableMatrix);
+    os << ", longEnumNullableMatrix: " << ::android::internal::ToString(longEnumNullableMatrix);
+    os << ", binderNullableMatrix: " << ::android::internal::ToString(binderNullableMatrix);
+    os << ", pfdNullableMatrix: " << ::android::internal::ToString(pfdNullableMatrix);
+    os << ", parcelableNullableMatrix: " << ::android::internal::ToString(parcelableNullableMatrix);
+    os << ", interfaceNullableMatrix: " << ::android::internal::ToString(interfaceNullableMatrix);
+    os << "}";
+    return os.str();
+  }
+};  // class FixedSizeArrayExample
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+[[nodiscard]] static inline std::string toString(FixedSizeArrayExample::ByteEnum val) {
+  switch(val) {
+  case FixedSizeArrayExample::ByteEnum::A:
+    return "A";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 1> enum_values<::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum> = {
+  ::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum::A,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+[[nodiscard]] static inline std::string toString(FixedSizeArrayExample::IntEnum val) {
+  switch(val) {
+  case FixedSizeArrayExample::IntEnum::A:
+    return "A";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 1> enum_values<::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum> = {
+  ::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum::A,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+[[nodiscard]] static inline std::string toString(FixedSizeArrayExample::LongEnum val) {
+  switch(val) {
+  case FixedSizeArrayExample::LongEnum::A:
+    return "A";
+  default:
+    return std::to_string(static_cast<int64_t>(val));
+  }
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 1> enum_values<::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum> = {
+  ::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum::A,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-cpp-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-java-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.java b/tests/golden_output/frozen/aidl-test-fixedsizearray-java-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.java
new file mode 100644
index 0000000..fae264c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-java-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.java
@@ -0,0 +1,875 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-java-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+package android.aidl.fixedsizearray;
+public class FixedSizeArrayExample implements android.os.Parcelable
+{
+  // to see if NxM array works
+  public int[][] int2x3 = {{1, 2, 3}, {4, 5, 6}};
+  public boolean[] boolArray;
+  public byte[] byteArray;
+  public char[] charArray;
+  public int[] intArray;
+  public long[] longArray;
+  public float[] floatArray;
+  public double[] doubleArray;
+  public java.lang.String[] stringArray = {"hello", "world"};
+  public byte[] byteEnumArray;
+  public int[] intEnumArray;
+  public long[] longEnumArray;
+  public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] parcelableArray;
+  // Following fields are not test-friendly because they should be initialized as non-null.
+  // IBinder[2] binderArray;
+  // ParcelFileDescriptor[2] pfdArray;
+  // IEmptyInterface[2] interfaceArray;
+  public boolean[][] boolMatrix;
+  public byte[][] byteMatrix;
+  public char[][] charMatrix;
+  public int[][] intMatrix;
+  public long[][] longMatrix;
+  public float[][] floatMatrix;
+  public double[][] doubleMatrix;
+  public java.lang.String[][] stringMatrix = {{"hello", "world"}, {"Ciao", "mondo"}};
+  public byte[][] byteEnumMatrix;
+  public int[][] intEnumMatrix;
+  public long[][] longEnumMatrix;
+  public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] parcelableMatrix;
+  // Following fields are not test-friendly because they should be initialized as non-null.
+  // ParcelFileDescriptor[2][2] pfdMatrix;
+  // IBinder[2][2] binderMatrix;
+  // IEmptyInterface[2][2] interfaceMatrix;
+  public boolean[] boolNullableArray;
+  public byte[] byteNullableArray;
+  public char[] charNullableArray;
+  public int[] intNullableArray;
+  public long[] longNullableArray;
+  public float[] floatNullableArray;
+  public double[] doubleNullableArray;
+  public java.lang.String[] stringNullableArray = {"hello", "world"};
+  public byte[] byteEnumNullableArray;
+  public int[] intEnumNullableArray;
+  public long[] longEnumNullableArray;
+  public android.os.IBinder[] binderNullableArray;
+  public android.os.ParcelFileDescriptor[] pfdNullableArray;
+  public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] parcelableNullableArray;
+  public android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface[] interfaceNullableArray;
+  public boolean[][] boolNullableMatrix;
+  public byte[][] byteNullableMatrix;
+  public char[][] charNullableMatrix;
+  public int[][] intNullableMatrix;
+  public long[][] longNullableMatrix;
+  public float[][] floatNullableMatrix;
+  public double[][] doubleNullableMatrix;
+  public java.lang.String[][] stringNullableMatrix = {{"hello", "world"}, {"Ciao", "mondo"}};
+  public byte[][] byteEnumNullableMatrix;
+  public int[][] intEnumNullableMatrix;
+  public long[][] longEnumNullableMatrix;
+  public android.os.IBinder[][] binderNullableMatrix;
+  public android.os.ParcelFileDescriptor[][] pfdNullableMatrix;
+  public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] parcelableNullableMatrix;
+  public android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface[][] interfaceNullableMatrix;
+  public static final android.os.Parcelable.Creator<FixedSizeArrayExample> CREATOR = new android.os.Parcelable.Creator<FixedSizeArrayExample>() {
+    @Override
+    public FixedSizeArrayExample createFromParcel(android.os.Parcel _aidl_source) {
+      FixedSizeArrayExample _aidl_out = new FixedSizeArrayExample();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public FixedSizeArrayExample[] newArray(int _aidl_size) {
+      return new FixedSizeArrayExample[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeFixedArray(int2x3, _aidl_flag, 2, 3);
+    _aidl_parcel.writeFixedArray(boolArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(byteArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(charArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(intArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(longArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(floatArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(doubleArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(stringArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(byteEnumArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(intEnumArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(longEnumArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(parcelableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(boolMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(byteMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(charMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(intMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(longMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(floatMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(doubleMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(stringMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(byteEnumMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(intEnumMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(longEnumMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(parcelableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(boolNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(byteNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(charNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(intNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(longNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(floatNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(doubleNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(stringNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(byteEnumNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(intEnumNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(longEnumNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(binderNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(pfdNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(parcelableNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(interfaceNullableArray, _aidl_flag, 2);
+    _aidl_parcel.writeFixedArray(boolNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(byteNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(charNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(intNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(longNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(floatNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(doubleNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(stringNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(byteEnumNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(intEnumNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(longEnumNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(binderNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(pfdNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(parcelableNullableMatrix, _aidl_flag, 2, 2);
+    _aidl_parcel.writeFixedArray(interfaceNullableMatrix, _aidl_flag, 2, 2);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      int2x3 = _aidl_parcel.createFixedArray(int[][].class, 2, 3);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      boolArray = _aidl_parcel.createFixedArray(boolean[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteArray = _aidl_parcel.createFixedArray(byte[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      charArray = _aidl_parcel.createFixedArray(char[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intArray = _aidl_parcel.createFixedArray(int[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longArray = _aidl_parcel.createFixedArray(long[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      floatArray = _aidl_parcel.createFixedArray(float[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      doubleArray = _aidl_parcel.createFixedArray(double[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      stringArray = _aidl_parcel.createFixedArray(java.lang.String[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteEnumArray = _aidl_parcel.createFixedArray(byte[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intEnumArray = _aidl_parcel.createFixedArray(int[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longEnumArray = _aidl_parcel.createFixedArray(long[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      parcelableArray = _aidl_parcel.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      boolMatrix = _aidl_parcel.createFixedArray(boolean[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteMatrix = _aidl_parcel.createFixedArray(byte[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      charMatrix = _aidl_parcel.createFixedArray(char[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intMatrix = _aidl_parcel.createFixedArray(int[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longMatrix = _aidl_parcel.createFixedArray(long[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      floatMatrix = _aidl_parcel.createFixedArray(float[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      doubleMatrix = _aidl_parcel.createFixedArray(double[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      stringMatrix = _aidl_parcel.createFixedArray(java.lang.String[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteEnumMatrix = _aidl_parcel.createFixedArray(byte[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intEnumMatrix = _aidl_parcel.createFixedArray(int[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longEnumMatrix = _aidl_parcel.createFixedArray(long[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      parcelableMatrix = _aidl_parcel.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      boolNullableArray = _aidl_parcel.createFixedArray(boolean[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteNullableArray = _aidl_parcel.createFixedArray(byte[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      charNullableArray = _aidl_parcel.createFixedArray(char[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intNullableArray = _aidl_parcel.createFixedArray(int[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longNullableArray = _aidl_parcel.createFixedArray(long[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      floatNullableArray = _aidl_parcel.createFixedArray(float[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      doubleNullableArray = _aidl_parcel.createFixedArray(double[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      stringNullableArray = _aidl_parcel.createFixedArray(java.lang.String[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteEnumNullableArray = _aidl_parcel.createFixedArray(byte[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intEnumNullableArray = _aidl_parcel.createFixedArray(int[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longEnumNullableArray = _aidl_parcel.createFixedArray(long[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      binderNullableArray = _aidl_parcel.createFixedArray(android.os.IBinder[].class, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      pfdNullableArray = _aidl_parcel.createFixedArray(android.os.ParcelFileDescriptor[].class, android.os.ParcelFileDescriptor.CREATOR, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      parcelableNullableArray = _aidl_parcel.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      interfaceNullableArray = _aidl_parcel.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface[].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface.Stub::asInterface, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      boolNullableMatrix = _aidl_parcel.createFixedArray(boolean[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteNullableMatrix = _aidl_parcel.createFixedArray(byte[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      charNullableMatrix = _aidl_parcel.createFixedArray(char[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intNullableMatrix = _aidl_parcel.createFixedArray(int[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longNullableMatrix = _aidl_parcel.createFixedArray(long[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      floatNullableMatrix = _aidl_parcel.createFixedArray(float[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      doubleNullableMatrix = _aidl_parcel.createFixedArray(double[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      stringNullableMatrix = _aidl_parcel.createFixedArray(java.lang.String[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteEnumNullableMatrix = _aidl_parcel.createFixedArray(byte[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intEnumNullableMatrix = _aidl_parcel.createFixedArray(int[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longEnumNullableMatrix = _aidl_parcel.createFixedArray(long[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      binderNullableMatrix = _aidl_parcel.createFixedArray(android.os.IBinder[][].class, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      pfdNullableMatrix = _aidl_parcel.createFixedArray(android.os.ParcelFileDescriptor[][].class, android.os.ParcelFileDescriptor.CREATOR, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      parcelableNullableMatrix = _aidl_parcel.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR, 2, 2);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      interfaceNullableMatrix = _aidl_parcel.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface[][].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface.Stub::asInterface, 2, 2);
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public String toString() {
+    java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "{", "}");
+    _aidl_sj.add("int2x3: " + (java.util.Arrays.deepToString(int2x3)));
+    _aidl_sj.add("boolArray: " + (java.util.Arrays.toString(boolArray)));
+    _aidl_sj.add("byteArray: " + (java.util.Arrays.toString(byteArray)));
+    _aidl_sj.add("charArray: " + (java.util.Arrays.toString(charArray)));
+    _aidl_sj.add("intArray: " + (java.util.Arrays.toString(intArray)));
+    _aidl_sj.add("longArray: " + (java.util.Arrays.toString(longArray)));
+    _aidl_sj.add("floatArray: " + (java.util.Arrays.toString(floatArray)));
+    _aidl_sj.add("doubleArray: " + (java.util.Arrays.toString(doubleArray)));
+    _aidl_sj.add("stringArray: " + (java.util.Arrays.toString(stringArray)));
+    _aidl_sj.add("byteEnumArray: " + (java.util.Arrays.toString(byteEnumArray)));
+    _aidl_sj.add("intEnumArray: " + (java.util.Arrays.toString(intEnumArray)));
+    _aidl_sj.add("longEnumArray: " + (java.util.Arrays.toString(longEnumArray)));
+    _aidl_sj.add("parcelableArray: " + (java.util.Arrays.toString(parcelableArray)));
+    _aidl_sj.add("boolMatrix: " + (java.util.Arrays.deepToString(boolMatrix)));
+    _aidl_sj.add("byteMatrix: " + (java.util.Arrays.deepToString(byteMatrix)));
+    _aidl_sj.add("charMatrix: " + (java.util.Arrays.deepToString(charMatrix)));
+    _aidl_sj.add("intMatrix: " + (java.util.Arrays.deepToString(intMatrix)));
+    _aidl_sj.add("longMatrix: " + (java.util.Arrays.deepToString(longMatrix)));
+    _aidl_sj.add("floatMatrix: " + (java.util.Arrays.deepToString(floatMatrix)));
+    _aidl_sj.add("doubleMatrix: " + (java.util.Arrays.deepToString(doubleMatrix)));
+    _aidl_sj.add("stringMatrix: " + (java.util.Arrays.deepToString(stringMatrix)));
+    _aidl_sj.add("byteEnumMatrix: " + (java.util.Arrays.deepToString(byteEnumMatrix)));
+    _aidl_sj.add("intEnumMatrix: " + (java.util.Arrays.deepToString(intEnumMatrix)));
+    _aidl_sj.add("longEnumMatrix: " + (java.util.Arrays.deepToString(longEnumMatrix)));
+    _aidl_sj.add("parcelableMatrix: " + (java.util.Arrays.deepToString(parcelableMatrix)));
+    _aidl_sj.add("boolNullableArray: " + (java.util.Arrays.toString(boolNullableArray)));
+    _aidl_sj.add("byteNullableArray: " + (java.util.Arrays.toString(byteNullableArray)));
+    _aidl_sj.add("charNullableArray: " + (java.util.Arrays.toString(charNullableArray)));
+    _aidl_sj.add("intNullableArray: " + (java.util.Arrays.toString(intNullableArray)));
+    _aidl_sj.add("longNullableArray: " + (java.util.Arrays.toString(longNullableArray)));
+    _aidl_sj.add("floatNullableArray: " + (java.util.Arrays.toString(floatNullableArray)));
+    _aidl_sj.add("doubleNullableArray: " + (java.util.Arrays.toString(doubleNullableArray)));
+    _aidl_sj.add("stringNullableArray: " + (java.util.Arrays.toString(stringNullableArray)));
+    _aidl_sj.add("byteEnumNullableArray: " + (java.util.Arrays.toString(byteEnumNullableArray)));
+    _aidl_sj.add("intEnumNullableArray: " + (java.util.Arrays.toString(intEnumNullableArray)));
+    _aidl_sj.add("longEnumNullableArray: " + (java.util.Arrays.toString(longEnumNullableArray)));
+    _aidl_sj.add("binderNullableArray: " + (java.util.Arrays.toString(binderNullableArray)));
+    _aidl_sj.add("pfdNullableArray: " + (java.util.Arrays.toString(pfdNullableArray)));
+    _aidl_sj.add("parcelableNullableArray: " + (java.util.Arrays.toString(parcelableNullableArray)));
+    _aidl_sj.add("interfaceNullableArray: " + (java.util.Arrays.toString(interfaceNullableArray)));
+    _aidl_sj.add("boolNullableMatrix: " + (java.util.Arrays.deepToString(boolNullableMatrix)));
+    _aidl_sj.add("byteNullableMatrix: " + (java.util.Arrays.deepToString(byteNullableMatrix)));
+    _aidl_sj.add("charNullableMatrix: " + (java.util.Arrays.deepToString(charNullableMatrix)));
+    _aidl_sj.add("intNullableMatrix: " + (java.util.Arrays.deepToString(intNullableMatrix)));
+    _aidl_sj.add("longNullableMatrix: " + (java.util.Arrays.deepToString(longNullableMatrix)));
+    _aidl_sj.add("floatNullableMatrix: " + (java.util.Arrays.deepToString(floatNullableMatrix)));
+    _aidl_sj.add("doubleNullableMatrix: " + (java.util.Arrays.deepToString(doubleNullableMatrix)));
+    _aidl_sj.add("stringNullableMatrix: " + (java.util.Arrays.deepToString(stringNullableMatrix)));
+    _aidl_sj.add("byteEnumNullableMatrix: " + (java.util.Arrays.deepToString(byteEnumNullableMatrix)));
+    _aidl_sj.add("intEnumNullableMatrix: " + (java.util.Arrays.deepToString(intEnumNullableMatrix)));
+    _aidl_sj.add("longEnumNullableMatrix: " + (java.util.Arrays.deepToString(longEnumNullableMatrix)));
+    _aidl_sj.add("binderNullableMatrix: " + (java.util.Arrays.deepToString(binderNullableMatrix)));
+    _aidl_sj.add("pfdNullableMatrix: " + (java.util.Arrays.deepToString(pfdNullableMatrix)));
+    _aidl_sj.add("parcelableNullableMatrix: " + (java.util.Arrays.deepToString(parcelableNullableMatrix)));
+    _aidl_sj.add("interfaceNullableMatrix: " + (java.util.Arrays.deepToString(interfaceNullableMatrix)));
+    return "FixedSizeArrayExample" + _aidl_sj.toString()  ;
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    _mask |= describeContents(parcelableArray);
+    _mask |= describeContents(parcelableMatrix);
+    _mask |= describeContents(pfdNullableArray);
+    _mask |= describeContents(parcelableNullableArray);
+    _mask |= describeContents(pfdNullableMatrix);
+    _mask |= describeContents(parcelableNullableMatrix);
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof Object[]) {
+      int _mask = 0;
+      for (Object o : (Object[]) _v) {
+        _mask |= describeContents(o);
+      }
+      return _mask;
+    }
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+  public interface IRepeatFixedSizeArray extends android.os.IInterface
+  {
+    /** Default implementation for IRepeatFixedSizeArray. */
+    public static class Default implements android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray
+    {
+      @Override public byte[] RepeatBytes(byte[] input, byte[] repeated) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public int[] RepeatInts(int[] input, int[] repeated) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public android.os.IBinder[] RepeatBinders(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] RepeatParcelables(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] input, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] repeated) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public byte[][] Repeat2dBytes(byte[][] input, byte[][] repeated) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public int[][] Repeat2dInts(int[][] input, int[][] repeated) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public android.os.IBinder[][] Repeat2dBinders(android.os.IBinder[][] input, android.os.IBinder[][] repeated) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] Repeat2dParcelables(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] input, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] repeated) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray))) {
+          return ((android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray)iin);
+        }
+        return new android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+          data.enforceInterface(descriptor);
+        }
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        switch (code)
+        {
+          case TRANSACTION_RepeatBytes:
+          {
+            byte[] _arg0;
+            _arg0 = data.createFixedArray(byte[].class, 3);
+            byte[] _arg1;
+            _arg1 = new byte[3];
+            data.enforceNoDataAvail();
+            byte[] _result = this.RepeatBytes(_arg0, _arg1);
+            reply.writeNoException();
+            reply.writeFixedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 3);
+            reply.writeFixedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 3);
+            break;
+          }
+          case TRANSACTION_RepeatInts:
+          {
+            int[] _arg0;
+            _arg0 = data.createFixedArray(int[].class, 3);
+            int[] _arg1;
+            _arg1 = new int[3];
+            data.enforceNoDataAvail();
+            int[] _result = this.RepeatInts(_arg0, _arg1);
+            reply.writeNoException();
+            reply.writeFixedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 3);
+            reply.writeFixedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 3);
+            break;
+          }
+          case TRANSACTION_RepeatBinders:
+          {
+            android.os.IBinder[] _arg0;
+            _arg0 = data.createFixedArray(android.os.IBinder[].class, 3);
+            android.os.IBinder[] _arg1;
+            _arg1 = new android.os.IBinder[3];
+            data.enforceNoDataAvail();
+            android.os.IBinder[] _result = this.RepeatBinders(_arg0, _arg1);
+            reply.writeNoException();
+            reply.writeFixedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 3);
+            reply.writeFixedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 3);
+            break;
+          }
+          case TRANSACTION_RepeatParcelables:
+          {
+            android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] _arg0;
+            _arg0 = data.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR, 3);
+            android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] _arg1;
+            _arg1 = new android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[3];
+            data.enforceNoDataAvail();
+            android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] _result = this.RepeatParcelables(_arg0, _arg1);
+            reply.writeNoException();
+            reply.writeFixedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 3);
+            reply.writeFixedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 3);
+            break;
+          }
+          case TRANSACTION_Repeat2dBytes:
+          {
+            byte[][] _arg0;
+            _arg0 = data.createFixedArray(byte[][].class, 2, 3);
+            byte[][] _arg1;
+            _arg1 = new byte[2][3];
+            data.enforceNoDataAvail();
+            byte[][] _result = this.Repeat2dBytes(_arg0, _arg1);
+            reply.writeNoException();
+            reply.writeFixedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 2, 3);
+            reply.writeFixedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 2, 3);
+            break;
+          }
+          case TRANSACTION_Repeat2dInts:
+          {
+            int[][] _arg0;
+            _arg0 = data.createFixedArray(int[][].class, 2, 3);
+            int[][] _arg1;
+            _arg1 = new int[2][3];
+            data.enforceNoDataAvail();
+            int[][] _result = this.Repeat2dInts(_arg0, _arg1);
+            reply.writeNoException();
+            reply.writeFixedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 2, 3);
+            reply.writeFixedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 2, 3);
+            break;
+          }
+          case TRANSACTION_Repeat2dBinders:
+          {
+            android.os.IBinder[][] _arg0;
+            _arg0 = data.createFixedArray(android.os.IBinder[][].class, 2, 3);
+            android.os.IBinder[][] _arg1;
+            _arg1 = new android.os.IBinder[2][3];
+            data.enforceNoDataAvail();
+            android.os.IBinder[][] _result = this.Repeat2dBinders(_arg0, _arg1);
+            reply.writeNoException();
+            reply.writeFixedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 2, 3);
+            reply.writeFixedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 2, 3);
+            break;
+          }
+          case TRANSACTION_Repeat2dParcelables:
+          {
+            android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] _arg0;
+            _arg0 = data.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR, 2, 3);
+            android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] _arg1;
+            _arg1 = new android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[2][3];
+            data.enforceNoDataAvail();
+            android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] _result = this.Repeat2dParcelables(_arg0, _arg1);
+            reply.writeNoException();
+            reply.writeFixedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 2, 3);
+            reply.writeFixedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE, 2, 3);
+            break;
+          }
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+        return true;
+      }
+      private static class Proxy implements android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+        @Override public byte[] RepeatBytes(byte[] input, byte[] repeated) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          byte[] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeFixedArray(input, 0, 3);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatBytes, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createFixedArray(byte[].class, 3);
+            _reply.readFixedArray(repeated);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public int[] RepeatInts(int[] input, int[] repeated) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          int[] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeFixedArray(input, 0, 3);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatInts, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createFixedArray(int[].class, 3);
+            _reply.readFixedArray(repeated);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public android.os.IBinder[] RepeatBinders(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.os.IBinder[] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeFixedArray(input, 0, 3);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatBinders, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createFixedArray(android.os.IBinder[].class, 3);
+            _reply.readFixedArray(repeated);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] RepeatParcelables(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] input, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] repeated) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeFixedArray(input, 0, 3);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatParcelables, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR, 3);
+            _reply.readFixedArray(repeated, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public byte[][] Repeat2dBytes(byte[][] input, byte[][] repeated) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          byte[][] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeFixedArray(input, 0, 2, 3);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_Repeat2dBytes, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createFixedArray(byte[][].class, 2, 3);
+            _reply.readFixedArray(repeated);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public int[][] Repeat2dInts(int[][] input, int[][] repeated) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          int[][] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeFixedArray(input, 0, 2, 3);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_Repeat2dInts, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createFixedArray(int[][].class, 2, 3);
+            _reply.readFixedArray(repeated);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public android.os.IBinder[][] Repeat2dBinders(android.os.IBinder[][] input, android.os.IBinder[][] repeated) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.os.IBinder[][] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeFixedArray(input, 0, 2, 3);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_Repeat2dBinders, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createFixedArray(android.os.IBinder[][].class, 2, 3);
+            _reply.readFixedArray(repeated);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] Repeat2dParcelables(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] input, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] repeated) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeFixedArray(input, 0, 2, 3);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_Repeat2dParcelables, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createFixedArray(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][].class, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR, 2, 3);
+            _reply.readFixedArray(repeated, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable.CREATOR);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+      }
+      static final int TRANSACTION_RepeatBytes = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+      static final int TRANSACTION_RepeatInts = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+      static final int TRANSACTION_RepeatBinders = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+      static final int TRANSACTION_RepeatParcelables = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+      static final int TRANSACTION_Repeat2dBytes = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
+      static final int TRANSACTION_Repeat2dInts = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5);
+      static final int TRANSACTION_Repeat2dBinders = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6);
+      static final int TRANSACTION_Repeat2dParcelables = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7);
+    }
+    public static final java.lang.String DESCRIPTOR = "android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray";
+    public byte[] RepeatBytes(byte[] input, byte[] repeated) throws android.os.RemoteException;
+    public int[] RepeatInts(int[] input, int[] repeated) throws android.os.RemoteException;
+    public android.os.IBinder[] RepeatBinders(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException;
+    public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] RepeatParcelables(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] input, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[] repeated) throws android.os.RemoteException;
+    public byte[][] Repeat2dBytes(byte[][] input, byte[][] repeated) throws android.os.RemoteException;
+    public int[][] Repeat2dInts(int[][] input, int[][] repeated) throws android.os.RemoteException;
+    public android.os.IBinder[][] Repeat2dBinders(android.os.IBinder[][] input, android.os.IBinder[][] repeated) throws android.os.RemoteException;
+    public android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] Repeat2dParcelables(android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] input, android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable[][] repeated) throws android.os.RemoteException;
+  }
+  public static @interface ByteEnum {
+    public static final byte A = 0;
+  }
+  public static @interface IntEnum {
+    public static final int A = 0;
+  }
+  public static @interface LongEnum {
+    public static final long A = 0L;
+  }
+  public static class IntParcelable implements android.os.Parcelable
+  {
+    public int value = 0;
+    public static final android.os.Parcelable.Creator<IntParcelable> CREATOR = new android.os.Parcelable.Creator<IntParcelable>() {
+      @Override
+      public IntParcelable createFromParcel(android.os.Parcel _aidl_source) {
+        IntParcelable _aidl_out = new IntParcelable();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public IntParcelable[] newArray(int _aidl_size) {
+        return new IntParcelable[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeInt(value);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        value = _aidl_parcel.readInt();
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public boolean equals(Object other) {
+      if (this == other) return true;
+      if (other == null) return false;
+      if (!(other instanceof IntParcelable)) return false;
+      IntParcelable that = (IntParcelable)other;
+      if (!java.util.Objects.deepEquals(value, that.value)) return false;
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return java.util.Arrays.deepHashCode(java.util.Arrays.asList(value).toArray());
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+  public interface IEmptyInterface extends android.os.IInterface
+  {
+    /** Default implementation for IEmptyInterface. */
+    public static class Default implements android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface
+    {
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface))) {
+          return ((android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface)iin);
+        }
+        return new android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        switch (code)
+        {
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+      }
+      private static class Proxy implements android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface";
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-java-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.java.d b/tests/golden_output/frozen/aidl-test-fixedsizearray-java-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.java.d
new file mode 100644
index 0000000..1ed6bda
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-java-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-java-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.java : \
+  system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-java-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-fixedsizearray-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-java-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp b/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp
new file mode 100644
index 0000000..11e90b5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp
@@ -0,0 +1,1373 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/staging/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#include "aidl/android/aidl/fixedsizearray/FixedSizeArrayExample.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+const char* FixedSizeArrayExample::descriptor = "android.aidl.fixedsizearray.FixedSizeArrayExample";
+
+binder_status_t FixedSizeArrayExample::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &int2x3);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &boolArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &charArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &floatArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &doubleArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &stringArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteEnumArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intEnumArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longEnumArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcelableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &boolMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &charMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &floatMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &doubleMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &stringMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteEnumMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intEnumMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longEnumMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcelableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &boolNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &byteNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &charNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &intNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &longNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &floatNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &doubleNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &stringNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &byteEnumNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &intEnumNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &longEnumNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &binderNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &pfdNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &parcelableNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &interfaceNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &boolNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &byteNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &charNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &intNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &longNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &floatNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &doubleNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &stringNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &byteEnumNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &intEnumNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &longEnumNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &binderNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &pfdNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &parcelableNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &interfaceNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t FixedSizeArrayExample::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, int2x3);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, boolArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, charArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, floatArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, doubleArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, stringArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteEnumArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intEnumArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longEnumArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcelableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, boolMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, charMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, floatMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, doubleMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, stringMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteEnumMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intEnumMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longEnumMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcelableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, boolNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, byteNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, charNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, intNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, longNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, floatNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, doubleNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, stringNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, byteEnumNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, intEnumNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, longEnumNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, binderNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, pfdNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, parcelableNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, interfaceNullableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, boolNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, byteNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, charNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, intNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, longNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, floatNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, doubleNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, stringNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, byteEnumNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, intEnumNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, longEnumNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, binderNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, pfdNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, parcelableNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, interfaceNullableMatrix);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+static binder_status_t _aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IRepeatFixedSizeArray_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<FixedSizeArrayExample::BnRepeatFixedSizeArray> _aidl_impl = std::static_pointer_cast<FixedSizeArrayExample::BnRepeatFixedSizeArray>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*RepeatBytes*/): {
+      std::array<uint8_t, 3> in_input;
+      std::array<uint8_t, 3> out_repeated;
+      std::array<uint8_t, 3> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatBytes(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*RepeatInts*/): {
+      std::array<int32_t, 3> in_input;
+      std::array<int32_t, 3> out_repeated;
+      std::array<int32_t, 3> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatInts(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*RepeatBinders*/): {
+      std::array<::ndk::SpAIBinder, 3> in_input;
+      std::array<::ndk::SpAIBinder, 3> out_repeated;
+      std::array<::ndk::SpAIBinder, 3> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatBinders(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 3 /*RepeatParcelables*/): {
+      std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3> in_input;
+      std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3> out_repeated;
+      std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatParcelables(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 4 /*Repeat2dBytes*/): {
+      std::array<std::array<uint8_t, 3>, 2> in_input;
+      std::array<std::array<uint8_t, 3>, 2> out_repeated;
+      std::array<std::array<uint8_t, 3>, 2> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->Repeat2dBytes(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 5 /*Repeat2dInts*/): {
+      std::array<std::array<int32_t, 3>, 2> in_input;
+      std::array<std::array<int32_t, 3>, 2> out_repeated;
+      std::array<std::array<int32_t, 3>, 2> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->Repeat2dInts(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 6 /*Repeat2dBinders*/): {
+      std::array<std::array<::ndk::SpAIBinder, 3>, 2> in_input;
+      std::array<std::array<::ndk::SpAIBinder, 3>, 2> out_repeated;
+      std::array<std::array<::ndk::SpAIBinder, 3>, 2> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->Repeat2dBinders(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 7 /*Repeat2dParcelables*/): {
+      std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2> in_input;
+      std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2> out_repeated;
+      std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->Repeat2dParcelables(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IRepeatFixedSizeArray_clazz = ::ndk::ICInterface::defineClass(FixedSizeArrayExample::IRepeatFixedSizeArray::descriptor, _aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IRepeatFixedSizeArray_onTransact);
+
+FixedSizeArrayExample::BpRepeatFixedSizeArray::BpRepeatFixedSizeArray(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+FixedSizeArrayExample::BpRepeatFixedSizeArray::~BpRepeatFixedSizeArray() {}
+
+::ndk::ScopedAStatus FixedSizeArrayExample::BpRepeatFixedSizeArray::RepeatBytes(const std::array<uint8_t, 3>& in_input, std::array<uint8_t, 3>* out_repeated, std::array<uint8_t, 3>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*RepeatBytes*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl()) {
+    _aidl_status = IRepeatFixedSizeArray::getDefaultImpl()->RepeatBytes(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::BpRepeatFixedSizeArray::RepeatInts(const std::array<int32_t, 3>& in_input, std::array<int32_t, 3>* out_repeated, std::array<int32_t, 3>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*RepeatInts*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl()) {
+    _aidl_status = IRepeatFixedSizeArray::getDefaultImpl()->RepeatInts(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::BpRepeatFixedSizeArray::RepeatBinders(const std::array<::ndk::SpAIBinder, 3>& in_input, std::array<::ndk::SpAIBinder, 3>* out_repeated, std::array<::ndk::SpAIBinder, 3>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*RepeatBinders*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl()) {
+    _aidl_status = IRepeatFixedSizeArray::getDefaultImpl()->RepeatBinders(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::BpRepeatFixedSizeArray::RepeatParcelables(const std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& in_input, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* out_repeated, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 3 /*RepeatParcelables*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl()) {
+    _aidl_status = IRepeatFixedSizeArray::getDefaultImpl()->RepeatParcelables(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::BpRepeatFixedSizeArray::Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& in_input, std::array<std::array<uint8_t, 3>, 2>* out_repeated, std::array<std::array<uint8_t, 3>, 2>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 4 /*Repeat2dBytes*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl()) {
+    _aidl_status = IRepeatFixedSizeArray::getDefaultImpl()->Repeat2dBytes(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::BpRepeatFixedSizeArray::Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& in_input, std::array<std::array<int32_t, 3>, 2>* out_repeated, std::array<std::array<int32_t, 3>, 2>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 5 /*Repeat2dInts*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl()) {
+    _aidl_status = IRepeatFixedSizeArray::getDefaultImpl()->Repeat2dInts(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::BpRepeatFixedSizeArray::Repeat2dBinders(const std::array<std::array<::ndk::SpAIBinder, 3>, 2>& in_input, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* out_repeated, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 6 /*Repeat2dBinders*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl()) {
+    _aidl_status = IRepeatFixedSizeArray::getDefaultImpl()->Repeat2dBinders(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::BpRepeatFixedSizeArray::Repeat2dParcelables(const std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& in_input, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* out_repeated, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 7 /*Repeat2dParcelables*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IRepeatFixedSizeArray::getDefaultImpl()) {
+    _aidl_status = IRepeatFixedSizeArray::getDefaultImpl()->Repeat2dParcelables(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnRepeatFixedSizeArray
+FixedSizeArrayExample::BnRepeatFixedSizeArray::BnRepeatFixedSizeArray() {}
+FixedSizeArrayExample::BnRepeatFixedSizeArray::~BnRepeatFixedSizeArray() {}
+::ndk::SpAIBinder FixedSizeArrayExample::BnRepeatFixedSizeArray::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IRepeatFixedSizeArray_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IRepeatFixedSizeArray
+const char* FixedSizeArrayExample::IRepeatFixedSizeArray::descriptor = "android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray";
+FixedSizeArrayExample::IRepeatFixedSizeArray::IRepeatFixedSizeArray() {}
+FixedSizeArrayExample::IRepeatFixedSizeArray::~IRepeatFixedSizeArray() {}
+
+
+std::shared_ptr<FixedSizeArrayExample::IRepeatFixedSizeArray> FixedSizeArrayExample::IRepeatFixedSizeArray::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IRepeatFixedSizeArray_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<FixedSizeArrayExample::BpRepeatFixedSizeArray>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IRepeatFixedSizeArray>(interface);
+  }
+  return ::ndk::SharedRefBase::make<FixedSizeArrayExample::BpRepeatFixedSizeArray>(binder);
+}
+
+binder_status_t FixedSizeArrayExample::IRepeatFixedSizeArray::writeToParcel(AParcel* parcel, const std::shared_ptr<IRepeatFixedSizeArray>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t FixedSizeArrayExample::IRepeatFixedSizeArray::readFromParcel(const AParcel* parcel, std::shared_ptr<IRepeatFixedSizeArray>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IRepeatFixedSizeArray::fromBinder(binder);
+  return STATUS_OK;
+}
+bool FixedSizeArrayExample::IRepeatFixedSizeArray::setDefaultImpl(const std::shared_ptr<IRepeatFixedSizeArray>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IRepeatFixedSizeArray::default_impl);
+  if (impl) {
+    IRepeatFixedSizeArray::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<FixedSizeArrayExample::IRepeatFixedSizeArray>& FixedSizeArrayExample::IRepeatFixedSizeArray::getDefaultImpl() {
+  return IRepeatFixedSizeArray::default_impl;
+}
+std::shared_ptr<FixedSizeArrayExample::IRepeatFixedSizeArray> FixedSizeArrayExample::IRepeatFixedSizeArray::default_impl = nullptr;
+::ndk::ScopedAStatus FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::RepeatBytes(const std::array<uint8_t, 3>& /*in_input*/, std::array<uint8_t, 3>* /*out_repeated*/, std::array<uint8_t, 3>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::RepeatInts(const std::array<int32_t, 3>& /*in_input*/, std::array<int32_t, 3>* /*out_repeated*/, std::array<int32_t, 3>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::RepeatBinders(const std::array<::ndk::SpAIBinder, 3>& /*in_input*/, std::array<::ndk::SpAIBinder, 3>* /*out_repeated*/, std::array<::ndk::SpAIBinder, 3>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::RepeatParcelables(const std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& /*in_input*/, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* /*out_repeated*/, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& /*in_input*/, std::array<std::array<uint8_t, 3>, 2>* /*out_repeated*/, std::array<std::array<uint8_t, 3>, 2>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& /*in_input*/, std::array<std::array<int32_t, 3>, 2>* /*out_repeated*/, std::array<std::array<int32_t, 3>, 2>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::Repeat2dBinders(const std::array<std::array<::ndk::SpAIBinder, 3>, 2>& /*in_input*/, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* /*out_repeated*/, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::Repeat2dParcelables(const std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& /*in_input*/, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* /*out_repeated*/, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool FixedSizeArrayExample::IRepeatFixedSizeArrayDefault::isRemote() {
+  return false;
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+const char* FixedSizeArrayExample::IntParcelable::descriptor = "android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable";
+
+binder_status_t FixedSizeArrayExample::IntParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &value);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t FixedSizeArrayExample::IntParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, value);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+static binder_status_t _aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IEmptyInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  (void)_aidl_binder;
+  (void)_aidl_code;
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IEmptyInterface_clazz = ::ndk::ICInterface::defineClass(FixedSizeArrayExample::IEmptyInterface::descriptor, _aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IEmptyInterface_onTransact);
+
+FixedSizeArrayExample::BpEmptyInterface::BpEmptyInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+FixedSizeArrayExample::BpEmptyInterface::~BpEmptyInterface() {}
+
+// Source for BnEmptyInterface
+FixedSizeArrayExample::BnEmptyInterface::BnEmptyInterface() {}
+FixedSizeArrayExample::BnEmptyInterface::~BnEmptyInterface() {}
+::ndk::SpAIBinder FixedSizeArrayExample::BnEmptyInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IEmptyInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IEmptyInterface
+const char* FixedSizeArrayExample::IEmptyInterface::descriptor = "android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface";
+FixedSizeArrayExample::IEmptyInterface::IEmptyInterface() {}
+FixedSizeArrayExample::IEmptyInterface::~IEmptyInterface() {}
+
+
+std::shared_ptr<FixedSizeArrayExample::IEmptyInterface> FixedSizeArrayExample::IEmptyInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_fixedsizearray_FixedSizeArrayExample_IEmptyInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<FixedSizeArrayExample::BpEmptyInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IEmptyInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<FixedSizeArrayExample::BpEmptyInterface>(binder);
+}
+
+binder_status_t FixedSizeArrayExample::IEmptyInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<IEmptyInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t FixedSizeArrayExample::IEmptyInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<IEmptyInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IEmptyInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool FixedSizeArrayExample::IEmptyInterface::setDefaultImpl(const std::shared_ptr<IEmptyInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IEmptyInterface::default_impl);
+  if (impl) {
+    IEmptyInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<FixedSizeArrayExample::IEmptyInterface>& FixedSizeArrayExample::IEmptyInterface::getDefaultImpl() {
+  return IEmptyInterface::default_impl;
+}
+std::shared_ptr<FixedSizeArrayExample::IEmptyInterface> FixedSizeArrayExample::IEmptyInterface::default_impl = nullptr;
+::ndk::SpAIBinder FixedSizeArrayExample::IEmptyInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool FixedSizeArrayExample::IEmptyInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d b/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d
new file mode 100644
index 0000000..1443490
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp : \
+  system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/BnFixedSizeArrayExample.h b/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/BnFixedSizeArrayExample.h
new file mode 100644
index 0000000..f360c15
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/BnFixedSizeArrayExample.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/staging/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/BpFixedSizeArrayExample.h b/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/BpFixedSizeArrayExample.h
new file mode 100644
index 0000000..8da98c2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/BpFixedSizeArrayExample.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/staging/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/FixedSizeArrayExample.h b/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/FixedSizeArrayExample.h
new file mode 100644
index 0000000..f3f4899
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/include/aidl/android/aidl/fixedsizearray/FixedSizeArrayExample.h
@@ -0,0 +1,413 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/staging/android/aidl/fixedsizearray/FixedSizeArrayExample.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_ibinder.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/fixedsizearray/FixedSizeArrayExample.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+class FixedSizeArrayExample {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  class IntParcelable {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    int32_t value = 0;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const IntParcelable& rhs) const {
+      return std::tie(value) != std::tie(rhs.value);
+    }
+    inline bool operator<(const IntParcelable& rhs) const {
+      return std::tie(value) < std::tie(rhs.value);
+    }
+    inline bool operator<=(const IntParcelable& rhs) const {
+      return std::tie(value) <= std::tie(rhs.value);
+    }
+    inline bool operator==(const IntParcelable& rhs) const {
+      return std::tie(value) == std::tie(rhs.value);
+    }
+    inline bool operator>(const IntParcelable& rhs) const {
+      return std::tie(value) > std::tie(rhs.value);
+    }
+    inline bool operator>=(const IntParcelable& rhs) const {
+      return std::tie(value) >= std::tie(rhs.value);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "IntParcelable{";
+      os << "value: " << ::android::internal::ToString(value);
+      os << "}";
+      return os.str();
+    }
+  };
+  class IRepeatFixedSizeArrayDelegator;
+
+  class IRepeatFixedSizeArray : public ::ndk::ICInterface {
+  public:
+    typedef IRepeatFixedSizeArrayDelegator DefaultDelegator;
+    static const char* descriptor;
+    IRepeatFixedSizeArray();
+    virtual ~IRepeatFixedSizeArray();
+
+    static constexpr uint32_t TRANSACTION_RepeatBytes = FIRST_CALL_TRANSACTION + 0;
+    static constexpr uint32_t TRANSACTION_RepeatInts = FIRST_CALL_TRANSACTION + 1;
+    static constexpr uint32_t TRANSACTION_RepeatBinders = FIRST_CALL_TRANSACTION + 2;
+    static constexpr uint32_t TRANSACTION_RepeatParcelables = FIRST_CALL_TRANSACTION + 3;
+    static constexpr uint32_t TRANSACTION_Repeat2dBytes = FIRST_CALL_TRANSACTION + 4;
+    static constexpr uint32_t TRANSACTION_Repeat2dInts = FIRST_CALL_TRANSACTION + 5;
+    static constexpr uint32_t TRANSACTION_Repeat2dBinders = FIRST_CALL_TRANSACTION + 6;
+    static constexpr uint32_t TRANSACTION_Repeat2dParcelables = FIRST_CALL_TRANSACTION + 7;
+
+    static std::shared_ptr<IRepeatFixedSizeArray> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IRepeatFixedSizeArray>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IRepeatFixedSizeArray>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<IRepeatFixedSizeArray>& impl);
+    static const std::shared_ptr<IRepeatFixedSizeArray>& getDefaultImpl();
+    virtual ::ndk::ScopedAStatus RepeatBytes(const std::array<uint8_t, 3>& in_input, std::array<uint8_t, 3>* out_repeated, std::array<uint8_t, 3>* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus RepeatInts(const std::array<int32_t, 3>& in_input, std::array<int32_t, 3>* out_repeated, std::array<int32_t, 3>* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus RepeatBinders(const std::array<::ndk::SpAIBinder, 3>& in_input, std::array<::ndk::SpAIBinder, 3>* out_repeated, std::array<::ndk::SpAIBinder, 3>* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus RepeatParcelables(const std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& in_input, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* out_repeated, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& in_input, std::array<std::array<uint8_t, 3>, 2>* out_repeated, std::array<std::array<uint8_t, 3>, 2>* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& in_input, std::array<std::array<int32_t, 3>, 2>* out_repeated, std::array<std::array<int32_t, 3>, 2>* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus Repeat2dBinders(const std::array<std::array<::ndk::SpAIBinder, 3>, 2>& in_input, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* out_repeated, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus Repeat2dParcelables(const std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& in_input, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* out_repeated, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) = 0;
+  private:
+    static std::shared_ptr<IRepeatFixedSizeArray> default_impl;
+  };
+  class IRepeatFixedSizeArrayDefault : public IRepeatFixedSizeArray {
+  public:
+    ::ndk::ScopedAStatus RepeatBytes(const std::array<uint8_t, 3>& in_input, std::array<uint8_t, 3>* out_repeated, std::array<uint8_t, 3>* _aidl_return) override;
+    ::ndk::ScopedAStatus RepeatInts(const std::array<int32_t, 3>& in_input, std::array<int32_t, 3>* out_repeated, std::array<int32_t, 3>* _aidl_return) override;
+    ::ndk::ScopedAStatus RepeatBinders(const std::array<::ndk::SpAIBinder, 3>& in_input, std::array<::ndk::SpAIBinder, 3>* out_repeated, std::array<::ndk::SpAIBinder, 3>* _aidl_return) override;
+    ::ndk::ScopedAStatus RepeatParcelables(const std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& in_input, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* out_repeated, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) override;
+    ::ndk::ScopedAStatus Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& in_input, std::array<std::array<uint8_t, 3>, 2>* out_repeated, std::array<std::array<uint8_t, 3>, 2>* _aidl_return) override;
+    ::ndk::ScopedAStatus Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& in_input, std::array<std::array<int32_t, 3>, 2>* out_repeated, std::array<std::array<int32_t, 3>, 2>* _aidl_return) override;
+    ::ndk::ScopedAStatus Repeat2dBinders(const std::array<std::array<::ndk::SpAIBinder, 3>, 2>& in_input, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* out_repeated, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* _aidl_return) override;
+    ::ndk::ScopedAStatus Repeat2dParcelables(const std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& in_input, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* out_repeated, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) override;
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpRepeatFixedSizeArray : public ::ndk::BpCInterface<IRepeatFixedSizeArray> {
+  public:
+    explicit BpRepeatFixedSizeArray(const ::ndk::SpAIBinder& binder);
+    virtual ~BpRepeatFixedSizeArray();
+
+    ::ndk::ScopedAStatus RepeatBytes(const std::array<uint8_t, 3>& in_input, std::array<uint8_t, 3>* out_repeated, std::array<uint8_t, 3>* _aidl_return) override;
+    ::ndk::ScopedAStatus RepeatInts(const std::array<int32_t, 3>& in_input, std::array<int32_t, 3>* out_repeated, std::array<int32_t, 3>* _aidl_return) override;
+    ::ndk::ScopedAStatus RepeatBinders(const std::array<::ndk::SpAIBinder, 3>& in_input, std::array<::ndk::SpAIBinder, 3>* out_repeated, std::array<::ndk::SpAIBinder, 3>* _aidl_return) override;
+    ::ndk::ScopedAStatus RepeatParcelables(const std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>& in_input, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* out_repeated, std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>* _aidl_return) override;
+    ::ndk::ScopedAStatus Repeat2dBytes(const std::array<std::array<uint8_t, 3>, 2>& in_input, std::array<std::array<uint8_t, 3>, 2>* out_repeated, std::array<std::array<uint8_t, 3>, 2>* _aidl_return) override;
+    ::ndk::ScopedAStatus Repeat2dInts(const std::array<std::array<int32_t, 3>, 2>& in_input, std::array<std::array<int32_t, 3>, 2>* out_repeated, std::array<std::array<int32_t, 3>, 2>* _aidl_return) override;
+    ::ndk::ScopedAStatus Repeat2dBinders(const std::array<std::array<::ndk::SpAIBinder, 3>, 2>& in_input, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* out_repeated, std::array<std::array<::ndk::SpAIBinder, 3>, 2>* _aidl_return) override;
+    ::ndk::ScopedAStatus Repeat2dParcelables(const std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>& in_input, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* out_repeated, std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 3>, 2>* _aidl_return) override;
+  };
+  class BnRepeatFixedSizeArray : public ::ndk::BnCInterface<IRepeatFixedSizeArray> {
+  public:
+    BnRepeatFixedSizeArray();
+    virtual ~BnRepeatFixedSizeArray();
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  enum class ByteEnum : int8_t {
+    A = 0,
+  };
+
+  enum class IntEnum : int32_t {
+    A = 0,
+  };
+
+  enum class LongEnum : int64_t {
+    A = 0L,
+  };
+
+  class IEmptyInterfaceDelegator;
+
+  class IEmptyInterface : public ::ndk::ICInterface {
+  public:
+    typedef IEmptyInterfaceDelegator DefaultDelegator;
+    static const char* descriptor;
+    IEmptyInterface();
+    virtual ~IEmptyInterface();
+
+
+    static std::shared_ptr<IEmptyInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IEmptyInterface>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IEmptyInterface>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<IEmptyInterface>& impl);
+    static const std::shared_ptr<IEmptyInterface>& getDefaultImpl();
+  private:
+    static std::shared_ptr<IEmptyInterface> default_impl;
+  };
+  class IEmptyInterfaceDefault : public IEmptyInterface {
+  public:
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpEmptyInterface : public ::ndk::BpCInterface<IEmptyInterface> {
+  public:
+    explicit BpEmptyInterface(const ::ndk::SpAIBinder& binder);
+    virtual ~BpEmptyInterface();
+
+  };
+  class BnEmptyInterface : public ::ndk::BnCInterface<IEmptyInterface> {
+  public:
+    BnEmptyInterface();
+    virtual ~BnEmptyInterface();
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  std::array<std::array<int32_t, 3>, 2> int2x3 = {{{{1, 2, 3}}, {{4, 5, 6}}}};
+  std::array<bool, 2> boolArray = {{}};
+  std::array<uint8_t, 2> byteArray = {{}};
+  std::array<char16_t, 2> charArray = {{}};
+  std::array<int32_t, 2> intArray = {{}};
+  std::array<int64_t, 2> longArray = {{}};
+  std::array<float, 2> floatArray = {{}};
+  std::array<double, 2> doubleArray = {{}};
+  std::array<std::string, 2> stringArray = {{"hello", "world"}};
+  std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 2> byteEnumArray = {{}};
+  std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 2> intEnumArray = {{}};
+  std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 2> longEnumArray = {{}};
+  std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 2> parcelableArray = {{}};
+  std::array<std::array<bool, 2>, 2> boolMatrix = {{}};
+  std::array<std::array<uint8_t, 2>, 2> byteMatrix = {{}};
+  std::array<std::array<char16_t, 2>, 2> charMatrix = {{}};
+  std::array<std::array<int32_t, 2>, 2> intMatrix = {{}};
+  std::array<std::array<int64_t, 2>, 2> longMatrix = {{}};
+  std::array<std::array<float, 2>, 2> floatMatrix = {{}};
+  std::array<std::array<double, 2>, 2> doubleMatrix = {{}};
+  std::array<std::array<std::string, 2>, 2> stringMatrix = {{{{"hello", "world"}}, {{"Ciao", "mondo"}}}};
+  std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 2>, 2> byteEnumMatrix = {{}};
+  std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 2>, 2> intEnumMatrix = {{}};
+  std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 2>, 2> longEnumMatrix = {{}};
+  std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable, 2>, 2> parcelableMatrix = {{}};
+  std::optional<std::array<bool, 2>> boolNullableArray;
+  std::optional<std::array<uint8_t, 2>> byteNullableArray;
+  std::optional<std::array<char16_t, 2>> charNullableArray;
+  std::optional<std::array<int32_t, 2>> intNullableArray;
+  std::optional<std::array<int64_t, 2>> longNullableArray;
+  std::optional<std::array<float, 2>> floatNullableArray;
+  std::optional<std::array<double, 2>> doubleNullableArray;
+  std::optional<std::array<std::optional<std::string>, 2>> stringNullableArray = {{{"hello", "world"}}};
+  std::optional<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 2>> byteEnumNullableArray;
+  std::optional<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 2>> intEnumNullableArray;
+  std::optional<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 2>> longEnumNullableArray;
+  std::optional<std::array<::ndk::SpAIBinder, 2>> binderNullableArray;
+  std::optional<std::array<::ndk::ScopedFileDescriptor, 2>> pfdNullableArray;
+  std::optional<std::array<std::optional<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable>, 2>> parcelableNullableArray;
+  std::optional<std::array<std::shared_ptr<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IEmptyInterface>, 2>> interfaceNullableArray;
+  std::optional<std::array<std::array<bool, 2>, 2>> boolNullableMatrix;
+  std::optional<std::array<std::array<uint8_t, 2>, 2>> byteNullableMatrix;
+  std::optional<std::array<std::array<char16_t, 2>, 2>> charNullableMatrix;
+  std::optional<std::array<std::array<int32_t, 2>, 2>> intNullableMatrix;
+  std::optional<std::array<std::array<int64_t, 2>, 2>> longNullableMatrix;
+  std::optional<std::array<std::array<float, 2>, 2>> floatNullableMatrix;
+  std::optional<std::array<std::array<double, 2>, 2>> doubleNullableMatrix;
+  std::optional<std::array<std::array<std::optional<std::string>, 2>, 2>> stringNullableMatrix = {{{{{"hello", "world"}}, {{"Ciao", "mondo"}}}}};
+  std::optional<std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 2>, 2>> byteEnumNullableMatrix;
+  std::optional<std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 2>, 2>> intEnumNullableMatrix;
+  std::optional<std::array<std::array<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 2>, 2>> longEnumNullableMatrix;
+  std::optional<std::array<std::array<::ndk::SpAIBinder, 2>, 2>> binderNullableMatrix;
+  std::optional<std::array<std::array<::ndk::ScopedFileDescriptor, 2>, 2>> pfdNullableMatrix;
+  std::optional<std::array<std::array<std::optional<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntParcelable>, 2>, 2>> parcelableNullableMatrix;
+  std::optional<std::array<std::array<std::shared_ptr<::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IEmptyInterface>, 2>, 2>> interfaceNullableMatrix;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) != std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator<(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) < std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator<=(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) <= std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator==(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) == std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator>(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) > std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+  inline bool operator>=(const FixedSizeArrayExample& rhs) const {
+    return std::tie(int2x3, boolArray, byteArray, charArray, intArray, longArray, floatArray, doubleArray, stringArray, byteEnumArray, intEnumArray, longEnumArray, parcelableArray, boolMatrix, byteMatrix, charMatrix, intMatrix, longMatrix, floatMatrix, doubleMatrix, stringMatrix, byteEnumMatrix, intEnumMatrix, longEnumMatrix, parcelableMatrix, boolNullableArray, byteNullableArray, charNullableArray, intNullableArray, longNullableArray, floatNullableArray, doubleNullableArray, stringNullableArray, byteEnumNullableArray, intEnumNullableArray, longEnumNullableArray, binderNullableArray, pfdNullableArray, parcelableNullableArray, interfaceNullableArray, boolNullableMatrix, byteNullableMatrix, charNullableMatrix, intNullableMatrix, longNullableMatrix, floatNullableMatrix, doubleNullableMatrix, stringNullableMatrix, byteEnumNullableMatrix, intEnumNullableMatrix, longEnumNullableMatrix, binderNullableMatrix, pfdNullableMatrix, parcelableNullableMatrix, interfaceNullableMatrix) >= std::tie(rhs.int2x3, rhs.boolArray, rhs.byteArray, rhs.charArray, rhs.intArray, rhs.longArray, rhs.floatArray, rhs.doubleArray, rhs.stringArray, rhs.byteEnumArray, rhs.intEnumArray, rhs.longEnumArray, rhs.parcelableArray, rhs.boolMatrix, rhs.byteMatrix, rhs.charMatrix, rhs.intMatrix, rhs.longMatrix, rhs.floatMatrix, rhs.doubleMatrix, rhs.stringMatrix, rhs.byteEnumMatrix, rhs.intEnumMatrix, rhs.longEnumMatrix, rhs.parcelableMatrix, rhs.boolNullableArray, rhs.byteNullableArray, rhs.charNullableArray, rhs.intNullableArray, rhs.longNullableArray, rhs.floatNullableArray, rhs.doubleNullableArray, rhs.stringNullableArray, rhs.byteEnumNullableArray, rhs.intEnumNullableArray, rhs.longEnumNullableArray, rhs.binderNullableArray, rhs.pfdNullableArray, rhs.parcelableNullableArray, rhs.interfaceNullableArray, rhs.boolNullableMatrix, rhs.byteNullableMatrix, rhs.charNullableMatrix, rhs.intNullableMatrix, rhs.longNullableMatrix, rhs.floatNullableMatrix, rhs.doubleNullableMatrix, rhs.stringNullableMatrix, rhs.byteEnumNullableMatrix, rhs.intEnumNullableMatrix, rhs.longEnumNullableMatrix, rhs.binderNullableMatrix, rhs.pfdNullableMatrix, rhs.parcelableNullableMatrix, rhs.interfaceNullableMatrix);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "FixedSizeArrayExample{";
+    os << "int2x3: " << ::android::internal::ToString(int2x3);
+    os << ", boolArray: " << ::android::internal::ToString(boolArray);
+    os << ", byteArray: " << ::android::internal::ToString(byteArray);
+    os << ", charArray: " << ::android::internal::ToString(charArray);
+    os << ", intArray: " << ::android::internal::ToString(intArray);
+    os << ", longArray: " << ::android::internal::ToString(longArray);
+    os << ", floatArray: " << ::android::internal::ToString(floatArray);
+    os << ", doubleArray: " << ::android::internal::ToString(doubleArray);
+    os << ", stringArray: " << ::android::internal::ToString(stringArray);
+    os << ", byteEnumArray: " << ::android::internal::ToString(byteEnumArray);
+    os << ", intEnumArray: " << ::android::internal::ToString(intEnumArray);
+    os << ", longEnumArray: " << ::android::internal::ToString(longEnumArray);
+    os << ", parcelableArray: " << ::android::internal::ToString(parcelableArray);
+    os << ", boolMatrix: " << ::android::internal::ToString(boolMatrix);
+    os << ", byteMatrix: " << ::android::internal::ToString(byteMatrix);
+    os << ", charMatrix: " << ::android::internal::ToString(charMatrix);
+    os << ", intMatrix: " << ::android::internal::ToString(intMatrix);
+    os << ", longMatrix: " << ::android::internal::ToString(longMatrix);
+    os << ", floatMatrix: " << ::android::internal::ToString(floatMatrix);
+    os << ", doubleMatrix: " << ::android::internal::ToString(doubleMatrix);
+    os << ", stringMatrix: " << ::android::internal::ToString(stringMatrix);
+    os << ", byteEnumMatrix: " << ::android::internal::ToString(byteEnumMatrix);
+    os << ", intEnumMatrix: " << ::android::internal::ToString(intEnumMatrix);
+    os << ", longEnumMatrix: " << ::android::internal::ToString(longEnumMatrix);
+    os << ", parcelableMatrix: " << ::android::internal::ToString(parcelableMatrix);
+    os << ", boolNullableArray: " << ::android::internal::ToString(boolNullableArray);
+    os << ", byteNullableArray: " << ::android::internal::ToString(byteNullableArray);
+    os << ", charNullableArray: " << ::android::internal::ToString(charNullableArray);
+    os << ", intNullableArray: " << ::android::internal::ToString(intNullableArray);
+    os << ", longNullableArray: " << ::android::internal::ToString(longNullableArray);
+    os << ", floatNullableArray: " << ::android::internal::ToString(floatNullableArray);
+    os << ", doubleNullableArray: " << ::android::internal::ToString(doubleNullableArray);
+    os << ", stringNullableArray: " << ::android::internal::ToString(stringNullableArray);
+    os << ", byteEnumNullableArray: " << ::android::internal::ToString(byteEnumNullableArray);
+    os << ", intEnumNullableArray: " << ::android::internal::ToString(intEnumNullableArray);
+    os << ", longEnumNullableArray: " << ::android::internal::ToString(longEnumNullableArray);
+    os << ", binderNullableArray: " << ::android::internal::ToString(binderNullableArray);
+    os << ", pfdNullableArray: " << ::android::internal::ToString(pfdNullableArray);
+    os << ", parcelableNullableArray: " << ::android::internal::ToString(parcelableNullableArray);
+    os << ", interfaceNullableArray: " << ::android::internal::ToString(interfaceNullableArray);
+    os << ", boolNullableMatrix: " << ::android::internal::ToString(boolNullableMatrix);
+    os << ", byteNullableMatrix: " << ::android::internal::ToString(byteNullableMatrix);
+    os << ", charNullableMatrix: " << ::android::internal::ToString(charNullableMatrix);
+    os << ", intNullableMatrix: " << ::android::internal::ToString(intNullableMatrix);
+    os << ", longNullableMatrix: " << ::android::internal::ToString(longNullableMatrix);
+    os << ", floatNullableMatrix: " << ::android::internal::ToString(floatNullableMatrix);
+    os << ", doubleNullableMatrix: " << ::android::internal::ToString(doubleNullableMatrix);
+    os << ", stringNullableMatrix: " << ::android::internal::ToString(stringNullableMatrix);
+    os << ", byteEnumNullableMatrix: " << ::android::internal::ToString(byteEnumNullableMatrix);
+    os << ", intEnumNullableMatrix: " << ::android::internal::ToString(intEnumNullableMatrix);
+    os << ", longEnumNullableMatrix: " << ::android::internal::ToString(longEnumNullableMatrix);
+    os << ", binderNullableMatrix: " << ::android::internal::ToString(binderNullableMatrix);
+    os << ", pfdNullableMatrix: " << ::android::internal::ToString(pfdNullableMatrix);
+    os << ", parcelableNullableMatrix: " << ::android::internal::ToString(parcelableNullableMatrix);
+    os << ", interfaceNullableMatrix: " << ::android::internal::ToString(interfaceNullableMatrix);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+[[nodiscard]] static inline std::string toString(FixedSizeArrayExample::ByteEnum val) {
+  switch(val) {
+  case FixedSizeArrayExample::ByteEnum::A:
+    return "A";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum, 1> enum_values<aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum> = {
+  aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::ByteEnum::A,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+[[nodiscard]] static inline std::string toString(FixedSizeArrayExample::IntEnum val) {
+  switch(val) {
+  case FixedSizeArrayExample::IntEnum::A:
+    return "A";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum, 1> enum_values<aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum> = {
+  aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::IntEnum::A,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace fixedsizearray {
+[[nodiscard]] static inline std::string toString(FixedSizeArrayExample::LongEnum val) {
+  switch(val) {
+  case FixedSizeArrayExample::LongEnum::A:
+    return "A";
+  default:
+    return std::to_string(static_cast<int64_t>(val));
+  }
+}
+}  // namespace fixedsizearray
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum, 1> enum_values<aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum> = {
+  aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::LongEnum::A,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-ndk-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs b/tests/golden_output/frozen/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs
new file mode 100644
index 0000000..7533d9d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs
@@ -0,0 +1,1074 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug, PartialEq)]
+pub struct r#FixedSizeArrayExample {
+  pub r#int2x3: [[i32; 3]; 2],
+  pub r#boolArray: [bool; 2],
+  pub r#byteArray: [u8; 2],
+  pub r#charArray: [u16; 2],
+  pub r#intArray: [i32; 2],
+  pub r#longArray: [i64; 2],
+  pub r#floatArray: [f32; 2],
+  pub r#doubleArray: [f64; 2],
+  pub r#stringArray: [String; 2],
+  pub r#byteEnumArray: [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_ByteEnum; 2],
+  pub r#intEnumArray: [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_7_IntEnum; 2],
+  pub r#longEnumArray: [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_LongEnum; 2],
+  pub r#parcelableArray: [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 2],
+  pub r#boolMatrix: [[bool; 2]; 2],
+  pub r#byteMatrix: [[u8; 2]; 2],
+  pub r#charMatrix: [[u16; 2]; 2],
+  pub r#intMatrix: [[i32; 2]; 2],
+  pub r#longMatrix: [[i64; 2]; 2],
+  pub r#floatMatrix: [[f32; 2]; 2],
+  pub r#doubleMatrix: [[f64; 2]; 2],
+  pub r#stringMatrix: [[String; 2]; 2],
+  pub r#byteEnumMatrix: [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_ByteEnum; 2]; 2],
+  pub r#intEnumMatrix: [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_7_IntEnum; 2]; 2],
+  pub r#longEnumMatrix: [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_LongEnum; 2]; 2],
+  pub r#parcelableMatrix: [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 2]; 2],
+  pub r#boolNullableArray: Option<[bool; 2]>,
+  pub r#byteNullableArray: Option<[u8; 2]>,
+  pub r#charNullableArray: Option<[u16; 2]>,
+  pub r#intNullableArray: Option<[i32; 2]>,
+  pub r#longNullableArray: Option<[i64; 2]>,
+  pub r#floatNullableArray: Option<[f32; 2]>,
+  pub r#doubleNullableArray: Option<[f64; 2]>,
+  pub r#stringNullableArray: Option<[Option<String>; 2]>,
+  pub r#byteEnumNullableArray: Option<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_ByteEnum; 2]>,
+  pub r#intEnumNullableArray: Option<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_7_IntEnum; 2]>,
+  pub r#longEnumNullableArray: Option<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_LongEnum; 2]>,
+  pub r#binderNullableArray: Option<[Option<binder::SpIBinder>; 2]>,
+  pub r#pfdNullableArray: Option<[Option<binder::ParcelFileDescriptor>; 2]>,
+  pub r#parcelableNullableArray: Option<[Option<crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable>; 2]>,
+  pub r#interfaceNullableArray: Option<[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_15_IEmptyInterface>>; 2]>,
+  pub r#boolNullableMatrix: Option<[[bool; 2]; 2]>,
+  pub r#byteNullableMatrix: Option<[[u8; 2]; 2]>,
+  pub r#charNullableMatrix: Option<[[u16; 2]; 2]>,
+  pub r#intNullableMatrix: Option<[[i32; 2]; 2]>,
+  pub r#longNullableMatrix: Option<[[i64; 2]; 2]>,
+  pub r#floatNullableMatrix: Option<[[f32; 2]; 2]>,
+  pub r#doubleNullableMatrix: Option<[[f64; 2]; 2]>,
+  pub r#stringNullableMatrix: Option<[[Option<String>; 2]; 2]>,
+  pub r#byteEnumNullableMatrix: Option<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_ByteEnum; 2]; 2]>,
+  pub r#intEnumNullableMatrix: Option<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_7_IntEnum; 2]; 2]>,
+  pub r#longEnumNullableMatrix: Option<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_LongEnum; 2]; 2]>,
+  pub r#binderNullableMatrix: Option<[[Option<binder::SpIBinder>; 2]; 2]>,
+  pub r#pfdNullableMatrix: Option<[[Option<binder::ParcelFileDescriptor>; 2]; 2]>,
+  pub r#parcelableNullableMatrix: Option<[[Option<crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable>; 2]; 2]>,
+  pub r#interfaceNullableMatrix: Option<[[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_15_IEmptyInterface>>; 2]; 2]>,
+}
+impl Default for r#FixedSizeArrayExample {
+  fn default() -> Self {
+    Self {
+      r#int2x3: [[1, 2, 3], [4, 5, 6]],
+      r#boolArray: [Default::default(), Default::default()],
+      r#byteArray: [Default::default(), Default::default()],
+      r#charArray: [Default::default(), Default::default()],
+      r#intArray: [Default::default(), Default::default()],
+      r#longArray: [Default::default(), Default::default()],
+      r#floatArray: [Default::default(), Default::default()],
+      r#doubleArray: [Default::default(), Default::default()],
+      r#stringArray: ["hello".into(), "world".into()],
+      r#byteEnumArray: [Default::default(), Default::default()],
+      r#intEnumArray: [Default::default(), Default::default()],
+      r#longEnumArray: [Default::default(), Default::default()],
+      r#parcelableArray: [Default::default(), Default::default()],
+      r#boolMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#byteMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#charMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#intMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#longMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#floatMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#doubleMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#stringMatrix: [["hello".into(), "world".into()], ["Ciao".into(), "mondo".into()]],
+      r#byteEnumMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#intEnumMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#longEnumMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#parcelableMatrix: [[Default::default(), Default::default()], [Default::default(), Default::default()]],
+      r#boolNullableArray: Default::default(),
+      r#byteNullableArray: Default::default(),
+      r#charNullableArray: Default::default(),
+      r#intNullableArray: Default::default(),
+      r#longNullableArray: Default::default(),
+      r#floatNullableArray: Default::default(),
+      r#doubleNullableArray: Default::default(),
+      r#stringNullableArray: Some([Some("hello".into()), Some("world".into())]),
+      r#byteEnumNullableArray: Default::default(),
+      r#intEnumNullableArray: Default::default(),
+      r#longEnumNullableArray: Default::default(),
+      r#binderNullableArray: Default::default(),
+      r#pfdNullableArray: Default::default(),
+      r#parcelableNullableArray: Default::default(),
+      r#interfaceNullableArray: Default::default(),
+      r#boolNullableMatrix: Default::default(),
+      r#byteNullableMatrix: Default::default(),
+      r#charNullableMatrix: Default::default(),
+      r#intNullableMatrix: Default::default(),
+      r#longNullableMatrix: Default::default(),
+      r#floatNullableMatrix: Default::default(),
+      r#doubleNullableMatrix: Default::default(),
+      r#stringNullableMatrix: Some([[Some("hello".into()), Some("world".into())], [Some("Ciao".into()), Some("mondo".into())]]),
+      r#byteEnumNullableMatrix: Default::default(),
+      r#intEnumNullableMatrix: Default::default(),
+      r#longEnumNullableMatrix: Default::default(),
+      r#binderNullableMatrix: Default::default(),
+      r#pfdNullableMatrix: Default::default(),
+      r#parcelableNullableMatrix: Default::default(),
+      r#interfaceNullableMatrix: Default::default(),
+    }
+  }
+}
+impl binder::Parcelable for r#FixedSizeArrayExample {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#int2x3)?;
+      subparcel.write(&self.r#boolArray)?;
+      subparcel.write(&self.r#byteArray)?;
+      subparcel.write(&self.r#charArray)?;
+      subparcel.write(&self.r#intArray)?;
+      subparcel.write(&self.r#longArray)?;
+      subparcel.write(&self.r#floatArray)?;
+      subparcel.write(&self.r#doubleArray)?;
+      subparcel.write(&self.r#stringArray)?;
+      subparcel.write(&self.r#byteEnumArray)?;
+      subparcel.write(&self.r#intEnumArray)?;
+      subparcel.write(&self.r#longEnumArray)?;
+      subparcel.write(&self.r#parcelableArray)?;
+      subparcel.write(&self.r#boolMatrix)?;
+      subparcel.write(&self.r#byteMatrix)?;
+      subparcel.write(&self.r#charMatrix)?;
+      subparcel.write(&self.r#intMatrix)?;
+      subparcel.write(&self.r#longMatrix)?;
+      subparcel.write(&self.r#floatMatrix)?;
+      subparcel.write(&self.r#doubleMatrix)?;
+      subparcel.write(&self.r#stringMatrix)?;
+      subparcel.write(&self.r#byteEnumMatrix)?;
+      subparcel.write(&self.r#intEnumMatrix)?;
+      subparcel.write(&self.r#longEnumMatrix)?;
+      subparcel.write(&self.r#parcelableMatrix)?;
+      subparcel.write(&self.r#boolNullableArray)?;
+      subparcel.write(&self.r#byteNullableArray)?;
+      subparcel.write(&self.r#charNullableArray)?;
+      subparcel.write(&self.r#intNullableArray)?;
+      subparcel.write(&self.r#longNullableArray)?;
+      subparcel.write(&self.r#floatNullableArray)?;
+      subparcel.write(&self.r#doubleNullableArray)?;
+      subparcel.write(&self.r#stringNullableArray)?;
+      subparcel.write(&self.r#byteEnumNullableArray)?;
+      subparcel.write(&self.r#intEnumNullableArray)?;
+      subparcel.write(&self.r#longEnumNullableArray)?;
+      subparcel.write(&self.r#binderNullableArray)?;
+      subparcel.write(&self.r#pfdNullableArray)?;
+      subparcel.write(&self.r#parcelableNullableArray)?;
+      subparcel.write(&self.r#interfaceNullableArray)?;
+      subparcel.write(&self.r#boolNullableMatrix)?;
+      subparcel.write(&self.r#byteNullableMatrix)?;
+      subparcel.write(&self.r#charNullableMatrix)?;
+      subparcel.write(&self.r#intNullableMatrix)?;
+      subparcel.write(&self.r#longNullableMatrix)?;
+      subparcel.write(&self.r#floatNullableMatrix)?;
+      subparcel.write(&self.r#doubleNullableMatrix)?;
+      subparcel.write(&self.r#stringNullableMatrix)?;
+      subparcel.write(&self.r#byteEnumNullableMatrix)?;
+      subparcel.write(&self.r#intEnumNullableMatrix)?;
+      subparcel.write(&self.r#longEnumNullableMatrix)?;
+      subparcel.write(&self.r#binderNullableMatrix)?;
+      subparcel.write(&self.r#pfdNullableMatrix)?;
+      subparcel.write(&self.r#parcelableNullableMatrix)?;
+      subparcel.write(&self.r#interfaceNullableMatrix)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#int2x3 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#boolArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#charArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#floatArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#doubleArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#stringArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteEnumArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intEnumArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longEnumArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#parcelableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#boolMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#charMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#floatMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#doubleMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#stringMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteEnumMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intEnumMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longEnumMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#parcelableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#boolNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#charNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#floatNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#doubleNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#stringNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteEnumNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intEnumNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longEnumNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#binderNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#pfdNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#parcelableNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#interfaceNullableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#boolNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#charNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#floatNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#doubleNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#stringNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteEnumNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intEnumNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longEnumNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#binderNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#pfdNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#parcelableNullableMatrix = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#interfaceNullableMatrix = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#FixedSizeArrayExample);
+binder::impl_deserialize_for_parcelable!(r#FixedSizeArrayExample);
+impl binder::binder_impl::ParcelableMetadata for r#FixedSizeArrayExample {
+  fn get_descriptor() -> &'static str { "android.aidl.fixedsizearray.FixedSizeArrayExample" }
+}
+pub mod r#IRepeatFixedSizeArray {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    IRepeatFixedSizeArray["android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray"] {
+      native: BnRepeatFixedSizeArray(on_transact),
+      proxy: BpRepeatFixedSizeArray {
+      },
+      async: IRepeatFixedSizeArrayAsync,
+    }
+  }
+  pub trait IRepeatFixedSizeArray: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray" }
+    fn r#RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3]) -> binder::Result<[u8; 3]>;
+    fn r#RepeatInts(&self, _arg_input: &[i32; 3], _arg_repeated: &mut [i32; 3]) -> binder::Result<[i32; 3]>;
+    fn r#RepeatBinders(&self, _arg_input: &[binder::SpIBinder; 3], _arg_repeated: &mut [Option<binder::SpIBinder>; 3]) -> binder::Result<[binder::SpIBinder; 3]>;
+    fn r#RepeatParcelables(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]>;
+    fn r#Repeat2dBytes(&self, _arg_input: &[[u8; 3]; 2], _arg_repeated: &mut [[u8; 3]; 2]) -> binder::Result<[[u8; 3]; 2]>;
+    fn r#Repeat2dInts(&self, _arg_input: &[[i32; 3]; 2], _arg_repeated: &mut [[i32; 3]; 2]) -> binder::Result<[[i32; 3]; 2]>;
+    fn r#Repeat2dBinders(&self, _arg_input: &[[binder::SpIBinder; 3]; 2], _arg_repeated: &mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::Result<[[binder::SpIBinder; 3]; 2]>;
+    fn r#Repeat2dParcelables(&self, _arg_input: &[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]>;
+    fn getDefaultImpl() -> IRepeatFixedSizeArrayDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: IRepeatFixedSizeArrayDefaultRef) -> IRepeatFixedSizeArrayDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait IRepeatFixedSizeArrayAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray" }
+    fn r#RepeatBytes<'a>(&'a self, _arg_input: &'a [u8; 3], _arg_repeated: &'a mut [u8; 3]) -> binder::BoxFuture<'a, binder::Result<[u8; 3]>>;
+    fn r#RepeatInts<'a>(&'a self, _arg_input: &'a [i32; 3], _arg_repeated: &'a mut [i32; 3]) -> binder::BoxFuture<'a, binder::Result<[i32; 3]>>;
+    fn r#RepeatBinders<'a>(&'a self, _arg_input: &'a [binder::SpIBinder; 3], _arg_repeated: &'a mut [Option<binder::SpIBinder>; 3]) -> binder::BoxFuture<'a, binder::Result<[binder::SpIBinder; 3]>>;
+    fn r#RepeatParcelables<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &'a mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::BoxFuture<'a, binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]>>;
+    fn r#Repeat2dBytes<'a>(&'a self, _arg_input: &'a [[u8; 3]; 2], _arg_repeated: &'a mut [[u8; 3]; 2]) -> binder::BoxFuture<'a, binder::Result<[[u8; 3]; 2]>>;
+    fn r#Repeat2dInts<'a>(&'a self, _arg_input: &'a [[i32; 3]; 2], _arg_repeated: &'a mut [[i32; 3]; 2]) -> binder::BoxFuture<'a, binder::Result<[[i32; 3]; 2]>>;
+    fn r#Repeat2dBinders<'a>(&'a self, _arg_input: &'a [[binder::SpIBinder; 3]; 2], _arg_repeated: &'a mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::BoxFuture<'a, binder::Result<[[binder::SpIBinder; 3]; 2]>>;
+    fn r#Repeat2dParcelables<'a>(&'a self, _arg_input: &'a [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &'a mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::BoxFuture<'a, binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]>>;
+  }
+  #[::async_trait::async_trait]
+  pub trait IRepeatFixedSizeArrayAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray" }
+    async fn r#RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3]) -> binder::Result<[u8; 3]>;
+    async fn r#RepeatInts(&self, _arg_input: &[i32; 3], _arg_repeated: &mut [i32; 3]) -> binder::Result<[i32; 3]>;
+    async fn r#RepeatBinders(&self, _arg_input: &[binder::SpIBinder; 3], _arg_repeated: &mut [Option<binder::SpIBinder>; 3]) -> binder::Result<[binder::SpIBinder; 3]>;
+    async fn r#RepeatParcelables(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]>;
+    async fn r#Repeat2dBytes(&self, _arg_input: &[[u8; 3]; 2], _arg_repeated: &mut [[u8; 3]; 2]) -> binder::Result<[[u8; 3]; 2]>;
+    async fn r#Repeat2dInts(&self, _arg_input: &[[i32; 3]; 2], _arg_repeated: &mut [[i32; 3]; 2]) -> binder::Result<[[i32; 3]; 2]>;
+    async fn r#Repeat2dBinders(&self, _arg_input: &[[binder::SpIBinder; 3]; 2], _arg_repeated: &mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::Result<[[binder::SpIBinder; 3]; 2]>;
+    async fn r#Repeat2dParcelables(&self, _arg_input: &[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]>;
+  }
+  impl BnRepeatFixedSizeArray {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IRepeatFixedSizeArray>
+    where
+      T: IRepeatFixedSizeArrayAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> IRepeatFixedSizeArray for Wrapper<T, R>
+      where
+        T: IRepeatFixedSizeArrayAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+        fn r#RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3]) -> binder::Result<[u8; 3]> {
+          self._rt.block_on(self._inner.r#RepeatBytes(_arg_input, _arg_repeated))
+        }
+        fn r#RepeatInts(&self, _arg_input: &[i32; 3], _arg_repeated: &mut [i32; 3]) -> binder::Result<[i32; 3]> {
+          self._rt.block_on(self._inner.r#RepeatInts(_arg_input, _arg_repeated))
+        }
+        fn r#RepeatBinders(&self, _arg_input: &[binder::SpIBinder; 3], _arg_repeated: &mut [Option<binder::SpIBinder>; 3]) -> binder::Result<[binder::SpIBinder; 3]> {
+          self._rt.block_on(self._inner.r#RepeatBinders(_arg_input, _arg_repeated))
+        }
+        fn r#RepeatParcelables(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]> {
+          self._rt.block_on(self._inner.r#RepeatParcelables(_arg_input, _arg_repeated))
+        }
+        fn r#Repeat2dBytes(&self, _arg_input: &[[u8; 3]; 2], _arg_repeated: &mut [[u8; 3]; 2]) -> binder::Result<[[u8; 3]; 2]> {
+          self._rt.block_on(self._inner.r#Repeat2dBytes(_arg_input, _arg_repeated))
+        }
+        fn r#Repeat2dInts(&self, _arg_input: &[[i32; 3]; 2], _arg_repeated: &mut [[i32; 3]; 2]) -> binder::Result<[[i32; 3]; 2]> {
+          self._rt.block_on(self._inner.r#Repeat2dInts(_arg_input, _arg_repeated))
+        }
+        fn r#Repeat2dBinders(&self, _arg_input: &[[binder::SpIBinder; 3]; 2], _arg_repeated: &mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::Result<[[binder::SpIBinder; 3]; 2]> {
+          self._rt.block_on(self._inner.r#Repeat2dBinders(_arg_input, _arg_repeated))
+        }
+        fn r#Repeat2dParcelables(&self, _arg_input: &[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]> {
+          self._rt.block_on(self._inner.r#Repeat2dParcelables(_arg_input, _arg_repeated))
+        }
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait IRepeatFixedSizeArrayDefault: Send + Sync {
+    fn r#RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3]) -> binder::Result<[u8; 3]> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#RepeatInts(&self, _arg_input: &[i32; 3], _arg_repeated: &mut [i32; 3]) -> binder::Result<[i32; 3]> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#RepeatBinders(&self, _arg_input: &[binder::SpIBinder; 3], _arg_repeated: &mut [Option<binder::SpIBinder>; 3]) -> binder::Result<[binder::SpIBinder; 3]> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#RepeatParcelables(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#Repeat2dBytes(&self, _arg_input: &[[u8; 3]; 2], _arg_repeated: &mut [[u8; 3]; 2]) -> binder::Result<[[u8; 3]; 2]> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#Repeat2dInts(&self, _arg_input: &[[i32; 3]; 2], _arg_repeated: &mut [[i32; 3]; 2]) -> binder::Result<[[i32; 3]; 2]> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#Repeat2dBinders(&self, _arg_input: &[[binder::SpIBinder; 3]; 2], _arg_repeated: &mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::Result<[[binder::SpIBinder; 3]; 2]> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#Repeat2dParcelables(&self, _arg_input: &[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+  }
+  pub mod transactions {
+    pub const r#RepeatBytes: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+    pub const r#RepeatInts: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+    pub const r#RepeatBinders: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+    pub const r#RepeatParcelables: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 3;
+    pub const r#Repeat2dBytes: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 4;
+    pub const r#Repeat2dInts: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 5;
+    pub const r#Repeat2dBinders: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 6;
+    pub const r#Repeat2dParcelables: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 7;
+  }
+  pub type IRepeatFixedSizeArrayDefaultRef = Option<std::sync::Arc<dyn IRepeatFixedSizeArrayDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<IRepeatFixedSizeArrayDefaultRef> = std::sync::Mutex::new(None);
+  }
+  impl BpRepeatFixedSizeArray {
+    fn build_parcel_RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3]) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<[u8; 3]> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IRepeatFixedSizeArray>::getDefaultImpl() {
+          return _aidl_default_impl.r#RepeatBytes(_arg_input, _arg_repeated);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: [u8; 3] = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_repeated)?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_RepeatInts(&self, _arg_input: &[i32; 3], _arg_repeated: &mut [i32; 3]) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_RepeatInts(&self, _arg_input: &[i32; 3], _arg_repeated: &mut [i32; 3], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<[i32; 3]> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IRepeatFixedSizeArray>::getDefaultImpl() {
+          return _aidl_default_impl.r#RepeatInts(_arg_input, _arg_repeated);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: [i32; 3] = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_repeated)?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_RepeatBinders(&self, _arg_input: &[binder::SpIBinder; 3], _arg_repeated: &mut [Option<binder::SpIBinder>; 3]) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_RepeatBinders(&self, _arg_input: &[binder::SpIBinder; 3], _arg_repeated: &mut [Option<binder::SpIBinder>; 3], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<[binder::SpIBinder; 3]> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IRepeatFixedSizeArray>::getDefaultImpl() {
+          return _aidl_default_impl.r#RepeatBinders(_arg_input, _arg_repeated);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: [binder::SpIBinder; 3] = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_repeated)?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_RepeatParcelables(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_RepeatParcelables(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IRepeatFixedSizeArray>::getDefaultImpl() {
+          return _aidl_default_impl.r#RepeatParcelables(_arg_input, _arg_repeated);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3] = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_repeated)?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_Repeat2dBytes(&self, _arg_input: &[[u8; 3]; 2], _arg_repeated: &mut [[u8; 3]; 2]) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_Repeat2dBytes(&self, _arg_input: &[[u8; 3]; 2], _arg_repeated: &mut [[u8; 3]; 2], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<[[u8; 3]; 2]> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IRepeatFixedSizeArray>::getDefaultImpl() {
+          return _aidl_default_impl.r#Repeat2dBytes(_arg_input, _arg_repeated);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: [[u8; 3]; 2] = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_repeated)?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_Repeat2dInts(&self, _arg_input: &[[i32; 3]; 2], _arg_repeated: &mut [[i32; 3]; 2]) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_Repeat2dInts(&self, _arg_input: &[[i32; 3]; 2], _arg_repeated: &mut [[i32; 3]; 2], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<[[i32; 3]; 2]> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IRepeatFixedSizeArray>::getDefaultImpl() {
+          return _aidl_default_impl.r#Repeat2dInts(_arg_input, _arg_repeated);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: [[i32; 3]; 2] = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_repeated)?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_Repeat2dBinders(&self, _arg_input: &[[binder::SpIBinder; 3]; 2], _arg_repeated: &mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_Repeat2dBinders(&self, _arg_input: &[[binder::SpIBinder; 3]; 2], _arg_repeated: &mut [[Option<binder::SpIBinder>; 3]; 2], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<[[binder::SpIBinder; 3]; 2]> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IRepeatFixedSizeArray>::getDefaultImpl() {
+          return _aidl_default_impl.r#Repeat2dBinders(_arg_input, _arg_repeated);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: [[binder::SpIBinder; 3]; 2] = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_repeated)?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_Repeat2dParcelables(&self, _arg_input: &[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_Repeat2dParcelables(&self, _arg_input: &[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IRepeatFixedSizeArray>::getDefaultImpl() {
+          return _aidl_default_impl.r#Repeat2dParcelables(_arg_input, _arg_repeated);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2] = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_repeated)?;
+      Ok(_aidl_return)
+    }
+  }
+  impl IRepeatFixedSizeArray for BpRepeatFixedSizeArray {
+    fn r#RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3]) -> binder::Result<[u8; 3]> {
+      let _aidl_data = self.build_parcel_RepeatBytes(_arg_input, _arg_repeated)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatBytes, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_RepeatBytes(_arg_input, _arg_repeated, _aidl_reply)
+    }
+    fn r#RepeatInts(&self, _arg_input: &[i32; 3], _arg_repeated: &mut [i32; 3]) -> binder::Result<[i32; 3]> {
+      let _aidl_data = self.build_parcel_RepeatInts(_arg_input, _arg_repeated)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatInts, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_RepeatInts(_arg_input, _arg_repeated, _aidl_reply)
+    }
+    fn r#RepeatBinders(&self, _arg_input: &[binder::SpIBinder; 3], _arg_repeated: &mut [Option<binder::SpIBinder>; 3]) -> binder::Result<[binder::SpIBinder; 3]> {
+      let _aidl_data = self.build_parcel_RepeatBinders(_arg_input, _arg_repeated)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatBinders, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_RepeatBinders(_arg_input, _arg_repeated, _aidl_reply)
+    }
+    fn r#RepeatParcelables(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]> {
+      let _aidl_data = self.build_parcel_RepeatParcelables(_arg_input, _arg_repeated)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatParcelables, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_RepeatParcelables(_arg_input, _arg_repeated, _aidl_reply)
+    }
+    fn r#Repeat2dBytes(&self, _arg_input: &[[u8; 3]; 2], _arg_repeated: &mut [[u8; 3]; 2]) -> binder::Result<[[u8; 3]; 2]> {
+      let _aidl_data = self.build_parcel_Repeat2dBytes(_arg_input, _arg_repeated)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#Repeat2dBytes, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_Repeat2dBytes(_arg_input, _arg_repeated, _aidl_reply)
+    }
+    fn r#Repeat2dInts(&self, _arg_input: &[[i32; 3]; 2], _arg_repeated: &mut [[i32; 3]; 2]) -> binder::Result<[[i32; 3]; 2]> {
+      let _aidl_data = self.build_parcel_Repeat2dInts(_arg_input, _arg_repeated)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#Repeat2dInts, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_Repeat2dInts(_arg_input, _arg_repeated, _aidl_reply)
+    }
+    fn r#Repeat2dBinders(&self, _arg_input: &[[binder::SpIBinder; 3]; 2], _arg_repeated: &mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::Result<[[binder::SpIBinder; 3]; 2]> {
+      let _aidl_data = self.build_parcel_Repeat2dBinders(_arg_input, _arg_repeated)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#Repeat2dBinders, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_Repeat2dBinders(_arg_input, _arg_repeated, _aidl_reply)
+    }
+    fn r#Repeat2dParcelables(&self, _arg_input: &[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]> {
+      let _aidl_data = self.build_parcel_Repeat2dParcelables(_arg_input, _arg_repeated)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#Repeat2dParcelables, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_Repeat2dParcelables(_arg_input, _arg_repeated, _aidl_reply)
+    }
+  }
+  impl<P: binder::BinderAsyncPool> IRepeatFixedSizeArrayAsync<P> for BpRepeatFixedSizeArray {
+    fn r#RepeatBytes<'a>(&'a self, _arg_input: &'a [u8; 3], _arg_repeated: &'a mut [u8; 3]) -> binder::BoxFuture<'a, binder::Result<[u8; 3]>> {
+      let _aidl_data = match self.build_parcel_RepeatBytes(_arg_input, _arg_repeated) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#RepeatBytes, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_RepeatBytes(_arg_input, _arg_repeated, _aidl_reply)
+        }
+      )
+    }
+    fn r#RepeatInts<'a>(&'a self, _arg_input: &'a [i32; 3], _arg_repeated: &'a mut [i32; 3]) -> binder::BoxFuture<'a, binder::Result<[i32; 3]>> {
+      let _aidl_data = match self.build_parcel_RepeatInts(_arg_input, _arg_repeated) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#RepeatInts, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_RepeatInts(_arg_input, _arg_repeated, _aidl_reply)
+        }
+      )
+    }
+    fn r#RepeatBinders<'a>(&'a self, _arg_input: &'a [binder::SpIBinder; 3], _arg_repeated: &'a mut [Option<binder::SpIBinder>; 3]) -> binder::BoxFuture<'a, binder::Result<[binder::SpIBinder; 3]>> {
+      let _aidl_data = match self.build_parcel_RepeatBinders(_arg_input, _arg_repeated) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#RepeatBinders, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_RepeatBinders(_arg_input, _arg_repeated, _aidl_reply)
+        }
+      )
+    }
+    fn r#RepeatParcelables<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &'a mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::BoxFuture<'a, binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]>> {
+      let _aidl_data = match self.build_parcel_RepeatParcelables(_arg_input, _arg_repeated) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#RepeatParcelables, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_RepeatParcelables(_arg_input, _arg_repeated, _aidl_reply)
+        }
+      )
+    }
+    fn r#Repeat2dBytes<'a>(&'a self, _arg_input: &'a [[u8; 3]; 2], _arg_repeated: &'a mut [[u8; 3]; 2]) -> binder::BoxFuture<'a, binder::Result<[[u8; 3]; 2]>> {
+      let _aidl_data = match self.build_parcel_Repeat2dBytes(_arg_input, _arg_repeated) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#Repeat2dBytes, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_Repeat2dBytes(_arg_input, _arg_repeated, _aidl_reply)
+        }
+      )
+    }
+    fn r#Repeat2dInts<'a>(&'a self, _arg_input: &'a [[i32; 3]; 2], _arg_repeated: &'a mut [[i32; 3]; 2]) -> binder::BoxFuture<'a, binder::Result<[[i32; 3]; 2]>> {
+      let _aidl_data = match self.build_parcel_Repeat2dInts(_arg_input, _arg_repeated) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#Repeat2dInts, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_Repeat2dInts(_arg_input, _arg_repeated, _aidl_reply)
+        }
+      )
+    }
+    fn r#Repeat2dBinders<'a>(&'a self, _arg_input: &'a [[binder::SpIBinder; 3]; 2], _arg_repeated: &'a mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::BoxFuture<'a, binder::Result<[[binder::SpIBinder; 3]; 2]>> {
+      let _aidl_data = match self.build_parcel_Repeat2dBinders(_arg_input, _arg_repeated) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#Repeat2dBinders, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_Repeat2dBinders(_arg_input, _arg_repeated, _aidl_reply)
+        }
+      )
+    }
+    fn r#Repeat2dParcelables<'a>(&'a self, _arg_input: &'a [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &'a mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::BoxFuture<'a, binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]>> {
+      let _aidl_data = match self.build_parcel_Repeat2dParcelables(_arg_input, _arg_repeated) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#Repeat2dParcelables, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_Repeat2dParcelables(_arg_input, _arg_repeated, _aidl_reply)
+        }
+      )
+    }
+  }
+  impl IRepeatFixedSizeArray for binder::binder_impl::Binder<BnRepeatFixedSizeArray> {
+    fn r#RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3]) -> binder::Result<[u8; 3]> { self.0.r#RepeatBytes(_arg_input, _arg_repeated) }
+    fn r#RepeatInts(&self, _arg_input: &[i32; 3], _arg_repeated: &mut [i32; 3]) -> binder::Result<[i32; 3]> { self.0.r#RepeatInts(_arg_input, _arg_repeated) }
+    fn r#RepeatBinders(&self, _arg_input: &[binder::SpIBinder; 3], _arg_repeated: &mut [Option<binder::SpIBinder>; 3]) -> binder::Result<[binder::SpIBinder; 3]> { self.0.r#RepeatBinders(_arg_input, _arg_repeated) }
+    fn r#RepeatParcelables(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3], _arg_repeated: &mut [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]) -> binder::Result<[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]> { self.0.r#RepeatParcelables(_arg_input, _arg_repeated) }
+    fn r#Repeat2dBytes(&self, _arg_input: &[[u8; 3]; 2], _arg_repeated: &mut [[u8; 3]; 2]) -> binder::Result<[[u8; 3]; 2]> { self.0.r#Repeat2dBytes(_arg_input, _arg_repeated) }
+    fn r#Repeat2dInts(&self, _arg_input: &[[i32; 3]; 2], _arg_repeated: &mut [[i32; 3]; 2]) -> binder::Result<[[i32; 3]; 2]> { self.0.r#Repeat2dInts(_arg_input, _arg_repeated) }
+    fn r#Repeat2dBinders(&self, _arg_input: &[[binder::SpIBinder; 3]; 2], _arg_repeated: &mut [[Option<binder::SpIBinder>; 3]; 2]) -> binder::Result<[[binder::SpIBinder; 3]; 2]> { self.0.r#Repeat2dBinders(_arg_input, _arg_repeated) }
+    fn r#Repeat2dParcelables(&self, _arg_input: &[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2], _arg_repeated: &mut [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]) -> binder::Result<[[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2]> { self.0.r#Repeat2dParcelables(_arg_input, _arg_repeated) }
+  }
+  fn on_transact(_aidl_service: &dyn IRepeatFixedSizeArray, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      transactions::r#RepeatBytes => {
+        let _arg_input: [u8; 3] = _aidl_data.read()?;
+        let mut _arg_repeated: [u8; 3] = Default::default();
+        let _aidl_return = _aidl_service.r#RepeatBytes(&_arg_input, &mut _arg_repeated);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_repeated)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#RepeatInts => {
+        let _arg_input: [i32; 3] = _aidl_data.read()?;
+        let mut _arg_repeated: [i32; 3] = Default::default();
+        let _aidl_return = _aidl_service.r#RepeatInts(&_arg_input, &mut _arg_repeated);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_repeated)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#RepeatBinders => {
+        let _arg_input: [binder::SpIBinder; 3] = _aidl_data.read()?;
+        let mut _arg_repeated: [Option<binder::SpIBinder>; 3] = Default::default();
+        let _aidl_return = _aidl_service.r#RepeatBinders(&_arg_input, &mut _arg_repeated);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_repeated)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#RepeatParcelables => {
+        let _arg_input: [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3] = _aidl_data.read()?;
+        let mut _arg_repeated: [crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3] = Default::default();
+        let _aidl_return = _aidl_service.r#RepeatParcelables(&_arg_input, &mut _arg_repeated);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_repeated)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#Repeat2dBytes => {
+        let _arg_input: [[u8; 3]; 2] = _aidl_data.read()?;
+        let mut _arg_repeated: [[u8; 3]; 2] = Default::default();
+        let _aidl_return = _aidl_service.r#Repeat2dBytes(&_arg_input, &mut _arg_repeated);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_repeated)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#Repeat2dInts => {
+        let _arg_input: [[i32; 3]; 2] = _aidl_data.read()?;
+        let mut _arg_repeated: [[i32; 3]; 2] = Default::default();
+        let _aidl_return = _aidl_service.r#Repeat2dInts(&_arg_input, &mut _arg_repeated);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_repeated)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#Repeat2dBinders => {
+        let _arg_input: [[binder::SpIBinder; 3]; 2] = _aidl_data.read()?;
+        let mut _arg_repeated: [[Option<binder::SpIBinder>; 3]; 2] = Default::default();
+        let _aidl_return = _aidl_service.r#Repeat2dBinders(&_arg_input, &mut _arg_repeated);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_repeated)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#Repeat2dParcelables => {
+        let _arg_input: [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2] = _aidl_data.read()?;
+        let mut _arg_repeated: [[crate::mangled::_7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable; 3]; 2] = Default::default();
+        let _aidl_return = _aidl_service.r#Repeat2dParcelables(&_arg_input, &mut _arg_repeated);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_repeated)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub mod r#ByteEnum {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#ByteEnum : [i8; 1] {
+      r#A = 0,
+    }
+  }
+}
+pub mod r#IntEnum {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#IntEnum : [i32; 1] {
+      r#A = 0,
+    }
+  }
+}
+pub mod r#LongEnum {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#LongEnum : [i64; 1] {
+      r#A = 0,
+    }
+  }
+}
+pub mod r#IntParcelable {
+  #[derive(Debug, Clone, Copy, PartialEq)]
+  pub struct r#IntParcelable {
+    pub r#value: i32,
+  }
+  impl Default for r#IntParcelable {
+    fn default() -> Self {
+      Self {
+        r#value: 0,
+      }
+    }
+  }
+  impl binder::Parcelable for r#IntParcelable {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        subparcel.write(&self.r#value)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#value = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#IntParcelable);
+  binder::impl_deserialize_for_parcelable!(r#IntParcelable);
+  impl binder::binder_impl::ParcelableMetadata for r#IntParcelable {
+    fn get_descriptor() -> &'static str { "android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable" }
+  }
+}
+pub mod r#IEmptyInterface {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    IEmptyInterface["android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface"] {
+      native: BnEmptyInterface(on_transact),
+      proxy: BpEmptyInterface {
+      },
+      async: IEmptyInterfaceAsync,
+    }
+  }
+  pub trait IEmptyInterface: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface" }
+    fn getDefaultImpl() -> IEmptyInterfaceDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: IEmptyInterfaceDefaultRef) -> IEmptyInterfaceDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait IEmptyInterfaceAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface" }
+  }
+  #[::async_trait::async_trait]
+  pub trait IEmptyInterfaceAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.fixedsizearray.FixedSizeArrayExample.IEmptyInterface" }
+  }
+  impl BnEmptyInterface {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IEmptyInterface>
+    where
+      T: IEmptyInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> IEmptyInterface for Wrapper<T, R>
+      where
+        T: IEmptyInterfaceAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait IEmptyInterfaceDefault: Send + Sync {
+  }
+  pub mod transactions {
+  }
+  pub type IEmptyInterfaceDefaultRef = Option<std::sync::Arc<dyn IEmptyInterfaceDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None);
+  }
+  impl BpEmptyInterface {
+  }
+  impl IEmptyInterface for BpEmptyInterface {
+  }
+  impl<P: binder::BinderAsyncPool> IEmptyInterfaceAsync<P> for BpEmptyInterface {
+  }
+  impl IEmptyInterface for binder::binder_impl::Binder<BnEmptyInterface> {
+  }
+  fn on_transact(_aidl_service: &dyn IEmptyInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#FixedSizeArrayExample as _7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample;
+ pub use super::r#IRepeatFixedSizeArray::r#IRepeatFixedSizeArray as _7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_21_IRepeatFixedSizeArray;
+ pub use super::r#ByteEnum::r#ByteEnum as _7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_ByteEnum;
+ pub use super::r#IntEnum::r#IntEnum as _7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_7_IntEnum;
+ pub use super::r#LongEnum::r#LongEnum as _7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_8_LongEnum;
+ pub use super::r#IntParcelable::r#IntParcelable as _7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_13_IntParcelable;
+ pub use super::r#IEmptyInterface::r#IEmptyInterface as _7_android_4_aidl_14_fixedsizearray_21_FixedSizeArrayExample_15_IEmptyInterface;
+}
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs.d b/tests/golden_output/frozen/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs.d
new file mode 100644
index 0000000..5811cd6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs : \
+  system/tools/aidl/tests/android/aidl/fixedsizearray/FixedSizeArrayExample.aidl
diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-rust-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-fixedsizearray-rust-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-rust-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp
new file mode 100644
index 0000000..dee8d5e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d
new file mode 100644
index 0000000..926b7a9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/BackendType.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/BackendType.cpp
new file mode 100644
index 0000000..9944fa9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/BackendType.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/BackendType.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/BackendType.cpp.d
new file mode 100644
index 0000000..a8eb8f4
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/BackendType.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/BackendType.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ByteEnum.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ByteEnum.cpp
new file mode 100644
index 0000000..960e196
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ByteEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ByteEnum.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ByteEnum.cpp.d
new file mode 100644
index 0000000..dc5cd10
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ByteEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ByteEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/CircularParcelable.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/CircularParcelable.cpp
new file mode 100644
index 0000000..b911760
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/CircularParcelable.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/CircularParcelable.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/CircularParcelable.cpp.d
new file mode 100644
index 0000000..ca732bc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/CircularParcelable.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/CircularParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp
new file mode 100644
index 0000000..20e9b51
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d
new file mode 100644
index 0000000..7c62e12
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedEnum.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedEnum.cpp
new file mode 100644
index 0000000..a6ed0dc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d
new file mode 100644
index 0000000..13e605a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedParcelable.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedParcelable.cpp
new file mode 100644
index 0000000..121a7bc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedParcelable.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d
new file mode 100644
index 0000000..cb06e1f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/DeprecatedParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/FixedSize.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/FixedSize.cpp
new file mode 100644
index 0000000..51a504c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/FixedSize.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/FixedSize.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/FixedSize.cpp.d
new file mode 100644
index 0000000..6f36764
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/FixedSize.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/FixedSize.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp
new file mode 100644
index 0000000..7a76896
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d
new file mode 100644
index 0000000..bc6d54d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ICircular.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ICircular.cpp
new file mode 100644
index 0000000..b71b8c0
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ICircular.cpp
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#include <iostream>
+#include <binder/Parcel.h>
+#include <android/binder_to_string.h>
+#include <android/aidl/tests/ICircular.h>
+namespace {
+android::status_t analyzeICircular(uint32_t _aidl_code, const android::Parcel& _aidl_data, const android::Parcel& _aidl_reply) {
+  android::status_t _aidl_ret_status;
+  switch(_aidl_code) {
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 0:
+    {
+      std::cout << "ICircular.GetTestService()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ICircular")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::sp<::android::aidl::tests::ITestService> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readNullableStrongBinder(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    default:
+    {
+      std::cout << "  Transaction code " << _aidl_code << " not known." << std::endl;
+    _aidl_ret_status = android::UNKNOWN_TRANSACTION;
+    }
+  }
+  return _aidl_ret_status;
+  // To prevent unused variable warnings
+  (void)_aidl_ret_status; (void)_aidl_data; (void)_aidl_reply;
+}
+
+} // namespace
+
+#include <Analyzer.h>
+using android::aidl::Analyzer;
+__attribute__((constructor)) static void addAnalyzer() {
+  Analyzer::installAnalyzer(std::make_unique<Analyzer>("android.aidl.tests.ICircular", "ICircular", &analyzeICircular));
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ICircular.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ICircular.cpp.d
new file mode 100644
index 0000000..caefda2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ICircular.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ICircular.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IDeprecated.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IDeprecated.cpp
new file mode 100644
index 0000000..0c56ecd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IDeprecated.cpp
@@ -0,0 +1,30 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#include <iostream>
+#include <binder/Parcel.h>
+#include <android/binder_to_string.h>
+#include <android/aidl/tests/IDeprecated.h>
+namespace {
+android::status_t analyzeIDeprecated(uint32_t _aidl_code, const android::Parcel& _aidl_data, const android::Parcel& _aidl_reply) {
+  android::status_t _aidl_ret_status;
+  switch(_aidl_code) {
+    default:
+    {
+      std::cout << "  Transaction code " << _aidl_code << " not known." << std::endl;
+    _aidl_ret_status = android::UNKNOWN_TRANSACTION;
+    }
+  }
+  return _aidl_ret_status;
+  // To prevent unused variable warnings
+  (void)_aidl_ret_status; (void)_aidl_data; (void)_aidl_reply;
+}
+
+} // namespace
+
+#include <Analyzer.h>
+using android::aidl::Analyzer;
+__attribute__((constructor)) static void addAnalyzer() {
+  Analyzer::installAnalyzer(std::make_unique<Analyzer>("android.aidl.tests.IDeprecated", "IDeprecated", &analyzeIDeprecated));
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IDeprecated.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IDeprecated.cpp.d
new file mode 100644
index 0000000..afc741e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IDeprecated.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IDeprecated.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INamedCallback.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INamedCallback.cpp
new file mode 100644
index 0000000..45ce556
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INamedCallback.cpp
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#include <iostream>
+#include <binder/Parcel.h>
+#include <android/binder_to_string.h>
+#include <android/aidl/tests/INamedCallback.h>
+namespace {
+android::status_t analyzeINamedCallback(uint32_t _aidl_code, const android::Parcel& _aidl_data, const android::Parcel& _aidl_reply) {
+  android::status_t _aidl_ret_status;
+  switch(_aidl_code) {
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 0:
+    {
+      std::cout << "INamedCallback.GetName()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.INamedCallback")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::String16 _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readString16(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    default:
+    {
+      std::cout << "  Transaction code " << _aidl_code << " not known." << std::endl;
+    _aidl_ret_status = android::UNKNOWN_TRANSACTION;
+    }
+  }
+  return _aidl_ret_status;
+  // To prevent unused variable warnings
+  (void)_aidl_ret_status; (void)_aidl_data; (void)_aidl_reply;
+}
+
+} // namespace
+
+#include <Analyzer.h>
+using android::aidl::Analyzer;
+__attribute__((constructor)) static void addAnalyzer() {
+  Analyzer::installAnalyzer(std::make_unique<Analyzer>("android.aidl.tests.INamedCallback", "INamedCallback", &analyzeINamedCallback));
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INamedCallback.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INamedCallback.cpp.d
new file mode 100644
index 0000000..18e6033
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INamedCallback.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INamedCallback.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INewName.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INewName.cpp
new file mode 100644
index 0000000..5fd13d2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INewName.cpp
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#include <iostream>
+#include <binder/Parcel.h>
+#include <android/binder_to_string.h>
+#include <android/aidl/tests/INewName.h>
+namespace {
+android::status_t analyzeINewName(uint32_t _aidl_code, const android::Parcel& _aidl_data, const android::Parcel& _aidl_reply) {
+  android::status_t _aidl_ret_status;
+  switch(_aidl_code) {
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 0:
+    {
+      std::cout << "INewName.RealName()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.IOldName")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::String16 _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readString16(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    default:
+    {
+      std::cout << "  Transaction code " << _aidl_code << " not known." << std::endl;
+    _aidl_ret_status = android::UNKNOWN_TRANSACTION;
+    }
+  }
+  return _aidl_ret_status;
+  // To prevent unused variable warnings
+  (void)_aidl_ret_status; (void)_aidl_data; (void)_aidl_reply;
+}
+
+} // namespace
+
+#include <Analyzer.h>
+using android::aidl::Analyzer;
+__attribute__((constructor)) static void addAnalyzer() {
+  Analyzer::installAnalyzer(std::make_unique<Analyzer>("android.aidl.tests.INewName", "INewName", &analyzeINewName));
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INewName.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INewName.cpp.d
new file mode 100644
index 0000000..54b0be5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INewName.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/INewName.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IOldName.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IOldName.cpp
new file mode 100644
index 0000000..2581294
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IOldName.cpp
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#include <iostream>
+#include <binder/Parcel.h>
+#include <android/binder_to_string.h>
+#include <android/aidl/tests/IOldName.h>
+namespace {
+android::status_t analyzeIOldName(uint32_t _aidl_code, const android::Parcel& _aidl_data, const android::Parcel& _aidl_reply) {
+  android::status_t _aidl_ret_status;
+  switch(_aidl_code) {
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 0:
+    {
+      std::cout << "IOldName.RealName()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.IOldName")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::String16 _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readString16(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    default:
+    {
+      std::cout << "  Transaction code " << _aidl_code << " not known." << std::endl;
+    _aidl_ret_status = android::UNKNOWN_TRANSACTION;
+    }
+  }
+  return _aidl_ret_status;
+  // To prevent unused variable warnings
+  (void)_aidl_ret_status; (void)_aidl_data; (void)_aidl_reply;
+}
+
+} // namespace
+
+#include <Analyzer.h>
+using android::aidl::Analyzer;
+__attribute__((constructor)) static void addAnalyzer() {
+  Analyzer::installAnalyzer(std::make_unique<Analyzer>("android.aidl.tests.IOldName", "IOldName", &analyzeIOldName));
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IOldName.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IOldName.cpp.d
new file mode 100644
index 0000000..d09b11f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IOldName.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IOldName.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ITestService.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ITestService.cpp
new file mode 100644
index 0000000..ce2a4b3
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ITestService.cpp
@@ -0,0 +1,2688 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#include <iostream>
+#include <binder/Parcel.h>
+#include <android/binder_to_string.h>
+#include <android/aidl/tests/ITestService.h>
+namespace {
+android::status_t analyzeITestService(uint32_t _aidl_code, const android::Parcel& _aidl_data, const android::Parcel& _aidl_reply) {
+  android::status_t _aidl_ret_status;
+  switch(_aidl_code) {
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 0:
+    {
+      std::cout << "ITestService.UnimplementedMethod()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      int32_t in_arg;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      int32_t _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readInt32(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt32(&in_arg);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument arg from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    arg: " << ::android::internal::ToString(in_arg) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 1:
+    {
+      std::cout << "ITestService.Deprecated()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 2:
+    {
+      std::cout << "ITestService.TestOneway()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 3:
+    {
+      std::cout << "ITestService.RepeatBoolean()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      bool in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      bool _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readBool(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readBool(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 4:
+    {
+      std::cout << "ITestService.RepeatByte()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      int8_t in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      int8_t _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readByte(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readByte(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 5:
+    {
+      std::cout << "ITestService.RepeatChar()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      char16_t in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      char16_t _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readChar(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readChar(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 6:
+    {
+      std::cout << "ITestService.RepeatInt()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      int32_t in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      int32_t _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readInt32(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt32(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 7:
+    {
+      std::cout << "ITestService.RepeatLong()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      int64_t in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      int64_t _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readInt64(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt64(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 8:
+    {
+      std::cout << "ITestService.RepeatFloat()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      float in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      float _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readFloat(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readFloat(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 9:
+    {
+      std::cout << "ITestService.RepeatDouble()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      double in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      double _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readDouble(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readDouble(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 10:
+    {
+      std::cout << "ITestService.RepeatString()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::String16 in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::String16 _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readString16(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 11:
+    {
+      std::cout << "ITestService.RepeatByteEnum()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::ByteEnum in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::aidl::tests::ByteEnum _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readByte(reinterpret_cast<int8_t *>(&_aidl_return));
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_token));
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 12:
+    {
+      std::cout << "ITestService.RepeatIntEnum()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::IntEnum in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::aidl::tests::IntEnum _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readInt32(reinterpret_cast<int32_t *>(&_aidl_return));
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt32(reinterpret_cast<int32_t *>(&in_token));
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 13:
+    {
+      std::cout << "ITestService.RepeatLongEnum()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::LongEnum in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::aidl::tests::LongEnum _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readInt64(reinterpret_cast<int64_t *>(&_aidl_return));
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt64(reinterpret_cast<int64_t *>(&in_token));
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 14:
+    {
+      std::cout << "ITestService.ReverseBoolean()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<bool> in_input;
+      ::std::vector<bool> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<bool> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readBoolVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readBoolVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readBoolVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 15:
+    {
+      std::cout << "ITestService.ReverseByte()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<uint8_t> in_input;
+      ::std::vector<uint8_t> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<uint8_t> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readByteVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readByteVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readByteVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 16:
+    {
+      std::cout << "ITestService.ReverseChar()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<char16_t> in_input;
+      ::std::vector<char16_t> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<char16_t> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readCharVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readCharVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readCharVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 17:
+    {
+      std::cout << "ITestService.ReverseInt()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<int32_t> in_input;
+      ::std::vector<int32_t> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<int32_t> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readInt32Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt32Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readInt32Vector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 18:
+    {
+      std::cout << "ITestService.ReverseLong()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<int64_t> in_input;
+      ::std::vector<int64_t> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<int64_t> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readInt64Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt64Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readInt64Vector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 19:
+    {
+      std::cout << "ITestService.ReverseFloat()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<float> in_input;
+      ::std::vector<float> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<float> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readFloatVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readFloatVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readFloatVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 20:
+    {
+      std::cout << "ITestService.ReverseDouble()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<double> in_input;
+      ::std::vector<double> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<double> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readDoubleVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readDoubleVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readDoubleVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 21:
+    {
+      std::cout << "ITestService.ReverseString()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::String16> in_input;
+      ::std::vector<::android::String16> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::String16> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readString16Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readString16Vector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 22:
+    {
+      std::cout << "ITestService.ReverseByteEnum()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::aidl::tests::ByteEnum> in_input;
+      ::std::vector<::android::aidl::tests::ByteEnum> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::aidl::tests::ByteEnum> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readEnumVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readEnumVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 23:
+    {
+      std::cout << "ITestService.ReverseIntEnum()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::aidl::tests::IntEnum> in_input;
+      ::std::vector<::android::aidl::tests::IntEnum> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::aidl::tests::IntEnum> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readEnumVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readEnumVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 24:
+    {
+      std::cout << "ITestService.ReverseLongEnum()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::aidl::tests::LongEnum> in_input;
+      ::std::vector<::android::aidl::tests::LongEnum> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::aidl::tests::LongEnum> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readEnumVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readEnumVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 25:
+    {
+      std::cout << "ITestService.GetOtherTestService()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::String16 in_name;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::sp<::android::aidl::tests::INamedCallback> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinder(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16(&in_name);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument name from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    name: " << ::android::internal::ToString(in_name) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 26:
+    {
+      std::cout << "ITestService.SetOtherTestService()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::String16 in_name;
+      ::android::sp<::android::aidl::tests::INamedCallback> in_service;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      bool _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readBool(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16(&in_name);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument name from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readStrongBinder(&in_service);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument service from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    name: " << ::android::internal::ToString(in_name) << std::endl;
+      std::cout << "    service: " << ::android::internal::ToString(in_service) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 27:
+    {
+      std::cout << "ITestService.VerifyName()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::sp<::android::aidl::tests::INamedCallback> in_service;
+      ::android::String16 in_name;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      bool _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readBool(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinder(&in_service);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument service from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readString16(&in_name);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument name from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    service: " << ::android::internal::ToString(in_service) << std::endl;
+      std::cout << "    name: " << ::android::internal::ToString(in_name) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 28:
+    {
+      std::cout << "ITestService.GetInterfaceArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::String16> in_names;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinderVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument names from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    names: " << ::android::internal::ToString(in_names) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 29:
+    {
+      std::cout << "ITestService.VerifyNamesWithInterfaceArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>> in_services;
+      ::std::vector<::android::String16> in_names;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      bool _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readBool(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_services);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument services from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument names from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    services: " << ::android::internal::ToString(in_services) << std::endl;
+      std::cout << "    names: " << ::android::internal::ToString(in_names) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 30:
+    {
+      std::cout << "ITestService.GetNullableInterfaceArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::std::optional<::android::String16>>> in_names;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinderVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument names from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    names: " << ::android::internal::ToString(in_names) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 31:
+    {
+      std::cout << "ITestService.VerifyNamesWithNullableInterfaceArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>> in_services;
+      ::std::optional<::std::vector<::std::optional<::android::String16>>> in_names;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      bool _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readBool(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_services);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument services from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument names from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    services: " << ::android::internal::ToString(in_services) << std::endl;
+      std::cout << "    names: " << ::android::internal::ToString(in_names) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 32:
+    {
+      std::cout << "ITestService.GetInterfaceList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::std::optional<::android::String16>>> in_names;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinderVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument names from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    names: " << ::android::internal::ToString(in_names) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 33:
+    {
+      std::cout << "ITestService.VerifyNamesWithInterfaceList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>> in_services;
+      ::std::optional<::std::vector<::std::optional<::android::String16>>> in_names;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      bool _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readBool(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_services);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument services from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument names from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    services: " << ::android::internal::ToString(in_services) << std::endl;
+      std::cout << "    names: " << ::android::internal::ToString(in_names) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 34:
+    {
+      std::cout << "ITestService.ReverseStringList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::String16> in_input;
+      ::std::vector<::android::String16> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::String16> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readString16Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readString16Vector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 35:
+    {
+      std::cout << "ITestService.RepeatParcelFileDescriptor()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::os::ParcelFileDescriptor in_read;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::os::ParcelFileDescriptor _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readParcelable(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelable(&in_read);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument read from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    read: " << ::android::internal::ToString(in_read) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 36:
+    {
+      std::cout << "ITestService.ReverseParcelFileDescriptorArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::os::ParcelFileDescriptor> in_input;
+      ::std::vector<::android::os::ParcelFileDescriptor> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::os::ParcelFileDescriptor> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readParcelableVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelableVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readParcelableVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 37:
+    {
+      std::cout << "ITestService.ThrowServiceException()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      int32_t in_code;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt32(&in_code);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument code from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    code: " << ::android::internal::ToString(in_code) << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 38:
+    {
+      std::cout << "ITestService.RepeatNullableIntArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<int32_t>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<int32_t>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readInt32Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readInt32Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 39:
+    {
+      std::cout << "ITestService.RepeatNullableByteEnumArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readEnumVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 40:
+    {
+      std::cout << "ITestService.RepeatNullableIntEnumArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::android::aidl::tests::IntEnum>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::android::aidl::tests::IntEnum>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readEnumVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 41:
+    {
+      std::cout << "ITestService.RepeatNullableLongEnumArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::android::aidl::tests::LongEnum>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::android::aidl::tests::LongEnum>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readEnumVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 42:
+    {
+      std::cout << "ITestService.RepeatNullableString()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::android::String16> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::android::String16> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readString16(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 43:
+    {
+      std::cout << "ITestService.RepeatNullableStringList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::std::optional<::android::String16>>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::std::optional<::android::String16>>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readString16Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readString16Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 44:
+    {
+      std::cout << "ITestService.RepeatNullableParcelable()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::android::aidl::tests::ITestService::Empty> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::android::aidl::tests::ITestService::Empty> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readParcelable(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 45:
+    {
+      std::cout << "ITestService.RepeatNullableParcelableArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readParcelableVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelableVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 46:
+    {
+      std::cout << "ITestService.RepeatNullableParcelableList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readParcelableVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelableVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 47:
+    {
+      std::cout << "ITestService.TakesAnIBinder()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::sp<::android::IBinder> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinder(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 48:
+    {
+      std::cout << "ITestService.TakesANullableIBinder()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::sp<::android::IBinder> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readNullableStrongBinder(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 49:
+    {
+      std::cout << "ITestService.TakesAnIBinderList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::sp<::android::IBinder>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 50:
+    {
+      std::cout << "ITestService.TakesANullableIBinderList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::android::sp<::android::IBinder>>> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 51:
+    {
+      std::cout << "ITestService.RepeatUtf8CppString()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::string in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::string _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readUtf8FromUtf16(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readUtf8FromUtf16(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 52:
+    {
+      std::cout << "ITestService.RepeatNullableUtf8CppString()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::string> in_token;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::string> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readUtf8FromUtf16(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readUtf8FromUtf16(&in_token);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument token from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    token: " << ::android::internal::ToString(in_token) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 53:
+    {
+      std::cout << "ITestService.ReverseUtf8CppString()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::std::string> in_input;
+      ::std::vector<::std::string> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::std::string> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 54:
+    {
+      std::cout << "ITestService.ReverseNullableUtf8CppString()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::std::optional<::std::string>>> in_input;
+      ::std::optional<::std::vector<::std::optional<::std::string>>> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::std::optional<::std::string>>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 55:
+    {
+      std::cout << "ITestService.ReverseUtf8CppStringList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::std::optional<::std::string>>> in_input;
+      ::std::optional<::std::vector<::std::optional<::std::string>>> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::std::optional<::std::string>>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 56:
+    {
+      std::cout << "ITestService.GetCallback()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      bool in_return_null;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::sp<::android::aidl::tests::INamedCallback> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readNullableStrongBinder(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readBool(&in_return_null);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument return_null from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    return_null: " << ::android::internal::ToString(in_return_null) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 57:
+    {
+      std::cout << "ITestService.FillOutStructuredParcelable()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::StructuredParcelable in_parcel;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelable(&in_parcel);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument parcel from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    parcel: " << ::android::internal::ToString(in_parcel) << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 58:
+    {
+      std::cout << "ITestService.RepeatExtendableParcelable()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::extension::ExtendableParcelable in_ep;
+      ::android::aidl::tests::extension::ExtendableParcelable out_ep2;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelable(&in_ep);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument ep from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readParcelable(&out_ep2);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument ep2 from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    ep: " << ::android::internal::ToString(in_ep) << std::endl;
+      std::cout << "    ep2: " << ::android::internal::ToString(out_ep2) << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 59:
+    {
+      std::cout << "ITestService.ReverseList()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::RecursiveList in_list;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::aidl::tests::RecursiveList _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readParcelable(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelable(&in_list);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument list from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    list: " << ::android::internal::ToString(in_list) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 60:
+    {
+      std::cout << "ITestService.ReverseIBinderArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::sp<::android::IBinder>> in_input;
+      ::std::vector<::android::sp<::android::IBinder>> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::sp<::android::IBinder>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinderVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 61:
+    {
+      std::cout << "ITestService.ReverseNullableIBinderArray()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::optional<::std::vector<::android::sp<::android::IBinder>>> in_input;
+      ::std::optional<::std::vector<::android::sp<::android::IBinder>>> out_repeated;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::optional<::std::vector<::android::sp<::android::IBinder>>> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinderVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readStrongBinderVector(&out_repeated);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument repeated from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      std::cout << "    repeated: " << ::android::internal::ToString(out_repeated) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 62:
+    {
+      std::cout << "ITestService.GetOldNameInterface()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::sp<::android::aidl::tests::IOldName> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinder(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 63:
+    {
+      std::cout << "ITestService.GetNewNameInterface()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::sp<::android::aidl::tests::INewName> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinder(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 64:
+    {
+      std::cout << "ITestService.GetUnionTags()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::std::vector<::android::aidl::tests::Union> in_input;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::std::vector<::android::aidl::tests::Union::Tag> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readEnumVector(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelableVector(&in_input);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument input from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    input: " << ::android::internal::ToString(in_input) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 65:
+    {
+      std::cout << "ITestService.GetCppJavaTests()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::sp<::android::IBinder> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readNullableStrongBinder(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 66:
+    {
+      std::cout << "ITestService.getBackendType()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::aidl::tests::BackendType _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readByte(reinterpret_cast<int8_t *>(&_aidl_return));
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+      } while(false);
+      std::cout << "  arguments: " << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 67:
+    {
+      std::cout << "ITestService.GetCircular()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.ITestService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::CircularParcelable out_cp;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::sp<::android::aidl::tests::ICircular> _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readStrongBinder(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelable(&out_cp);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument cp from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    cp: " << ::android::internal::ToString(out_cp) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    default:
+    {
+      std::cout << "  Transaction code " << _aidl_code << " not known." << std::endl;
+    _aidl_ret_status = android::UNKNOWN_TRANSACTION;
+    }
+  }
+  return _aidl_ret_status;
+  // To prevent unused variable warnings
+  (void)_aidl_ret_status; (void)_aidl_data; (void)_aidl_reply;
+}
+
+} // namespace
+
+#include <Analyzer.h>
+using android::aidl::Analyzer;
+__attribute__((constructor)) static void addAnalyzer() {
+  Analyzer::installAnalyzer(std::make_unique<Analyzer>("android.aidl.tests.ITestService", "ITestService", &analyzeITestService));
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ITestService.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ITestService.cpp.d
new file mode 100644
index 0000000..5884077
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ITestService.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ITestService.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IntEnum.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IntEnum.cpp
new file mode 100644
index 0000000..ef5521f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IntEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IntEnum.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IntEnum.cpp.d
new file mode 100644
index 0000000..cd09610
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IntEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/IntEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ListOfInterfaces.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ListOfInterfaces.cpp
new file mode 100644
index 0000000..f04a3dd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ListOfInterfaces.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d
new file mode 100644
index 0000000..09abd96
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ListOfInterfaces.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/LongEnum.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/LongEnum.cpp
new file mode 100644
index 0000000..0fb26c7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/LongEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/LongEnum.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/LongEnum.cpp.d
new file mode 100644
index 0000000..d83d703
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/LongEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/LongEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/OtherParcelableForToString.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/OtherParcelableForToString.cpp
new file mode 100644
index 0000000..452f43f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/OtherParcelableForToString.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d
new file mode 100644
index 0000000..1907745
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/OtherParcelableForToString.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ParcelableForToString.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ParcelableForToString.cpp
new file mode 100644
index 0000000..cb59e7b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ParcelableForToString.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ParcelableForToString.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ParcelableForToString.cpp.d
new file mode 100644
index 0000000..b89b897
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ParcelableForToString.cpp.d
@@ -0,0 +1,10 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/ParcelableForToString.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/RecursiveList.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/RecursiveList.cpp
new file mode 100644
index 0000000..1e350ca
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/RecursiveList.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/RecursiveList.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/RecursiveList.cpp.d
new file mode 100644
index 0000000..d4e29f0
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/RecursiveList.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/RecursiveList.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/StructuredParcelable.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/StructuredParcelable.cpp
new file mode 100644
index 0000000..eac1cf4
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/StructuredParcelable.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/StructuredParcelable.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/StructuredParcelable.cpp.d
new file mode 100644
index 0000000..dc83d1a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/StructuredParcelable.cpp.d
@@ -0,0 +1,7 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/StructuredParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/Union.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/Union.cpp
new file mode 100644
index 0000000..611b7e2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/Union.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/Union.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/Union.cpp.d
new file mode 100644
index 0000000..8a4c078
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/Union.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/Union.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/UnionWithFd.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/UnionWithFd.cpp
new file mode 100644
index 0000000..d76738b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/UnionWithFd.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/UnionWithFd.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/UnionWithFd.cpp.d
new file mode 100644
index 0000000..db9f113
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/UnionWithFd.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/UnionWithFd.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp
new file mode 100644
index 0000000..317b85b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d
new file mode 100644
index 0000000..05a7b8b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt.cpp
new file mode 100644
index 0000000..b98b3a6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt.cpp.d
new file mode 100644
index 0000000..b408cd5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt2.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt2.cpp
new file mode 100644
index 0000000..f418142
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt2.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt2.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt2.cpp.d
new file mode 100644
index 0000000..922747c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt2.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExt2.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExtLike.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExtLike.cpp
new file mode 100644
index 0000000..e6e17a1
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExtLike.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d
new file mode 100644
index 0000000..86841d0
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/extension/MyExtLike.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/DeeplyNested.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/DeeplyNested.cpp
new file mode 100644
index 0000000..53b4c2a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/DeeplyNested.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d
new file mode 100644
index 0000000..60c4829
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/DeeplyNested.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/INestedService.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/INestedService.cpp
new file mode 100644
index 0000000..ad9a55d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/INestedService.cpp
@@ -0,0 +1,105 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#include <iostream>
+#include <binder/Parcel.h>
+#include <android/binder_to_string.h>
+#include <android/aidl/tests/nested/INestedService.h>
+namespace {
+android::status_t analyzeINestedService(uint32_t _aidl_code, const android::Parcel& _aidl_data, const android::Parcel& _aidl_reply) {
+  android::status_t _aidl_ret_status;
+  switch(_aidl_code) {
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 0:
+    {
+      std::cout << "INestedService.flipStatus()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.nested.INestedService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::nested::ParcelableWithNested in_p;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      ::android::aidl::tests::nested::INestedService::Result _aidl_return;
+      bool returnError = false;
+      _aidl_ret_status = _aidl_reply.readParcelable(&_aidl_return);
+      if (((_aidl_ret_status) != (android::NO_ERROR))) {
+        std::cerr << "Failure: error in reading return value from Parcel." << std::endl;
+        returnError = true;
+      }
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readParcelable(&in_p);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument p from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    p: " << ::android::internal::ToString(in_p) << std::endl;
+      if (returnError) {
+        std::cout << "  return: <error>" << std::endl;
+      } else {std::cout << "  return: " << ::android::internal::ToString(_aidl_return) << std::endl;
+      }
+    }
+    break;
+    case ::android::IBinder::FIRST_CALL_TRANSACTION + 1:
+    {
+      std::cout << "INestedService.flipStatusWithCallback()" << std::endl;
+      _aidl_ret_status = ::android::OK;
+      if (!(_aidl_data.enforceInterface(android::String16("android.aidl.tests.nested.INestedService")))) {
+        _aidl_ret_status = ::android::BAD_TYPE;
+        std::cout << "  Failure: Parcel interface does not match." << std::endl;
+        break;
+      }
+      ::android::aidl::tests::nested::ParcelableWithNested::Status in_status;
+      ::android::sp<::android::aidl::tests::nested::INestedService::ICallback> in_cb;
+      ::android::binder::Status binderStatus;
+      binderStatus.readFromParcel(_aidl_reply);
+      do { // Single-pass loop to break if argument reading fails
+        _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_status));
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument status from Parcel." << std::endl;
+          break;
+        }
+        _aidl_ret_status = _aidl_data.readStrongBinder(&in_cb);
+        if (((_aidl_ret_status) != (android::NO_ERROR))) {
+          std::cerr << "Failure: error in reading argument cb from Parcel." << std::endl;
+          break;
+        }
+      } while(false);
+      if (!_aidl_data.enforceNoDataAvail().isOk()) {
+        _aidl_ret_status = android::BAD_VALUE;
+        std::cout << "  Failure: Parcel has too much data." << std::endl;
+        break;
+      }
+      std::cout << "  arguments: " << std::endl;
+      std::cout << "    status: " << ::android::internal::ToString(in_status) << std::endl;
+      std::cout << "    cb: " << ::android::internal::ToString(in_cb) << std::endl;
+      std::cout << "  return: void" << std::endl;
+    }
+    break;
+    default:
+    {
+      std::cout << "  Transaction code " << _aidl_code << " not known." << std::endl;
+    _aidl_ret_status = android::UNKNOWN_TRANSACTION;
+    }
+  }
+  return _aidl_ret_status;
+  // To prevent unused variable warnings
+  (void)_aidl_ret_status; (void)_aidl_data; (void)_aidl_reply;
+}
+
+} // namespace
+
+#include <Analyzer.h>
+using android::aidl::Analyzer;
+__attribute__((constructor)) static void addAnalyzer() {
+  Analyzer::installAnalyzer(std::make_unique<Analyzer>("android.aidl.tests.nested.INestedService", "INestedService", &analyzeINestedService));
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/INestedService.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/INestedService.cpp.d
new file mode 100644
index 0000000..117662c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/INestedService.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/INestedService.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp
new file mode 100644
index 0000000..dcaf75e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d
new file mode 100644
index 0000000..6e2e015
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/EnumUnion.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/EnumUnion.cpp
new file mode 100644
index 0000000..0b8d592
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/EnumUnion.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d
new file mode 100644
index 0000000..dcebde5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/EnumUnion.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/UnionInUnion.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/UnionInUnion.cpp
new file mode 100644
index 0000000..6e30c4f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/UnionInUnion.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp-analyzer -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+// This file is intentionally left blank as placeholder for building an analyzer.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d
new file mode 100644
index 0000000..dd9c00e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d
@@ -0,0 +1,5 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-analyzer-source/gen/android/aidl/tests/unions/UnionInUnion.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-analyzer-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp
new file mode 100644
index 0000000..164cecc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp
@@ -0,0 +1,459 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ArrayOfInterfaces::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ArrayOfInterfaces::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ArrayOfInterfaces, EmptyInterface, "android.aidl.tests.ArrayOfInterfaces.IEmptyInterface")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ArrayOfInterfaces::BpEmptyInterface::BpEmptyInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IEmptyInterface>(_aidl_impl){
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ArrayOfInterfaces::BnEmptyInterface::BnEmptyInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ArrayOfInterfaces::BnEmptyInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ArrayOfInterfaces, MyInterface, "android.aidl.tests.ArrayOfInterfaces.IMyInterface")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ArrayOfInterfaces::BpMyInterface::BpMyInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IMyInterface>(_aidl_impl){
+}
+
+::android::binder::Status ArrayOfInterfaces::BpMyInterface::methodWithInterfaces(const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& iface_array_in, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_out, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& nullable_iface_array_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyInterface::methodWithInterfaces::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(nullable_iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(iface_array_in);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*iface_array_out);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(*iface_array_inout);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(nullable_iface_array_in);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*nullable_iface_array_out);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(*nullable_iface_array_inout);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ArrayOfInterfaces::BnMyInterface::TRANSACTION_methodWithInterfaces, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyInterface::getDefaultImpl())) {
+     return IMyInterface::getDefaultImpl()->methodWithInterfaces(iface, nullable_iface, iface_array_in, iface_array_out, iface_array_inout, nullable_iface_array_in, nullable_iface_array_out, nullable_iface_array_inout, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(iface_array_out);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(iface_array_inout);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(nullable_iface_array_out);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(nullable_iface_array_inout);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ArrayOfInterfaces::BnMyInterface::BnMyInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ArrayOfInterfaces::BnMyInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnMyInterface::TRANSACTION_methodWithInterfaces:
+  {
+    ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> in_iface;
+    ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> in_nullable_iface;
+    ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> in_iface_array_in;
+    ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> out_iface_array_out;
+    ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> in_iface_array_inout;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> in_nullable_iface_array_in;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> out_nullable_iface_array_out;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> in_nullable_iface_array_inout;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyInterface::methodWithInterfaces::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinder(&in_iface);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readNullableStrongBinder(&in_nullable_iface);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_iface_array_in);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_iface_array_out);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_iface_array_inout);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_nullable_iface_array_in);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_nullable_iface_array_out);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_nullable_iface_array_inout);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(methodWithInterfaces(in_iface, in_nullable_iface, in_iface_array_in, &out_iface_array_out, &in_iface_array_inout, in_nullable_iface_array_in, &out_nullable_iface_array_out, &in_nullable_iface_array_inout, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(out_iface_array_out);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(in_iface_array_inout);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(out_nullable_iface_array_out);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(in_nullable_iface_array_inout);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ArrayOfInterfaces::MyParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinder(&iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readNullableStrongBinder(&nullable_iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinderVector(&iface_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinderVector(&nullable_iface_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ArrayOfInterfaces::MyParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeStrongBinder(iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinder(nullable_iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinderVector(iface_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinderVector(nullable_iface_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ArrayOfInterfaces::MyUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case iface: {
+    ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readStrongBinder(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>) {
+      set<iface>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<iface>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case nullable_iface: {
+    ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readNullableStrongBinder(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>) {
+      set<nullable_iface>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<nullable_iface>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case iface_array: {
+    ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readStrongBinderVector(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>) {
+      set<iface_array>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<iface_array>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case nullable_iface_array: {
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readStrongBinderVector(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>>) {
+      set<nullable_iface_array>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<nullable_iface_array>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t ArrayOfInterfaces::MyUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case iface: return _aidl_parcel->writeStrongBinder(get<iface>());
+  case nullable_iface: return _aidl_parcel->writeStrongBinder(get<nullable_iface>());
+  case iface_array: return _aidl_parcel->writeStrongBinderVector(get<iface_array>());
+  case nullable_iface_array: return _aidl_parcel->writeStrongBinderVector(get<nullable_iface_array>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d
new file mode 100644
index 0000000..7aaca7f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/BackendType.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/BackendType.cpp
new file mode 100644
index 0000000..f0abfd9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/BackendType.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/BackendType.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/BackendType.cpp.d
new file mode 100644
index 0000000..776a1ea
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/BackendType.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/BackendType.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ByteEnum.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ByteEnum.cpp
new file mode 100644
index 0000000..258e734
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ByteEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ByteEnum.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ByteEnum.cpp.d
new file mode 100644
index 0000000..6ed9138
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ByteEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/ByteEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/CircularParcelable.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/CircularParcelable.cpp
new file mode 100644
index 0000000..0b9483f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/CircularParcelable.cpp
@@ -0,0 +1,48 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#include <android/aidl/tests/CircularParcelable.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t CircularParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readNullableStrongBinder(&testService);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t CircularParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeStrongBinder(testService);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/CircularParcelable.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/CircularParcelable.cpp.d
new file mode 100644
index 0000000..1606b92
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/CircularParcelable.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/CircularParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp
new file mode 100644
index 0000000..5f7b4d9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d
new file mode 100644
index 0000000..c8de960
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp
new file mode 100644
index 0000000..f3365ca
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d
new file mode 100644
index 0000000..6f9c39b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp
new file mode 100644
index 0000000..0d9362b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp
@@ -0,0 +1,36 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#include <android/aidl/tests/DeprecatedParcelable.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t DeprecatedParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t DeprecatedParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d
new file mode 100644
index 0000000..f11d82f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/FixedSize.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/FixedSize.cpp
new file mode 100644
index 0000000..40daab7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/FixedSize.cpp
@@ -0,0 +1,287 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#include <android/aidl/tests/FixedSize.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t FixedSize::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t FixedSize::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/FixedSize.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t FixedSize::FixedParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readBool(&booleanValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(&byteValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readChar(&charValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&intValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64(&longValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFloat(&floatValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readDouble(&doubleValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64(reinterpret_cast<int64_t *>(&enumValue));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&parcelableValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t FixedSize::FixedParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeBool(booleanValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeByte(byteValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeChar(charValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(intValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64(longValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFloat(floatValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeDouble(doubleValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64(static_cast<int64_t>(enumValue));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(parcelableValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/FixedSize.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t FixedSize::FixedUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case booleanValue: {
+    bool _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readBool(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<bool>) {
+      set<booleanValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<booleanValue>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case byteValue: {
+    int8_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readByte(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int8_t>) {
+      set<byteValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<byteValue>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case charValue: {
+    char16_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readChar(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<char16_t>) {
+      set<charValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<charValue>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case intValue: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<intValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intValue>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case longValue: {
+    int64_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt64(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int64_t>) {
+      set<longValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<longValue>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case floatValue: {
+    float _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readFloat(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<float>) {
+      set<floatValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<floatValue>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case doubleValue: {
+    double _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readDouble(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<double>) {
+      set<doubleValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<doubleValue>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case enumValue: {
+    ::android::aidl::tests::LongEnum _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt64(reinterpret_cast<int64_t *>(&_aidl_value))) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::aidl::tests::LongEnum>) {
+      set<enumValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<enumValue>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t FixedSize::FixedUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case booleanValue: return _aidl_parcel->writeBool(get<booleanValue>());
+  case byteValue: return _aidl_parcel->writeByte(get<byteValue>());
+  case charValue: return _aidl_parcel->writeChar(get<charValue>());
+  case intValue: return _aidl_parcel->writeInt32(get<intValue>());
+  case longValue: return _aidl_parcel->writeInt64(get<longValue>());
+  case floatValue: return _aidl_parcel->writeFloat(get<floatValue>());
+  case doubleValue: return _aidl_parcel->writeDouble(get<doubleValue>());
+  case enumValue: return _aidl_parcel->writeInt64(static_cast<int64_t>(get<enumValue>()));
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/FixedSize.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/FixedSize.cpp.d
new file mode 100644
index 0000000..b564041
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/FixedSize.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/FixedSize.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp
new file mode 100644
index 0000000..1861c85
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d
new file mode 100644
index 0000000..37ac9e0
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ICircular.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ICircular.cpp
new file mode 100644
index 0000000..ca78521
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ICircular.cpp
@@ -0,0 +1,116 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#include <android/aidl/tests/ICircular.h>
+#include <android/aidl/tests/BpCircular.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(Circular, "android.aidl.tests.ICircular")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BpCircular.h>
+#include <android/aidl/tests/BnCircular.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BpCircular::BpCircular(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<ICircular>(_aidl_impl){
+}
+
+::android::binder::Status BpCircular::GetTestService(::android::sp<::android::aidl::tests::ITestService>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ICircular::GetTestService::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnCircular::TRANSACTION_GetTestService, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ICircular::getDefaultImpl())) {
+     return ICircular::getDefaultImpl()->GetTestService(_aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readNullableStrongBinder(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BnCircular.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BnCircular::BnCircular()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnCircular::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnCircular::TRANSACTION_GetTestService:
+  {
+    ::android::sp<::android::aidl::tests::ITestService> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ICircular::GetTestService::cppServer");
+    ::android::binder::Status _aidl_status(GetTestService(&_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinder(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ICircular.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ICircular.cpp.d
new file mode 100644
index 0000000..eb56011
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ICircular.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/ICircular.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp
new file mode 100644
index 0000000..3e1e24f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp
@@ -0,0 +1,65 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#include <android/aidl/tests/IDeprecated.h>
+#include <android/aidl/tests/BpDeprecated.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(Deprecated, "android.aidl.tests.IDeprecated")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BpDeprecated.h>
+#include <android/aidl/tests/BnDeprecated.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BpDeprecated::BpDeprecated(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IDeprecated>(_aidl_impl){
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BnDeprecated.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BnDeprecated::BnDeprecated()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated"
+
+::android::status_t BnDeprecated::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+#pragma clang diagnostic pop
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp.d
new file mode 100644
index 0000000..ef80a77
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/INamedCallback.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/INamedCallback.cpp
new file mode 100644
index 0000000..be22cab
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/INamedCallback.cpp
@@ -0,0 +1,116 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#include <android/aidl/tests/INamedCallback.h>
+#include <android/aidl/tests/BpNamedCallback.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(NamedCallback, "android.aidl.tests.INamedCallback")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BpNamedCallback.h>
+#include <android/aidl/tests/BnNamedCallback.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BpNamedCallback::BpNamedCallback(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<INamedCallback>(_aidl_impl){
+}
+
+::android::binder::Status BpNamedCallback::GetName(::android::String16* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::INamedCallback::GetName::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnNamedCallback::TRANSACTION_GetName, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && INamedCallback::getDefaultImpl())) {
+     return INamedCallback::getDefaultImpl()->GetName(_aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BnNamedCallback.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BnNamedCallback::BnNamedCallback()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnNamedCallback::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnNamedCallback::TRANSACTION_GetName:
+  {
+    ::android::String16 _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::INamedCallback::GetName::cppServer");
+    ::android::binder::Status _aidl_status(GetName(&_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/INamedCallback.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/INamedCallback.cpp.d
new file mode 100644
index 0000000..9a61844
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/INamedCallback.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/INamedCallback.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/INewName.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/INewName.cpp
new file mode 100644
index 0000000..60456fe
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/INewName.cpp
@@ -0,0 +1,116 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#include <android/aidl/tests/INewName.h>
+#include <android/aidl/tests/BpNewName.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(NewName, "android.aidl.tests.IOldName")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BpNewName.h>
+#include <android/aidl/tests/BnNewName.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BpNewName::BpNewName(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<INewName>(_aidl_impl){
+}
+
+::android::binder::Status BpNewName::RealName(::android::String16* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::INewName::RealName::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnNewName::TRANSACTION_RealName, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && INewName::getDefaultImpl())) {
+     return INewName::getDefaultImpl()->RealName(_aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BnNewName.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BnNewName::BnNewName()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnNewName::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnNewName::TRANSACTION_RealName:
+  {
+    ::android::String16 _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::INewName::RealName::cppServer");
+    ::android::binder::Status _aidl_status(RealName(&_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/INewName.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/INewName.cpp.d
new file mode 100644
index 0000000..b0f129f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/INewName.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/INewName.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IOldName.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IOldName.cpp
new file mode 100644
index 0000000..0bc6c1f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IOldName.cpp
@@ -0,0 +1,116 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#include <android/aidl/tests/IOldName.h>
+#include <android/aidl/tests/BpOldName.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(OldName, "android.aidl.tests.IOldName")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BpOldName.h>
+#include <android/aidl/tests/BnOldName.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BpOldName::BpOldName(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IOldName>(_aidl_impl){
+}
+
+::android::binder::Status BpOldName::RealName(::android::String16* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IOldName::RealName::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnOldName::TRANSACTION_RealName, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IOldName::getDefaultImpl())) {
+     return IOldName::getDefaultImpl()->RealName(_aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BnOldName.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BnOldName::BnOldName()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnOldName::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnOldName::TRANSACTION_RealName:
+  {
+    ::android::String16 _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IOldName::RealName::cppServer");
+    ::android::binder::Status _aidl_status(RealName(&_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IOldName.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IOldName.cpp.d
new file mode 100644
index 0000000..ed3c327
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IOldName.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/IOldName.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp
new file mode 100644
index 0000000..38f28b8
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp
@@ -0,0 +1,5682 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/BpTestService.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(TestService, "android.aidl.tests.ITestService")
+const ::android::String16& ITestService::STRING_CONSTANT() {
+  static const ::android::String16 value(::android::String16("foo"));
+  return value;
+}
+const ::android::String16& ITestService::STRING_CONSTANT2() {
+  static const ::android::String16 value(::android::String16("bar"));
+  return value;
+}
+const ::std::string& ITestService::STRING_CONSTANT_UTF8() {
+  static const ::std::string value("baz");
+  return value;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BpTestService.h>
+#include <android/aidl/tests/BnTestService.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BpTestService::BpTestService(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<ITestService>(_aidl_impl){
+}
+
+::android::binder::Status BpTestService::UnimplementedMethod(int32_t arg, int32_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::UnimplementedMethod::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(arg);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_UnimplementedMethod, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->UnimplementedMethod(arg, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::Deprecated() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::Deprecated::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_Deprecated, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->Deprecated();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::TestOneway() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TestOneway::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_TestOneway, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_ONEWAY | ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->TestOneway();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatBoolean(bool token, bool* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatBoolean::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeBool(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatBoolean, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatBoolean(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readBool(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatByte(int8_t token, int8_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatByte::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatByte, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatByte(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readByte(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatChar(char16_t token, char16_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatChar::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeChar(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatChar, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatChar(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readChar(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatInt(int32_t token, int32_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatInt::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatInt, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatInt(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatLong(int64_t token, int64_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatLong::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt64(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatLong, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatLong(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt64(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatFloat(float token, float* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatFloat::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFloat(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatFloat, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatFloat(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFloat(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatDouble(double token, double* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatDouble::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeDouble(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatDouble, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatDouble(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readDouble(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatString(const ::android::String16& token, ::android::String16* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatString, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatString(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatByteEnum(::android::aidl::tests::ByteEnum token, ::android::aidl::tests::ByteEnum* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatByteEnum::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(static_cast<int8_t>(token));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatByteEnum, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatByteEnum(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readByte(reinterpret_cast<int8_t *>(_aidl_return));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatIntEnum(::android::aidl::tests::IntEnum token, ::android::aidl::tests::IntEnum* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatIntEnum::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(static_cast<int32_t>(token));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatIntEnum, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatIntEnum(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(reinterpret_cast<int32_t *>(_aidl_return));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatLongEnum(::android::aidl::tests::LongEnum token, ::android::aidl::tests::LongEnum* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatLongEnum::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt64(static_cast<int64_t>(token));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatLongEnum, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatLongEnum(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt64(reinterpret_cast<int64_t *>(_aidl_return));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseBoolean(const ::std::vector<bool>& input, ::std::vector<bool>* repeated, ::std::vector<bool>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseBoolean::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeBoolVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseBoolean, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseBoolean(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readBoolVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readBoolVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseByte(const ::std::vector<uint8_t>& input, ::std::vector<uint8_t>* repeated, ::std::vector<uint8_t>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseByte::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByteVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseByte, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseByte(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readByteVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readByteVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseChar(const ::std::vector<char16_t>& input, ::std::vector<char16_t>* repeated, ::std::vector<char16_t>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseChar::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeCharVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseChar, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseChar(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readCharVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readCharVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseInt(const ::std::vector<int32_t>& input, ::std::vector<int32_t>* repeated, ::std::vector<int32_t>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseInt::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseInt, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseInt(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32Vector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseLong(const ::std::vector<int64_t>& input, ::std::vector<int64_t>* repeated, ::std::vector<int64_t>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseLong::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt64Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseLong, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseLong(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt64Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readInt64Vector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseFloat(const ::std::vector<float>& input, ::std::vector<float>* repeated, ::std::vector<float>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseFloat::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFloatVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseFloat, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseFloat(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readFloatVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFloatVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseDouble(const ::std::vector<double>& input, ::std::vector<double>* repeated, ::std::vector<double>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseDouble::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeDoubleVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseDouble, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseDouble(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readDoubleVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readDoubleVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseString(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* repeated, ::std::vector<::android::String16>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseString, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseString(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readString16Vector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseByteEnum(const ::std::vector<::android::aidl::tests::ByteEnum>& input, ::std::vector<::android::aidl::tests::ByteEnum>* repeated, ::std::vector<::android::aidl::tests::ByteEnum>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseByteEnum::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeEnumVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseByteEnum, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseByteEnum(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseIntEnum(const ::std::vector<::android::aidl::tests::IntEnum>& input, ::std::vector<::android::aidl::tests::IntEnum>* repeated, ::std::vector<::android::aidl::tests::IntEnum>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseIntEnum::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeEnumVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseIntEnum, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseIntEnum(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseLongEnum(const ::std::vector<::android::aidl::tests::LongEnum>& input, ::std::vector<::android::aidl::tests::LongEnum>* repeated, ::std::vector<::android::aidl::tests::LongEnum>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseLongEnum::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeEnumVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseLongEnum, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseLongEnum(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetOtherTestService(const ::android::String16& name, ::android::sp<::android::aidl::tests::INamedCallback>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetOtherTestService::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16(name);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetOtherTestService, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetOtherTestService(name, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinder(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::SetOtherTestService(const ::android::String16& name, const ::android::sp<::android::aidl::tests::INamedCallback>& service, bool* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::SetOtherTestService::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16(name);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(service);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_SetOtherTestService, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->SetOtherTestService(name, service, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readBool(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::VerifyName(const ::android::sp<::android::aidl::tests::INamedCallback>& service, const ::android::String16& name, bool* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::VerifyName::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(service);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16(name);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_VerifyName, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->VerifyName(service, name, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readBool(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetInterfaceArray(const ::std::vector<::android::String16>& names, ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetInterfaceArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(names);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetInterfaceArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetInterfaceArray(names, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::VerifyNamesWithInterfaceArray(const ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>& services, const ::std::vector<::android::String16>& names, bool* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::VerifyNamesWithInterfaceArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(services);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(names);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_VerifyNamesWithInterfaceArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->VerifyNamesWithInterfaceArray(services, names, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readBool(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetNullableInterfaceArray(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetNullableInterfaceArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(names);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetNullableInterfaceArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetNullableInterfaceArray(names, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::VerifyNamesWithNullableInterfaceArray(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& services, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, bool* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::VerifyNamesWithNullableInterfaceArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(services);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(names);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_VerifyNamesWithNullableInterfaceArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->VerifyNamesWithNullableInterfaceArray(services, names, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readBool(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetInterfaceList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetInterfaceList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(names);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetInterfaceList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetInterfaceList(names, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::VerifyNamesWithInterfaceList(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& services, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, bool* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::VerifyNamesWithInterfaceList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(services);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(names);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_VerifyNamesWithInterfaceList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->VerifyNamesWithInterfaceList(services, names, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readBool(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseStringList(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* repeated, ::std::vector<::android::String16>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseStringList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseStringList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseStringList(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readString16Vector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatParcelFileDescriptor(const ::android::os::ParcelFileDescriptor& read, ::android::os::ParcelFileDescriptor* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatParcelFileDescriptor::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(read);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatParcelFileDescriptor, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatParcelFileDescriptor(read, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseParcelFileDescriptorArray(const ::std::vector<::android::os::ParcelFileDescriptor>& input, ::std::vector<::android::os::ParcelFileDescriptor>* repeated, ::std::vector<::android::os::ParcelFileDescriptor>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseParcelFileDescriptorArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelableVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseParcelFileDescriptorArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseParcelFileDescriptorArray(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelableVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelableVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ThrowServiceException(int32_t code) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ThrowServiceException::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(code);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ThrowServiceException, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ThrowServiceException(code);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableIntArray(const ::std::optional<::std::vector<int32_t>>& input, ::std::optional<::std::vector<int32_t>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableIntArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableIntArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableIntArray(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableByteEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableByteEnumArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeEnumVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableByteEnumArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableByteEnumArray(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableIntEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableIntEnumArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeEnumVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableIntEnumArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableIntEnumArray(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableLongEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableLongEnumArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeEnumVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableLongEnumArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableLongEnumArray(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableString(const ::std::optional<::android::String16>& input, ::std::optional<::android::String16>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableString, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableString(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableStringList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& input, ::std::optional<::std::vector<::std::optional<::android::String16>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableStringList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableStringList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableStringList(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableParcelable(const ::std::optional<::android::aidl::tests::ITestService::Empty>& input, ::std::optional<::android::aidl::tests::ITestService::Empty>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableParcelable::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeNullableParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableParcelable, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableParcelable(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableParcelableArray(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& input, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableParcelableArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelableVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableParcelableArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableParcelableArray(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelableVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableParcelableList(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& input, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableParcelableList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelableVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableParcelableList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableParcelableList(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelableVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::TakesAnIBinder(const ::android::sp<::android::IBinder>& input) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TakesAnIBinder::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_TakesAnIBinder, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->TakesAnIBinder(input);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::TakesANullableIBinder(const ::android::sp<::android::IBinder>& input) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TakesANullableIBinder::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_TakesANullableIBinder, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->TakesANullableIBinder(input);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::TakesAnIBinderList(const ::std::vector<::android::sp<::android::IBinder>>& input) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TakesAnIBinderList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_TakesAnIBinderList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->TakesAnIBinderList(input);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::TakesANullableIBinderList(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& input) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TakesANullableIBinderList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_TakesANullableIBinderList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->TakesANullableIBinderList(input);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatUtf8CppString(const ::std::string& token, ::std::string* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatUtf8CppString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeUtf8AsUtf16(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatUtf8CppString, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatUtf8CppString(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8FromUtf16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatNullableUtf8CppString(const ::std::optional<::std::string>& token, ::std::optional<::std::string>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableUtf8CppString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeUtf8AsUtf16(token);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatNullableUtf8CppString, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatNullableUtf8CppString(token, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8FromUtf16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseUtf8CppString(const ::std::vector<::std::string>& input, ::std::vector<::std::string>* repeated, ::std::vector<::std::string>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseUtf8CppString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeUtf8VectorAsUtf16Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseUtf8CppString, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseUtf8CppString(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseNullableUtf8CppString(const ::std::optional<::std::vector<::std::optional<::std::string>>>& input, ::std::optional<::std::vector<::std::optional<::std::string>>>* repeated, ::std::optional<::std::vector<::std::optional<::std::string>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseNullableUtf8CppString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeUtf8VectorAsUtf16Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseNullableUtf8CppString, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseNullableUtf8CppString(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseUtf8CppStringList(const ::std::optional<::std::vector<::std::optional<::std::string>>>& input, ::std::optional<::std::vector<::std::optional<::std::string>>>* repeated, ::std::optional<::std::vector<::std::optional<::std::string>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseUtf8CppStringList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeUtf8VectorAsUtf16Vector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseUtf8CppStringList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseUtf8CppStringList(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8VectorFromUtf16Vector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetCallback(bool return_null, ::android::sp<::android::aidl::tests::INamedCallback>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetCallback::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeBool(return_null);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetCallback, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetCallback(return_null, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readNullableStrongBinder(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::FillOutStructuredParcelable(::android::aidl::tests::StructuredParcelable* parcel) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::FillOutStructuredParcelable::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(*parcel);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_FillOutStructuredParcelable, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->FillOutStructuredParcelable(parcel);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(parcel);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::RepeatExtendableParcelable(const ::android::aidl::tests::extension::ExtendableParcelable& ep, ::android::aidl::tests::extension::ExtendableParcelable* ep2) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatExtendableParcelable::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(ep);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_RepeatExtendableParcelable, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->RepeatExtendableParcelable(ep, ep2);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(ep2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseList(const ::android::aidl::tests::RecursiveList& list, ::android::aidl::tests::RecursiveList* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseList::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseList, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseList(list, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseIBinderArray(const ::std::vector<::android::sp<::android::IBinder>>& input, ::std::vector<::android::sp<::android::IBinder>>* repeated, ::std::vector<::android::sp<::android::IBinder>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseIBinderArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseIBinderArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseIBinderArray(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::ReverseNullableIBinderArray(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& input, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* repeated, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseNullableIBinderArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeVectorSize(*repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_ReverseNullableIBinderArray, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->ReverseNullableIBinderArray(input, repeated, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(repeated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetOldNameInterface(::android::sp<::android::aidl::tests::IOldName>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetOldNameInterface::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetOldNameInterface, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetOldNameInterface(_aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinder(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetNewNameInterface(::android::sp<::android::aidl::tests::INewName>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetNewNameInterface::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetNewNameInterface, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetNewNameInterface(_aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinder(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetUnionTags(const ::std::vector<::android::aidl::tests::Union>& input, ::std::vector<::android::aidl::tests::Union::Tag>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetUnionTags::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelableVector(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetUnionTags, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetUnionTags(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readEnumVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetCppJavaTests(::android::sp<::android::IBinder>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetCppJavaTests::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetCppJavaTests, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetCppJavaTests(_aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readNullableStrongBinder(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::getBackendType(::android::aidl::tests::BackendType* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::getBackendType::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_getBackendType, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->getBackendType(_aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readByte(reinterpret_cast<int8_t *>(_aidl_return));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpTestService::GetCircular(::android::aidl::tests::CircularParcelable* cp, ::android::sp<::android::aidl::tests::ICircular>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markSensitive();
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetCircular::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_GetCircular, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+     return ITestService::getDefaultImpl()->GetCircular(cp, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinder(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(cp);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/BnTestService.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+BnTestService::BnTestService()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated"
+
+::android::status_t BnTestService::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnTestService::TRANSACTION_UnimplementedMethod:
+  {
+    int32_t in_arg;
+    int32_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::UnimplementedMethod::cppServer");
+    _aidl_ret_status = _aidl_data.readInt32(&in_arg);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(UnimplementedMethod(in_arg, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_Deprecated:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::Deprecated::cppServer");
+    ::android::binder::Status _aidl_status(Deprecated());
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_TestOneway:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TestOneway::cppServer");
+    ::android::binder::Status _aidl_status(TestOneway());
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatBoolean:
+  {
+    bool in_token;
+    bool _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatBoolean::cppServer");
+    _aidl_ret_status = _aidl_data.readBool(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatBoolean(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBool(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatByte:
+  {
+    int8_t in_token;
+    int8_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatByte::cppServer");
+    _aidl_ret_status = _aidl_data.readByte(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatByte(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByte(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatChar:
+  {
+    char16_t in_token;
+    char16_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatChar::cppServer");
+    _aidl_ret_status = _aidl_data.readChar(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatChar(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeChar(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatInt:
+  {
+    int32_t in_token;
+    int32_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatInt::cppServer");
+    _aidl_ret_status = _aidl_data.readInt32(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatInt(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatLong:
+  {
+    int64_t in_token;
+    int64_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatLong::cppServer");
+    _aidl_ret_status = _aidl_data.readInt64(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatLong(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt64(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatFloat:
+  {
+    float in_token;
+    float _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatFloat::cppServer");
+    _aidl_ret_status = _aidl_data.readFloat(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatFloat(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFloat(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatDouble:
+  {
+    double in_token;
+    double _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatDouble::cppServer");
+    _aidl_ret_status = _aidl_data.readDouble(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatDouble(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeDouble(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatString:
+  {
+    ::android::String16 in_token;
+    ::android::String16 _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatString::cppServer");
+    _aidl_ret_status = _aidl_data.readString16(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatString(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatByteEnum:
+  {
+    ::android::aidl::tests::ByteEnum in_token;
+    ::android::aidl::tests::ByteEnum _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatByteEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_token));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatByteEnum(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByte(static_cast<int8_t>(_aidl_return));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatIntEnum:
+  {
+    ::android::aidl::tests::IntEnum in_token;
+    ::android::aidl::tests::IntEnum _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatIntEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readInt32(reinterpret_cast<int32_t *>(&in_token));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatIntEnum(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(static_cast<int32_t>(_aidl_return));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatLongEnum:
+  {
+    ::android::aidl::tests::LongEnum in_token;
+    ::android::aidl::tests::LongEnum _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatLongEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readInt64(reinterpret_cast<int64_t *>(&in_token));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatLongEnum(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt64(static_cast<int64_t>(_aidl_return));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseBoolean:
+  {
+    ::std::vector<bool> in_input;
+    ::std::vector<bool> out_repeated;
+    ::std::vector<bool> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseBoolean::cppServer");
+    _aidl_ret_status = _aidl_data.readBoolVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseBoolean(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBoolVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBoolVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseByte:
+  {
+    ::std::vector<uint8_t> in_input;
+    ::std::vector<uint8_t> out_repeated;
+    ::std::vector<uint8_t> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseByte::cppServer");
+    _aidl_ret_status = _aidl_data.readByteVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseByte(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByteVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByteVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseChar:
+  {
+    ::std::vector<char16_t> in_input;
+    ::std::vector<char16_t> out_repeated;
+    ::std::vector<char16_t> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseChar::cppServer");
+    _aidl_ret_status = _aidl_data.readCharVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseChar(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeCharVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeCharVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseInt:
+  {
+    ::std::vector<int32_t> in_input;
+    ::std::vector<int32_t> out_repeated;
+    ::std::vector<int32_t> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseInt::cppServer");
+    _aidl_ret_status = _aidl_data.readInt32Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseInt(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32Vector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseLong:
+  {
+    ::std::vector<int64_t> in_input;
+    ::std::vector<int64_t> out_repeated;
+    ::std::vector<int64_t> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseLong::cppServer");
+    _aidl_ret_status = _aidl_data.readInt64Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseLong(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt64Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt64Vector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseFloat:
+  {
+    ::std::vector<float> in_input;
+    ::std::vector<float> out_repeated;
+    ::std::vector<float> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseFloat::cppServer");
+    _aidl_ret_status = _aidl_data.readFloatVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseFloat(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFloatVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFloatVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseDouble:
+  {
+    ::std::vector<double> in_input;
+    ::std::vector<double> out_repeated;
+    ::std::vector<double> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseDouble::cppServer");
+    _aidl_ret_status = _aidl_data.readDoubleVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseDouble(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeDoubleVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeDoubleVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseString:
+  {
+    ::std::vector<::android::String16> in_input;
+    ::std::vector<::android::String16> out_repeated;
+    ::std::vector<::android::String16> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseString::cppServer");
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseString(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16Vector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseByteEnum:
+  {
+    ::std::vector<::android::aidl::tests::ByteEnum> in_input;
+    ::std::vector<::android::aidl::tests::ByteEnum> out_repeated;
+    ::std::vector<::android::aidl::tests::ByteEnum> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseByteEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseByteEnum(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseIntEnum:
+  {
+    ::std::vector<::android::aidl::tests::IntEnum> in_input;
+    ::std::vector<::android::aidl::tests::IntEnum> out_repeated;
+    ::std::vector<::android::aidl::tests::IntEnum> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseIntEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseIntEnum(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseLongEnum:
+  {
+    ::std::vector<::android::aidl::tests::LongEnum> in_input;
+    ::std::vector<::android::aidl::tests::LongEnum> out_repeated;
+    ::std::vector<::android::aidl::tests::LongEnum> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseLongEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseLongEnum(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetOtherTestService:
+  {
+    ::android::String16 in_name;
+    ::android::sp<::android::aidl::tests::INamedCallback> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetOtherTestService::cppServer");
+    _aidl_ret_status = _aidl_data.readString16(&in_name);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(GetOtherTestService(in_name, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinder(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_SetOtherTestService:
+  {
+    ::android::String16 in_name;
+    ::android::sp<::android::aidl::tests::INamedCallback> in_service;
+    bool _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::SetOtherTestService::cppServer");
+    _aidl_ret_status = _aidl_data.readString16(&in_name);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinder(&in_service);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(SetOtherTestService(in_name, in_service, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBool(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_VerifyName:
+  {
+    ::android::sp<::android::aidl::tests::INamedCallback> in_service;
+    ::android::String16 in_name;
+    bool _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::VerifyName::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinder(&in_service);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readString16(&in_name);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(VerifyName(in_service, in_name, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBool(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetInterfaceArray:
+  {
+    ::std::vector<::android::String16> in_names;
+    ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetInterfaceArray::cppServer");
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(GetInterfaceArray(in_names, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_VerifyNamesWithInterfaceArray:
+  {
+    ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>> in_services;
+    ::std::vector<::android::String16> in_names;
+    bool _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::VerifyNamesWithInterfaceArray::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_services);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(VerifyNamesWithInterfaceArray(in_services, in_names, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBool(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetNullableInterfaceArray:
+  {
+    ::std::optional<::std::vector<::std::optional<::android::String16>>> in_names;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetNullableInterfaceArray::cppServer");
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(GetNullableInterfaceArray(in_names, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_VerifyNamesWithNullableInterfaceArray:
+  {
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>> in_services;
+    ::std::optional<::std::vector<::std::optional<::android::String16>>> in_names;
+    bool _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::VerifyNamesWithNullableInterfaceArray::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_services);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(VerifyNamesWithNullableInterfaceArray(in_services, in_names, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBool(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetInterfaceList:
+  {
+    ::std::optional<::std::vector<::std::optional<::android::String16>>> in_names;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetInterfaceList::cppServer");
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(GetInterfaceList(in_names, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_VerifyNamesWithInterfaceList:
+  {
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>> in_services;
+    ::std::optional<::std::vector<::std::optional<::android::String16>>> in_names;
+    bool _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::VerifyNamesWithInterfaceList::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_services);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_names);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(VerifyNamesWithInterfaceList(in_services, in_names, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBool(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseStringList:
+  {
+    ::std::vector<::android::String16> in_input;
+    ::std::vector<::android::String16> out_repeated;
+    ::std::vector<::android::String16> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseStringList::cppServer");
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseStringList(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16Vector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatParcelFileDescriptor:
+  {
+    ::android::os::ParcelFileDescriptor in_read;
+    ::android::os::ParcelFileDescriptor _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatParcelFileDescriptor::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_read);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatParcelFileDescriptor(in_read, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseParcelFileDescriptorArray:
+  {
+    ::std::vector<::android::os::ParcelFileDescriptor> in_input;
+    ::std::vector<::android::os::ParcelFileDescriptor> out_repeated;
+    ::std::vector<::android::os::ParcelFileDescriptor> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseParcelFileDescriptorArray::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelableVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseParcelFileDescriptorArray(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelableVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelableVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ThrowServiceException:
+  {
+    int32_t in_code;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ThrowServiceException::cppServer");
+    _aidl_ret_status = _aidl_data.readInt32(&in_code);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ThrowServiceException(in_code));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableIntArray:
+  {
+    ::std::optional<::std::vector<int32_t>> in_input;
+    ::std::optional<::std::vector<int32_t>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableIntArray::cppServer");
+    _aidl_ret_status = _aidl_data.readInt32Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableIntArray(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableByteEnumArray:
+  {
+    ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>> in_input;
+    ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableByteEnumArray::cppServer");
+    _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableByteEnumArray(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableIntEnumArray:
+  {
+    ::std::optional<::std::vector<::android::aidl::tests::IntEnum>> in_input;
+    ::std::optional<::std::vector<::android::aidl::tests::IntEnum>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableIntEnumArray::cppServer");
+    _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableIntEnumArray(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableLongEnumArray:
+  {
+    ::std::optional<::std::vector<::android::aidl::tests::LongEnum>> in_input;
+    ::std::optional<::std::vector<::android::aidl::tests::LongEnum>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableLongEnumArray::cppServer");
+    _aidl_ret_status = _aidl_data.readEnumVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableLongEnumArray(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableString:
+  {
+    ::std::optional<::android::String16> in_input;
+    ::std::optional<::android::String16> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableString::cppServer");
+    _aidl_ret_status = _aidl_data.readString16(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableString(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableStringList:
+  {
+    ::std::optional<::std::vector<::std::optional<::android::String16>>> in_input;
+    ::std::optional<::std::vector<::std::optional<::android::String16>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableStringList::cppServer");
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableStringList(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableParcelable:
+  {
+    ::std::optional<::android::aidl::tests::ITestService::Empty> in_input;
+    ::std::optional<::android::aidl::tests::ITestService::Empty> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableParcelable(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeNullableParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableParcelableArray:
+  {
+    ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> in_input;
+    ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableParcelableArray::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelableVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableParcelableArray(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelableVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableParcelableList:
+  {
+    ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> in_input;
+    ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableParcelableList::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelableVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableParcelableList(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelableVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_TakesAnIBinder:
+  {
+    ::android::sp<::android::IBinder> in_input;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TakesAnIBinder::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinder(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(TakesAnIBinder(in_input));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_TakesANullableIBinder:
+  {
+    ::android::sp<::android::IBinder> in_input;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TakesANullableIBinder::cppServer");
+    _aidl_ret_status = _aidl_data.readNullableStrongBinder(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(TakesANullableIBinder(in_input));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_TakesAnIBinderList:
+  {
+    ::std::vector<::android::sp<::android::IBinder>> in_input;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TakesAnIBinderList::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(TakesAnIBinderList(in_input));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_TakesANullableIBinderList:
+  {
+    ::std::optional<::std::vector<::android::sp<::android::IBinder>>> in_input;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::TakesANullableIBinderList::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(TakesANullableIBinderList(in_input));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatUtf8CppString:
+  {
+    ::std::string in_token;
+    ::std::string _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatUtf8CppString::cppServer");
+    _aidl_ret_status = _aidl_data.readUtf8FromUtf16(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatUtf8CppString(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8AsUtf16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatNullableUtf8CppString:
+  {
+    ::std::optional<::std::string> in_token;
+    ::std::optional<::std::string> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatNullableUtf8CppString::cppServer");
+    _aidl_ret_status = _aidl_data.readUtf8FromUtf16(&in_token);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatNullableUtf8CppString(in_token, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8AsUtf16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseUtf8CppString:
+  {
+    ::std::vector<::std::string> in_input;
+    ::std::vector<::std::string> out_repeated;
+    ::std::vector<::std::string> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseUtf8CppString::cppServer");
+    _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseUtf8CppString(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8VectorAsUtf16Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8VectorAsUtf16Vector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseNullableUtf8CppString:
+  {
+    ::std::optional<::std::vector<::std::optional<::std::string>>> in_input;
+    ::std::optional<::std::vector<::std::optional<::std::string>>> out_repeated;
+    ::std::optional<::std::vector<::std::optional<::std::string>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseNullableUtf8CppString::cppServer");
+    _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseNullableUtf8CppString(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8VectorAsUtf16Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8VectorAsUtf16Vector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseUtf8CppStringList:
+  {
+    ::std::optional<::std::vector<::std::optional<::std::string>>> in_input;
+    ::std::optional<::std::vector<::std::optional<::std::string>>> out_repeated;
+    ::std::optional<::std::vector<::std::optional<::std::string>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseUtf8CppStringList::cppServer");
+    _aidl_ret_status = _aidl_data.readUtf8VectorFromUtf16Vector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseUtf8CppStringList(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8VectorAsUtf16Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8VectorAsUtf16Vector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetCallback:
+  {
+    bool in_return_null;
+    ::android::sp<::android::aidl::tests::INamedCallback> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetCallback::cppServer");
+    _aidl_ret_status = _aidl_data.readBool(&in_return_null);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(GetCallback(in_return_null, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinder(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_FillOutStructuredParcelable:
+  {
+    ::android::aidl::tests::StructuredParcelable in_parcel;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::FillOutStructuredParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_parcel);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(FillOutStructuredParcelable(&in_parcel));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(in_parcel);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_RepeatExtendableParcelable:
+  {
+    ::android::aidl::tests::extension::ExtendableParcelable in_ep;
+    ::android::aidl::tests::extension::ExtendableParcelable out_ep2;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::RepeatExtendableParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_ep);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(RepeatExtendableParcelable(in_ep, &out_ep2));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(out_ep2);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseList:
+  {
+    ::android::aidl::tests::RecursiveList in_list;
+    ::android::aidl::tests::RecursiveList _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseList::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_list);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseList(in_list, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseIBinderArray:
+  {
+    ::std::vector<::android::sp<::android::IBinder>> in_input;
+    ::std::vector<::android::sp<::android::IBinder>> out_repeated;
+    ::std::vector<::android::sp<::android::IBinder>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseIBinderArray::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseIBinderArray(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_ReverseNullableIBinderArray:
+  {
+    ::std::optional<::std::vector<::android::sp<::android::IBinder>>> in_input;
+    ::std::optional<::std::vector<::android::sp<::android::IBinder>>> out_repeated;
+    ::std::optional<::std::vector<::android::sp<::android::IBinder>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::ReverseNullableIBinderArray::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.resizeOutVector(&out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ReverseNullableIBinderArray(in_input, &out_repeated, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(out_repeated);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetOldNameInterface:
+  {
+    ::android::sp<::android::aidl::tests::IOldName> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetOldNameInterface::cppServer");
+    ::android::binder::Status _aidl_status(GetOldNameInterface(&_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinder(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetNewNameInterface:
+  {
+    ::android::sp<::android::aidl::tests::INewName> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetNewNameInterface::cppServer");
+    ::android::binder::Status _aidl_status(GetNewNameInterface(&_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinder(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetUnionTags:
+  {
+    ::std::vector<::android::aidl::tests::Union> in_input;
+    ::std::vector<::android::aidl::tests::Union::Tag> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetUnionTags::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelableVector(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(GetUnionTags(in_input, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeEnumVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetCppJavaTests:
+  {
+    ::android::sp<::android::IBinder> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetCppJavaTests::cppServer");
+    ::android::binder::Status _aidl_status(GetCppJavaTests(&_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinder(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_getBackendType:
+  {
+    ::android::aidl::tests::BackendType _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::getBackendType::cppServer");
+    ::android::binder::Status _aidl_status(getBackendType(&_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByte(static_cast<int8_t>(_aidl_return));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTestService::TRANSACTION_GetCircular:
+  {
+    ::android::aidl::tests::CircularParcelable out_cp;
+    ::android::sp<::android::aidl::tests::ICircular> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITestService::GetCircular::cppServer");
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(GetCircular(&out_cp, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinder(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(out_cp);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+#pragma clang diagnostic pop
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ITestService::Empty::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ITestService::Empty::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ITestService::CompilerChecks::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinder(&binder);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readNullableStrongBinder(&nullable_binder);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinderVector(&binder_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinderVector(&nullable_binder_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinderVector(&binder_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinderVector(&nullable_binder_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&pfd);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&nullable_pfd);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&pfd_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&nullable_pfd_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&pfd_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&nullable_pfd_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&parcel);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&nullable_parcel);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&parcel_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&nullable_parcel_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&parcel_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&nullable_parcel_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ITestService::CompilerChecks::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeStrongBinder(binder);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinder(nullable_binder);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinderVector(binder_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinderVector(nullable_binder_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinderVector(binder_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinderVector(nullable_binder_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(pfd);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeNullableParcelable(nullable_pfd);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(pfd_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(nullable_pfd_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(pfd_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(nullable_pfd_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(parcel);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeNullableParcelable(nullable_parcel);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(parcel_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(nullable_parcel_array);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(parcel_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(nullable_parcel_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/ITestService.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ITestService::CompilerChecks, Foo, "android.aidl.tests.ITestService.CompilerChecks.Foo")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/ITestService.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ITestService::CompilerChecks::BpFoo::BpFoo(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IFoo>(_aidl_impl){
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ITestService::CompilerChecks::BnFoo::BnFoo()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ITestService::CompilerChecks::BnFoo::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+::android::status_t ITestService::CompilerChecks::HasDeprecated::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&deprecated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ITestService::CompilerChecks::HasDeprecated::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(deprecated);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+#pragma clang diagnostic pop
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ITestService::CompilerChecks::UsingHasDeprecated::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case n: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<n>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<n>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case m: {
+    ::android::aidl::tests::ITestService::CompilerChecks::HasDeprecated _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readParcelable(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::aidl::tests::ITestService::CompilerChecks::HasDeprecated>) {
+      set<m>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<m>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t ITestService::CompilerChecks::UsingHasDeprecated::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case n: return _aidl_parcel->writeInt32(get<n>());
+  case m: return _aidl_parcel->writeParcelable(get<m>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/ITestService.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ITestService::CompilerChecks, NoPrefixInterface, "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/ITestService.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ITestService::CompilerChecks::BpNoPrefixInterface::BpNoPrefixInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<INoPrefixInterface>(_aidl_impl){
+}
+
+::android::binder::Status ITestService::CompilerChecks::BpNoPrefixInterface::foo() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::NoPrefixInterface::foo::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ITestService::CompilerChecks::BnNoPrefixInterface::TRANSACTION_foo, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && INoPrefixInterface::getDefaultImpl())) {
+     return INoPrefixInterface::getDefaultImpl()->foo();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ITestService::CompilerChecks::BnNoPrefixInterface::BnNoPrefixInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ITestService::CompilerChecks::BnNoPrefixInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnNoPrefixInterface::TRANSACTION_foo:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::NoPrefixInterface::foo::cppServer");
+    ::android::binder::Status _aidl_status(foo());
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ITestService::CompilerChecks::INoPrefixInterface::Nested::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ITestService::CompilerChecks::INoPrefixInterface::Nested::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/ITestService.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ITestService::CompilerChecks::INoPrefixInterface, NestedNoPrefixInterface, "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/ITestService.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ITestService::CompilerChecks::INoPrefixInterface::BpNestedNoPrefixInterface::BpNestedNoPrefixInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<INestedNoPrefixInterface>(_aidl_impl){
+}
+
+::android::binder::Status ITestService::CompilerChecks::INoPrefixInterface::BpNestedNoPrefixInterface::foo() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::NestedNoPrefixInterface::foo::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ITestService::CompilerChecks::INoPrefixInterface::BnNestedNoPrefixInterface::TRANSACTION_foo, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && INestedNoPrefixInterface::getDefaultImpl())) {
+     return INestedNoPrefixInterface::getDefaultImpl()->foo();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ITestService.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ITestService::CompilerChecks::INoPrefixInterface::BnNestedNoPrefixInterface::BnNestedNoPrefixInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ITestService::CompilerChecks::INoPrefixInterface::BnNestedNoPrefixInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnNestedNoPrefixInterface::TRANSACTION_foo:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::NestedNoPrefixInterface::foo::cppServer");
+    ::android::binder::Status _aidl_status(foo());
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp.d
new file mode 100644
index 0000000..89d3a1d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IntEnum.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IntEnum.cpp
new file mode 100644
index 0000000..54de736
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IntEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IntEnum.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IntEnum.cpp.d
new file mode 100644
index 0000000..5cb6ac6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/IntEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/IntEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ListOfInterfaces.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ListOfInterfaces.cpp
new file mode 100644
index 0000000..a962482
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ListOfInterfaces.cpp
@@ -0,0 +1,443 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#include <android/aidl/tests/ListOfInterfaces.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ListOfInterfaces::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ListOfInterfaces::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <android/aidl/tests/ListOfInterfaces.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ListOfInterfaces, EmptyInterface, "android.aidl.tests.ListOfInterfaces.IEmptyInterface")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ListOfInterfaces::BpEmptyInterface::BpEmptyInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IEmptyInterface>(_aidl_impl){
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ListOfInterfaces::BnEmptyInterface::BnEmptyInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ListOfInterfaces::BnEmptyInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <android/aidl/tests/ListOfInterfaces.h>
+namespace android {
+namespace aidl {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ListOfInterfaces, MyInterface, "android.aidl.tests.ListOfInterfaces.IMyInterface")
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ListOfInterfaces::BpMyInterface::BpMyInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IMyInterface>(_aidl_impl){
+}
+
+::android::binder::Status ListOfInterfaces::BpMyInterface::methodWithInterfaces(const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& iface_list_in, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* iface_list_out, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* iface_list_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& nullable_iface_list_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* nullable_iface_list_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* nullable_iface_list_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyInterface::methodWithInterfaces::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(nullable_iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(iface_list_in);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(*iface_list_inout);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(nullable_iface_list_in);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinderVector(*nullable_iface_list_inout);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ListOfInterfaces::BnMyInterface::TRANSACTION_methodWithInterfaces, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyInterface::getDefaultImpl())) {
+     return IMyInterface::getDefaultImpl()->methodWithInterfaces(iface, nullable_iface, iface_list_in, iface_list_out, iface_list_inout, nullable_iface_list_in, nullable_iface_list_out, nullable_iface_list_inout, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(iface_list_out);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(iface_list_inout);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(nullable_iface_list_out);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readStrongBinderVector(nullable_iface_list_inout);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+ListOfInterfaces::BnMyInterface::BnMyInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ListOfInterfaces::BnMyInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnMyInterface::TRANSACTION_methodWithInterfaces:
+  {
+    ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface> in_iface;
+    ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface> in_nullable_iface;
+    ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> in_iface_list_in;
+    ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> out_iface_list_out;
+    ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> in_iface_list_inout;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> in_nullable_iface_list_in;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> out_nullable_iface_list_out;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> in_nullable_iface_list_inout;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyInterface::methodWithInterfaces::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinder(&in_iface);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readNullableStrongBinder(&in_nullable_iface);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_iface_list_in);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_iface_list_inout);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_nullable_iface_list_in);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_nullable_iface_list_inout);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(methodWithInterfaces(in_iface, in_nullable_iface, in_iface_list_in, &out_iface_list_out, &in_iface_list_inout, in_nullable_iface_list_in, &out_nullable_iface_list_out, &in_nullable_iface_list_inout, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(out_iface_list_out);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(in_iface_list_inout);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(out_nullable_iface_list_out);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeStrongBinderVector(in_nullable_iface_list_inout);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ListOfInterfaces.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ListOfInterfaces::MyParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinder(&iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readNullableStrongBinder(&nullable_iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinderVector(&iface_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readStrongBinderVector(&nullable_iface_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ListOfInterfaces::MyParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeStrongBinder(iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinder(nullable_iface);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinderVector(iface_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinderVector(nullable_iface_list);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/ListOfInterfaces.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ListOfInterfaces::MyUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case iface: {
+    ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readStrongBinder(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>) {
+      set<iface>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<iface>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case nullable_iface: {
+    ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readNullableStrongBinder(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>) {
+      set<nullable_iface>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<nullable_iface>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case iface_list: {
+    ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readStrongBinderVector(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>) {
+      set<iface_list>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<iface_list>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case nullable_iface_list: {
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readStrongBinderVector(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>>) {
+      set<nullable_iface_list>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<nullable_iface_list>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t ListOfInterfaces::MyUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case iface: return _aidl_parcel->writeStrongBinder(get<iface>());
+  case nullable_iface: return _aidl_parcel->writeStrongBinder(get<nullable_iface>());
+  case iface_list: return _aidl_parcel->writeStrongBinderVector(get<iface_list>());
+  case nullable_iface_list: return _aidl_parcel->writeStrongBinderVector(get<nullable_iface_list>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d
new file mode 100644
index 0000000..9d79d56
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/ListOfInterfaces.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/LongEnum.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/LongEnum.cpp
new file mode 100644
index 0000000..b5cfb1c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/LongEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/LongEnum.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/LongEnum.cpp.d
new file mode 100644
index 0000000..881dfcf
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/LongEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/LongEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/OtherParcelableForToString.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/OtherParcelableForToString.cpp
new file mode 100644
index 0000000..1efd1eb
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/OtherParcelableForToString.cpp
@@ -0,0 +1,48 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#include <android/aidl/tests/OtherParcelableForToString.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t OtherParcelableForToString::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16(&field);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t OtherParcelableForToString::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeString16(field);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d
new file mode 100644
index 0000000..3d6fc45
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/OtherParcelableForToString.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ParcelableForToString.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ParcelableForToString.cpp
new file mode 100644
index 0000000..a0eacda
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ParcelableForToString.cpp
@@ -0,0 +1,312 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#include <android/aidl/tests/ParcelableForToString.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t ParcelableForToString::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&intValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32Vector(&intArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64(&longValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64Vector(&longArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readDouble(&doubleValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readDoubleVector(&doubleArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFloat(&floatValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFloatVector(&floatArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(&byteValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByteVector(&byteArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readBool(&booleanValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readBoolVector(&booleanArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16(&stringValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16Vector(&stringArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16Vector(&stringList);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&parcelableValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelableVector(&parcelableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&enumValue));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readEnumVector(&enumArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16Vector(&nullArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16Vector(&nullList);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&parcelableGeneric);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&unionValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ParcelableForToString::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(intValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32Vector(intArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64(longValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64Vector(longArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeDouble(doubleValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeDoubleVector(doubleArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFloat(floatValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFloatVector(floatArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeByte(byteValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeByteVector(byteArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeBool(booleanValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeBoolVector(booleanArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeString16(stringValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeString16Vector(stringArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeString16Vector(stringList);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(parcelableValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelableVector(parcelableArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(enumValue));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeEnumVector(enumArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeString16Vector(nullArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeString16Vector(nullList);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(parcelableGeneric);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(unionValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ParcelableForToString.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ParcelableForToString.cpp.d
new file mode 100644
index 0000000..4043fd1
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/ParcelableForToString.cpp.d
@@ -0,0 +1,10 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/ParcelableForToString.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/RecursiveList.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/RecursiveList.cpp
new file mode 100644
index 0000000..0284cb9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/RecursiveList.cpp
@@ -0,0 +1,60 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#include <android/aidl/tests/RecursiveList.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t RecursiveList::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&value);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&next);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t RecursiveList::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(value);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeNullableParcelable(next);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/RecursiveList.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/RecursiveList.cpp.d
new file mode 100644
index 0000000..a0d1ffd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/RecursiveList.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/RecursiveList.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/StructuredParcelable.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/StructuredParcelable.cpp
new file mode 100644
index 0000000..67e3a69
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/StructuredParcelable.cpp
@@ -0,0 +1,728 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#include <android/aidl/tests/StructuredParcelable.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t StructuredParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32Vector(&shouldContainThreeFs);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&f);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&shouldBeJerry);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(reinterpret_cast<int8_t *>(&shouldBeByteBar));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&shouldBeIntBar));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64(reinterpret_cast<int64_t *>(&shouldBeLongBar));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readEnumVector(&shouldContainTwoByteFoos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readEnumVector(&shouldContainTwoIntFoos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readEnumVector(&shouldContainTwoLongFoos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16(&stringDefaultsToFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(&byteDefaultsToFour);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&intDefaultsToFive);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64(&longDefaultsToNegativeSeven);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readBool(&booleanDefaultsToTrue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readChar(&charDefaultsToC);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFloat(&floatDefaultsToPi);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readDouble(&doubleWithDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32Vector(&arrayDefaultsTo123);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32Vector(&arrayDefaultsToEmpty);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readBool(&boolDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(&byteDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&intDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64(&longDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readFloat(&floatDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readDouble(&doubleDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readDouble(&checkDoubleFromFloat);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16Vector(&checkStringArray1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readUtf8VectorFromUtf16Vector(&checkStringArray2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&int32_min);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&int32_max);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64(&int64_max);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&hexInt32_neg_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readNullableStrongBinder(&ibinder);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&empty);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByteVector(&int8_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32Vector(&int32_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64Vector(&int64_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&hexInt32_pos_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&hexInt64_pos_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_1));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_2));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_3));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_4));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_5));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_6));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_7));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_8));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_9));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&const_exprs_10));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&addString1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&addString2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&shouldSetBit0AndBit2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&u);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&shouldBeConstS1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&defaultWithFoo));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t StructuredParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32Vector(shouldContainThreeFs);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(f);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeUtf8AsUtf16(shouldBeJerry);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeByte(static_cast<int8_t>(shouldBeByteBar));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(shouldBeIntBar));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64(static_cast<int64_t>(shouldBeLongBar));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeEnumVector(shouldContainTwoByteFoos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeEnumVector(shouldContainTwoIntFoos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeEnumVector(shouldContainTwoLongFoos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeString16(stringDefaultsToFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeByte(byteDefaultsToFour);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(intDefaultsToFive);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64(longDefaultsToNegativeSeven);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeBool(booleanDefaultsToTrue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeChar(charDefaultsToC);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFloat(floatDefaultsToPi);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeDouble(doubleWithDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32Vector(arrayDefaultsTo123);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32Vector(arrayDefaultsToEmpty);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeBool(boolDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeByte(byteDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(intDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64(longDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeFloat(floatDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeDouble(doubleDefault);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeDouble(checkDoubleFromFloat);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeString16Vector(checkStringArray1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeUtf8VectorAsUtf16Vector(checkStringArray2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(int32_min);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(int32_max);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64(int64_max);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(hexInt32_neg_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeStrongBinder(ibinder);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(empty);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeByteVector(int8_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32Vector(int32_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64Vector(int64_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(hexInt32_pos_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(hexInt64_pos_1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_1));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_2));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_3));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_4));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_5));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_6));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_7));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_8));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_9));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(const_exprs_10));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeUtf8AsUtf16(addString1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeUtf8AsUtf16(addString2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(shouldSetBit0AndBit2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeNullableParcelable(u);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeNullableParcelable(shouldBeConstS1);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(defaultWithFoo));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/StructuredParcelable.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t StructuredParcelable::Empty::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t StructuredParcelable::Empty::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/StructuredParcelable.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/StructuredParcelable.cpp.d
new file mode 100644
index 0000000..8d72a81
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/StructuredParcelable.cpp.d
@@ -0,0 +1,7 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/StructuredParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/Union.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/Union.cpp
new file mode 100644
index 0000000..d08d48a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/Union.cpp
@@ -0,0 +1,108 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#include <android/aidl/tests/Union.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+const ::std::string& Union::S1() {
+  static const ::std::string value("a string constant in union");
+  return value;
+}
+::android::status_t Union::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case ns: {
+    ::std::vector<int32_t> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32Vector(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::std::vector<int32_t>>) {
+      set<ns>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<ns>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case n: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<n>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<n>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case m: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<m>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<m>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case s: {
+    ::std::string _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::std::string>) {
+      set<s>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<s>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case ibinder: {
+    ::android::sp<::android::IBinder> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readNullableStrongBinder(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::sp<::android::IBinder>>) {
+      set<ibinder>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<ibinder>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case ss: {
+    ::std::vector<::std::string> _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readUtf8VectorFromUtf16Vector(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::std::vector<::std::string>>) {
+      set<ss>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<ss>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case be: {
+    ::android::aidl::tests::ByteEnum _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readByte(reinterpret_cast<int8_t *>(&_aidl_value))) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::aidl::tests::ByteEnum>) {
+      set<be>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<be>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t Union::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case ns: return _aidl_parcel->writeInt32Vector(get<ns>());
+  case n: return _aidl_parcel->writeInt32(get<n>());
+  case m: return _aidl_parcel->writeInt32(get<m>());
+  case s: return _aidl_parcel->writeUtf8AsUtf16(get<s>());
+  case ibinder: return _aidl_parcel->writeStrongBinder(get<ibinder>());
+  case ss: return _aidl_parcel->writeUtf8VectorAsUtf16Vector(get<ss>());
+  case be: return _aidl_parcel->writeByte(static_cast<int8_t>(get<be>()));
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/Union.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/Union.cpp.d
new file mode 100644
index 0000000..69ddafa
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/Union.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/Union.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/UnionWithFd.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/UnionWithFd.cpp
new file mode 100644
index 0000000..35c0db8
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/UnionWithFd.cpp
@@ -0,0 +1,49 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#include <android/aidl/tests/UnionWithFd.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+::android::status_t UnionWithFd::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case num: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<num>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<num>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case pfd: {
+    ::android::os::ParcelFileDescriptor _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readParcelable(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::os::ParcelFileDescriptor>) {
+      set<pfd>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<pfd>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t UnionWithFd::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case num: return _aidl_parcel->writeInt32(get<num>());
+  case pfd: return _aidl_parcel->writeParcelable(get<pfd>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/UnionWithFd.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/UnionWithFd.cpp.d
new file mode 100644
index 0000000..0ac1ec4
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/UnionWithFd.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/UnionWithFd.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp
new file mode 100644
index 0000000..11ab286
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp
@@ -0,0 +1,98 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#include <android/aidl/tests/extension/ExtendableParcelable.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+::android::status_t ExtendableParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&ext);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt64(&c);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&ext2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ExtendableParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeUtf8AsUtf16(b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(ext);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt64(c);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(ext2);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d
new file mode 100644
index 0000000..1fce902
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt.cpp
new file mode 100644
index 0000000..c1c5021
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt.cpp
@@ -0,0 +1,62 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#include <android/aidl/tests/extension/MyExt.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+::android::status_t MyExt::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t MyExt::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeUtf8AsUtf16(b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt.cpp.d
new file mode 100644
index 0000000..37e34d3
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt2.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt2.cpp
new file mode 100644
index 0000000..c08ecb1
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt2.cpp
@@ -0,0 +1,74 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#include <android/aidl/tests/extension/MyExt2.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+::android::status_t MyExt2::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&c);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t MyExt2::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeUtf8AsUtf16(c);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt2.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt2.cpp.d
new file mode 100644
index 0000000..1c9e164
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt2.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExt2.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExtLike.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExtLike.cpp
new file mode 100644
index 0000000..9d3ba35
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExtLike.cpp
@@ -0,0 +1,62 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#include <android/aidl/tests/extension/MyExtLike.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+::android::status_t MyExtLike::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readString16(&b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t MyExtLike::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeString16(b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d
new file mode 100644
index 0000000..3181128
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/extension/MyExtLike.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/DeeplyNested.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/DeeplyNested.cpp
new file mode 100644
index 0000000..2b68d26
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/DeeplyNested.cpp
@@ -0,0 +1,186 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#include <android/aidl/tests/nested/DeeplyNested.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+::android::status_t DeeplyNested::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t DeeplyNested::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/DeeplyNested.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+::android::status_t DeeplyNested::A::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(reinterpret_cast<int8_t *>(&e));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t DeeplyNested::A::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeByte(static_cast<int8_t>(e));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/DeeplyNested.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+::android::status_t DeeplyNested::B::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t DeeplyNested::B::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/DeeplyNested.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+::android::status_t DeeplyNested::B::C::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t DeeplyNested::B::C::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/DeeplyNested.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+::android::status_t DeeplyNested::B::C::D::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t DeeplyNested::B::C::D::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d
new file mode 100644
index 0000000..2b84190
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/DeeplyNested.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/INestedService.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/INestedService.cpp
new file mode 100644
index 0000000..e00951b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/INestedService.cpp
@@ -0,0 +1,372 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#include <android/aidl/tests/nested/INestedService.h>
+#include <android/aidl/tests/nested/BpNestedService.h>
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(NestedService, "android.aidl.tests.nested.INestedService")
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/BpNestedService.h>
+#include <android/aidl/tests/nested/BnNestedService.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+
+BpNestedService::BpNestedService(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<INestedService>(_aidl_impl){
+}
+
+::android::binder::Status BpNestedService::flipStatus(const ::android::aidl::tests::nested::ParcelableWithNested& p, ::android::aidl::tests::nested::INestedService::Result* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::INestedService::flipStatus::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(p);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnNestedService::TRANSACTION_flipStatus, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && INestedService::getDefaultImpl())) {
+     return INestedService::getDefaultImpl()->flipStatus(p, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpNestedService::flipStatusWithCallback(::android::aidl::tests::nested::ParcelableWithNested::Status status, const ::android::sp<::android::aidl::tests::nested::INestedService::ICallback>& cb) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::INestedService::flipStatusWithCallback::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(static_cast<int8_t>(status));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(cb);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnNestedService::TRANSACTION_flipStatusWithCallback, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && INestedService::getDefaultImpl())) {
+     return INestedService::getDefaultImpl()->flipStatusWithCallback(status, cb);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/BnNestedService.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+
+BnNestedService::BnNestedService()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnNestedService::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnNestedService::TRANSACTION_flipStatus:
+  {
+    ::android::aidl::tests::nested::ParcelableWithNested in_p;
+    ::android::aidl::tests::nested::INestedService::Result _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::INestedService::flipStatus::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_p);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(flipStatus(in_p, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnNestedService::TRANSACTION_flipStatusWithCallback:
+  {
+    ::android::aidl::tests::nested::ParcelableWithNested::Status in_status;
+    ::android::sp<::android::aidl::tests::nested::INestedService::ICallback> in_cb;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::INestedService::flipStatusWithCallback::cppServer");
+    _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_status));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readStrongBinder(&in_cb);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(flipStatusWithCallback(in_status, in_cb));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/INestedService.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+::android::status_t INestedService::Result::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(reinterpret_cast<int8_t *>(&status));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t INestedService::Result::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeByte(static_cast<int8_t>(status));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/INestedService.h>
+#include <android/aidl/tests/nested/INestedService.h>
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(INestedService, Callback, "android.aidl.tests.nested.INestedService.ICallback")
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/INestedService.h>
+#include <android/aidl/tests/nested/INestedService.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+
+INestedService::BpCallback::BpCallback(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<ICallback>(_aidl_impl){
+}
+
+::android::binder::Status INestedService::BpCallback::done(::android::aidl::tests::nested::ParcelableWithNested::Status status) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ICallback::done::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(static_cast<int8_t>(status));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(INestedService::BnCallback::TRANSACTION_done, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ICallback::getDefaultImpl())) {
+     return ICallback::getDefaultImpl()->done(status);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/nested/INestedService.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+
+INestedService::BnCallback::BnCallback()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t INestedService::BnCallback::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnCallback::TRANSACTION_done:
+  {
+    ::android::aidl::tests::nested::ParcelableWithNested::Status in_status;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ICallback::done::cppServer");
+    _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_status));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(done(in_status));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/INestedService.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/INestedService.cpp.d
new file mode 100644
index 0000000..54177d3
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/INestedService.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/INestedService.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp
new file mode 100644
index 0000000..6c426e7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp
@@ -0,0 +1,50 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#include <android/aidl/tests/nested/ParcelableWithNested.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+::android::status_t ParcelableWithNested::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(reinterpret_cast<int8_t *>(&status));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ParcelableWithNested::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeByte(static_cast<int8_t>(status));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d
new file mode 100644
index 0000000..44c21f5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/EnumUnion.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/EnumUnion.cpp
new file mode 100644
index 0000000..f10b547
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/EnumUnion.cpp
@@ -0,0 +1,68 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#include <android/aidl/tests/unions/EnumUnion.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+::android::status_t EnumUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case intEnum: {
+    ::android::aidl::tests::IntEnum _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(reinterpret_cast<int32_t *>(&_aidl_value))) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::aidl::tests::IntEnum>) {
+      set<intEnum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intEnum>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case longEnum: {
+    ::android::aidl::tests::LongEnum _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt64(reinterpret_cast<int64_t *>(&_aidl_value))) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::aidl::tests::LongEnum>) {
+      set<longEnum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<longEnum>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case deprecatedField: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<deprecatedField>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<deprecatedField>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t EnumUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case intEnum: return _aidl_parcel->writeInt32(static_cast<int32_t>(get<intEnum>()));
+  case longEnum: return _aidl_parcel->writeInt64(static_cast<int64_t>(get<longEnum>()));
+  #pragma clang diagnostic push
+  #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+  case deprecatedField: return _aidl_parcel->writeInt32(get<deprecatedField>());
+  #pragma clang diagnostic pop
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+#pragma clang diagnostic pop
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d
new file mode 100644
index 0000000..b8e1647
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/EnumUnion.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/UnionInUnion.cpp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/UnionInUnion.cpp
new file mode 100644
index 0000000..7fc66ce
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/UnionInUnion.cpp
@@ -0,0 +1,51 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#include <android/aidl/tests/unions/UnionInUnion.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+::android::status_t UnionInUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case first: {
+    ::android::aidl::tests::unions::EnumUnion _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readParcelable(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::android::aidl::tests::unions::EnumUnion>) {
+      set<first>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<first>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case second: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<second>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<second>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t UnionInUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case first: return _aidl_parcel->writeParcelable(get<first>());
+  case second: return _aidl_parcel->writeInt32(get<second>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d
new file mode 100644
index 0000000..470d9ea
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d
@@ -0,0 +1,5 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/unions/UnionInUnion.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ArrayOfInterfaces.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ArrayOfInterfaces.h
new file mode 100644
index 0000000..2dc7afa
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ArrayOfInterfaces.h
@@ -0,0 +1,330 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/ArrayOfInterfaces.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Delegate.h>
+#include <binder/Enums.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cassert>
+#include <cstdint>
+#include <optional>
+#include <string>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <variant>
+#include <vector>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace tests {
+class ArrayOfInterfaces : public ::android::Parcelable {
+public:
+  class IEmptyInterfaceDelegator;
+
+  class IEmptyInterface : public ::android::IInterface {
+  public:
+    typedef IEmptyInterfaceDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(EmptyInterface)
+  };  // class IEmptyInterface
+
+  class IEmptyInterfaceDefault : public IEmptyInterface {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+  };  // class IEmptyInterfaceDefault
+  class BpEmptyInterface : public ::android::BpInterface<IEmptyInterface> {
+  public:
+    explicit BpEmptyInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpEmptyInterface() = default;
+  };  // class BpEmptyInterface
+  class BnEmptyInterface : public ::android::BnInterface<IEmptyInterface> {
+  public:
+    explicit BnEmptyInterface();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  };  // class BnEmptyInterface
+
+  class IEmptyInterfaceDelegator : public BnEmptyInterface {
+  public:
+    explicit IEmptyInterfaceDelegator(const ::android::sp<IEmptyInterface> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<IEmptyInterface> getImpl() { return _aidl_delegate; }
+  private:
+    ::android::sp<IEmptyInterface> _aidl_delegate;
+  };  // class IEmptyInterfaceDelegator
+  class IMyInterfaceDelegator;
+
+  class IMyInterface : public ::android::IInterface {
+  public:
+    typedef IMyInterfaceDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(MyInterface)
+    virtual ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& iface_array_in, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_out, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& nullable_iface_array_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) = 0;
+  };  // class IMyInterface
+
+  class IMyInterfaceDefault : public IMyInterface {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+    ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& /*iface*/, const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& /*nullable_iface*/, const ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& /*iface_array_in*/, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* /*iface_array_out*/, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* /*iface_array_inout*/, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& /*nullable_iface_array_in*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* /*nullable_iface_array_out*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* /*nullable_iface_array_inout*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+  };  // class IMyInterfaceDefault
+  class BpMyInterface : public ::android::BpInterface<IMyInterface> {
+  public:
+    explicit BpMyInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpMyInterface() = default;
+    ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& iface_array_in, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_out, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& nullable_iface_array_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) override;
+  };  // class BpMyInterface
+  class BnMyInterface : public ::android::BnInterface<IMyInterface> {
+  public:
+    static constexpr uint32_t TRANSACTION_methodWithInterfaces = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+    explicit BnMyInterface();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  };  // class BnMyInterface
+
+  class IMyInterfaceDelegator : public BnMyInterface {
+  public:
+    explicit IMyInterfaceDelegator(const ::android::sp<IMyInterface> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<IMyInterface> getImpl() { return _aidl_delegate; }
+    ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& iface_array_in, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_out, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* iface_array_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& nullable_iface_array_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* nullable_iface_array_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) override {
+      ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterfaceDelegator> _iface;
+      if (iface) {
+        _iface = ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterfaceDelegator>::cast(delegate(iface));
+      }
+      ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterfaceDelegator> _nullable_iface;
+      if (nullable_iface) {
+        _nullable_iface = ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterfaceDelegator>::cast(delegate(nullable_iface));
+      }
+      return _aidl_delegate->methodWithInterfaces(_iface, _nullable_iface, iface_array_in, iface_array_out, iface_array_inout, nullable_iface_array_in, nullable_iface_array_out, nullable_iface_array_inout, _aidl_return);
+    }
+  private:
+    ::android::sp<IMyInterface> _aidl_delegate;
+  };  // class IMyInterfaceDelegator
+  class MyParcelable : public ::android::Parcelable {
+  public:
+    ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> iface;
+    ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> nullable_iface;
+    ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> iface_array;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> nullable_iface_array;
+    inline bool operator!=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) != std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator<(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) < std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator<=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) <= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator==(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) == std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator>(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) > std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator>=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) >= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ArrayOfInterfaces.MyParcelable");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyParcelable{";
+      os << "iface: " << ::android::internal::ToString(iface);
+      os << ", nullable_iface: " << ::android::internal::ToString(nullable_iface);
+      os << ", iface_array: " << ::android::internal::ToString(iface_array);
+      os << ", nullable_iface_array: " << ::android::internal::ToString(nullable_iface_array);
+      os << "}";
+      return os.str();
+    }
+  };  // class MyParcelable
+  class MyUnion : public ::android::Parcelable {
+  public:
+    enum class Tag : int32_t {
+      iface = 0,
+      nullable_iface = 1,
+      iface_array = 2,
+      nullable_iface_array = 3,
+    };
+    // Expose tag symbols for legacy code
+    static const inline Tag iface = Tag::iface;
+    static const inline Tag nullable_iface = Tag::nullable_iface;
+    static const inline Tag iface_array = Tag::iface_array;
+    static const inline Tag nullable_iface_array = Tag::nullable_iface_array;
+
+    template<typename _Tp>
+    static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, MyUnion>;
+
+    MyUnion() : _value(std::in_place_index<static_cast<size_t>(iface)>, ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>()) { }
+
+    template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+    // NOLINTNEXTLINE(google-explicit-constructor)
+    constexpr MyUnion(_Tp&& _arg)
+        : _value(std::forward<_Tp>(_arg)) {}
+
+    template <size_t _Np, typename... _Tp>
+    constexpr explicit MyUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+        : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+    template <Tag _tag, typename... _Tp>
+    static MyUnion make(_Tp&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+    }
+
+    template <Tag _tag, typename _Tp, typename... _Up>
+    static MyUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+    }
+
+    Tag getTag() const {
+      return static_cast<Tag>(_value.index());
+    }
+
+    template <Tag _tag>
+    const auto& get() const {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag>
+    auto& get() {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag, typename... _Tp>
+    void set(_Tp&&... _args) {
+      _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+    }
+
+    inline bool operator!=(const MyUnion& rhs) const {
+      return _value != rhs._value;
+    }
+    inline bool operator<(const MyUnion& rhs) const {
+      return _value < rhs._value;
+    }
+    inline bool operator<=(const MyUnion& rhs) const {
+      return _value <= rhs._value;
+    }
+    inline bool operator==(const MyUnion& rhs) const {
+      return _value == rhs._value;
+    }
+    inline bool operator>(const MyUnion& rhs) const {
+      return _value > rhs._value;
+    }
+    inline bool operator>=(const MyUnion& rhs) const {
+      return _value >= rhs._value;
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ArrayOfInterfaces.MyUnion");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyUnion{";
+      switch (getTag()) {
+      case iface: os << "iface: " << ::android::internal::ToString(get<iface>()); break;
+      case nullable_iface: os << "nullable_iface: " << ::android::internal::ToString(get<nullable_iface>()); break;
+      case iface_array: os << "iface_array: " << ::android::internal::ToString(get<iface_array>()); break;
+      case nullable_iface_array: os << "nullable_iface_array: " << ::android::internal::ToString(get<nullable_iface_array>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    std::variant<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>, ::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>, ::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>> _value;
+  };  // class MyUnion
+  inline bool operator!=(const ArrayOfInterfaces&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const ArrayOfInterfaces&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const ArrayOfInterfaces&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const ArrayOfInterfaces&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const ArrayOfInterfaces&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const ArrayOfInterfaces&) const {
+    return std::tie() >= std::tie();
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ArrayOfInterfaces");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ArrayOfInterfaces{";
+    os << "}";
+    return os.str();
+  }
+};  // class ArrayOfInterfaces
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ArrayOfInterfaces::MyUnion::Tag val) {
+  switch(val) {
+  case ArrayOfInterfaces::MyUnion::Tag::iface:
+    return "iface";
+  case ArrayOfInterfaces::MyUnion::Tag::nullable_iface:
+    return "nullable_iface";
+  case ArrayOfInterfaces::MyUnion::Tag::iface_array:
+    return "iface_array";
+  case ArrayOfInterfaces::MyUnion::Tag::nullable_iface_array:
+    return "nullable_iface_array";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag, 4> enum_values<::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag> = {
+  ::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::iface,
+  ::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::nullable_iface,
+  ::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::iface_array,
+  ::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::nullable_iface_array,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BackendType.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BackendType.h
new file mode 100644
index 0000000..bf9ca3a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BackendType.h
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+#pragma once
+
+#include <array>
+#include <binder/Enums.h>
+#include <cstdint>
+#include <string>
+
+namespace android {
+namespace aidl {
+namespace tests {
+enum class BackendType : int8_t {
+  CPP = 0,
+  JAVA = 1,
+  NDK = 2,
+  RUST = 3,
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(BackendType val) {
+  switch(val) {
+  case BackendType::CPP:
+    return "CPP";
+  case BackendType::JAVA:
+    return "JAVA";
+  case BackendType::NDK:
+    return "NDK";
+  case BackendType::RUST:
+    return "RUST";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::BackendType, 4> enum_values<::android::aidl::tests::BackendType> = {
+  ::android::aidl::tests::BackendType::CPP,
+  ::android::aidl::tests::BackendType::JAVA,
+  ::android::aidl::tests::BackendType::NDK,
+  ::android::aidl::tests::BackendType::RUST,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnArrayOfInterfaces.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnArrayOfInterfaces.h
new file mode 100644
index 0000000..3fcd18b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnArrayOfInterfaces.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnBackendType.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnBackendType.h
new file mode 100644
index 0000000..4c978cc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnBackendType.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnByteEnum.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnByteEnum.h
new file mode 100644
index 0000000..051e053
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnByteEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnCircular.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnCircular.h
new file mode 100644
index 0000000..6c7a2a8
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnCircular.h
@@ -0,0 +1,41 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/tests/ICircular.h>
+#include <android/aidl/tests/BnCircular.h>
+#include <android/aidl/tests/BnTestService.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BnCircular : public ::android::BnInterface<ICircular> {
+public:
+  static constexpr uint32_t TRANSACTION_GetTestService = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  explicit BnCircular();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+};  // class BnCircular
+
+class ICircularDelegator : public BnCircular {
+public:
+  explicit ICircularDelegator(const ::android::sp<ICircular> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<ICircular> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status GetTestService(::android::sp<::android::aidl::tests::ITestService>* _aidl_return) override {
+    auto _status = _aidl_delegate->GetTestService(_aidl_return);
+    if (*_aidl_return) {
+      *_aidl_return = ::android::sp<::android::aidl::tests::ITestServiceDelegator>::cast(delegate(*_aidl_return));
+    }
+    return _status;
+  }
+private:
+  ::android::sp<ICircular> _aidl_delegate;
+};  // class ICircularDelegator
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnCircularParcelable.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnCircularParcelable.h
new file mode 100644
index 0000000..2750327
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnCircularParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnConstantExpressionEnum.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnConstantExpressionEnum.h
new file mode 100644
index 0000000..2defd16
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnConstantExpressionEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecated.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecated.h
new file mode 100644
index 0000000..9effe3d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecated.h
@@ -0,0 +1,32 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/tests/IDeprecated.h>
+#include <android/aidl/tests/BnDeprecated.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace tests {
+class __attribute__((deprecated("test"))) BnDeprecated : public ::android::BnInterface<IDeprecated> {
+public:
+  explicit BnDeprecated();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+};  // class BnDeprecated
+
+class __attribute__((deprecated("test"))) IDeprecatedDelegator : public BnDeprecated {
+public:
+  explicit IDeprecatedDelegator(const ::android::sp<IDeprecated> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<IDeprecated> getImpl() { return _aidl_delegate; }
+private:
+  ::android::sp<IDeprecated> _aidl_delegate;
+};  // class IDeprecatedDelegator
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedEnum.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedEnum.h
new file mode 100644
index 0000000..42a29ed
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedParcelable.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedParcelable.h
new file mode 100644
index 0000000..a3cd9d3
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnFixedSize.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnFixedSize.h
new file mode 100644
index 0000000..cc77fb7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnFixedSize.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnGenericStructuredParcelable.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnGenericStructuredParcelable.h
new file mode 100644
index 0000000..3c59ef7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnGenericStructuredParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnIntEnum.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnIntEnum.h
new file mode 100644
index 0000000..4d09a2b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnIntEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnListOfInterfaces.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnListOfInterfaces.h
new file mode 100644
index 0000000..ccf9ce9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnListOfInterfaces.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnLongEnum.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnLongEnum.h
new file mode 100644
index 0000000..682ddaf
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnLongEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnNamedCallback.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnNamedCallback.h
new file mode 100644
index 0000000..fee8d2f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnNamedCallback.h
@@ -0,0 +1,36 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/tests/INamedCallback.h>
+#include <android/aidl/tests/BnNamedCallback.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BnNamedCallback : public ::android::BnInterface<INamedCallback> {
+public:
+  static constexpr uint32_t TRANSACTION_GetName = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  explicit BnNamedCallback();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+};  // class BnNamedCallback
+
+class INamedCallbackDelegator : public BnNamedCallback {
+public:
+  explicit INamedCallbackDelegator(const ::android::sp<INamedCallback> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<INamedCallback> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status GetName(::android::String16* _aidl_return) override {
+    return _aidl_delegate->GetName(_aidl_return);
+  }
+private:
+  ::android::sp<INamedCallback> _aidl_delegate;
+};  // class INamedCallbackDelegator
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnNewName.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnNewName.h
new file mode 100644
index 0000000..7eb7214
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnNewName.h
@@ -0,0 +1,36 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/tests/INewName.h>
+#include <android/aidl/tests/BnNewName.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BnNewName : public ::android::BnInterface<INewName> {
+public:
+  static constexpr uint32_t TRANSACTION_RealName = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  explicit BnNewName();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+};  // class BnNewName
+
+class INewNameDelegator : public BnNewName {
+public:
+  explicit INewNameDelegator(const ::android::sp<INewName> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<INewName> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status RealName(::android::String16* _aidl_return) override {
+    return _aidl_delegate->RealName(_aidl_return);
+  }
+private:
+  ::android::sp<INewName> _aidl_delegate;
+};  // class INewNameDelegator
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnOldName.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnOldName.h
new file mode 100644
index 0000000..986a674
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnOldName.h
@@ -0,0 +1,36 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/tests/IOldName.h>
+#include <android/aidl/tests/BnOldName.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BnOldName : public ::android::BnInterface<IOldName> {
+public:
+  static constexpr uint32_t TRANSACTION_RealName = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  explicit BnOldName();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+};  // class BnOldName
+
+class IOldNameDelegator : public BnOldName {
+public:
+  explicit IOldNameDelegator(const ::android::sp<IOldName> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<IOldName> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status RealName(::android::String16* _aidl_return) override {
+    return _aidl_delegate->RealName(_aidl_return);
+  }
+private:
+  ::android::sp<IOldName> _aidl_delegate;
+};  // class IOldNameDelegator
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnOtherParcelableForToString.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnOtherParcelableForToString.h
new file mode 100644
index 0000000..a9755b8
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnOtherParcelableForToString.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnParcelableForToString.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnParcelableForToString.h
new file mode 100644
index 0000000..8f3485f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnParcelableForToString.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnRecursiveList.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnRecursiveList.h
new file mode 100644
index 0000000..c1100e1
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnRecursiveList.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnStructuredParcelable.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnStructuredParcelable.h
new file mode 100644
index 0000000..c4f5984
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnStructuredParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnTestService.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnTestService.h
new file mode 100644
index 0000000..4ad6393
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnTestService.h
@@ -0,0 +1,337 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/BnCircular.h>
+#include <android/aidl/tests/BnNamedCallback.h>
+#include <android/aidl/tests/BnNewName.h>
+#include <android/aidl/tests/BnOldName.h>
+#include <android/aidl/tests/BnTestService.h>
+#include <android/aidl/tests/ITestService.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BnTestService : public ::android::BnInterface<ITestService> {
+public:
+  static constexpr uint32_t TRANSACTION_UnimplementedMethod = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_Deprecated = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_TestOneway = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_RepeatBoolean = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_RepeatByte = ::android::IBinder::FIRST_CALL_TRANSACTION + 4;
+  static constexpr uint32_t TRANSACTION_RepeatChar = ::android::IBinder::FIRST_CALL_TRANSACTION + 5;
+  static constexpr uint32_t TRANSACTION_RepeatInt = ::android::IBinder::FIRST_CALL_TRANSACTION + 6;
+  static constexpr uint32_t TRANSACTION_RepeatLong = ::android::IBinder::FIRST_CALL_TRANSACTION + 7;
+  static constexpr uint32_t TRANSACTION_RepeatFloat = ::android::IBinder::FIRST_CALL_TRANSACTION + 8;
+  static constexpr uint32_t TRANSACTION_RepeatDouble = ::android::IBinder::FIRST_CALL_TRANSACTION + 9;
+  static constexpr uint32_t TRANSACTION_RepeatString = ::android::IBinder::FIRST_CALL_TRANSACTION + 10;
+  static constexpr uint32_t TRANSACTION_RepeatByteEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 11;
+  static constexpr uint32_t TRANSACTION_RepeatIntEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 12;
+  static constexpr uint32_t TRANSACTION_RepeatLongEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 13;
+  static constexpr uint32_t TRANSACTION_ReverseBoolean = ::android::IBinder::FIRST_CALL_TRANSACTION + 14;
+  static constexpr uint32_t TRANSACTION_ReverseByte = ::android::IBinder::FIRST_CALL_TRANSACTION + 15;
+  static constexpr uint32_t TRANSACTION_ReverseChar = ::android::IBinder::FIRST_CALL_TRANSACTION + 16;
+  static constexpr uint32_t TRANSACTION_ReverseInt = ::android::IBinder::FIRST_CALL_TRANSACTION + 17;
+  static constexpr uint32_t TRANSACTION_ReverseLong = ::android::IBinder::FIRST_CALL_TRANSACTION + 18;
+  static constexpr uint32_t TRANSACTION_ReverseFloat = ::android::IBinder::FIRST_CALL_TRANSACTION + 19;
+  static constexpr uint32_t TRANSACTION_ReverseDouble = ::android::IBinder::FIRST_CALL_TRANSACTION + 20;
+  static constexpr uint32_t TRANSACTION_ReverseString = ::android::IBinder::FIRST_CALL_TRANSACTION + 21;
+  static constexpr uint32_t TRANSACTION_ReverseByteEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 22;
+  static constexpr uint32_t TRANSACTION_ReverseIntEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 23;
+  static constexpr uint32_t TRANSACTION_ReverseLongEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 24;
+  static constexpr uint32_t TRANSACTION_GetOtherTestService = ::android::IBinder::FIRST_CALL_TRANSACTION + 25;
+  static constexpr uint32_t TRANSACTION_SetOtherTestService = ::android::IBinder::FIRST_CALL_TRANSACTION + 26;
+  static constexpr uint32_t TRANSACTION_VerifyName = ::android::IBinder::FIRST_CALL_TRANSACTION + 27;
+  static constexpr uint32_t TRANSACTION_GetInterfaceArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 28;
+  static constexpr uint32_t TRANSACTION_VerifyNamesWithInterfaceArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 29;
+  static constexpr uint32_t TRANSACTION_GetNullableInterfaceArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 30;
+  static constexpr uint32_t TRANSACTION_VerifyNamesWithNullableInterfaceArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 31;
+  static constexpr uint32_t TRANSACTION_GetInterfaceList = ::android::IBinder::FIRST_CALL_TRANSACTION + 32;
+  static constexpr uint32_t TRANSACTION_VerifyNamesWithInterfaceList = ::android::IBinder::FIRST_CALL_TRANSACTION + 33;
+  static constexpr uint32_t TRANSACTION_ReverseStringList = ::android::IBinder::FIRST_CALL_TRANSACTION + 34;
+  static constexpr uint32_t TRANSACTION_RepeatParcelFileDescriptor = ::android::IBinder::FIRST_CALL_TRANSACTION + 35;
+  static constexpr uint32_t TRANSACTION_ReverseParcelFileDescriptorArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 36;
+  static constexpr uint32_t TRANSACTION_ThrowServiceException = ::android::IBinder::FIRST_CALL_TRANSACTION + 37;
+  static constexpr uint32_t TRANSACTION_RepeatNullableIntArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 38;
+  static constexpr uint32_t TRANSACTION_RepeatNullableByteEnumArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 39;
+  static constexpr uint32_t TRANSACTION_RepeatNullableIntEnumArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 40;
+  static constexpr uint32_t TRANSACTION_RepeatNullableLongEnumArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 41;
+  static constexpr uint32_t TRANSACTION_RepeatNullableString = ::android::IBinder::FIRST_CALL_TRANSACTION + 42;
+  static constexpr uint32_t TRANSACTION_RepeatNullableStringList = ::android::IBinder::FIRST_CALL_TRANSACTION + 43;
+  static constexpr uint32_t TRANSACTION_RepeatNullableParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 44;
+  static constexpr uint32_t TRANSACTION_RepeatNullableParcelableArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 45;
+  static constexpr uint32_t TRANSACTION_RepeatNullableParcelableList = ::android::IBinder::FIRST_CALL_TRANSACTION + 46;
+  static constexpr uint32_t TRANSACTION_TakesAnIBinder = ::android::IBinder::FIRST_CALL_TRANSACTION + 47;
+  static constexpr uint32_t TRANSACTION_TakesANullableIBinder = ::android::IBinder::FIRST_CALL_TRANSACTION + 48;
+  static constexpr uint32_t TRANSACTION_TakesAnIBinderList = ::android::IBinder::FIRST_CALL_TRANSACTION + 49;
+  static constexpr uint32_t TRANSACTION_TakesANullableIBinderList = ::android::IBinder::FIRST_CALL_TRANSACTION + 50;
+  static constexpr uint32_t TRANSACTION_RepeatUtf8CppString = ::android::IBinder::FIRST_CALL_TRANSACTION + 51;
+  static constexpr uint32_t TRANSACTION_RepeatNullableUtf8CppString = ::android::IBinder::FIRST_CALL_TRANSACTION + 52;
+  static constexpr uint32_t TRANSACTION_ReverseUtf8CppString = ::android::IBinder::FIRST_CALL_TRANSACTION + 53;
+  static constexpr uint32_t TRANSACTION_ReverseNullableUtf8CppString = ::android::IBinder::FIRST_CALL_TRANSACTION + 54;
+  static constexpr uint32_t TRANSACTION_ReverseUtf8CppStringList = ::android::IBinder::FIRST_CALL_TRANSACTION + 55;
+  static constexpr uint32_t TRANSACTION_GetCallback = ::android::IBinder::FIRST_CALL_TRANSACTION + 56;
+  static constexpr uint32_t TRANSACTION_FillOutStructuredParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 57;
+  static constexpr uint32_t TRANSACTION_RepeatExtendableParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 58;
+  static constexpr uint32_t TRANSACTION_ReverseList = ::android::IBinder::FIRST_CALL_TRANSACTION + 59;
+  static constexpr uint32_t TRANSACTION_ReverseIBinderArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 60;
+  static constexpr uint32_t TRANSACTION_ReverseNullableIBinderArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 61;
+  static constexpr uint32_t TRANSACTION_GetOldNameInterface = ::android::IBinder::FIRST_CALL_TRANSACTION + 62;
+  static constexpr uint32_t TRANSACTION_GetNewNameInterface = ::android::IBinder::FIRST_CALL_TRANSACTION + 63;
+  static constexpr uint32_t TRANSACTION_GetUnionTags = ::android::IBinder::FIRST_CALL_TRANSACTION + 64;
+  static constexpr uint32_t TRANSACTION_GetCppJavaTests = ::android::IBinder::FIRST_CALL_TRANSACTION + 65;
+  static constexpr uint32_t TRANSACTION_getBackendType = ::android::IBinder::FIRST_CALL_TRANSACTION + 66;
+  static constexpr uint32_t TRANSACTION_GetCircular = ::android::IBinder::FIRST_CALL_TRANSACTION + 67;
+  explicit BnTestService();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+};  // class BnTestService
+
+class ITestServiceDelegator : public BnTestService {
+public:
+  explicit ITestServiceDelegator(const ::android::sp<ITestService> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<ITestService> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status UnimplementedMethod(int32_t arg, int32_t* _aidl_return) override {
+    return _aidl_delegate->UnimplementedMethod(arg, _aidl_return);
+  }
+  ::android::binder::Status Deprecated() override __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"))) {
+    return _aidl_delegate->Deprecated();
+  }
+  ::android::binder::Status TestOneway() override {
+    return _aidl_delegate->TestOneway();
+  }
+  ::android::binder::Status RepeatBoolean(bool token, bool* _aidl_return) override {
+    return _aidl_delegate->RepeatBoolean(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatByte(int8_t token, int8_t* _aidl_return) override {
+    return _aidl_delegate->RepeatByte(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatChar(char16_t token, char16_t* _aidl_return) override {
+    return _aidl_delegate->RepeatChar(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatInt(int32_t token, int32_t* _aidl_return) override {
+    return _aidl_delegate->RepeatInt(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatLong(int64_t token, int64_t* _aidl_return) override {
+    return _aidl_delegate->RepeatLong(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatFloat(float token, float* _aidl_return) override {
+    return _aidl_delegate->RepeatFloat(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatDouble(double token, double* _aidl_return) override {
+    return _aidl_delegate->RepeatDouble(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatString(const ::android::String16& token, ::android::String16* _aidl_return) override {
+    return _aidl_delegate->RepeatString(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatByteEnum(::android::aidl::tests::ByteEnum token, ::android::aidl::tests::ByteEnum* _aidl_return) override {
+    return _aidl_delegate->RepeatByteEnum(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatIntEnum(::android::aidl::tests::IntEnum token, ::android::aidl::tests::IntEnum* _aidl_return) override {
+    return _aidl_delegate->RepeatIntEnum(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatLongEnum(::android::aidl::tests::LongEnum token, ::android::aidl::tests::LongEnum* _aidl_return) override {
+    return _aidl_delegate->RepeatLongEnum(token, _aidl_return);
+  }
+  ::android::binder::Status ReverseBoolean(const ::std::vector<bool>& input, ::std::vector<bool>* repeated, ::std::vector<bool>* _aidl_return) override {
+    return _aidl_delegate->ReverseBoolean(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseByte(const ::std::vector<uint8_t>& input, ::std::vector<uint8_t>* repeated, ::std::vector<uint8_t>* _aidl_return) override {
+    return _aidl_delegate->ReverseByte(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseChar(const ::std::vector<char16_t>& input, ::std::vector<char16_t>* repeated, ::std::vector<char16_t>* _aidl_return) override {
+    return _aidl_delegate->ReverseChar(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseInt(const ::std::vector<int32_t>& input, ::std::vector<int32_t>* repeated, ::std::vector<int32_t>* _aidl_return) override {
+    return _aidl_delegate->ReverseInt(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseLong(const ::std::vector<int64_t>& input, ::std::vector<int64_t>* repeated, ::std::vector<int64_t>* _aidl_return) override {
+    return _aidl_delegate->ReverseLong(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseFloat(const ::std::vector<float>& input, ::std::vector<float>* repeated, ::std::vector<float>* _aidl_return) override {
+    return _aidl_delegate->ReverseFloat(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseDouble(const ::std::vector<double>& input, ::std::vector<double>* repeated, ::std::vector<double>* _aidl_return) override {
+    return _aidl_delegate->ReverseDouble(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseString(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* repeated, ::std::vector<::android::String16>* _aidl_return) override {
+    return _aidl_delegate->ReverseString(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseByteEnum(const ::std::vector<::android::aidl::tests::ByteEnum>& input, ::std::vector<::android::aidl::tests::ByteEnum>* repeated, ::std::vector<::android::aidl::tests::ByteEnum>* _aidl_return) override {
+    return _aidl_delegate->ReverseByteEnum(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseIntEnum(const ::std::vector<::android::aidl::tests::IntEnum>& input, ::std::vector<::android::aidl::tests::IntEnum>* repeated, ::std::vector<::android::aidl::tests::IntEnum>* _aidl_return) override {
+    return _aidl_delegate->ReverseIntEnum(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseLongEnum(const ::std::vector<::android::aidl::tests::LongEnum>& input, ::std::vector<::android::aidl::tests::LongEnum>* repeated, ::std::vector<::android::aidl::tests::LongEnum>* _aidl_return) override {
+    return _aidl_delegate->ReverseLongEnum(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status GetOtherTestService(const ::android::String16& name, ::android::sp<::android::aidl::tests::INamedCallback>* _aidl_return) override {
+    auto _status = _aidl_delegate->GetOtherTestService(name, _aidl_return);
+    if (*_aidl_return) {
+      *_aidl_return = ::android::sp<::android::aidl::tests::INamedCallbackDelegator>::cast(delegate(*_aidl_return));
+    }
+    return _status;
+  }
+  ::android::binder::Status SetOtherTestService(const ::android::String16& name, const ::android::sp<::android::aidl::tests::INamedCallback>& service, bool* _aidl_return) override {
+    ::android::sp<::android::aidl::tests::INamedCallbackDelegator> _service;
+    if (service) {
+      _service = ::android::sp<::android::aidl::tests::INamedCallbackDelegator>::cast(delegate(service));
+    }
+    return _aidl_delegate->SetOtherTestService(name, _service, _aidl_return);
+  }
+  ::android::binder::Status VerifyName(const ::android::sp<::android::aidl::tests::INamedCallback>& service, const ::android::String16& name, bool* _aidl_return) override {
+    ::android::sp<::android::aidl::tests::INamedCallbackDelegator> _service;
+    if (service) {
+      _service = ::android::sp<::android::aidl::tests::INamedCallbackDelegator>::cast(delegate(service));
+    }
+    return _aidl_delegate->VerifyName(_service, name, _aidl_return);
+  }
+  ::android::binder::Status GetInterfaceArray(const ::std::vector<::android::String16>& names, ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>* _aidl_return) override {
+    return _aidl_delegate->GetInterfaceArray(names, _aidl_return);
+  }
+  ::android::binder::Status VerifyNamesWithInterfaceArray(const ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>& services, const ::std::vector<::android::String16>& names, bool* _aidl_return) override {
+    return _aidl_delegate->VerifyNamesWithInterfaceArray(services, names, _aidl_return);
+  }
+  ::android::binder::Status GetNullableInterfaceArray(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* _aidl_return) override {
+    return _aidl_delegate->GetNullableInterfaceArray(names, _aidl_return);
+  }
+  ::android::binder::Status VerifyNamesWithNullableInterfaceArray(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& services, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, bool* _aidl_return) override {
+    return _aidl_delegate->VerifyNamesWithNullableInterfaceArray(services, names, _aidl_return);
+  }
+  ::android::binder::Status GetInterfaceList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* _aidl_return) override {
+    return _aidl_delegate->GetInterfaceList(names, _aidl_return);
+  }
+  ::android::binder::Status VerifyNamesWithInterfaceList(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& services, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, bool* _aidl_return) override {
+    return _aidl_delegate->VerifyNamesWithInterfaceList(services, names, _aidl_return);
+  }
+  ::android::binder::Status ReverseStringList(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* repeated, ::std::vector<::android::String16>* _aidl_return) override {
+    return _aidl_delegate->ReverseStringList(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status RepeatParcelFileDescriptor(const ::android::os::ParcelFileDescriptor& read, ::android::os::ParcelFileDescriptor* _aidl_return) override {
+    return _aidl_delegate->RepeatParcelFileDescriptor(read, _aidl_return);
+  }
+  ::android::binder::Status ReverseParcelFileDescriptorArray(const ::std::vector<::android::os::ParcelFileDescriptor>& input, ::std::vector<::android::os::ParcelFileDescriptor>* repeated, ::std::vector<::android::os::ParcelFileDescriptor>* _aidl_return) override {
+    return _aidl_delegate->ReverseParcelFileDescriptorArray(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ThrowServiceException(int32_t code) override {
+    return _aidl_delegate->ThrowServiceException(code);
+  }
+  ::android::binder::Status RepeatNullableIntArray(const ::std::optional<::std::vector<int32_t>>& input, ::std::optional<::std::vector<int32_t>>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableIntArray(input, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableByteEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableByteEnumArray(input, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableIntEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableIntEnumArray(input, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableLongEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableLongEnumArray(input, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableString(const ::std::optional<::android::String16>& input, ::std::optional<::android::String16>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableString(input, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableStringList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& input, ::std::optional<::std::vector<::std::optional<::android::String16>>>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableStringList(input, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableParcelable(const ::std::optional<::android::aidl::tests::ITestService::Empty>& input, ::std::optional<::android::aidl::tests::ITestService::Empty>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableParcelable(input, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableParcelableArray(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& input, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableParcelableArray(input, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableParcelableList(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& input, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableParcelableList(input, _aidl_return);
+  }
+  ::android::binder::Status TakesAnIBinder(const ::android::sp<::android::IBinder>& input) override {
+    return _aidl_delegate->TakesAnIBinder(input);
+  }
+  ::android::binder::Status TakesANullableIBinder(const ::android::sp<::android::IBinder>& input) override {
+    return _aidl_delegate->TakesANullableIBinder(input);
+  }
+  ::android::binder::Status TakesAnIBinderList(const ::std::vector<::android::sp<::android::IBinder>>& input) override {
+    return _aidl_delegate->TakesAnIBinderList(input);
+  }
+  ::android::binder::Status TakesANullableIBinderList(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& input) override {
+    return _aidl_delegate->TakesANullableIBinderList(input);
+  }
+  ::android::binder::Status RepeatUtf8CppString(const ::std::string& token, ::std::string* _aidl_return) override {
+    return _aidl_delegate->RepeatUtf8CppString(token, _aidl_return);
+  }
+  ::android::binder::Status RepeatNullableUtf8CppString(const ::std::optional<::std::string>& token, ::std::optional<::std::string>* _aidl_return) override {
+    return _aidl_delegate->RepeatNullableUtf8CppString(token, _aidl_return);
+  }
+  ::android::binder::Status ReverseUtf8CppString(const ::std::vector<::std::string>& input, ::std::vector<::std::string>* repeated, ::std::vector<::std::string>* _aidl_return) override {
+    return _aidl_delegate->ReverseUtf8CppString(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseNullableUtf8CppString(const ::std::optional<::std::vector<::std::optional<::std::string>>>& input, ::std::optional<::std::vector<::std::optional<::std::string>>>* repeated, ::std::optional<::std::vector<::std::optional<::std::string>>>* _aidl_return) override {
+    return _aidl_delegate->ReverseNullableUtf8CppString(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseUtf8CppStringList(const ::std::optional<::std::vector<::std::optional<::std::string>>>& input, ::std::optional<::std::vector<::std::optional<::std::string>>>* repeated, ::std::optional<::std::vector<::std::optional<::std::string>>>* _aidl_return) override {
+    return _aidl_delegate->ReverseUtf8CppStringList(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status GetCallback(bool return_null, ::android::sp<::android::aidl::tests::INamedCallback>* _aidl_return) override {
+    auto _status = _aidl_delegate->GetCallback(return_null, _aidl_return);
+    if (*_aidl_return) {
+      *_aidl_return = ::android::sp<::android::aidl::tests::INamedCallbackDelegator>::cast(delegate(*_aidl_return));
+    }
+    return _status;
+  }
+  ::android::binder::Status FillOutStructuredParcelable(::android::aidl::tests::StructuredParcelable* parcel) override {
+    return _aidl_delegate->FillOutStructuredParcelable(parcel);
+  }
+  ::android::binder::Status RepeatExtendableParcelable(const ::android::aidl::tests::extension::ExtendableParcelable& ep, ::android::aidl::tests::extension::ExtendableParcelable* ep2) override {
+    return _aidl_delegate->RepeatExtendableParcelable(ep, ep2);
+  }
+  ::android::binder::Status ReverseList(const ::android::aidl::tests::RecursiveList& list, ::android::aidl::tests::RecursiveList* _aidl_return) override {
+    return _aidl_delegate->ReverseList(list, _aidl_return);
+  }
+  ::android::binder::Status ReverseIBinderArray(const ::std::vector<::android::sp<::android::IBinder>>& input, ::std::vector<::android::sp<::android::IBinder>>* repeated, ::std::vector<::android::sp<::android::IBinder>>* _aidl_return) override {
+    return _aidl_delegate->ReverseIBinderArray(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status ReverseNullableIBinderArray(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& input, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* repeated, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* _aidl_return) override {
+    return _aidl_delegate->ReverseNullableIBinderArray(input, repeated, _aidl_return);
+  }
+  ::android::binder::Status GetOldNameInterface(::android::sp<::android::aidl::tests::IOldName>* _aidl_return) override {
+    auto _status = _aidl_delegate->GetOldNameInterface(_aidl_return);
+    if (*_aidl_return) {
+      *_aidl_return = ::android::sp<::android::aidl::tests::IOldNameDelegator>::cast(delegate(*_aidl_return));
+    }
+    return _status;
+  }
+  ::android::binder::Status GetNewNameInterface(::android::sp<::android::aidl::tests::INewName>* _aidl_return) override {
+    auto _status = _aidl_delegate->GetNewNameInterface(_aidl_return);
+    if (*_aidl_return) {
+      *_aidl_return = ::android::sp<::android::aidl::tests::INewNameDelegator>::cast(delegate(*_aidl_return));
+    }
+    return _status;
+  }
+  ::android::binder::Status GetUnionTags(const ::std::vector<::android::aidl::tests::Union>& input, ::std::vector<::android::aidl::tests::Union::Tag>* _aidl_return) override {
+    return _aidl_delegate->GetUnionTags(input, _aidl_return);
+  }
+  ::android::binder::Status GetCppJavaTests(::android::sp<::android::IBinder>* _aidl_return) override {
+    return _aidl_delegate->GetCppJavaTests(_aidl_return);
+  }
+  ::android::binder::Status getBackendType(::android::aidl::tests::BackendType* _aidl_return) override {
+    return _aidl_delegate->getBackendType(_aidl_return);
+  }
+  ::android::binder::Status GetCircular(::android::aidl::tests::CircularParcelable* cp, ::android::sp<::android::aidl::tests::ICircular>* _aidl_return) override {
+    auto _status = _aidl_delegate->GetCircular(cp, _aidl_return);
+    if (*_aidl_return) {
+      *_aidl_return = ::android::sp<::android::aidl::tests::ICircularDelegator>::cast(delegate(*_aidl_return));
+    }
+    return _status;
+  }
+private:
+  ::android::sp<ITestService> _aidl_delegate;
+};  // class ITestServiceDelegator
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnUnion.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnUnion.h
new file mode 100644
index 0000000..8cd705d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnUnionWithFd.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnUnionWithFd.h
new file mode 100644
index 0000000..6e564bf
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnUnionWithFd.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpArrayOfInterfaces.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpArrayOfInterfaces.h
new file mode 100644
index 0000000..3a27562
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpArrayOfInterfaces.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpBackendType.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpBackendType.h
new file mode 100644
index 0000000..9263c71
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpBackendType.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpByteEnum.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpByteEnum.h
new file mode 100644
index 0000000..3924c9e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpByteEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpCircular.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpCircular.h
new file mode 100644
index 0000000..53aa76e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpCircular.h
@@ -0,0 +1,23 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/tests/ICircular.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BpCircular : public ::android::BpInterface<ICircular> {
+public:
+  explicit BpCircular(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpCircular() = default;
+  ::android::binder::Status GetTestService(::android::sp<::android::aidl::tests::ITestService>* _aidl_return) override;
+};  // class BpCircular
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpCircularParcelable.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpCircularParcelable.h
new file mode 100644
index 0000000..d822d8c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpCircularParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpConstantExpressionEnum.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpConstantExpressionEnum.h
new file mode 100644
index 0000000..fa5329a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpConstantExpressionEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecated.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecated.h
new file mode 100644
index 0000000..ff4ef51
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecated.h
@@ -0,0 +1,22 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/tests/IDeprecated.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class __attribute__((deprecated("test"))) BpDeprecated : public ::android::BpInterface<IDeprecated> {
+public:
+  explicit BpDeprecated(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpDeprecated() = default;
+};  // class BpDeprecated
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedEnum.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedEnum.h
new file mode 100644
index 0000000..e31a839
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedParcelable.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedParcelable.h
new file mode 100644
index 0000000..cad927a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpFixedSize.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpFixedSize.h
new file mode 100644
index 0000000..7280aa6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpFixedSize.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpGenericStructuredParcelable.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpGenericStructuredParcelable.h
new file mode 100644
index 0000000..2b0bbae
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpGenericStructuredParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpIntEnum.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpIntEnum.h
new file mode 100644
index 0000000..d474db5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpIntEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpListOfInterfaces.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpListOfInterfaces.h
new file mode 100644
index 0000000..fbbc804
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpListOfInterfaces.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpLongEnum.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpLongEnum.h
new file mode 100644
index 0000000..c8356c2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpLongEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpNamedCallback.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpNamedCallback.h
new file mode 100644
index 0000000..4d333ef
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpNamedCallback.h
@@ -0,0 +1,23 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/tests/INamedCallback.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BpNamedCallback : public ::android::BpInterface<INamedCallback> {
+public:
+  explicit BpNamedCallback(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpNamedCallback() = default;
+  ::android::binder::Status GetName(::android::String16* _aidl_return) override;
+};  // class BpNamedCallback
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpNewName.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpNewName.h
new file mode 100644
index 0000000..4be360b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpNewName.h
@@ -0,0 +1,23 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/tests/INewName.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BpNewName : public ::android::BpInterface<INewName> {
+public:
+  explicit BpNewName(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpNewName() = default;
+  ::android::binder::Status RealName(::android::String16* _aidl_return) override;
+};  // class BpNewName
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpOldName.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpOldName.h
new file mode 100644
index 0000000..c8b87dd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpOldName.h
@@ -0,0 +1,23 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/tests/IOldName.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BpOldName : public ::android::BpInterface<IOldName> {
+public:
+  explicit BpOldName(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpOldName() = default;
+  ::android::binder::Status RealName(::android::String16* _aidl_return) override;
+};  // class BpOldName
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpOtherParcelableForToString.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpOtherParcelableForToString.h
new file mode 100644
index 0000000..fb82c81
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpOtherParcelableForToString.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpParcelableForToString.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpParcelableForToString.h
new file mode 100644
index 0000000..10e7376
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpParcelableForToString.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpRecursiveList.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpRecursiveList.h
new file mode 100644
index 0000000..4f1758c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpRecursiveList.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpStructuredParcelable.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpStructuredParcelable.h
new file mode 100644
index 0000000..b1f6ef8
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpStructuredParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpTestService.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpTestService.h
new file mode 100644
index 0000000..450ffe1
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpTestService.h
@@ -0,0 +1,90 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/tests/ITestService.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class BpTestService : public ::android::BpInterface<ITestService> {
+public:
+  explicit BpTestService(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpTestService() = default;
+  ::android::binder::Status UnimplementedMethod(int32_t arg, int32_t* _aidl_return) override;
+  ::android::binder::Status Deprecated() override __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens")));
+  ::android::binder::Status TestOneway() override;
+  ::android::binder::Status RepeatBoolean(bool token, bool* _aidl_return) override;
+  ::android::binder::Status RepeatByte(int8_t token, int8_t* _aidl_return) override;
+  ::android::binder::Status RepeatChar(char16_t token, char16_t* _aidl_return) override;
+  ::android::binder::Status RepeatInt(int32_t token, int32_t* _aidl_return) override;
+  ::android::binder::Status RepeatLong(int64_t token, int64_t* _aidl_return) override;
+  ::android::binder::Status RepeatFloat(float token, float* _aidl_return) override;
+  ::android::binder::Status RepeatDouble(double token, double* _aidl_return) override;
+  ::android::binder::Status RepeatString(const ::android::String16& token, ::android::String16* _aidl_return) override;
+  ::android::binder::Status RepeatByteEnum(::android::aidl::tests::ByteEnum token, ::android::aidl::tests::ByteEnum* _aidl_return) override;
+  ::android::binder::Status RepeatIntEnum(::android::aidl::tests::IntEnum token, ::android::aidl::tests::IntEnum* _aidl_return) override;
+  ::android::binder::Status RepeatLongEnum(::android::aidl::tests::LongEnum token, ::android::aidl::tests::LongEnum* _aidl_return) override;
+  ::android::binder::Status ReverseBoolean(const ::std::vector<bool>& input, ::std::vector<bool>* repeated, ::std::vector<bool>* _aidl_return) override;
+  ::android::binder::Status ReverseByte(const ::std::vector<uint8_t>& input, ::std::vector<uint8_t>* repeated, ::std::vector<uint8_t>* _aidl_return) override;
+  ::android::binder::Status ReverseChar(const ::std::vector<char16_t>& input, ::std::vector<char16_t>* repeated, ::std::vector<char16_t>* _aidl_return) override;
+  ::android::binder::Status ReverseInt(const ::std::vector<int32_t>& input, ::std::vector<int32_t>* repeated, ::std::vector<int32_t>* _aidl_return) override;
+  ::android::binder::Status ReverseLong(const ::std::vector<int64_t>& input, ::std::vector<int64_t>* repeated, ::std::vector<int64_t>* _aidl_return) override;
+  ::android::binder::Status ReverseFloat(const ::std::vector<float>& input, ::std::vector<float>* repeated, ::std::vector<float>* _aidl_return) override;
+  ::android::binder::Status ReverseDouble(const ::std::vector<double>& input, ::std::vector<double>* repeated, ::std::vector<double>* _aidl_return) override;
+  ::android::binder::Status ReverseString(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* repeated, ::std::vector<::android::String16>* _aidl_return) override;
+  ::android::binder::Status ReverseByteEnum(const ::std::vector<::android::aidl::tests::ByteEnum>& input, ::std::vector<::android::aidl::tests::ByteEnum>* repeated, ::std::vector<::android::aidl::tests::ByteEnum>* _aidl_return) override;
+  ::android::binder::Status ReverseIntEnum(const ::std::vector<::android::aidl::tests::IntEnum>& input, ::std::vector<::android::aidl::tests::IntEnum>* repeated, ::std::vector<::android::aidl::tests::IntEnum>* _aidl_return) override;
+  ::android::binder::Status ReverseLongEnum(const ::std::vector<::android::aidl::tests::LongEnum>& input, ::std::vector<::android::aidl::tests::LongEnum>* repeated, ::std::vector<::android::aidl::tests::LongEnum>* _aidl_return) override;
+  ::android::binder::Status GetOtherTestService(const ::android::String16& name, ::android::sp<::android::aidl::tests::INamedCallback>* _aidl_return) override;
+  ::android::binder::Status SetOtherTestService(const ::android::String16& name, const ::android::sp<::android::aidl::tests::INamedCallback>& service, bool* _aidl_return) override;
+  ::android::binder::Status VerifyName(const ::android::sp<::android::aidl::tests::INamedCallback>& service, const ::android::String16& name, bool* _aidl_return) override;
+  ::android::binder::Status GetInterfaceArray(const ::std::vector<::android::String16>& names, ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>* _aidl_return) override;
+  ::android::binder::Status VerifyNamesWithInterfaceArray(const ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>& services, const ::std::vector<::android::String16>& names, bool* _aidl_return) override;
+  ::android::binder::Status GetNullableInterfaceArray(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* _aidl_return) override;
+  ::android::binder::Status VerifyNamesWithNullableInterfaceArray(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& services, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, bool* _aidl_return) override;
+  ::android::binder::Status GetInterfaceList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* _aidl_return) override;
+  ::android::binder::Status VerifyNamesWithInterfaceList(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& services, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, bool* _aidl_return) override;
+  ::android::binder::Status ReverseStringList(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* repeated, ::std::vector<::android::String16>* _aidl_return) override;
+  ::android::binder::Status RepeatParcelFileDescriptor(const ::android::os::ParcelFileDescriptor& read, ::android::os::ParcelFileDescriptor* _aidl_return) override;
+  ::android::binder::Status ReverseParcelFileDescriptorArray(const ::std::vector<::android::os::ParcelFileDescriptor>& input, ::std::vector<::android::os::ParcelFileDescriptor>* repeated, ::std::vector<::android::os::ParcelFileDescriptor>* _aidl_return) override;
+  ::android::binder::Status ThrowServiceException(int32_t code) override;
+  ::android::binder::Status RepeatNullableIntArray(const ::std::optional<::std::vector<int32_t>>& input, ::std::optional<::std::vector<int32_t>>* _aidl_return) override;
+  ::android::binder::Status RepeatNullableByteEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>* _aidl_return) override;
+  ::android::binder::Status RepeatNullableIntEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>* _aidl_return) override;
+  ::android::binder::Status RepeatNullableLongEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>* _aidl_return) override;
+  ::android::binder::Status RepeatNullableString(const ::std::optional<::android::String16>& input, ::std::optional<::android::String16>* _aidl_return) override;
+  ::android::binder::Status RepeatNullableStringList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& input, ::std::optional<::std::vector<::std::optional<::android::String16>>>* _aidl_return) override;
+  ::android::binder::Status RepeatNullableParcelable(const ::std::optional<::android::aidl::tests::ITestService::Empty>& input, ::std::optional<::android::aidl::tests::ITestService::Empty>* _aidl_return) override;
+  ::android::binder::Status RepeatNullableParcelableArray(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& input, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override;
+  ::android::binder::Status RepeatNullableParcelableList(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& input, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override;
+  ::android::binder::Status TakesAnIBinder(const ::android::sp<::android::IBinder>& input) override;
+  ::android::binder::Status TakesANullableIBinder(const ::android::sp<::android::IBinder>& input) override;
+  ::android::binder::Status TakesAnIBinderList(const ::std::vector<::android::sp<::android::IBinder>>& input) override;
+  ::android::binder::Status TakesANullableIBinderList(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& input) override;
+  ::android::binder::Status RepeatUtf8CppString(const ::std::string& token, ::std::string* _aidl_return) override;
+  ::android::binder::Status RepeatNullableUtf8CppString(const ::std::optional<::std::string>& token, ::std::optional<::std::string>* _aidl_return) override;
+  ::android::binder::Status ReverseUtf8CppString(const ::std::vector<::std::string>& input, ::std::vector<::std::string>* repeated, ::std::vector<::std::string>* _aidl_return) override;
+  ::android::binder::Status ReverseNullableUtf8CppString(const ::std::optional<::std::vector<::std::optional<::std::string>>>& input, ::std::optional<::std::vector<::std::optional<::std::string>>>* repeated, ::std::optional<::std::vector<::std::optional<::std::string>>>* _aidl_return) override;
+  ::android::binder::Status ReverseUtf8CppStringList(const ::std::optional<::std::vector<::std::optional<::std::string>>>& input, ::std::optional<::std::vector<::std::optional<::std::string>>>* repeated, ::std::optional<::std::vector<::std::optional<::std::string>>>* _aidl_return) override;
+  ::android::binder::Status GetCallback(bool return_null, ::android::sp<::android::aidl::tests::INamedCallback>* _aidl_return) override;
+  ::android::binder::Status FillOutStructuredParcelable(::android::aidl::tests::StructuredParcelable* parcel) override;
+  ::android::binder::Status RepeatExtendableParcelable(const ::android::aidl::tests::extension::ExtendableParcelable& ep, ::android::aidl::tests::extension::ExtendableParcelable* ep2) override;
+  ::android::binder::Status ReverseList(const ::android::aidl::tests::RecursiveList& list, ::android::aidl::tests::RecursiveList* _aidl_return) override;
+  ::android::binder::Status ReverseIBinderArray(const ::std::vector<::android::sp<::android::IBinder>>& input, ::std::vector<::android::sp<::android::IBinder>>* repeated, ::std::vector<::android::sp<::android::IBinder>>* _aidl_return) override;
+  ::android::binder::Status ReverseNullableIBinderArray(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& input, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* repeated, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* _aidl_return) override;
+  ::android::binder::Status GetOldNameInterface(::android::sp<::android::aidl::tests::IOldName>* _aidl_return) override;
+  ::android::binder::Status GetNewNameInterface(::android::sp<::android::aidl::tests::INewName>* _aidl_return) override;
+  ::android::binder::Status GetUnionTags(const ::std::vector<::android::aidl::tests::Union>& input, ::std::vector<::android::aidl::tests::Union::Tag>* _aidl_return) override;
+  ::android::binder::Status GetCppJavaTests(::android::sp<::android::IBinder>* _aidl_return) override;
+  ::android::binder::Status getBackendType(::android::aidl::tests::BackendType* _aidl_return) override;
+  ::android::binder::Status GetCircular(::android::aidl::tests::CircularParcelable* cp, ::android::sp<::android::aidl::tests::ICircular>* _aidl_return) override;
+};  // class BpTestService
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpUnion.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpUnion.h
new file mode 100644
index 0000000..ed2ea18
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpUnionWithFd.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpUnionWithFd.h
new file mode 100644
index 0000000..b040027
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpUnionWithFd.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ByteEnum.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ByteEnum.h
new file mode 100644
index 0000000..c6d544f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ByteEnum.h
@@ -0,0 +1,53 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <binder/Enums.h>
+#include <cstdint>
+#include <string>
+
+namespace android {
+namespace aidl {
+namespace tests {
+enum class ByteEnum : int8_t {
+  FOO = 1,
+  BAR = 2,
+  BAZ = 3,
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ByteEnum val) {
+  switch(val) {
+  case ByteEnum::FOO:
+    return "FOO";
+  case ByteEnum::BAR:
+    return "BAR";
+  case ByteEnum::BAZ:
+    return "BAZ";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::ByteEnum, 3> enum_values<::android::aidl::tests::ByteEnum> = {
+  ::android::aidl::tests::ByteEnum::FOO,
+  ::android::aidl::tests::ByteEnum::BAR,
+  ::android::aidl::tests::ByteEnum::BAZ,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/CircularParcelable.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/CircularParcelable.h
new file mode 100644
index 0000000..6388a93
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/CircularParcelable.h
@@ -0,0 +1,59 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/ITestService.h>
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <optional>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android::aidl::tests {
+class ITestService;
+}  // namespace android::aidl::tests
+namespace android {
+namespace aidl {
+namespace tests {
+class CircularParcelable : public ::android::Parcelable {
+public:
+  ::android::sp<::android::aidl::tests::ITestService> testService;
+  inline bool operator!=(const CircularParcelable& rhs) const {
+    return std::tie(testService) != std::tie(rhs.testService);
+  }
+  inline bool operator<(const CircularParcelable& rhs) const {
+    return std::tie(testService) < std::tie(rhs.testService);
+  }
+  inline bool operator<=(const CircularParcelable& rhs) const {
+    return std::tie(testService) <= std::tie(rhs.testService);
+  }
+  inline bool operator==(const CircularParcelable& rhs) const {
+    return std::tie(testService) == std::tie(rhs.testService);
+  }
+  inline bool operator>(const CircularParcelable& rhs) const {
+    return std::tie(testService) > std::tie(rhs.testService);
+  }
+  inline bool operator>=(const CircularParcelable& rhs) const {
+    return std::tie(testService) >= std::tie(rhs.testService);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.CircularParcelable");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "CircularParcelable{";
+    os << "testService: " << ::android::internal::ToString(testService);
+    os << "}";
+    return os.str();
+  }
+};  // class CircularParcelable
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ConstantExpressionEnum.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ConstantExpressionEnum.h
new file mode 100644
index 0000000..ca25ca8
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ConstantExpressionEnum.h
@@ -0,0 +1,63 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <binder/Enums.h>
+#include <cstdint>
+#include <string>
+
+namespace android {
+namespace aidl {
+namespace tests {
+enum class ConstantExpressionEnum : int32_t {
+  decInt32_1 = 1,
+  decInt32_2 = 1,
+  decInt64_1 = 1,
+  decInt64_2 = 1,
+  decInt64_3 = 1,
+  decInt64_4 = 1,
+  hexInt32_1 = 1,
+  hexInt32_2 = 1,
+  hexInt32_3 = 1,
+  hexInt64_1 = 1,
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ConstantExpressionEnum val) {
+  switch(val) {
+  case ConstantExpressionEnum::decInt32_1:
+    return "decInt32_1";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::ConstantExpressionEnum, 10> enum_values<::android::aidl::tests::ConstantExpressionEnum> = {
+  ::android::aidl::tests::ConstantExpressionEnum::decInt32_1,
+  ::android::aidl::tests::ConstantExpressionEnum::decInt32_2,
+  ::android::aidl::tests::ConstantExpressionEnum::decInt64_1,
+  ::android::aidl::tests::ConstantExpressionEnum::decInt64_2,
+  ::android::aidl::tests::ConstantExpressionEnum::decInt64_3,
+  ::android::aidl::tests::ConstantExpressionEnum::decInt64_4,
+  ::android::aidl::tests::ConstantExpressionEnum::hexInt32_1,
+  ::android::aidl::tests::ConstantExpressionEnum::hexInt32_2,
+  ::android::aidl::tests::ConstantExpressionEnum::hexInt32_3,
+  ::android::aidl::tests::ConstantExpressionEnum::hexInt64_1,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedEnum.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedEnum.h
new file mode 100644
index 0000000..886231f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedEnum.h
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <binder/Enums.h>
+#include <cstdint>
+#include <string>
+
+namespace android {
+namespace aidl {
+namespace tests {
+enum class __attribute__((deprecated("test"))) DeprecatedEnum : int32_t {
+  A = 0,
+  B = 1,
+  C = 2,
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+[[nodiscard]] static inline std::string toString(DeprecatedEnum val) {
+  switch(val) {
+  case DeprecatedEnum::A:
+    return "A";
+  case DeprecatedEnum::B:
+    return "B";
+  case DeprecatedEnum::C:
+    return "C";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+#pragma clang diagnostic pop
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+template <>
+constexpr inline std::array<::android::aidl::tests::DeprecatedEnum, 3> enum_values<::android::aidl::tests::DeprecatedEnum> = {
+  ::android::aidl::tests::DeprecatedEnum::A,
+  ::android::aidl::tests::DeprecatedEnum::B,
+  ::android::aidl::tests::DeprecatedEnum::C,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedParcelable.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedParcelable.h
new file mode 100644
index 0000000..d7165a7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedParcelable.h
@@ -0,0 +1,52 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class __attribute__((deprecated("test"))) DeprecatedParcelable : public ::android::Parcelable {
+public:
+  inline bool operator!=(const DeprecatedParcelable&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const DeprecatedParcelable&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const DeprecatedParcelable&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const DeprecatedParcelable&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const DeprecatedParcelable&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const DeprecatedParcelable&) const {
+    return std::tie() >= std::tie();
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.DeprecatedParcelable");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "DeprecatedParcelable{";
+    os << "}";
+    return os.str();
+  }
+};  // class DeprecatedParcelable
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/FixedSize.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/FixedSize.h
new file mode 100644
index 0000000..8e93fdd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/FixedSize.h
@@ -0,0 +1,284 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/FixedSize.h>
+#include <android/aidl/tests/LongEnum.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace tests {
+class FixedSize : public ::android::Parcelable {
+public:
+  class FixedUnion : public ::android::Parcelable {
+  public:
+    enum class Tag : int8_t {
+      booleanValue = 0,
+      byteValue = 1,
+      charValue = 2,
+      intValue = 3,
+      longValue = 4,
+      floatValue = 5,
+      doubleValue = 6,
+      enumValue = 7,
+    };
+    // Expose tag symbols for legacy code
+    static const inline Tag booleanValue = Tag::booleanValue;
+    static const inline Tag byteValue = Tag::byteValue;
+    static const inline Tag charValue = Tag::charValue;
+    static const inline Tag intValue = Tag::intValue;
+    static const inline Tag longValue = Tag::longValue;
+    static const inline Tag floatValue = Tag::floatValue;
+    static const inline Tag doubleValue = Tag::doubleValue;
+    static const inline Tag enumValue = Tag::enumValue;
+
+    template <Tag _Tag>
+    using _at = typename std::tuple_element<static_cast<size_t>(_Tag), std::tuple<bool, int8_t, char16_t, int32_t, int64_t, float, double, ::android::aidl::tests::LongEnum>>::type;
+    template <Tag _Tag, typename _Type>
+    static FixedUnion make(_Type&& _arg) {
+      FixedUnion _inst;
+      _inst.set<_Tag>(std::forward<_Type>(_arg));
+      return _inst;
+    }
+    constexpr Tag getTag() const {
+      return _tag;
+    }
+    template <Tag _Tag>
+    const _at<_Tag>& get() const {
+      if (_Tag != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return *(_at<_Tag>*)(&_value);
+    }
+    template <Tag _Tag>
+    _at<_Tag>& get() {
+      if (_Tag != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return *(_at<_Tag>*)(&_value);
+    }
+    template <Tag _Tag, typename _Type>
+    void set(_Type&& _arg) {
+      _tag = _Tag;
+      get<_Tag>() = std::forward<_Type>(_arg);
+    }
+    static int _cmp(const FixedUnion& _lhs, const FixedUnion& _rhs) {
+      return _cmp_value(_lhs.getTag(), _rhs.getTag()) || _cmp_value_at<enumValue>(_lhs, _rhs);
+    }
+    template <Tag _Tag>
+    static int _cmp_value_at(const FixedUnion& _lhs, const FixedUnion& _rhs) {
+      if constexpr (_Tag == booleanValue) {
+        return _cmp_value(_lhs.get<_Tag>(), _rhs.get<_Tag>());
+      } else {
+        return (_lhs.getTag() == _Tag)
+          ? _cmp_value(_lhs.get<_Tag>(), _rhs.get<_Tag>())
+          : _cmp_value_at<static_cast<Tag>(static_cast<size_t>(_Tag)-1)>(_lhs, _rhs);
+      }
+    }
+    template <typename _Type>
+    static int _cmp_value(const _Type& _lhs, const _Type& _rhs) {
+      return (_lhs == _rhs) ? 0 : (_lhs < _rhs) ? -1 : 1;
+    }
+    inline bool operator!=(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) != 0;
+    }
+    inline bool operator<(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) < 0;
+    }
+    inline bool operator<=(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) <= 0;
+    }
+    inline bool operator==(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) == 0;
+    }
+    inline bool operator>(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) > 0;
+    }
+    inline bool operator>=(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) >= 0;
+    }
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.FixedSize.FixedUnion");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "FixedUnion{";
+      switch (getTag()) {
+      case booleanValue: os << "booleanValue: " << ::android::internal::ToString(get<booleanValue>()); break;
+      case byteValue: os << "byteValue: " << ::android::internal::ToString(get<byteValue>()); break;
+      case charValue: os << "charValue: " << ::android::internal::ToString(get<charValue>()); break;
+      case intValue: os << "intValue: " << ::android::internal::ToString(get<intValue>()); break;
+      case longValue: os << "longValue: " << ::android::internal::ToString(get<longValue>()); break;
+      case floatValue: os << "floatValue: " << ::android::internal::ToString(get<floatValue>()); break;
+      case doubleValue: os << "doubleValue: " << ::android::internal::ToString(get<doubleValue>()); break;
+      case enumValue: os << "enumValue: " << ::android::internal::ToString(get<enumValue>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    Tag _tag = booleanValue;
+    union _value_t {
+      _value_t() {}
+      ~_value_t() {}
+      bool booleanValue __attribute__((aligned (1))) = bool(false);
+      int8_t byteValue __attribute__((aligned (1)));
+      char16_t charValue __attribute__((aligned (2)));
+      int32_t intValue __attribute__((aligned (4)));
+      int64_t longValue __attribute__((aligned (8)));
+      float floatValue __attribute__((aligned (4)));
+      double doubleValue __attribute__((aligned (8)));
+      ::android::aidl::tests::LongEnum enumValue __attribute__((aligned (8)));
+    } _value;
+  };  // class FixedUnion
+  class FixedParcelable : public ::android::Parcelable {
+  public:
+    bool booleanValue = false;
+    int8_t byteValue = 0;
+    char16_t charValue = '\0';
+    int32_t intValue = 0;
+    int64_t longValue = 0L;
+    float floatValue = 0.000000f;
+    double doubleValue = 0.000000;
+    ::android::aidl::tests::LongEnum enumValue = ::android::aidl::tests::LongEnum::FOO;
+    ::android::aidl::tests::FixedSize::FixedUnion parcelableValue;
+    inline bool operator!=(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) != std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator<(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) < std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator<=(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) <= std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator==(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) == std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator>(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) > std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator>=(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) >= std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.FixedSize.FixedParcelable");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "FixedParcelable{";
+      os << "booleanValue: " << ::android::internal::ToString(booleanValue);
+      os << ", byteValue: " << ::android::internal::ToString(byteValue);
+      os << ", charValue: " << ::android::internal::ToString(charValue);
+      os << ", intValue: " << ::android::internal::ToString(intValue);
+      os << ", longValue: " << ::android::internal::ToString(longValue);
+      os << ", floatValue: " << ::android::internal::ToString(floatValue);
+      os << ", doubleValue: " << ::android::internal::ToString(doubleValue);
+      os << ", enumValue: " << ::android::internal::ToString(enumValue);
+      os << ", parcelableValue: " << ::android::internal::ToString(parcelableValue);
+      os << "}";
+      return os.str();
+    }
+  };  // class FixedParcelable
+  inline bool operator!=(const FixedSize&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const FixedSize&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const FixedSize&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const FixedSize&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const FixedSize&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const FixedSize&) const {
+    return std::tie() >= std::tie();
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.FixedSize");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "FixedSize{";
+    os << "}";
+    return os.str();
+  }
+};  // class FixedSize
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(FixedSize::FixedUnion::Tag val) {
+  switch(val) {
+  case FixedSize::FixedUnion::Tag::booleanValue:
+    return "booleanValue";
+  case FixedSize::FixedUnion::Tag::byteValue:
+    return "byteValue";
+  case FixedSize::FixedUnion::Tag::charValue:
+    return "charValue";
+  case FixedSize::FixedUnion::Tag::intValue:
+    return "intValue";
+  case FixedSize::FixedUnion::Tag::longValue:
+    return "longValue";
+  case FixedSize::FixedUnion::Tag::floatValue:
+    return "floatValue";
+  case FixedSize::FixedUnion::Tag::doubleValue:
+    return "doubleValue";
+  case FixedSize::FixedUnion::Tag::enumValue:
+    return "enumValue";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::FixedSize::FixedUnion::Tag, 8> enum_values<::android::aidl::tests::FixedSize::FixedUnion::Tag> = {
+  ::android::aidl::tests::FixedSize::FixedUnion::Tag::booleanValue,
+  ::android::aidl::tests::FixedSize::FixedUnion::Tag::byteValue,
+  ::android::aidl::tests::FixedSize::FixedUnion::Tag::charValue,
+  ::android::aidl::tests::FixedSize::FixedUnion::Tag::intValue,
+  ::android::aidl::tests::FixedSize::FixedUnion::Tag::longValue,
+  ::android::aidl::tests::FixedSize::FixedUnion::Tag::floatValue,
+  ::android::aidl::tests::FixedSize::FixedUnion::Tag::doubleValue,
+  ::android::aidl::tests::FixedSize::FixedUnion::Tag::enumValue,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/GenericStructuredParcelable.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/GenericStructuredParcelable.h
new file mode 100644
index 0000000..a7d0afd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/GenericStructuredParcelable.h
@@ -0,0 +1,116 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+template <typename T, typename U, typename B>
+class GenericStructuredParcelable : public ::android::Parcelable {
+public:
+  int32_t a = 0;
+  int32_t b = 0;
+  inline bool operator!=(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<=(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator==(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>=(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.GenericStructuredParcelable");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "GenericStructuredParcelable{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << "}";
+    return os.str();
+  }
+};  // class GenericStructuredParcelable
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/tests/GenericStructuredParcelable.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+template <typename T, typename U, typename B>
+::android::status_t GenericStructuredParcelable<T,U,B>::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+template <typename T, typename U, typename B>
+::android::status_t GenericStructuredParcelable<T,U,B>::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ICircular.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ICircular.h
new file mode 100644
index 0000000..2260451
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ICircular.h
@@ -0,0 +1,41 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/ITestService.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <optional>
+#include <utils/StrongPointer.h>
+
+namespace android::aidl::tests {
+class ITestService;
+}  // namespace android::aidl::tests
+namespace android {
+namespace aidl {
+namespace tests {
+class ICircularDelegator;
+
+class ICircular : public ::android::IInterface {
+public:
+  typedef ICircularDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(Circular)
+  virtual ::android::binder::Status GetTestService(::android::sp<::android::aidl::tests::ITestService>* _aidl_return) = 0;
+};  // class ICircular
+
+class ICircularDefault : public ICircular {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status GetTestService(::android::sp<::android::aidl::tests::ITestService>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+};  // class ICircularDefault
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IDeprecated.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IDeprecated.h
new file mode 100644
index 0000000..8ea891d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IDeprecated.h
@@ -0,0 +1,32 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <utils/StrongPointer.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class IDeprecatedDelegator;
+
+class __attribute__((deprecated("test"))) IDeprecated : public ::android::IInterface {
+public:
+  typedef IDeprecatedDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(Deprecated)
+};  // class IDeprecated
+
+class __attribute__((deprecated("test"))) IDeprecatedDefault : public IDeprecated {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+};  // class IDeprecatedDefault
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/INamedCallback.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/INamedCallback.h
new file mode 100644
index 0000000..ad9110f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/INamedCallback.h
@@ -0,0 +1,37 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class INamedCallbackDelegator;
+
+class INamedCallback : public ::android::IInterface {
+public:
+  typedef INamedCallbackDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(NamedCallback)
+  virtual ::android::binder::Status GetName(::android::String16* _aidl_return) = 0;
+};  // class INamedCallback
+
+class INamedCallbackDefault : public INamedCallback {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status GetName(::android::String16* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+};  // class INamedCallbackDefault
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/INewName.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/INewName.h
new file mode 100644
index 0000000..b2b0d5f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/INewName.h
@@ -0,0 +1,37 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class INewNameDelegator;
+
+class INewName : public ::android::IInterface {
+public:
+  typedef INewNameDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(NewName)
+  virtual ::android::binder::Status RealName(::android::String16* _aidl_return) = 0;
+};  // class INewName
+
+class INewNameDefault : public INewName {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status RealName(::android::String16* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+};  // class INewNameDefault
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IOldName.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IOldName.h
new file mode 100644
index 0000000..d4c4e82
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IOldName.h
@@ -0,0 +1,37 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class IOldNameDelegator;
+
+class IOldName : public ::android::IInterface {
+public:
+  typedef IOldNameDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(OldName)
+  virtual ::android::binder::Status RealName(::android::String16* _aidl_return) = 0;
+};  // class IOldName
+
+class IOldNameDefault : public IOldName {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status RealName(::android::String16* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+};  // class IOldNameDefault
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ITestService.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ITestService.h
new file mode 100644
index 0000000..3ab273d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ITestService.h
@@ -0,0 +1,855 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/BackendType.h>
+#include <android/aidl/tests/ByteEnum.h>
+#include <android/aidl/tests/CircularParcelable.h>
+#include <android/aidl/tests/ICircular.h>
+#include <android/aidl/tests/INamedCallback.h>
+#include <android/aidl/tests/INewName.h>
+#include <android/aidl/tests/IOldName.h>
+#include <android/aidl/tests/ITestService.h>
+#include <android/aidl/tests/IntEnum.h>
+#include <android/aidl/tests/LongEnum.h>
+#include <android/aidl/tests/RecursiveList.h>
+#include <android/aidl/tests/StructuredParcelable.h>
+#include <android/aidl/tests/Union.h>
+#include <android/aidl/tests/extension/ExtendableParcelable.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Delegate.h>
+#include <binder/Enums.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Parcel.h>
+#include <binder/ParcelFileDescriptor.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cassert>
+#include <cstdint>
+#include <optional>
+#include <string>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <variant>
+#include <vector>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android::aidl::tests {
+class CircularParcelable;
+class ICircular;
+class INamedCallback;
+class INewName;
+class IOldName;
+class RecursiveList;
+class StructuredParcelable;
+}  // namespace android::aidl::tests
+namespace android::aidl::tests::extension {
+class ExtendableParcelable;
+}  // namespace android::aidl::tests::extension
+namespace android {
+namespace aidl {
+namespace tests {
+class ITestServiceDelegator;
+
+class ITestService : public ::android::IInterface {
+public:
+  typedef ITestServiceDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(TestService)
+  class Empty : public ::android::Parcelable {
+  public:
+    inline bool operator!=(const Empty&) const {
+      return std::tie() != std::tie();
+    }
+    inline bool operator<(const Empty&) const {
+      return std::tie() < std::tie();
+    }
+    inline bool operator<=(const Empty&) const {
+      return std::tie() <= std::tie();
+    }
+    inline bool operator==(const Empty&) const {
+      return std::tie() == std::tie();
+    }
+    inline bool operator>(const Empty&) const {
+      return std::tie() > std::tie();
+    }
+    inline bool operator>=(const Empty&) const {
+      return std::tie() >= std::tie();
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ITestService.Empty");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "Empty{";
+      os << "}";
+      return os.str();
+    }
+  };  // class Empty
+  class CompilerChecks : public ::android::Parcelable {
+  public:
+    class IFooDelegator;
+
+    class IFoo : public ::android::IInterface {
+    public:
+      typedef IFooDelegator DefaultDelegator;
+      DECLARE_META_INTERFACE(Foo)
+    };  // class IFoo
+
+    class IFooDefault : public IFoo {
+    public:
+      ::android::IBinder* onAsBinder() override {
+        return nullptr;
+      }
+    };  // class IFooDefault
+    class BpFoo : public ::android::BpInterface<IFoo> {
+    public:
+      explicit BpFoo(const ::android::sp<::android::IBinder>& _aidl_impl);
+      virtual ~BpFoo() = default;
+    };  // class BpFoo
+    class BnFoo : public ::android::BnInterface<IFoo> {
+    public:
+      explicit BnFoo();
+      ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+    };  // class BnFoo
+
+    class IFooDelegator : public BnFoo {
+    public:
+      explicit IFooDelegator(const ::android::sp<IFoo> &impl) : _aidl_delegate(impl) {}
+
+      ::android::sp<IFoo> getImpl() { return _aidl_delegate; }
+    private:
+      ::android::sp<IFoo> _aidl_delegate;
+    };  // class IFooDelegator
+    #pragma clang diagnostic push
+    #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+    class HasDeprecated : public ::android::Parcelable {
+    public:
+      int32_t __attribute__((deprecated("field"))) deprecated = 0;
+      inline bool operator!=(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) != std::tie(rhs.deprecated);
+      }
+      inline bool operator<(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) < std::tie(rhs.deprecated);
+      }
+      inline bool operator<=(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) <= std::tie(rhs.deprecated);
+      }
+      inline bool operator==(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) == std::tie(rhs.deprecated);
+      }
+      inline bool operator>(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) > std::tie(rhs.deprecated);
+      }
+      inline bool operator>=(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) >= std::tie(rhs.deprecated);
+      }
+
+      ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+      ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+      static const ::android::String16& getParcelableDescriptor() {
+        static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ITestService.CompilerChecks.HasDeprecated");
+        return DESCRIPTOR;
+      }
+      inline std::string toString() const {
+        std::ostringstream os;
+        os << "HasDeprecated{";
+        os << "deprecated: " << ::android::internal::ToString(deprecated);
+        os << "}";
+        return os.str();
+      }
+    };  // class HasDeprecated
+    #pragma clang diagnostic pop
+    class UsingHasDeprecated : public ::android::Parcelable {
+    public:
+      enum class Tag : int32_t {
+        n = 0,
+        m = 1,
+      };
+      // Expose tag symbols for legacy code
+      static const inline Tag n = Tag::n;
+      static const inline Tag m = Tag::m;
+
+      template<typename _Tp>
+      static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, UsingHasDeprecated>;
+
+      UsingHasDeprecated() : _value(std::in_place_index<static_cast<size_t>(n)>, int32_t(0)) { }
+
+      template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+      // NOLINTNEXTLINE(google-explicit-constructor)
+      constexpr UsingHasDeprecated(_Tp&& _arg)
+          : _value(std::forward<_Tp>(_arg)) {}
+
+      template <size_t _Np, typename... _Tp>
+      constexpr explicit UsingHasDeprecated(std::in_place_index_t<_Np>, _Tp&&... _args)
+          : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+      template <Tag _tag, typename... _Tp>
+      static UsingHasDeprecated make(_Tp&&... _args) {
+        return UsingHasDeprecated(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+      }
+
+      template <Tag _tag, typename _Tp, typename... _Up>
+      static UsingHasDeprecated make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+        return UsingHasDeprecated(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+      }
+
+      Tag getTag() const {
+        return static_cast<Tag>(_value.index());
+      }
+
+      template <Tag _tag>
+      const auto& get() const {
+        if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+        return std::get<static_cast<size_t>(_tag)>(_value);
+      }
+
+      template <Tag _tag>
+      auto& get() {
+        if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+        return std::get<static_cast<size_t>(_tag)>(_value);
+      }
+
+      template <Tag _tag, typename... _Tp>
+      void set(_Tp&&... _args) {
+        _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+      }
+
+      inline bool operator!=(const UsingHasDeprecated& rhs) const {
+        return _value != rhs._value;
+      }
+      inline bool operator<(const UsingHasDeprecated& rhs) const {
+        return _value < rhs._value;
+      }
+      inline bool operator<=(const UsingHasDeprecated& rhs) const {
+        return _value <= rhs._value;
+      }
+      inline bool operator==(const UsingHasDeprecated& rhs) const {
+        return _value == rhs._value;
+      }
+      inline bool operator>(const UsingHasDeprecated& rhs) const {
+        return _value > rhs._value;
+      }
+      inline bool operator>=(const UsingHasDeprecated& rhs) const {
+        return _value >= rhs._value;
+      }
+
+      ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+      ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+      static const ::android::String16& getParcelableDescriptor() {
+        static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ITestService.CompilerChecks.UsingHasDeprecated");
+        return DESCRIPTOR;
+      }
+      inline std::string toString() const {
+        std::ostringstream os;
+        os << "UsingHasDeprecated{";
+        switch (getTag()) {
+        case n: os << "n: " << ::android::internal::ToString(get<n>()); break;
+        case m: os << "m: " << ::android::internal::ToString(get<m>()); break;
+        }
+        os << "}";
+        return os.str();
+      }
+    private:
+      std::variant<int32_t, ::android::aidl::tests::ITestService::CompilerChecks::HasDeprecated> _value;
+    };  // class UsingHasDeprecated
+    class INoPrefixInterfaceDelegator;
+
+    class INoPrefixInterface : public ::android::IInterface {
+    public:
+      typedef INoPrefixInterfaceDelegator DefaultDelegator;
+      DECLARE_META_INTERFACE(NoPrefixInterface)
+      class Nested : public ::android::Parcelable {
+      public:
+        inline bool operator!=(const Nested&) const {
+          return std::tie() != std::tie();
+        }
+        inline bool operator<(const Nested&) const {
+          return std::tie() < std::tie();
+        }
+        inline bool operator<=(const Nested&) const {
+          return std::tie() <= std::tie();
+        }
+        inline bool operator==(const Nested&) const {
+          return std::tie() == std::tie();
+        }
+        inline bool operator>(const Nested&) const {
+          return std::tie() > std::tie();
+        }
+        inline bool operator>=(const Nested&) const {
+          return std::tie() >= std::tie();
+        }
+
+        ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+        ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+        static const ::android::String16& getParcelableDescriptor() {
+          static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.Nested");
+          return DESCRIPTOR;
+        }
+        inline std::string toString() const {
+          std::ostringstream os;
+          os << "Nested{";
+          os << "}";
+          return os.str();
+        }
+      };  // class Nested
+      class INestedNoPrefixInterfaceDelegator;
+
+      class INestedNoPrefixInterface : public ::android::IInterface {
+      public:
+        typedef INestedNoPrefixInterfaceDelegator DefaultDelegator;
+        DECLARE_META_INTERFACE(NestedNoPrefixInterface)
+        virtual ::android::binder::Status foo() = 0;
+      };  // class INestedNoPrefixInterface
+
+      class INestedNoPrefixInterfaceDefault : public INestedNoPrefixInterface {
+      public:
+        ::android::IBinder* onAsBinder() override {
+          return nullptr;
+        }
+        ::android::binder::Status foo() override {
+          return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+        }
+      };  // class INestedNoPrefixInterfaceDefault
+      class BpNestedNoPrefixInterface : public ::android::BpInterface<INestedNoPrefixInterface> {
+      public:
+        explicit BpNestedNoPrefixInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+        virtual ~BpNestedNoPrefixInterface() = default;
+        ::android::binder::Status foo() override;
+      };  // class BpNestedNoPrefixInterface
+      class BnNestedNoPrefixInterface : public ::android::BnInterface<INestedNoPrefixInterface> {
+      public:
+        static constexpr uint32_t TRANSACTION_foo = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+        explicit BnNestedNoPrefixInterface();
+        ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+      };  // class BnNestedNoPrefixInterface
+
+      class INestedNoPrefixInterfaceDelegator : public BnNestedNoPrefixInterface {
+      public:
+        explicit INestedNoPrefixInterfaceDelegator(const ::android::sp<INestedNoPrefixInterface> &impl) : _aidl_delegate(impl) {}
+
+        ::android::sp<INestedNoPrefixInterface> getImpl() { return _aidl_delegate; }
+        ::android::binder::Status foo() override {
+          return _aidl_delegate->foo();
+        }
+      private:
+        ::android::sp<INestedNoPrefixInterface> _aidl_delegate;
+      };  // class INestedNoPrefixInterfaceDelegator
+      virtual ::android::binder::Status foo() = 0;
+    };  // class INoPrefixInterface
+
+    class INoPrefixInterfaceDefault : public INoPrefixInterface {
+    public:
+      ::android::IBinder* onAsBinder() override {
+        return nullptr;
+      }
+      ::android::binder::Status foo() override {
+        return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+      }
+    };  // class INoPrefixInterfaceDefault
+    class BpNoPrefixInterface : public ::android::BpInterface<INoPrefixInterface> {
+    public:
+      explicit BpNoPrefixInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+      virtual ~BpNoPrefixInterface() = default;
+      ::android::binder::Status foo() override;
+    };  // class BpNoPrefixInterface
+    class BnNoPrefixInterface : public ::android::BnInterface<INoPrefixInterface> {
+    public:
+      static constexpr uint32_t TRANSACTION_foo = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+      explicit BnNoPrefixInterface();
+      ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+    };  // class BnNoPrefixInterface
+
+    class INoPrefixInterfaceDelegator : public BnNoPrefixInterface {
+    public:
+      explicit INoPrefixInterfaceDelegator(const ::android::sp<INoPrefixInterface> &impl) : _aidl_delegate(impl) {}
+
+      ::android::sp<INoPrefixInterface> getImpl() { return _aidl_delegate; }
+      ::android::binder::Status foo() override {
+        return _aidl_delegate->foo();
+      }
+    private:
+      ::android::sp<INoPrefixInterface> _aidl_delegate;
+    };  // class INoPrefixInterfaceDelegator
+    ::android::sp<::android::IBinder> binder;
+    ::android::sp<::android::IBinder> nullable_binder;
+    ::std::vector<::android::sp<::android::IBinder>> binder_array;
+    ::std::optional<::std::vector<::android::sp<::android::IBinder>>> nullable_binder_array;
+    ::std::vector<::android::sp<::android::IBinder>> binder_list;
+    ::std::optional<::std::vector<::android::sp<::android::IBinder>>> nullable_binder_list;
+    ::android::os::ParcelFileDescriptor pfd;
+    ::std::optional<::android::os::ParcelFileDescriptor> nullable_pfd;
+    ::std::vector<::android::os::ParcelFileDescriptor> pfd_array;
+    ::std::optional<::std::vector<::std::optional<::android::os::ParcelFileDescriptor>>> nullable_pfd_array;
+    ::std::vector<::android::os::ParcelFileDescriptor> pfd_list;
+    ::std::optional<::std::vector<::std::optional<::android::os::ParcelFileDescriptor>>> nullable_pfd_list;
+    ::android::aidl::tests::ITestService::Empty parcel;
+    ::std::optional<::android::aidl::tests::ITestService::Empty> nullable_parcel;
+    ::std::vector<::android::aidl::tests::ITestService::Empty> parcel_array;
+    ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> nullable_parcel_array;
+    ::std::vector<::android::aidl::tests::ITestService::Empty> parcel_list;
+    ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>> nullable_parcel_list;
+    inline bool operator!=(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) != std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator<(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) < std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator<=(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) <= std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator==(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) == std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator>(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) > std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator>=(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) >= std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ITestService.CompilerChecks");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "CompilerChecks{";
+      os << "binder: " << ::android::internal::ToString(binder);
+      os << ", nullable_binder: " << ::android::internal::ToString(nullable_binder);
+      os << ", binder_array: " << ::android::internal::ToString(binder_array);
+      os << ", nullable_binder_array: " << ::android::internal::ToString(nullable_binder_array);
+      os << ", binder_list: " << ::android::internal::ToString(binder_list);
+      os << ", nullable_binder_list: " << ::android::internal::ToString(nullable_binder_list);
+      os << ", pfd: " << ::android::internal::ToString(pfd);
+      os << ", nullable_pfd: " << ::android::internal::ToString(nullable_pfd);
+      os << ", pfd_array: " << ::android::internal::ToString(pfd_array);
+      os << ", nullable_pfd_array: " << ::android::internal::ToString(nullable_pfd_array);
+      os << ", pfd_list: " << ::android::internal::ToString(pfd_list);
+      os << ", nullable_pfd_list: " << ::android::internal::ToString(nullable_pfd_list);
+      os << ", parcel: " << ::android::internal::ToString(parcel);
+      os << ", nullable_parcel: " << ::android::internal::ToString(nullable_parcel);
+      os << ", parcel_array: " << ::android::internal::ToString(parcel_array);
+      os << ", nullable_parcel_array: " << ::android::internal::ToString(nullable_parcel_array);
+      os << ", parcel_list: " << ::android::internal::ToString(parcel_list);
+      os << ", nullable_parcel_list: " << ::android::internal::ToString(nullable_parcel_list);
+      os << "}";
+      return os.str();
+    }
+  };  // class CompilerChecks
+  enum : int32_t { CONSTANT = 42 };
+  enum : int32_t { CONSTANT2 = -42 };
+  enum : int32_t { CONSTANT3 = 42 };
+  enum : int32_t { CONSTANT4 = 4 };
+  enum : int32_t { CONSTANT5 = -4 };
+  enum : int32_t { CONSTANT6 = 0 };
+  enum : int32_t { CONSTANT7 = 0 };
+  enum : int32_t { CONSTANT8 = 0 };
+  enum : int32_t { CONSTANT9 = 86 };
+  enum : int32_t { CONSTANT10 = 165 };
+  enum : int32_t { CONSTANT11 = 250 };
+  enum : int32_t { CONSTANT12 = -1 };
+  enum : int8_t { BYTE_CONSTANT = 17 };
+  enum : int64_t { LONG_CONSTANT = 1099511627776L };
+  static const ::android::String16& STRING_CONSTANT();
+  static const ::android::String16& STRING_CONSTANT2();
+  static constexpr float FLOAT_CONSTANT = 1.000000f;
+  static constexpr float FLOAT_CONSTANT2 = -1.000000f;
+  static constexpr float FLOAT_CONSTANT3 = 1.000000f;
+  static constexpr float FLOAT_CONSTANT4 = 2.200000f;
+  static constexpr float FLOAT_CONSTANT5 = -2.200000f;
+  static constexpr float FLOAT_CONSTANT6 = -0.000000f;
+  static constexpr float FLOAT_CONSTANT7 = 0.000000f;
+  static constexpr double DOUBLE_CONSTANT = 1.000000;
+  static constexpr double DOUBLE_CONSTANT2 = -1.000000;
+  static constexpr double DOUBLE_CONSTANT3 = 1.000000;
+  static constexpr double DOUBLE_CONSTANT4 = 2.200000;
+  static constexpr double DOUBLE_CONSTANT5 = -2.200000;
+  static constexpr double DOUBLE_CONSTANT6 = -0.000000;
+  static constexpr double DOUBLE_CONSTANT7 = 0.000000;
+  static constexpr double DOUBLE_CONSTANT8 = 1.100000;
+  static constexpr double DOUBLE_CONSTANT9 = -1.100000;
+  static const ::std::string& STRING_CONSTANT_UTF8();
+  enum : int32_t { A1 = 1 };
+  enum : int32_t { A2 = 1 };
+  enum : int32_t { A3 = 1 };
+  enum : int32_t { A4 = 1 };
+  enum : int32_t { A5 = 1 };
+  enum : int32_t { A6 = 1 };
+  enum : int32_t { A7 = 1 };
+  enum : int32_t { A8 = 1 };
+  enum : int32_t { A9 = 1 };
+  enum : int32_t { A10 = 1 };
+  enum : int32_t { A11 = 1 };
+  enum : int32_t { A12 = 1 };
+  enum : int32_t { A13 = 1 };
+  enum : int32_t { A14 = 1 };
+  enum : int32_t { A15 = 1 };
+  enum : int32_t { A16 = 1 };
+  enum : int32_t { A17 = 1 };
+  enum : int32_t { A18 = 1 };
+  enum : int32_t { A19 = 1 };
+  enum : int32_t { A20 = 1 };
+  enum : int32_t { A21 = 1 };
+  enum : int32_t { A22 = 1 };
+  enum : int32_t { A23 = 1 };
+  enum : int32_t { A24 = 1 };
+  enum : int32_t { A25 = 1 };
+  enum : int32_t { A26 = 1 };
+  enum : int32_t { A27 = 1 };
+  enum : int32_t { A28 = 1 };
+  enum : int32_t { A29 = 1 };
+  enum : int32_t { A30 = 1 };
+  enum : int32_t { A31 = 1 };
+  enum : int32_t { A32 = 1 };
+  enum : int32_t { A33 = 1 };
+  enum : int32_t { A34 = 1 };
+  enum : int32_t { A35 = 1 };
+  enum : int32_t { A36 = 1 };
+  enum : int32_t { A37 = 1 };
+  enum : int32_t { A38 = 1 };
+  enum : int32_t { A39 = 1 };
+  enum : int32_t { A40 = 1 };
+  enum : int32_t { A41 = 1 };
+  enum : int32_t { A42 = 1 };
+  enum : int32_t { A43 = 1 };
+  enum : int32_t { A44 = 1 };
+  enum : int32_t { A45 = 1 };
+  enum : int32_t { A46 = 1 };
+  enum : int32_t { A47 = 1 };
+  enum : int32_t { A48 = 1 };
+  enum : int32_t { A49 = 1 };
+  enum : int32_t { A50 = 1 };
+  enum : int32_t { A51 = 1 };
+  enum : int32_t { A52 = 1 };
+  enum : int32_t { A53 = 1 };
+  enum : int32_t { A54 = 1 };
+  enum : int32_t { A55 = 1 };
+  enum : int32_t { A56 = 1 };
+  enum : int32_t { A57 = 1 };
+  virtual ::android::binder::Status UnimplementedMethod(int32_t arg, int32_t* _aidl_return) = 0;
+  virtual ::android::binder::Status Deprecated() __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"))) = 0;
+  virtual ::android::binder::Status TestOneway() = 0;
+  virtual ::android::binder::Status RepeatBoolean(bool token, bool* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatByte(int8_t token, int8_t* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatChar(char16_t token, char16_t* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatInt(int32_t token, int32_t* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatLong(int64_t token, int64_t* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatFloat(float token, float* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatDouble(double token, double* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatString(const ::android::String16& token, ::android::String16* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatByteEnum(::android::aidl::tests::ByteEnum token, ::android::aidl::tests::ByteEnum* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatIntEnum(::android::aidl::tests::IntEnum token, ::android::aidl::tests::IntEnum* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatLongEnum(::android::aidl::tests::LongEnum token, ::android::aidl::tests::LongEnum* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseBoolean(const ::std::vector<bool>& input, ::std::vector<bool>* repeated, ::std::vector<bool>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseByte(const ::std::vector<uint8_t>& input, ::std::vector<uint8_t>* repeated, ::std::vector<uint8_t>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseChar(const ::std::vector<char16_t>& input, ::std::vector<char16_t>* repeated, ::std::vector<char16_t>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseInt(const ::std::vector<int32_t>& input, ::std::vector<int32_t>* repeated, ::std::vector<int32_t>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseLong(const ::std::vector<int64_t>& input, ::std::vector<int64_t>* repeated, ::std::vector<int64_t>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseFloat(const ::std::vector<float>& input, ::std::vector<float>* repeated, ::std::vector<float>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseDouble(const ::std::vector<double>& input, ::std::vector<double>* repeated, ::std::vector<double>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseString(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* repeated, ::std::vector<::android::String16>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseByteEnum(const ::std::vector<::android::aidl::tests::ByteEnum>& input, ::std::vector<::android::aidl::tests::ByteEnum>* repeated, ::std::vector<::android::aidl::tests::ByteEnum>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseIntEnum(const ::std::vector<::android::aidl::tests::IntEnum>& input, ::std::vector<::android::aidl::tests::IntEnum>* repeated, ::std::vector<::android::aidl::tests::IntEnum>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseLongEnum(const ::std::vector<::android::aidl::tests::LongEnum>& input, ::std::vector<::android::aidl::tests::LongEnum>* repeated, ::std::vector<::android::aidl::tests::LongEnum>* _aidl_return) = 0;
+  virtual ::android::binder::Status GetOtherTestService(const ::android::String16& name, ::android::sp<::android::aidl::tests::INamedCallback>* _aidl_return) = 0;
+  virtual ::android::binder::Status SetOtherTestService(const ::android::String16& name, const ::android::sp<::android::aidl::tests::INamedCallback>& service, bool* _aidl_return) = 0;
+  virtual ::android::binder::Status VerifyName(const ::android::sp<::android::aidl::tests::INamedCallback>& service, const ::android::String16& name, bool* _aidl_return) = 0;
+  virtual ::android::binder::Status GetInterfaceArray(const ::std::vector<::android::String16>& names, ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>* _aidl_return) = 0;
+  virtual ::android::binder::Status VerifyNamesWithInterfaceArray(const ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>& services, const ::std::vector<::android::String16>& names, bool* _aidl_return) = 0;
+  virtual ::android::binder::Status GetNullableInterfaceArray(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* _aidl_return) = 0;
+  virtual ::android::binder::Status VerifyNamesWithNullableInterfaceArray(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& services, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, bool* _aidl_return) = 0;
+  virtual ::android::binder::Status GetInterfaceList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* _aidl_return) = 0;
+  virtual ::android::binder::Status VerifyNamesWithInterfaceList(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& services, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& names, bool* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseStringList(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* repeated, ::std::vector<::android::String16>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatParcelFileDescriptor(const ::android::os::ParcelFileDescriptor& read, ::android::os::ParcelFileDescriptor* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseParcelFileDescriptorArray(const ::std::vector<::android::os::ParcelFileDescriptor>& input, ::std::vector<::android::os::ParcelFileDescriptor>* repeated, ::std::vector<::android::os::ParcelFileDescriptor>* _aidl_return) = 0;
+  virtual ::android::binder::Status ThrowServiceException(int32_t code) = 0;
+  virtual ::android::binder::Status RepeatNullableIntArray(const ::std::optional<::std::vector<int32_t>>& input, ::std::optional<::std::vector<int32_t>>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableByteEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableIntEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableLongEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>& input, ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableString(const ::std::optional<::android::String16>& input, ::std::optional<::android::String16>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableStringList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& input, ::std::optional<::std::vector<::std::optional<::android::String16>>>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableParcelable(const ::std::optional<::android::aidl::tests::ITestService::Empty>& input, ::std::optional<::android::aidl::tests::ITestService::Empty>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableParcelableArray(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& input, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableParcelableList(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& input, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* _aidl_return) = 0;
+  virtual ::android::binder::Status TakesAnIBinder(const ::android::sp<::android::IBinder>& input) = 0;
+  virtual ::android::binder::Status TakesANullableIBinder(const ::android::sp<::android::IBinder>& input) = 0;
+  virtual ::android::binder::Status TakesAnIBinderList(const ::std::vector<::android::sp<::android::IBinder>>& input) = 0;
+  virtual ::android::binder::Status TakesANullableIBinderList(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& input) = 0;
+  virtual ::android::binder::Status RepeatUtf8CppString(const ::std::string& token, ::std::string* _aidl_return) = 0;
+  virtual ::android::binder::Status RepeatNullableUtf8CppString(const ::std::optional<::std::string>& token, ::std::optional<::std::string>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseUtf8CppString(const ::std::vector<::std::string>& input, ::std::vector<::std::string>* repeated, ::std::vector<::std::string>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseNullableUtf8CppString(const ::std::optional<::std::vector<::std::optional<::std::string>>>& input, ::std::optional<::std::vector<::std::optional<::std::string>>>* repeated, ::std::optional<::std::vector<::std::optional<::std::string>>>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseUtf8CppStringList(const ::std::optional<::std::vector<::std::optional<::std::string>>>& input, ::std::optional<::std::vector<::std::optional<::std::string>>>* repeated, ::std::optional<::std::vector<::std::optional<::std::string>>>* _aidl_return) = 0;
+  virtual ::android::binder::Status GetCallback(bool return_null, ::android::sp<::android::aidl::tests::INamedCallback>* _aidl_return) = 0;
+  virtual ::android::binder::Status FillOutStructuredParcelable(::android::aidl::tests::StructuredParcelable* parcel) = 0;
+  virtual ::android::binder::Status RepeatExtendableParcelable(const ::android::aidl::tests::extension::ExtendableParcelable& ep, ::android::aidl::tests::extension::ExtendableParcelable* ep2) = 0;
+  virtual ::android::binder::Status ReverseList(const ::android::aidl::tests::RecursiveList& list, ::android::aidl::tests::RecursiveList* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseIBinderArray(const ::std::vector<::android::sp<::android::IBinder>>& input, ::std::vector<::android::sp<::android::IBinder>>* repeated, ::std::vector<::android::sp<::android::IBinder>>* _aidl_return) = 0;
+  virtual ::android::binder::Status ReverseNullableIBinderArray(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& input, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* repeated, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* _aidl_return) = 0;
+  virtual ::android::binder::Status GetOldNameInterface(::android::sp<::android::aidl::tests::IOldName>* _aidl_return) = 0;
+  virtual ::android::binder::Status GetNewNameInterface(::android::sp<::android::aidl::tests::INewName>* _aidl_return) = 0;
+  virtual ::android::binder::Status GetUnionTags(const ::std::vector<::android::aidl::tests::Union>& input, ::std::vector<::android::aidl::tests::Union::Tag>* _aidl_return) = 0;
+  virtual ::android::binder::Status GetCppJavaTests(::android::sp<::android::IBinder>* _aidl_return) = 0;
+  virtual ::android::binder::Status getBackendType(::android::aidl::tests::BackendType* _aidl_return) = 0;
+  virtual ::android::binder::Status GetCircular(::android::aidl::tests::CircularParcelable* cp, ::android::sp<::android::aidl::tests::ICircular>* _aidl_return) = 0;
+};  // class ITestService
+
+class ITestServiceDefault : public ITestService {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status UnimplementedMethod(int32_t /*arg*/, int32_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status Deprecated() override __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"))) {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status TestOneway() override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatBoolean(bool /*token*/, bool* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatByte(int8_t /*token*/, int8_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatChar(char16_t /*token*/, char16_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatInt(int32_t /*token*/, int32_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatLong(int64_t /*token*/, int64_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatFloat(float /*token*/, float* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatDouble(double /*token*/, double* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatString(const ::android::String16& /*token*/, ::android::String16* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatByteEnum(::android::aidl::tests::ByteEnum /*token*/, ::android::aidl::tests::ByteEnum* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatIntEnum(::android::aidl::tests::IntEnum /*token*/, ::android::aidl::tests::IntEnum* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatLongEnum(::android::aidl::tests::LongEnum /*token*/, ::android::aidl::tests::LongEnum* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseBoolean(const ::std::vector<bool>& /*input*/, ::std::vector<bool>* /*repeated*/, ::std::vector<bool>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseByte(const ::std::vector<uint8_t>& /*input*/, ::std::vector<uint8_t>* /*repeated*/, ::std::vector<uint8_t>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseChar(const ::std::vector<char16_t>& /*input*/, ::std::vector<char16_t>* /*repeated*/, ::std::vector<char16_t>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseInt(const ::std::vector<int32_t>& /*input*/, ::std::vector<int32_t>* /*repeated*/, ::std::vector<int32_t>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseLong(const ::std::vector<int64_t>& /*input*/, ::std::vector<int64_t>* /*repeated*/, ::std::vector<int64_t>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseFloat(const ::std::vector<float>& /*input*/, ::std::vector<float>* /*repeated*/, ::std::vector<float>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseDouble(const ::std::vector<double>& /*input*/, ::std::vector<double>* /*repeated*/, ::std::vector<double>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseString(const ::std::vector<::android::String16>& /*input*/, ::std::vector<::android::String16>* /*repeated*/, ::std::vector<::android::String16>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseByteEnum(const ::std::vector<::android::aidl::tests::ByteEnum>& /*input*/, ::std::vector<::android::aidl::tests::ByteEnum>* /*repeated*/, ::std::vector<::android::aidl::tests::ByteEnum>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseIntEnum(const ::std::vector<::android::aidl::tests::IntEnum>& /*input*/, ::std::vector<::android::aidl::tests::IntEnum>* /*repeated*/, ::std::vector<::android::aidl::tests::IntEnum>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseLongEnum(const ::std::vector<::android::aidl::tests::LongEnum>& /*input*/, ::std::vector<::android::aidl::tests::LongEnum>* /*repeated*/, ::std::vector<::android::aidl::tests::LongEnum>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetOtherTestService(const ::android::String16& /*name*/, ::android::sp<::android::aidl::tests::INamedCallback>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status SetOtherTestService(const ::android::String16& /*name*/, const ::android::sp<::android::aidl::tests::INamedCallback>& /*service*/, bool* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status VerifyName(const ::android::sp<::android::aidl::tests::INamedCallback>& /*service*/, const ::android::String16& /*name*/, bool* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetInterfaceArray(const ::std::vector<::android::String16>& /*names*/, ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status VerifyNamesWithInterfaceArray(const ::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>& /*services*/, const ::std::vector<::android::String16>& /*names*/, bool* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetNullableInterfaceArray(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& /*names*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status VerifyNamesWithNullableInterfaceArray(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& /*services*/, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& /*names*/, bool* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetInterfaceList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& /*names*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status VerifyNamesWithInterfaceList(const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::INamedCallback>>>& /*services*/, const ::std::optional<::std::vector<::std::optional<::android::String16>>>& /*names*/, bool* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseStringList(const ::std::vector<::android::String16>& /*input*/, ::std::vector<::android::String16>* /*repeated*/, ::std::vector<::android::String16>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatParcelFileDescriptor(const ::android::os::ParcelFileDescriptor& /*read*/, ::android::os::ParcelFileDescriptor* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseParcelFileDescriptorArray(const ::std::vector<::android::os::ParcelFileDescriptor>& /*input*/, ::std::vector<::android::os::ParcelFileDescriptor>* /*repeated*/, ::std::vector<::android::os::ParcelFileDescriptor>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ThrowServiceException(int32_t /*code*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableIntArray(const ::std::optional<::std::vector<int32_t>>& /*input*/, ::std::optional<::std::vector<int32_t>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableByteEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>& /*input*/, ::std::optional<::std::vector<::android::aidl::tests::ByteEnum>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableIntEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>& /*input*/, ::std::optional<::std::vector<::android::aidl::tests::IntEnum>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableLongEnumArray(const ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>& /*input*/, ::std::optional<::std::vector<::android::aidl::tests::LongEnum>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableString(const ::std::optional<::android::String16>& /*input*/, ::std::optional<::android::String16>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableStringList(const ::std::optional<::std::vector<::std::optional<::android::String16>>>& /*input*/, ::std::optional<::std::vector<::std::optional<::android::String16>>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableParcelable(const ::std::optional<::android::aidl::tests::ITestService::Empty>& /*input*/, ::std::optional<::android::aidl::tests::ITestService::Empty>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableParcelableArray(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& /*input*/, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableParcelableList(const ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>& /*input*/, ::std::optional<::std::vector<::std::optional<::android::aidl::tests::ITestService::Empty>>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status TakesAnIBinder(const ::android::sp<::android::IBinder>& /*input*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status TakesANullableIBinder(const ::android::sp<::android::IBinder>& /*input*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status TakesAnIBinderList(const ::std::vector<::android::sp<::android::IBinder>>& /*input*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status TakesANullableIBinderList(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& /*input*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatUtf8CppString(const ::std::string& /*token*/, ::std::string* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatNullableUtf8CppString(const ::std::optional<::std::string>& /*token*/, ::std::optional<::std::string>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseUtf8CppString(const ::std::vector<::std::string>& /*input*/, ::std::vector<::std::string>* /*repeated*/, ::std::vector<::std::string>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseNullableUtf8CppString(const ::std::optional<::std::vector<::std::optional<::std::string>>>& /*input*/, ::std::optional<::std::vector<::std::optional<::std::string>>>* /*repeated*/, ::std::optional<::std::vector<::std::optional<::std::string>>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseUtf8CppStringList(const ::std::optional<::std::vector<::std::optional<::std::string>>>& /*input*/, ::std::optional<::std::vector<::std::optional<::std::string>>>* /*repeated*/, ::std::optional<::std::vector<::std::optional<::std::string>>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetCallback(bool /*return_null*/, ::android::sp<::android::aidl::tests::INamedCallback>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status FillOutStructuredParcelable(::android::aidl::tests::StructuredParcelable* /*parcel*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status RepeatExtendableParcelable(const ::android::aidl::tests::extension::ExtendableParcelable& /*ep*/, ::android::aidl::tests::extension::ExtendableParcelable* /*ep2*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseList(const ::android::aidl::tests::RecursiveList& /*list*/, ::android::aidl::tests::RecursiveList* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseIBinderArray(const ::std::vector<::android::sp<::android::IBinder>>& /*input*/, ::std::vector<::android::sp<::android::IBinder>>* /*repeated*/, ::std::vector<::android::sp<::android::IBinder>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ReverseNullableIBinderArray(const ::std::optional<::std::vector<::android::sp<::android::IBinder>>>& /*input*/, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* /*repeated*/, ::std::optional<::std::vector<::android::sp<::android::IBinder>>>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetOldNameInterface(::android::sp<::android::aidl::tests::IOldName>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetNewNameInterface(::android::sp<::android::aidl::tests::INewName>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetUnionTags(const ::std::vector<::android::aidl::tests::Union>& /*input*/, ::std::vector<::android::aidl::tests::Union::Tag>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetCppJavaTests(::android::sp<::android::IBinder>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status getBackendType(::android::aidl::tests::BackendType* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status GetCircular(::android::aidl::tests::CircularParcelable* /*cp*/, ::android::sp<::android::aidl::tests::ICircular>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+};  // class ITestServiceDefault
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ITestService::CompilerChecks::UsingHasDeprecated::Tag val) {
+  switch(val) {
+  case ITestService::CompilerChecks::UsingHasDeprecated::Tag::n:
+    return "n";
+  case ITestService::CompilerChecks::UsingHasDeprecated::Tag::m:
+    return "m";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::ITestService::CompilerChecks::UsingHasDeprecated::Tag, 2> enum_values<::android::aidl::tests::ITestService::CompilerChecks::UsingHasDeprecated::Tag> = {
+  ::android::aidl::tests::ITestService::CompilerChecks::UsingHasDeprecated::Tag::n,
+  ::android::aidl::tests::ITestService::CompilerChecks::UsingHasDeprecated::Tag::m,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IntEnum.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IntEnum.h
new file mode 100644
index 0000000..4f59149
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IntEnum.h
@@ -0,0 +1,61 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <binder/Enums.h>
+#include <cstdint>
+#include <string>
+
+namespace android {
+namespace aidl {
+namespace tests {
+enum class IntEnum : int32_t {
+  FOO = 1000,
+  BAR = 2000,
+  BAZ = 2001,
+  QUX __attribute__((deprecated("do not use this"))) = 2002,
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+[[nodiscard]] static inline std::string toString(IntEnum val) {
+  switch(val) {
+  case IntEnum::FOO:
+    return "FOO";
+  case IntEnum::BAR:
+    return "BAR";
+  case IntEnum::BAZ:
+    return "BAZ";
+  case IntEnum::QUX:
+    return "QUX";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+#pragma clang diagnostic pop
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+template <>
+constexpr inline std::array<::android::aidl::tests::IntEnum, 4> enum_values<::android::aidl::tests::IntEnum> = {
+  ::android::aidl::tests::IntEnum::FOO,
+  ::android::aidl::tests::IntEnum::BAR,
+  ::android::aidl::tests::IntEnum::BAZ,
+  ::android::aidl::tests::IntEnum::QUX,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ListOfInterfaces.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ListOfInterfaces.h
new file mode 100644
index 0000000..79dd417
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ListOfInterfaces.h
@@ -0,0 +1,330 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/ListOfInterfaces.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Delegate.h>
+#include <binder/Enums.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cassert>
+#include <cstdint>
+#include <optional>
+#include <string>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <variant>
+#include <vector>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace tests {
+class ListOfInterfaces : public ::android::Parcelable {
+public:
+  class IEmptyInterfaceDelegator;
+
+  class IEmptyInterface : public ::android::IInterface {
+  public:
+    typedef IEmptyInterfaceDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(EmptyInterface)
+  };  // class IEmptyInterface
+
+  class IEmptyInterfaceDefault : public IEmptyInterface {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+  };  // class IEmptyInterfaceDefault
+  class BpEmptyInterface : public ::android::BpInterface<IEmptyInterface> {
+  public:
+    explicit BpEmptyInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpEmptyInterface() = default;
+  };  // class BpEmptyInterface
+  class BnEmptyInterface : public ::android::BnInterface<IEmptyInterface> {
+  public:
+    explicit BnEmptyInterface();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  };  // class BnEmptyInterface
+
+  class IEmptyInterfaceDelegator : public BnEmptyInterface {
+  public:
+    explicit IEmptyInterfaceDelegator(const ::android::sp<IEmptyInterface> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<IEmptyInterface> getImpl() { return _aidl_delegate; }
+  private:
+    ::android::sp<IEmptyInterface> _aidl_delegate;
+  };  // class IEmptyInterfaceDelegator
+  class IMyInterfaceDelegator;
+
+  class IMyInterface : public ::android::IInterface {
+  public:
+    typedef IMyInterfaceDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(MyInterface)
+    virtual ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& iface_list_in, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* iface_list_out, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* iface_list_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& nullable_iface_list_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* nullable_iface_list_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* nullable_iface_list_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* _aidl_return) = 0;
+  };  // class IMyInterface
+
+  class IMyInterfaceDefault : public IMyInterface {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+    ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& /*iface*/, const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& /*nullable_iface*/, const ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& /*iface_list_in*/, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* /*iface_list_out*/, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* /*iface_list_inout*/, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& /*nullable_iface_list_in*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* /*nullable_iface_list_out*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* /*nullable_iface_list_inout*/, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+  };  // class IMyInterfaceDefault
+  class BpMyInterface : public ::android::BpInterface<IMyInterface> {
+  public:
+    explicit BpMyInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpMyInterface() = default;
+    ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& iface_list_in, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* iface_list_out, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* iface_list_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& nullable_iface_list_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* nullable_iface_list_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* nullable_iface_list_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* _aidl_return) override;
+  };  // class BpMyInterface
+  class BnMyInterface : public ::android::BnInterface<IMyInterface> {
+  public:
+    static constexpr uint32_t TRANSACTION_methodWithInterfaces = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+    explicit BnMyInterface();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  };  // class BnMyInterface
+
+  class IMyInterfaceDelegator : public BnMyInterface {
+  public:
+    explicit IMyInterfaceDelegator(const ::android::sp<IMyInterface> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<IMyInterface> getImpl() { return _aidl_delegate; }
+    ::android::binder::Status methodWithInterfaces(const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& iface, const ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& nullable_iface, const ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& iface_list_in, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* iface_list_out, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* iface_list_inout, const ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& nullable_iface_list_in, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* nullable_iface_list_out, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* nullable_iface_list_inout, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* _aidl_return) override {
+      ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterfaceDelegator> _iface;
+      if (iface) {
+        _iface = ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterfaceDelegator>::cast(delegate(iface));
+      }
+      ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterfaceDelegator> _nullable_iface;
+      if (nullable_iface) {
+        _nullable_iface = ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterfaceDelegator>::cast(delegate(nullable_iface));
+      }
+      return _aidl_delegate->methodWithInterfaces(_iface, _nullable_iface, iface_list_in, iface_list_out, iface_list_inout, nullable_iface_list_in, nullable_iface_list_out, nullable_iface_list_inout, _aidl_return);
+    }
+  private:
+    ::android::sp<IMyInterface> _aidl_delegate;
+  };  // class IMyInterfaceDelegator
+  class MyParcelable : public ::android::Parcelable {
+  public:
+    ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface> iface;
+    ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface> nullable_iface;
+    ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> iface_list;
+    ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> nullable_iface_list;
+    inline bool operator!=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) != std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator<(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) < std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator<=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) <= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator==(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) == std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator>(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) > std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator>=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) >= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ListOfInterfaces.MyParcelable");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyParcelable{";
+      os << "iface: " << ::android::internal::ToString(iface);
+      os << ", nullable_iface: " << ::android::internal::ToString(nullable_iface);
+      os << ", iface_list: " << ::android::internal::ToString(iface_list);
+      os << ", nullable_iface_list: " << ::android::internal::ToString(nullable_iface_list);
+      os << "}";
+      return os.str();
+    }
+  };  // class MyParcelable
+  class MyUnion : public ::android::Parcelable {
+  public:
+    enum class Tag : int32_t {
+      iface = 0,
+      nullable_iface = 1,
+      iface_list = 2,
+      nullable_iface_list = 3,
+    };
+    // Expose tag symbols for legacy code
+    static const inline Tag iface = Tag::iface;
+    static const inline Tag nullable_iface = Tag::nullable_iface;
+    static const inline Tag iface_list = Tag::iface_list;
+    static const inline Tag nullable_iface_list = Tag::nullable_iface_list;
+
+    template<typename _Tp>
+    static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, MyUnion>;
+
+    MyUnion() : _value(std::in_place_index<static_cast<size_t>(iface)>, ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>()) { }
+
+    template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+    // NOLINTNEXTLINE(google-explicit-constructor)
+    constexpr MyUnion(_Tp&& _arg)
+        : _value(std::forward<_Tp>(_arg)) {}
+
+    template <size_t _Np, typename... _Tp>
+    constexpr explicit MyUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+        : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+    template <Tag _tag, typename... _Tp>
+    static MyUnion make(_Tp&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+    }
+
+    template <Tag _tag, typename _Tp, typename... _Up>
+    static MyUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+    }
+
+    Tag getTag() const {
+      return static_cast<Tag>(_value.index());
+    }
+
+    template <Tag _tag>
+    const auto& get() const {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag>
+    auto& get() {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag, typename... _Tp>
+    void set(_Tp&&... _args) {
+      _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+    }
+
+    inline bool operator!=(const MyUnion& rhs) const {
+      return _value != rhs._value;
+    }
+    inline bool operator<(const MyUnion& rhs) const {
+      return _value < rhs._value;
+    }
+    inline bool operator<=(const MyUnion& rhs) const {
+      return _value <= rhs._value;
+    }
+    inline bool operator==(const MyUnion& rhs) const {
+      return _value == rhs._value;
+    }
+    inline bool operator>(const MyUnion& rhs) const {
+      return _value > rhs._value;
+    }
+    inline bool operator>=(const MyUnion& rhs) const {
+      return _value >= rhs._value;
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ListOfInterfaces.MyUnion");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyUnion{";
+      switch (getTag()) {
+      case iface: os << "iface: " << ::android::internal::ToString(get<iface>()); break;
+      case nullable_iface: os << "nullable_iface: " << ::android::internal::ToString(get<nullable_iface>()); break;
+      case iface_list: os << "iface_list: " << ::android::internal::ToString(get<iface_list>()); break;
+      case nullable_iface_list: os << "nullable_iface_list: " << ::android::internal::ToString(get<nullable_iface_list>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    std::variant<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>, ::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>, ::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>, ::std::optional<::std::vector<::android::sp<::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>> _value;
+  };  // class MyUnion
+  inline bool operator!=(const ListOfInterfaces&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const ListOfInterfaces&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const ListOfInterfaces&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const ListOfInterfaces&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const ListOfInterfaces&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const ListOfInterfaces&) const {
+    return std::tie() >= std::tie();
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ListOfInterfaces");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ListOfInterfaces{";
+    os << "}";
+    return os.str();
+  }
+};  // class ListOfInterfaces
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ListOfInterfaces::MyUnion::Tag val) {
+  switch(val) {
+  case ListOfInterfaces::MyUnion::Tag::iface:
+    return "iface";
+  case ListOfInterfaces::MyUnion::Tag::nullable_iface:
+    return "nullable_iface";
+  case ListOfInterfaces::MyUnion::Tag::iface_list:
+    return "iface_list";
+  case ListOfInterfaces::MyUnion::Tag::nullable_iface_list:
+    return "nullable_iface_list";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::ListOfInterfaces::MyUnion::Tag, 4> enum_values<::android::aidl::tests::ListOfInterfaces::MyUnion::Tag> = {
+  ::android::aidl::tests::ListOfInterfaces::MyUnion::Tag::iface,
+  ::android::aidl::tests::ListOfInterfaces::MyUnion::Tag::nullable_iface,
+  ::android::aidl::tests::ListOfInterfaces::MyUnion::Tag::iface_list,
+  ::android::aidl::tests::ListOfInterfaces::MyUnion::Tag::nullable_iface_list,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/LongEnum.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/LongEnum.h
new file mode 100644
index 0000000..c96234f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/LongEnum.h
@@ -0,0 +1,53 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <binder/Enums.h>
+#include <cstdint>
+#include <string>
+
+namespace android {
+namespace aidl {
+namespace tests {
+enum class LongEnum : int64_t {
+  FOO = 100000000000L,
+  BAR = 200000000000L,
+  BAZ = 200000000001L,
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(LongEnum val) {
+  switch(val) {
+  case LongEnum::FOO:
+    return "FOO";
+  case LongEnum::BAR:
+    return "BAR";
+  case LongEnum::BAZ:
+    return "BAZ";
+  default:
+    return std::to_string(static_cast<int64_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::LongEnum, 3> enum_values<::android::aidl::tests::LongEnum> = {
+  ::android::aidl::tests::LongEnum::FOO,
+  ::android::aidl::tests::LongEnum::BAR,
+  ::android::aidl::tests::LongEnum::BAZ,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/OtherParcelableForToString.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/OtherParcelableForToString.h
new file mode 100644
index 0000000..c1fec62
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/OtherParcelableForToString.h
@@ -0,0 +1,54 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class OtherParcelableForToString : public ::android::Parcelable {
+public:
+  ::android::String16 field;
+  inline bool operator!=(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) != std::tie(rhs.field);
+  }
+  inline bool operator<(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) < std::tie(rhs.field);
+  }
+  inline bool operator<=(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) <= std::tie(rhs.field);
+  }
+  inline bool operator==(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) == std::tie(rhs.field);
+  }
+  inline bool operator>(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) > std::tie(rhs.field);
+  }
+  inline bool operator>=(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) >= std::tie(rhs.field);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.OtherParcelableForToString");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "OtherParcelableForToString{";
+    os << "field: " << ::android::internal::ToString(field);
+    os << "}";
+    return os.str();
+  }
+};  // class OtherParcelableForToString
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ParcelableForToString.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ParcelableForToString.h
new file mode 100644
index 0000000..28b1c6a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ParcelableForToString.h
@@ -0,0 +1,111 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/GenericStructuredParcelable.h>
+#include <android/aidl/tests/IntEnum.h>
+#include <android/aidl/tests/OtherParcelableForToString.h>
+#include <android/aidl/tests/StructuredParcelable.h>
+#include <android/aidl/tests/Union.h>
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <tuple>
+#include <utils/String16.h>
+#include <vector>
+
+namespace android::aidl::tests {
+template <typename T, typename U, typename B>
+class GenericStructuredParcelable;
+class OtherParcelableForToString;
+class StructuredParcelable;
+}  // namespace android::aidl::tests
+namespace android {
+namespace aidl {
+namespace tests {
+class ParcelableForToString : public ::android::Parcelable {
+public:
+  int32_t intValue = 0;
+  ::std::vector<int32_t> intArray;
+  int64_t longValue = 0L;
+  ::std::vector<int64_t> longArray;
+  double doubleValue = 0.000000;
+  ::std::vector<double> doubleArray;
+  float floatValue = 0.000000f;
+  ::std::vector<float> floatArray;
+  int8_t byteValue = 0;
+  ::std::vector<uint8_t> byteArray;
+  bool booleanValue = false;
+  ::std::vector<bool> booleanArray;
+  ::android::String16 stringValue;
+  ::std::vector<::android::String16> stringArray;
+  ::std::vector<::android::String16> stringList;
+  ::android::aidl::tests::OtherParcelableForToString parcelableValue;
+  ::std::vector<::android::aidl::tests::OtherParcelableForToString> parcelableArray;
+  ::android::aidl::tests::IntEnum enumValue = ::android::aidl::tests::IntEnum::FOO;
+  ::std::vector<::android::aidl::tests::IntEnum> enumArray;
+  ::std::vector<::android::String16> nullArray;
+  ::std::vector<::android::String16> nullList;
+  ::android::aidl::tests::GenericStructuredParcelable<int32_t, ::android::aidl::tests::StructuredParcelable, ::android::aidl::tests::IntEnum> parcelableGeneric;
+  ::android::aidl::tests::Union unionValue;
+  inline bool operator!=(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) != std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator<(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) < std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator<=(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) <= std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator==(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) == std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator>(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) > std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator>=(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) >= std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.ParcelableForToString");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ParcelableForToString{";
+    os << "intValue: " << ::android::internal::ToString(intValue);
+    os << ", intArray: " << ::android::internal::ToString(intArray);
+    os << ", longValue: " << ::android::internal::ToString(longValue);
+    os << ", longArray: " << ::android::internal::ToString(longArray);
+    os << ", doubleValue: " << ::android::internal::ToString(doubleValue);
+    os << ", doubleArray: " << ::android::internal::ToString(doubleArray);
+    os << ", floatValue: " << ::android::internal::ToString(floatValue);
+    os << ", floatArray: " << ::android::internal::ToString(floatArray);
+    os << ", byteValue: " << ::android::internal::ToString(byteValue);
+    os << ", byteArray: " << ::android::internal::ToString(byteArray);
+    os << ", booleanValue: " << ::android::internal::ToString(booleanValue);
+    os << ", booleanArray: " << ::android::internal::ToString(booleanArray);
+    os << ", stringValue: " << ::android::internal::ToString(stringValue);
+    os << ", stringArray: " << ::android::internal::ToString(stringArray);
+    os << ", stringList: " << ::android::internal::ToString(stringList);
+    os << ", parcelableValue: " << ::android::internal::ToString(parcelableValue);
+    os << ", parcelableArray: " << ::android::internal::ToString(parcelableArray);
+    os << ", enumValue: " << ::android::internal::ToString(enumValue);
+    os << ", enumArray: " << ::android::internal::ToString(enumArray);
+    os << ", nullArray: " << ::android::internal::ToString(nullArray);
+    os << ", nullList: " << ::android::internal::ToString(nullList);
+    os << ", parcelableGeneric: " << ::android::internal::ToString(parcelableGeneric);
+    os << ", unionValue: " << ::android::internal::ToString(unionValue);
+    os << "}";
+    return os.str();
+  }
+};  // class ParcelableForToString
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/RecursiveList.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/RecursiveList.h
new file mode 100644
index 0000000..95888f8
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/RecursiveList.h
@@ -0,0 +1,62 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/RecursiveList.h>
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <optional>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android::aidl::tests {
+class RecursiveList;
+}  // namespace android::aidl::tests
+namespace android {
+namespace aidl {
+namespace tests {
+class RecursiveList : public ::android::Parcelable {
+public:
+  int32_t value = 0;
+  ::std::unique_ptr<::android::aidl::tests::RecursiveList> next;
+  inline bool operator!=(const RecursiveList& rhs) const {
+    return std::tie(value, next) != std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator<(const RecursiveList& rhs) const {
+    return std::tie(value, next) < std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator<=(const RecursiveList& rhs) const {
+    return std::tie(value, next) <= std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator==(const RecursiveList& rhs) const {
+    return std::tie(value, next) == std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator>(const RecursiveList& rhs) const {
+    return std::tie(value, next) > std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator>=(const RecursiveList& rhs) const {
+    return std::tie(value, next) >= std::tie(rhs.value, rhs.next);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.RecursiveList");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "RecursiveList{";
+    os << "value: " << ::android::internal::ToString(value);
+    os << ", next: " << ::android::internal::ToString(next);
+    os << "}";
+    return os.str();
+  }
+};  // class RecursiveList
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/StructuredParcelable.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/StructuredParcelable.h
new file mode 100644
index 0000000..3e2288b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/StructuredParcelable.h
@@ -0,0 +1,210 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/ByteEnum.h>
+#include <android/aidl/tests/ConstantExpressionEnum.h>
+#include <android/aidl/tests/IntEnum.h>
+#include <android/aidl/tests/LongEnum.h>
+#include <android/aidl/tests/StructuredParcelable.h>
+#include <android/aidl/tests/Union.h>
+#include <android/binder_to_string.h>
+#include <binder/IBinder.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <optional>
+#include <string>
+#include <tuple>
+#include <utils/String16.h>
+#include <vector>
+
+namespace android {
+namespace aidl {
+namespace tests {
+class StructuredParcelable : public ::android::Parcelable {
+public:
+  class Empty : public ::android::Parcelable {
+  public:
+    inline bool operator!=(const Empty&) const {
+      return std::tie() != std::tie();
+    }
+    inline bool operator<(const Empty&) const {
+      return std::tie() < std::tie();
+    }
+    inline bool operator<=(const Empty&) const {
+      return std::tie() <= std::tie();
+    }
+    inline bool operator==(const Empty&) const {
+      return std::tie() == std::tie();
+    }
+    inline bool operator>(const Empty&) const {
+      return std::tie() > std::tie();
+    }
+    inline bool operator>=(const Empty&) const {
+      return std::tie() >= std::tie();
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.StructuredParcelable.Empty");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "Empty{";
+      os << "}";
+      return os.str();
+    }
+  };  // class Empty
+  ::std::vector<int32_t> shouldContainThreeFs;
+  int32_t f = 0;
+  ::std::string shouldBeJerry;
+  ::android::aidl::tests::ByteEnum shouldBeByteBar = ::android::aidl::tests::ByteEnum(0);
+  ::android::aidl::tests::IntEnum shouldBeIntBar = ::android::aidl::tests::IntEnum(0);
+  ::android::aidl::tests::LongEnum shouldBeLongBar = ::android::aidl::tests::LongEnum(0);
+  ::std::vector<::android::aidl::tests::ByteEnum> shouldContainTwoByteFoos;
+  ::std::vector<::android::aidl::tests::IntEnum> shouldContainTwoIntFoos;
+  ::std::vector<::android::aidl::tests::LongEnum> shouldContainTwoLongFoos;
+  ::android::String16 stringDefaultsToFoo = ::android::String16("foo");
+  int8_t byteDefaultsToFour = 4;
+  int32_t intDefaultsToFive = 5;
+  int64_t longDefaultsToNegativeSeven = -7L;
+  bool booleanDefaultsToTrue = true;
+  char16_t charDefaultsToC = 'C';
+  float floatDefaultsToPi = 3.140000f;
+  double doubleWithDefault = -314000000000000000.000000;
+  ::std::vector<int32_t> arrayDefaultsTo123 = {1, 2, 3};
+  ::std::vector<int32_t> arrayDefaultsToEmpty = {};
+  bool boolDefault = false;
+  int8_t byteDefault = 0;
+  int32_t intDefault = 0;
+  int64_t longDefault = 0L;
+  float floatDefault = 0.000000f;
+  double doubleDefault = 0.000000;
+  double checkDoubleFromFloat = 3.140000;
+  ::std::vector<::android::String16> checkStringArray1 = {::android::String16("a"), ::android::String16("b")};
+  ::std::vector<::std::string> checkStringArray2 = {"a", "b"};
+  int32_t int32_min = -2147483648;
+  int32_t int32_max = 2147483647;
+  int64_t int64_max = 9223372036854775807L;
+  int32_t hexInt32_neg_1 = -1;
+  ::android::sp<::android::IBinder> ibinder;
+  ::android::aidl::tests::StructuredParcelable::Empty empty;
+  ::std::vector<uint8_t> int8_1 = {1, 1, 1, 1, 1};
+  ::std::vector<int32_t> int32_1 = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
+  ::std::vector<int64_t> int64_1 = {1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L};
+  int32_t hexInt32_pos_1 = 1;
+  int32_t hexInt64_pos_1 = 1;
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_1 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_2 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_3 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_4 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_5 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_6 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_7 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_8 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_9 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::android::aidl::tests::ConstantExpressionEnum const_exprs_10 = ::android::aidl::tests::ConstantExpressionEnum(0);
+  ::std::string addString1 = "hello world!";
+  ::std::string addString2 = "The quick brown fox jumps over the lazy dog.";
+  int32_t shouldSetBit0AndBit2 = 0;
+  ::std::optional<::android::aidl::tests::Union> u;
+  ::std::optional<::android::aidl::tests::Union> shouldBeConstS1;
+  ::android::aidl::tests::IntEnum defaultWithFoo = ::android::aidl::tests::IntEnum::FOO;
+  inline bool operator!=(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) != std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator<(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) < std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator<=(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) <= std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator==(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) == std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator>(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) > std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator>=(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) >= std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+
+  enum : int32_t { BIT0 = 1 };
+  enum : int32_t { BIT1 = 2 };
+  enum : int32_t { BIT2 = 4 };
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.StructuredParcelable");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "StructuredParcelable{";
+    os << "shouldContainThreeFs: " << ::android::internal::ToString(shouldContainThreeFs);
+    os << ", f: " << ::android::internal::ToString(f);
+    os << ", shouldBeJerry: " << ::android::internal::ToString(shouldBeJerry);
+    os << ", shouldBeByteBar: " << ::android::internal::ToString(shouldBeByteBar);
+    os << ", shouldBeIntBar: " << ::android::internal::ToString(shouldBeIntBar);
+    os << ", shouldBeLongBar: " << ::android::internal::ToString(shouldBeLongBar);
+    os << ", shouldContainTwoByteFoos: " << ::android::internal::ToString(shouldContainTwoByteFoos);
+    os << ", shouldContainTwoIntFoos: " << ::android::internal::ToString(shouldContainTwoIntFoos);
+    os << ", shouldContainTwoLongFoos: " << ::android::internal::ToString(shouldContainTwoLongFoos);
+    os << ", stringDefaultsToFoo: " << ::android::internal::ToString(stringDefaultsToFoo);
+    os << ", byteDefaultsToFour: " << ::android::internal::ToString(byteDefaultsToFour);
+    os << ", intDefaultsToFive: " << ::android::internal::ToString(intDefaultsToFive);
+    os << ", longDefaultsToNegativeSeven: " << ::android::internal::ToString(longDefaultsToNegativeSeven);
+    os << ", booleanDefaultsToTrue: " << ::android::internal::ToString(booleanDefaultsToTrue);
+    os << ", charDefaultsToC: " << ::android::internal::ToString(charDefaultsToC);
+    os << ", floatDefaultsToPi: " << ::android::internal::ToString(floatDefaultsToPi);
+    os << ", doubleWithDefault: " << ::android::internal::ToString(doubleWithDefault);
+    os << ", arrayDefaultsTo123: " << ::android::internal::ToString(arrayDefaultsTo123);
+    os << ", arrayDefaultsToEmpty: " << ::android::internal::ToString(arrayDefaultsToEmpty);
+    os << ", boolDefault: " << ::android::internal::ToString(boolDefault);
+    os << ", byteDefault: " << ::android::internal::ToString(byteDefault);
+    os << ", intDefault: " << ::android::internal::ToString(intDefault);
+    os << ", longDefault: " << ::android::internal::ToString(longDefault);
+    os << ", floatDefault: " << ::android::internal::ToString(floatDefault);
+    os << ", doubleDefault: " << ::android::internal::ToString(doubleDefault);
+    os << ", checkDoubleFromFloat: " << ::android::internal::ToString(checkDoubleFromFloat);
+    os << ", checkStringArray1: " << ::android::internal::ToString(checkStringArray1);
+    os << ", checkStringArray2: " << ::android::internal::ToString(checkStringArray2);
+    os << ", int32_min: " << ::android::internal::ToString(int32_min);
+    os << ", int32_max: " << ::android::internal::ToString(int32_max);
+    os << ", int64_max: " << ::android::internal::ToString(int64_max);
+    os << ", hexInt32_neg_1: " << ::android::internal::ToString(hexInt32_neg_1);
+    os << ", ibinder: " << ::android::internal::ToString(ibinder);
+    os << ", empty: " << ::android::internal::ToString(empty);
+    os << ", int8_1: " << ::android::internal::ToString(int8_1);
+    os << ", int32_1: " << ::android::internal::ToString(int32_1);
+    os << ", int64_1: " << ::android::internal::ToString(int64_1);
+    os << ", hexInt32_pos_1: " << ::android::internal::ToString(hexInt32_pos_1);
+    os << ", hexInt64_pos_1: " << ::android::internal::ToString(hexInt64_pos_1);
+    os << ", const_exprs_1: " << ::android::internal::ToString(const_exprs_1);
+    os << ", const_exprs_2: " << ::android::internal::ToString(const_exprs_2);
+    os << ", const_exprs_3: " << ::android::internal::ToString(const_exprs_3);
+    os << ", const_exprs_4: " << ::android::internal::ToString(const_exprs_4);
+    os << ", const_exprs_5: " << ::android::internal::ToString(const_exprs_5);
+    os << ", const_exprs_6: " << ::android::internal::ToString(const_exprs_6);
+    os << ", const_exprs_7: " << ::android::internal::ToString(const_exprs_7);
+    os << ", const_exprs_8: " << ::android::internal::ToString(const_exprs_8);
+    os << ", const_exprs_9: " << ::android::internal::ToString(const_exprs_9);
+    os << ", const_exprs_10: " << ::android::internal::ToString(const_exprs_10);
+    os << ", addString1: " << ::android::internal::ToString(addString1);
+    os << ", addString2: " << ::android::internal::ToString(addString2);
+    os << ", shouldSetBit0AndBit2: " << ::android::internal::ToString(shouldSetBit0AndBit2);
+    os << ", u: " << ::android::internal::ToString(u);
+    os << ", shouldBeConstS1: " << ::android::internal::ToString(shouldBeConstS1);
+    os << ", defaultWithFoo: " << ::android::internal::ToString(defaultWithFoo);
+    os << "}";
+    return os.str();
+  }
+};  // class StructuredParcelable
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/Union.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/Union.h
new file mode 100644
index 0000000..7497b68
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/Union.h
@@ -0,0 +1,184 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/ByteEnum.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/IBinder.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+#include <vector>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace tests {
+class Union : public ::android::Parcelable {
+public:
+  enum class Tag : int32_t {
+    ns = 0,
+    n = 1,
+    m = 2,
+    s = 3,
+    ibinder = 4,
+    ss = 5,
+    be = 6,
+  };
+  // Expose tag symbols for legacy code
+  static const inline Tag ns = Tag::ns;
+  static const inline Tag n = Tag::n;
+  static const inline Tag m = Tag::m;
+  static const inline Tag s = Tag::s;
+  static const inline Tag ibinder = Tag::ibinder;
+  static const inline Tag ss = Tag::ss;
+  static const inline Tag be = Tag::be;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, Union>;
+
+  Union() : _value(std::in_place_index<static_cast<size_t>(ns)>, ::std::vector<int32_t>({})) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr Union(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit Union(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static Union make(_Tp&&... _args) {
+    return Union(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static Union make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return Union(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  inline bool operator!=(const Union& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const Union& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const Union& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const Union& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const Union& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const Union& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::std::string& S1();
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.Union");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Union{";
+    switch (getTag()) {
+    case ns: os << "ns: " << ::android::internal::ToString(get<ns>()); break;
+    case n: os << "n: " << ::android::internal::ToString(get<n>()); break;
+    case m: os << "m: " << ::android::internal::ToString(get<m>()); break;
+    case s: os << "s: " << ::android::internal::ToString(get<s>()); break;
+    case ibinder: os << "ibinder: " << ::android::internal::ToString(get<ibinder>()); break;
+    case ss: os << "ss: " << ::android::internal::ToString(get<ss>()); break;
+    case be: os << "be: " << ::android::internal::ToString(get<be>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<::std::vector<int32_t>, int32_t, int32_t, ::std::string, ::android::sp<::android::IBinder>, ::std::vector<::std::string>, ::android::aidl::tests::ByteEnum> _value;
+};  // class Union
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(Union::Tag val) {
+  switch(val) {
+  case Union::Tag::ns:
+    return "ns";
+  case Union::Tag::n:
+    return "n";
+  case Union::Tag::m:
+    return "m";
+  case Union::Tag::s:
+    return "s";
+  case Union::Tag::ibinder:
+    return "ibinder";
+  case Union::Tag::ss:
+    return "ss";
+  case Union::Tag::be:
+    return "be";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::Union::Tag, 7> enum_values<::android::aidl::tests::Union::Tag> = {
+  ::android::aidl::tests::Union::Tag::ns,
+  ::android::aidl::tests::Union::Tag::n,
+  ::android::aidl::tests::Union::Tag::m,
+  ::android::aidl::tests::Union::Tag::s,
+  ::android::aidl::tests::Union::Tag::ibinder,
+  ::android::aidl::tests::Union::Tag::ss,
+  ::android::aidl::tests::Union::Tag::be,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/UnionWithFd.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/UnionWithFd.h
new file mode 100644
index 0000000..4ffbf39
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/UnionWithFd.h
@@ -0,0 +1,151 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/ParcelFileDescriptor.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace tests {
+class UnionWithFd : public ::android::Parcelable {
+public:
+  enum class Tag : int32_t {
+    num = 0,
+    pfd = 1,
+  };
+  // Expose tag symbols for legacy code
+  static const inline Tag num = Tag::num;
+  static const inline Tag pfd = Tag::pfd;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, UnionWithFd>;
+
+  UnionWithFd() : _value(std::in_place_index<static_cast<size_t>(num)>, int32_t(0)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr UnionWithFd(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit UnionWithFd(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static UnionWithFd make(_Tp&&... _args) {
+    return UnionWithFd(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static UnionWithFd make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return UnionWithFd(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  inline bool operator!=(const UnionWithFd& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const UnionWithFd& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const UnionWithFd& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const UnionWithFd& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const UnionWithFd& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const UnionWithFd& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.UnionWithFd");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "UnionWithFd{";
+    switch (getTag()) {
+    case num: os << "num: " << ::android::internal::ToString(get<num>()); break;
+    case pfd: os << "pfd: " << ::android::internal::ToString(get<pfd>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t, ::android::os::ParcelFileDescriptor> _value;
+};  // class UnionWithFd
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(UnionWithFd::Tag val) {
+  switch(val) {
+  case UnionWithFd::Tag::num:
+    return "num";
+  case UnionWithFd::Tag::pfd:
+    return "pfd";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::UnionWithFd::Tag, 2> enum_values<::android::aidl::tests::UnionWithFd::Tag> = {
+  ::android::aidl::tests::UnionWithFd::Tag::num,
+  ::android::aidl::tests::UnionWithFd::Tag::pfd,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnExtendableParcelable.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnExtendableParcelable.h
new file mode 100644
index 0000000..95963f7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnExtendableParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExt.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExt.h
new file mode 100644
index 0000000..d141417
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExt.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExt2.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExt2.h
new file mode 100644
index 0000000..c00f8fd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExt2.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExtLike.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExtLike.h
new file mode 100644
index 0000000..96fe4f0
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BnMyExtLike.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpExtendableParcelable.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpExtendableParcelable.h
new file mode 100644
index 0000000..05a5498
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpExtendableParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExt.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExt.h
new file mode 100644
index 0000000..ba81982
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExt.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExt2.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExt2.h
new file mode 100644
index 0000000..f2ed71f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExt2.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExtLike.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExtLike.h
new file mode 100644
index 0000000..4357484
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/BpMyExtLike.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/ExtendableParcelable.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/ExtendableParcelable.h
new file mode 100644
index 0000000..8e24660
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/ExtendableParcelable.h
@@ -0,0 +1,67 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/ParcelableHolder.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <string>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+class ExtendableParcelable : public ::android::Parcelable {
+public:
+  int32_t a = 0;
+  ::std::string b;
+  ::android::os::ParcelableHolder ext { ::android::Parcelable::Stability::STABILITY_LOCAL };
+  int64_t c = 0L;
+  ::android::os::ParcelableHolder ext2 { ::android::Parcelable::Stability::STABILITY_LOCAL };
+  inline bool operator!=(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) != std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator<(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) < std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator<=(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) <= std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator==(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) == std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator>(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) > std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator>=(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) >= std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.extension.ExtendableParcelable");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ExtendableParcelable{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << ", ext: " << ::android::internal::ToString(ext);
+    os << ", c: " << ::android::internal::ToString(c);
+    os << ", ext2: " << ::android::internal::ToString(ext2);
+    os << "}";
+    return os.str();
+  }
+};  // class ExtendableParcelable
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExt.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExt.h
new file mode 100644
index 0000000..345ae53
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExt.h
@@ -0,0 +1,60 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <string>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+class MyExt : public ::android::Parcelable {
+public:
+  int32_t a = 0;
+  ::std::string b;
+  inline bool operator!=(const MyExt& rhs) const {
+    return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<(const MyExt& rhs) const {
+    return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<=(const MyExt& rhs) const {
+    return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator==(const MyExt& rhs) const {
+    return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>(const MyExt& rhs) const {
+    return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>=(const MyExt& rhs) const {
+    return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.extension.MyExt");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "MyExt{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << "}";
+    return os.str();
+  }
+};  // class MyExt
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExt2.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExt2.h
new file mode 100644
index 0000000..4c7d8a3
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExt2.h
@@ -0,0 +1,66 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/extension/MyExt.h>
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <string>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android::aidl::tests::extension {
+class MyExt;
+}  // namespace android::aidl::tests::extension
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+class MyExt2 : public ::android::Parcelable {
+public:
+  int32_t a = 0;
+  ::android::aidl::tests::extension::MyExt b;
+  ::std::string c;
+  inline bool operator!=(const MyExt2& rhs) const {
+    return std::tie(a, b, c) != std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator<(const MyExt2& rhs) const {
+    return std::tie(a, b, c) < std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator<=(const MyExt2& rhs) const {
+    return std::tie(a, b, c) <= std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator==(const MyExt2& rhs) const {
+    return std::tie(a, b, c) == std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator>(const MyExt2& rhs) const {
+    return std::tie(a, b, c) > std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator>=(const MyExt2& rhs) const {
+    return std::tie(a, b, c) >= std::tie(rhs.a, rhs.b, rhs.c);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.extension.MyExt2");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "MyExt2{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << ", c: " << ::android::internal::ToString(c);
+    os << "}";
+    return os.str();
+  }
+};  // class MyExt2
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExtLike.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExtLike.h
new file mode 100644
index 0000000..4647ecb
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/extension/MyExtLike.h
@@ -0,0 +1,59 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+class MyExtLike : public ::android::Parcelable {
+public:
+  int32_t a = 0;
+  ::android::String16 b;
+  inline bool operator!=(const MyExtLike& rhs) const {
+    return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<(const MyExtLike& rhs) const {
+    return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<=(const MyExtLike& rhs) const {
+    return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator==(const MyExtLike& rhs) const {
+    return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>(const MyExtLike& rhs) const {
+    return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>=(const MyExtLike& rhs) const {
+    return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.extension.MyExtLike");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "MyExtLike{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << "}";
+    return os.str();
+  }
+};  // class MyExtLike
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnDeeplyNested.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnDeeplyNested.h
new file mode 100644
index 0000000..2ad450a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnDeeplyNested.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnNestedService.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnNestedService.h
new file mode 100644
index 0000000..c676cca
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnNestedService.h
@@ -0,0 +1,47 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/tests/nested/INestedService.h>
+#include <android/aidl/tests/nested/BnNestedService.h>
+#include <android/aidl/tests/nested/INestedService.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class BnNestedService : public ::android::BnInterface<INestedService> {
+public:
+  static constexpr uint32_t TRANSACTION_flipStatus = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_flipStatusWithCallback = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+  explicit BnNestedService();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+};  // class BnNestedService
+
+class INestedServiceDelegator : public BnNestedService {
+public:
+  explicit INestedServiceDelegator(const ::android::sp<INestedService> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<INestedService> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status flipStatus(const ::android::aidl::tests::nested::ParcelableWithNested& p, ::android::aidl::tests::nested::INestedService::Result* _aidl_return) override {
+    return _aidl_delegate->flipStatus(p, _aidl_return);
+  }
+  ::android::binder::Status flipStatusWithCallback(::android::aidl::tests::nested::ParcelableWithNested::Status status, const ::android::sp<::android::aidl::tests::nested::INestedService::ICallback>& cb) override {
+    ::android::sp<::android::aidl::tests::nested::INestedService::ICallbackDelegator> _cb;
+    if (cb) {
+      _cb = ::android::sp<::android::aidl::tests::nested::INestedService::ICallbackDelegator>::cast(delegate(cb));
+    }
+    return _aidl_delegate->flipStatusWithCallback(status, _cb);
+  }
+private:
+  ::android::sp<INestedService> _aidl_delegate;
+};  // class INestedServiceDelegator
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnParcelableWithNested.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnParcelableWithNested.h
new file mode 100644
index 0000000..6345a15
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BnParcelableWithNested.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpDeeplyNested.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpDeeplyNested.h
new file mode 100644
index 0000000..9cb9be5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpDeeplyNested.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpNestedService.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpNestedService.h
new file mode 100644
index 0000000..640fa53
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpNestedService.h
@@ -0,0 +1,26 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/tests/nested/INestedService.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class BpNestedService : public ::android::BpInterface<INestedService> {
+public:
+  explicit BpNestedService(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpNestedService() = default;
+  ::android::binder::Status flipStatus(const ::android::aidl::tests::nested::ParcelableWithNested& p, ::android::aidl::tests::nested::INestedService::Result* _aidl_return) override;
+  ::android::binder::Status flipStatusWithCallback(::android::aidl::tests::nested::ParcelableWithNested::Status status, const ::android::sp<::android::aidl::tests::nested::INestedService::ICallback>& cb) override;
+};  // class BpNestedService
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpParcelableWithNested.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpParcelableWithNested.h
new file mode 100644
index 0000000..b7b14dc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/BpParcelableWithNested.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/DeeplyNested.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/DeeplyNested.h
new file mode 100644
index 0000000..3a66499
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/DeeplyNested.h
@@ -0,0 +1,227 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/nested/DeeplyNested.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <string>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class DeeplyNested : public ::android::Parcelable {
+public:
+  class B : public ::android::Parcelable {
+  public:
+    class C : public ::android::Parcelable {
+    public:
+      class D : public ::android::Parcelable {
+      public:
+        enum class E : int8_t {
+          OK = 0,
+        };
+        inline bool operator!=(const D&) const {
+          return std::tie() != std::tie();
+        }
+        inline bool operator<(const D&) const {
+          return std::tie() < std::tie();
+        }
+        inline bool operator<=(const D&) const {
+          return std::tie() <= std::tie();
+        }
+        inline bool operator==(const D&) const {
+          return std::tie() == std::tie();
+        }
+        inline bool operator>(const D&) const {
+          return std::tie() > std::tie();
+        }
+        inline bool operator>=(const D&) const {
+          return std::tie() >= std::tie();
+        }
+
+        ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+        ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+        static const ::android::String16& getParcelableDescriptor() {
+          static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.nested.DeeplyNested.B.C.D");
+          return DESCRIPTOR;
+        }
+        inline std::string toString() const {
+          std::ostringstream os;
+          os << "D{";
+          os << "}";
+          return os.str();
+        }
+      };  // class D
+      inline bool operator!=(const C&) const {
+        return std::tie() != std::tie();
+      }
+      inline bool operator<(const C&) const {
+        return std::tie() < std::tie();
+      }
+      inline bool operator<=(const C&) const {
+        return std::tie() <= std::tie();
+      }
+      inline bool operator==(const C&) const {
+        return std::tie() == std::tie();
+      }
+      inline bool operator>(const C&) const {
+        return std::tie() > std::tie();
+      }
+      inline bool operator>=(const C&) const {
+        return std::tie() >= std::tie();
+      }
+
+      ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+      ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+      static const ::android::String16& getParcelableDescriptor() {
+        static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.nested.DeeplyNested.B.C");
+        return DESCRIPTOR;
+      }
+      inline std::string toString() const {
+        std::ostringstream os;
+        os << "C{";
+        os << "}";
+        return os.str();
+      }
+    };  // class C
+    inline bool operator!=(const B&) const {
+      return std::tie() != std::tie();
+    }
+    inline bool operator<(const B&) const {
+      return std::tie() < std::tie();
+    }
+    inline bool operator<=(const B&) const {
+      return std::tie() <= std::tie();
+    }
+    inline bool operator==(const B&) const {
+      return std::tie() == std::tie();
+    }
+    inline bool operator>(const B&) const {
+      return std::tie() > std::tie();
+    }
+    inline bool operator>=(const B&) const {
+      return std::tie() >= std::tie();
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.nested.DeeplyNested.B");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "B{";
+      os << "}";
+      return os.str();
+    }
+  };  // class B
+  class A : public ::android::Parcelable {
+  public:
+    ::android::aidl::tests::nested::DeeplyNested::B::C::D::E e = ::android::aidl::tests::nested::DeeplyNested::B::C::D::E::OK;
+    inline bool operator!=(const A& rhs) const {
+      return std::tie(e) != std::tie(rhs.e);
+    }
+    inline bool operator<(const A& rhs) const {
+      return std::tie(e) < std::tie(rhs.e);
+    }
+    inline bool operator<=(const A& rhs) const {
+      return std::tie(e) <= std::tie(rhs.e);
+    }
+    inline bool operator==(const A& rhs) const {
+      return std::tie(e) == std::tie(rhs.e);
+    }
+    inline bool operator>(const A& rhs) const {
+      return std::tie(e) > std::tie(rhs.e);
+    }
+    inline bool operator>=(const A& rhs) const {
+      return std::tie(e) >= std::tie(rhs.e);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.nested.DeeplyNested.A");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "A{";
+      os << "e: " << ::android::internal::ToString(e);
+      os << "}";
+      return os.str();
+    }
+  };  // class A
+  inline bool operator!=(const DeeplyNested&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const DeeplyNested&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const DeeplyNested&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const DeeplyNested&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const DeeplyNested&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const DeeplyNested&) const {
+    return std::tie() >= std::tie();
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.nested.DeeplyNested");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "DeeplyNested{";
+    os << "}";
+    return os.str();
+  }
+};  // class DeeplyNested
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+[[nodiscard]] static inline std::string toString(DeeplyNested::B::C::D::E val) {
+  switch(val) {
+  case DeeplyNested::B::C::D::E::OK:
+    return "OK";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::nested::DeeplyNested::B::C::D::E, 1> enum_values<::android::aidl::tests::nested::DeeplyNested::B::C::D::E> = {
+  ::android::aidl::tests::nested::DeeplyNested::B::C::D::E::OK,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/INestedService.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/INestedService.h
new file mode 100644
index 0000000..c9fd99f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/INestedService.h
@@ -0,0 +1,130 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/nested/INestedService.h>
+#include <android/aidl/tests/nested/ParcelableWithNested.h>
+#include <android/binder_to_string.h>
+#include <binder/Delegate.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <tuple>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+
+namespace android::aidl::tests::nested {
+class ParcelableWithNested;
+}  // namespace android::aidl::tests::nested
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class INestedServiceDelegator;
+
+class INestedService : public ::android::IInterface {
+public:
+  typedef INestedServiceDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(NestedService)
+  class Result : public ::android::Parcelable {
+  public:
+    ::android::aidl::tests::nested::ParcelableWithNested::Status status = ::android::aidl::tests::nested::ParcelableWithNested::Status::OK;
+    inline bool operator!=(const Result& rhs) const {
+      return std::tie(status) != std::tie(rhs.status);
+    }
+    inline bool operator<(const Result& rhs) const {
+      return std::tie(status) < std::tie(rhs.status);
+    }
+    inline bool operator<=(const Result& rhs) const {
+      return std::tie(status) <= std::tie(rhs.status);
+    }
+    inline bool operator==(const Result& rhs) const {
+      return std::tie(status) == std::tie(rhs.status);
+    }
+    inline bool operator>(const Result& rhs) const {
+      return std::tie(status) > std::tie(rhs.status);
+    }
+    inline bool operator>=(const Result& rhs) const {
+      return std::tie(status) >= std::tie(rhs.status);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.nested.INestedService.Result");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "Result{";
+      os << "status: " << ::android::internal::ToString(status);
+      os << "}";
+      return os.str();
+    }
+  };  // class Result
+  class ICallbackDelegator;
+
+  class ICallback : public ::android::IInterface {
+  public:
+    typedef ICallbackDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(Callback)
+    virtual ::android::binder::Status done(::android::aidl::tests::nested::ParcelableWithNested::Status status) = 0;
+  };  // class ICallback
+
+  class ICallbackDefault : public ICallback {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+    ::android::binder::Status done(::android::aidl::tests::nested::ParcelableWithNested::Status /*status*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+  };  // class ICallbackDefault
+  class BpCallback : public ::android::BpInterface<ICallback> {
+  public:
+    explicit BpCallback(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpCallback() = default;
+    ::android::binder::Status done(::android::aidl::tests::nested::ParcelableWithNested::Status status) override;
+  };  // class BpCallback
+  class BnCallback : public ::android::BnInterface<ICallback> {
+  public:
+    static constexpr uint32_t TRANSACTION_done = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+    explicit BnCallback();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  };  // class BnCallback
+
+  class ICallbackDelegator : public BnCallback {
+  public:
+    explicit ICallbackDelegator(const ::android::sp<ICallback> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<ICallback> getImpl() { return _aidl_delegate; }
+    ::android::binder::Status done(::android::aidl::tests::nested::ParcelableWithNested::Status status) override {
+      return _aidl_delegate->done(status);
+    }
+  private:
+    ::android::sp<ICallback> _aidl_delegate;
+  };  // class ICallbackDelegator
+  virtual ::android::binder::Status flipStatus(const ::android::aidl::tests::nested::ParcelableWithNested& p, ::android::aidl::tests::nested::INestedService::Result* _aidl_return) = 0;
+  virtual ::android::binder::Status flipStatusWithCallback(::android::aidl::tests::nested::ParcelableWithNested::Status status, const ::android::sp<::android::aidl::tests::nested::INestedService::ICallback>& cb) = 0;
+};  // class INestedService
+
+class INestedServiceDefault : public INestedService {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status flipStatus(const ::android::aidl::tests::nested::ParcelableWithNested& /*p*/, ::android::aidl::tests::nested::INestedService::Result* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status flipStatusWithCallback(::android::aidl::tests::nested::ParcelableWithNested::Status /*status*/, const ::android::sp<::android::aidl::tests::nested::INestedService::ICallback>& /*cb*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+};  // class INestedServiceDefault
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/ParcelableWithNested.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/ParcelableWithNested.h
new file mode 100644
index 0000000..662c1fd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/nested/ParcelableWithNested.h
@@ -0,0 +1,95 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/nested/ParcelableWithNested.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <string>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class ParcelableWithNested : public ::android::Parcelable {
+public:
+  enum class Status : int8_t {
+    OK = 0,
+    NOT_OK = 1,
+  };
+  ::android::aidl::tests::nested::ParcelableWithNested::Status status = ::android::aidl::tests::nested::ParcelableWithNested::Status::OK;
+  inline bool operator!=(const ParcelableWithNested& rhs) const {
+    return std::tie(status) != std::tie(rhs.status);
+  }
+  inline bool operator<(const ParcelableWithNested& rhs) const {
+    return std::tie(status) < std::tie(rhs.status);
+  }
+  inline bool operator<=(const ParcelableWithNested& rhs) const {
+    return std::tie(status) <= std::tie(rhs.status);
+  }
+  inline bool operator==(const ParcelableWithNested& rhs) const {
+    return std::tie(status) == std::tie(rhs.status);
+  }
+  inline bool operator>(const ParcelableWithNested& rhs) const {
+    return std::tie(status) > std::tie(rhs.status);
+  }
+  inline bool operator>=(const ParcelableWithNested& rhs) const {
+    return std::tie(status) >= std::tie(rhs.status);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.nested.ParcelableWithNested");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ParcelableWithNested{";
+    os << "status: " << ::android::internal::ToString(status);
+    os << "}";
+    return os.str();
+  }
+};  // class ParcelableWithNested
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+[[nodiscard]] static inline std::string toString(ParcelableWithNested::Status val) {
+  switch(val) {
+  case ParcelableWithNested::Status::OK:
+    return "OK";
+  case ParcelableWithNested::Status::NOT_OK:
+    return "NOT_OK";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::nested::ParcelableWithNested::Status, 2> enum_values<::android::aidl::tests::nested::ParcelableWithNested::Status> = {
+  ::android::aidl::tests::nested::ParcelableWithNested::Status::OK,
+  ::android::aidl::tests::nested::ParcelableWithNested::Status::NOT_OK,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BnEnumUnion.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BnEnumUnion.h
new file mode 100644
index 0000000..9f3edec
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BnEnumUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BnUnionInUnion.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BnUnionInUnion.h
new file mode 100644
index 0000000..3390730
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BnUnionInUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BpEnumUnion.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BpEnumUnion.h
new file mode 100644
index 0000000..a42e75b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BpEnumUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BpUnionInUnion.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BpUnionInUnion.h
new file mode 100644
index 0000000..2fac940
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/BpUnionInUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/EnumUnion.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/EnumUnion.h
new file mode 100644
index 0000000..eeb88c8
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/EnumUnion.h
@@ -0,0 +1,169 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/IntEnum.h>
+#include <android/aidl/tests/LongEnum.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+class EnumUnion : public ::android::Parcelable {
+public:
+  enum class Tag : int32_t {
+    intEnum = 0,
+    longEnum = 1,
+    deprecatedField __attribute__((deprecated("do not use this"))) = 2,
+  };
+  // Expose tag symbols for legacy code
+  static const inline Tag intEnum = Tag::intEnum;
+  static const inline Tag longEnum = Tag::longEnum;
+  static const inline Tag __attribute__((deprecated("do not use this"))) deprecatedField = Tag::deprecatedField;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, EnumUnion>;
+
+  EnumUnion() : _value(std::in_place_index<static_cast<size_t>(intEnum)>, ::android::aidl::tests::IntEnum(::android::aidl::tests::IntEnum::FOO)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr EnumUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit EnumUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static EnumUnion make(_Tp&&... _args) {
+    return EnumUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static EnumUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return EnumUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  inline bool operator!=(const EnumUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const EnumUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const EnumUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const EnumUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const EnumUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const EnumUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.unions.EnumUnion");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "EnumUnion{";
+    switch (getTag()) {
+    case intEnum: os << "intEnum: " << ::android::internal::ToString(get<intEnum>()); break;
+    case longEnum: os << "longEnum: " << ::android::internal::ToString(get<longEnum>()); break;
+    case deprecatedField: os << "deprecatedField: " << ::android::internal::ToString(get<deprecatedField>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<::android::aidl::tests::IntEnum, ::android::aidl::tests::LongEnum, int32_t> _value;
+};  // class EnumUnion
+#pragma clang diagnostic pop
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+[[nodiscard]] static inline std::string toString(EnumUnion::Tag val) {
+  switch(val) {
+  case EnumUnion::Tag::intEnum:
+    return "intEnum";
+  case EnumUnion::Tag::longEnum:
+    return "longEnum";
+  case EnumUnion::Tag::deprecatedField:
+    return "deprecatedField";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+#pragma clang diagnostic pop
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+template <>
+constexpr inline std::array<::android::aidl::tests::unions::EnumUnion::Tag, 3> enum_values<::android::aidl::tests::unions::EnumUnion::Tag> = {
+  ::android::aidl::tests::unions::EnumUnion::Tag::intEnum,
+  ::android::aidl::tests::unions::EnumUnion::Tag::longEnum,
+  ::android::aidl::tests::unions::EnumUnion::Tag::deprecatedField,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/UnionInUnion.h b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/UnionInUnion.h
new file mode 100644
index 0000000..2b28831
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/unions/UnionInUnion.h
@@ -0,0 +1,155 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#pragma once
+
+#include <android/aidl/tests/unions/EnumUnion.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+class UnionInUnion : public ::android::Parcelable {
+public:
+  enum class Tag : int32_t {
+    first = 0,
+    second = 1,
+  };
+  // Expose tag symbols for legacy code
+  static const inline Tag first = Tag::first;
+  static const inline Tag second = Tag::second;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, UnionInUnion>;
+
+  UnionInUnion() : _value(std::in_place_index<static_cast<size_t>(first)>, ::android::aidl::tests::unions::EnumUnion()) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr UnionInUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit UnionInUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static UnionInUnion make(_Tp&&... _args) {
+    return UnionInUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static UnionInUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return UnionInUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  inline bool operator!=(const UnionInUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const UnionInUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const UnionInUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const UnionInUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const UnionInUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const UnionInUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.tests.unions.UnionInUnion");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "UnionInUnion{";
+    switch (getTag()) {
+    case first: os << "first: " << ::android::internal::ToString(get<first>()); break;
+    case second: os << "second: " << ::android::internal::ToString(get<second>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<::android::aidl::tests::unions::EnumUnion, int32_t> _value;
+};  // class UnionInUnion
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+[[nodiscard]] static inline std::string toString(UnionInUnion::Tag val) {
+  switch(val) {
+  case UnionInUnion::Tag::first:
+    return "first";
+  case UnionInUnion::Tag::second:
+    return "second";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::unions::UnionInUnion::Tag, 2> enum_values<::android::aidl::tests::unions::UnionInUnion::Tag> = {
+  ::android::aidl::tests::unions::UnionInUnion::Tag::first,
+  ::android::aidl::tests::unions::UnionInUnion::Tag::second,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-cpp-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ArrayOfInterfaces.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ArrayOfInterfaces.java
new file mode 100644
index 0000000..ba904b8
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ArrayOfInterfaces.java
@@ -0,0 +1,604 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ArrayOfInterfaces.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+package android.aidl.tests;
+public class ArrayOfInterfaces implements android.os.Parcelable
+{
+  public static final android.os.Parcelable.Creator<ArrayOfInterfaces> CREATOR = new android.os.Parcelable.Creator<ArrayOfInterfaces>() {
+    @Override
+    public ArrayOfInterfaces createFromParcel(android.os.Parcel _aidl_source) {
+      ArrayOfInterfaces _aidl_out = new ArrayOfInterfaces();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public ArrayOfInterfaces[] newArray(int _aidl_size) {
+      return new ArrayOfInterfaces[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+  public interface IEmptyInterface extends android.os.IInterface
+  {
+    /** Default implementation for IEmptyInterface. */
+    public static class Default implements android.aidl.tests.ArrayOfInterfaces.IEmptyInterface
+    {
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ArrayOfInterfaces.IEmptyInterface
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.tests.ArrayOfInterfaces.IEmptyInterface interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.tests.ArrayOfInterfaces.IEmptyInterface asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.tests.ArrayOfInterfaces.IEmptyInterface))) {
+          return ((android.aidl.tests.ArrayOfInterfaces.IEmptyInterface)iin);
+        }
+        return new android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      /** @hide */
+      public static java.lang.String getDefaultTransactionName(int transactionCode)
+      {
+        switch (transactionCode)
+        {
+          default:
+          {
+            return null;
+          }
+        }
+      }
+      /** @hide */
+      public java.lang.String getTransactionName(int transactionCode)
+      {
+        return this.getDefaultTransactionName(transactionCode);
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        switch (code)
+        {
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+      }
+      private static class Proxy implements android.aidl.tests.ArrayOfInterfaces.IEmptyInterface
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+      }
+      /** @hide */
+      public int getMaxTransactionId()
+      {
+        return 0;
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ArrayOfInterfaces.IEmptyInterface";
+  }
+  public interface IMyInterface extends android.os.IInterface
+  {
+    /** Default implementation for IMyInterface. */
+    public static class Default implements android.aidl.tests.ArrayOfInterfaces.IMyInterface
+    {
+      @Override public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] methodWithInterfaces(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface iface, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface nullable_iface, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_in, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_out, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_inout, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_in, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_out, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_inout) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ArrayOfInterfaces.IMyInterface
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.tests.ArrayOfInterfaces.IMyInterface interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.tests.ArrayOfInterfaces.IMyInterface asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.tests.ArrayOfInterfaces.IMyInterface))) {
+          return ((android.aidl.tests.ArrayOfInterfaces.IMyInterface)iin);
+        }
+        return new android.aidl.tests.ArrayOfInterfaces.IMyInterface.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      /** @hide */
+      public static java.lang.String getDefaultTransactionName(int transactionCode)
+      {
+        switch (transactionCode)
+        {
+          case TRANSACTION_methodWithInterfaces:
+          {
+            return "methodWithInterfaces";
+          }
+          default:
+          {
+            return null;
+          }
+        }
+      }
+      /** @hide */
+      public java.lang.String getTransactionName(int transactionCode)
+      {
+        return this.getDefaultTransactionName(transactionCode);
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+          data.enforceInterface(descriptor);
+        }
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        switch (code)
+        {
+          case TRANSACTION_methodWithInterfaces:
+          {
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _arg0;
+            _arg0 = android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub.asInterface(data.readStrongBinder());
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _arg1;
+            _arg1 = android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub.asInterface(data.readStrongBinder());
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _arg2;
+            _arg2 = data.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _arg3;
+            int _arg3_length = data.readInt();
+            if (_arg3_length < 0) {
+              _arg3 = null;
+            } else {
+              _arg3 = new android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[_arg3_length];
+            }
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _arg4;
+            _arg4 = data.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _arg5;
+            _arg5 = data.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _arg6;
+            int _arg6_length = data.readInt();
+            if (_arg6_length < 0) {
+              _arg6 = null;
+            } else {
+              _arg6 = new android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[_arg6_length];
+            }
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _arg7;
+            _arg7 = data.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+            data.enforceNoDataAvail();
+            android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _result = this.methodWithInterfaces(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
+            reply.writeNoException();
+            reply.writeInterfaceArray(_result);
+            reply.writeInterfaceArray(_arg3);
+            reply.writeInterfaceArray(_arg4);
+            reply.writeInterfaceArray(_arg6);
+            reply.writeInterfaceArray(_arg7);
+            break;
+          }
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+        return true;
+      }
+      private static class Proxy implements android.aidl.tests.ArrayOfInterfaces.IMyInterface
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+        @Override public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] methodWithInterfaces(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface iface, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface nullable_iface, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_in, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_out, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_inout, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_in, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_out, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_inout) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeStrongInterface(iface);
+            _data.writeStrongInterface(nullable_iface);
+            _data.writeInterfaceArray(iface_array_in);
+            _data.writeInt(iface_array_out.length);
+            _data.writeInterfaceArray(iface_array_inout);
+            _data.writeInterfaceArray(nullable_iface_array_in);
+            _data.writeInt(nullable_iface_array_out.length);
+            _data.writeInterfaceArray(nullable_iface_array_inout);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_methodWithInterfaces, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+            _reply.readInterfaceArray(iface_array_out, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+            _reply.readInterfaceArray(iface_array_inout, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+            _reply.readInterfaceArray(nullable_iface_array_out, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+            _reply.readInterfaceArray(nullable_iface_array_inout, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+      }
+      static final int TRANSACTION_methodWithInterfaces = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+      /** @hide */
+      public int getMaxTransactionId()
+      {
+        return 0;
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ArrayOfInterfaces.IMyInterface";
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] methodWithInterfaces(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface iface, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface nullable_iface, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_in, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_out, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array_inout, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_in, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_out, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array_inout) throws android.os.RemoteException;
+  }
+  public static class MyParcelable implements android.os.Parcelable
+  {
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface iface;
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface nullable_iface;
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array;
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array;
+    public static final android.os.Parcelable.Creator<MyParcelable> CREATOR = new android.os.Parcelable.Creator<MyParcelable>() {
+      @Override
+      public MyParcelable createFromParcel(android.os.Parcel _aidl_source) {
+        MyParcelable _aidl_out = new MyParcelable();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public MyParcelable[] newArray(int _aidl_size) {
+        return new MyParcelable[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeStrongInterface(iface);
+      _aidl_parcel.writeStrongInterface(nullable_iface);
+      _aidl_parcel.writeInterfaceArray(iface_array);
+      _aidl_parcel.writeInterfaceArray(nullable_iface_array);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        iface = android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_iface = android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        iface_array = _aidl_parcel.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_iface_array = _aidl_parcel.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public String toString() {
+      java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "{", "}");
+      _aidl_sj.add("iface: " + (java.util.Objects.toString(iface)));
+      _aidl_sj.add("nullable_iface: " + (java.util.Objects.toString(nullable_iface)));
+      _aidl_sj.add("iface_array: " + (java.util.Arrays.toString(iface_array)));
+      _aidl_sj.add("nullable_iface_array: " + (java.util.Arrays.toString(nullable_iface_array)));
+      return "MyParcelable" + _aidl_sj.toString()  ;
+    }
+    @Override
+    public boolean equals(Object other) {
+      if (this == other) return true;
+      if (other == null) return false;
+      if (!(other instanceof MyParcelable)) return false;
+      MyParcelable that = (MyParcelable)other;
+      if (!java.util.Objects.deepEquals(iface, that.iface)) return false;
+      if (!java.util.Objects.deepEquals(nullable_iface, that.nullable_iface)) return false;
+      if (!java.util.Objects.deepEquals(iface_array, that.iface_array)) return false;
+      if (!java.util.Objects.deepEquals(nullable_iface_array, that.nullable_iface_array)) return false;
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return java.util.Arrays.deepHashCode(java.util.Arrays.asList(iface, nullable_iface, iface_array, nullable_iface_array).toArray());
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+  public static final class MyUnion implements android.os.Parcelable {
+    // tags for union fields
+    public final static int iface = 0;  // android.aidl.tests.ArrayOfInterfaces.IEmptyInterface iface;
+    public final static int nullable_iface = 1;  // android.aidl.tests.ArrayOfInterfaces.IEmptyInterface nullable_iface;
+    public final static int iface_array = 2;  // android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array;
+    public final static int nullable_iface_array = 3;  // android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array;
+
+    private int _tag;
+    private Object _value;
+
+    public MyUnion() {
+      android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _value = null;
+      this._tag = iface;
+      this._value = _value;
+    }
+
+    private MyUnion(android.os.Parcel _aidl_parcel) {
+      readFromParcel(_aidl_parcel);
+    }
+
+    private MyUnion(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+
+    public int getTag() {
+      return _tag;
+    }
+
+    // android.aidl.tests.ArrayOfInterfaces.IEmptyInterface iface;
+
+    public static MyUnion iface(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _value) {
+      return new MyUnion(iface, _value);
+    }
+
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface getIface() {
+      _assertTag(iface);
+      return (android.aidl.tests.ArrayOfInterfaces.IEmptyInterface) _value;
+    }
+
+    public void setIface(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _value) {
+      _set(iface, _value);
+    }
+
+    // android.aidl.tests.ArrayOfInterfaces.IEmptyInterface nullable_iface;
+
+    public static MyUnion nullable_iface(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _value) {
+      return new MyUnion(nullable_iface, _value);
+    }
+
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface getNullable_iface() {
+      _assertTag(nullable_iface);
+      return (android.aidl.tests.ArrayOfInterfaces.IEmptyInterface) _value;
+    }
+
+    public void setNullable_iface(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _value) {
+      _set(nullable_iface, _value);
+    }
+
+    // android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] iface_array;
+
+    public static MyUnion iface_array(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _value) {
+      return new MyUnion(iface_array, _value);
+    }
+
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] getIface_array() {
+      _assertTag(iface_array);
+      return (android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]) _value;
+    }
+
+    public void setIface_array(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _value) {
+      _set(iface_array, _value);
+    }
+
+    // android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] nullable_iface_array;
+
+    public static MyUnion nullable_iface_array(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _value) {
+      return new MyUnion(nullable_iface_array, _value);
+    }
+
+    public android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] getNullable_iface_array() {
+      _assertTag(nullable_iface_array);
+      return (android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]) _value;
+    }
+
+    public void setNullable_iface_array(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _value) {
+      _set(nullable_iface_array, _value);
+    }
+
+    public static final android.os.Parcelable.Creator<MyUnion> CREATOR = new android.os.Parcelable.Creator<MyUnion>() {
+      @Override
+      public MyUnion createFromParcel(android.os.Parcel _aidl_source) {
+        return new MyUnion(_aidl_source);
+      }
+      @Override
+      public MyUnion[] newArray(int _aidl_size) {
+        return new MyUnion[_aidl_size];
+      }
+    };
+
+    @Override
+    public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+      _aidl_parcel.writeInt(_tag);
+      switch (_tag) {
+      case iface:
+        _aidl_parcel.writeStrongInterface(getIface());
+        break;
+      case nullable_iface:
+        _aidl_parcel.writeStrongInterface(getNullable_iface());
+        break;
+      case iface_array:
+        _aidl_parcel.writeInterfaceArray(getIface_array());
+        break;
+      case nullable_iface_array:
+        _aidl_parcel.writeInterfaceArray(getNullable_iface_array());
+        break;
+      }
+    }
+
+    public void readFromParcel(android.os.Parcel _aidl_parcel) {
+      int _aidl_tag;
+      _aidl_tag = _aidl_parcel.readInt();
+      switch (_aidl_tag) {
+      case iface: {
+        android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _aidl_value;
+        _aidl_value = android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case nullable_iface: {
+        android.aidl.tests.ArrayOfInterfaces.IEmptyInterface _aidl_value;
+        _aidl_value = android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case iface_array: {
+        android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _aidl_value;
+        _aidl_value = _aidl_parcel.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case nullable_iface_array: {
+        android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[] _aidl_value;
+        _aidl_value = _aidl_parcel.createInterfaceArray(android.aidl.tests.ArrayOfInterfaces.IEmptyInterface[]::new, android.aidl.tests.ArrayOfInterfaces.IEmptyInterface.Stub::asInterface);
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      }
+      throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+    }
+
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      switch (getTag()) {
+      }
+      return _mask;
+    }
+
+    @Override
+    public String toString() {
+      switch (_tag) {
+      case iface: return "MyUnion.iface(" + (java.util.Objects.toString(getIface())) + ")";
+      case nullable_iface: return "MyUnion.nullable_iface(" + (java.util.Objects.toString(getNullable_iface())) + ")";
+      case iface_array: return "MyUnion.iface_array(" + (java.util.Arrays.toString(getIface_array())) + ")";
+      case nullable_iface_array: return "MyUnion.nullable_iface_array(" + (java.util.Arrays.toString(getNullable_iface_array())) + ")";
+      }
+      throw new IllegalStateException("unknown field: " + _tag);
+    }
+    @Override
+    public boolean equals(Object other) {
+      if (this == other) return true;
+      if (other == null) return false;
+      if (!(other instanceof MyUnion)) return false;
+      MyUnion that = (MyUnion)other;
+      if (_tag != that._tag) return false;
+      if (!java.util.Objects.deepEquals(_value, that._value)) return false;
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return java.util.Arrays.deepHashCode(java.util.Arrays.asList(_tag, _value).toArray());
+    }
+
+    private void _assertTag(int tag) {
+      if (getTag() != tag) {
+        throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+      }
+    }
+
+    private String _tagString(int _tag) {
+      switch (_tag) {
+      case iface: return "iface";
+      case nullable_iface: return "nullable_iface";
+      case iface_array: return "iface_array";
+      case nullable_iface_array: return "nullable_iface_array";
+      }
+      throw new IllegalStateException("unknown field: " + _tag);
+    }
+
+    private void _set(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+    public static @interface Tag {
+      public static final int iface = 0;
+      public static final int nullable_iface = 1;
+      public static final int iface_array = 2;
+      public static final int nullable_iface_array = 3;
+    }
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ArrayOfInterfaces.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ArrayOfInterfaces.java.d
new file mode 100644
index 0000000..7605fbe
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ArrayOfInterfaces.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ArrayOfInterfaces.java : \
+  system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/BackendType.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/BackendType.java
new file mode 100644
index 0000000..0e72394
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/BackendType.java
@@ -0,0 +1,11 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/BackendType.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+package android.aidl.tests;
+public @interface BackendType {
+  public static final byte CPP = 0;
+  public static final byte JAVA = 1;
+  public static final byte NDK = 2;
+  public static final byte RUST = 3;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/BackendType.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/BackendType.java.d
new file mode 100644
index 0000000..bd69a28
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/BackendType.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/BackendType.java : \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ByteEnum.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ByteEnum.java
new file mode 100644
index 0000000..124d24a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ByteEnum.java
@@ -0,0 +1,12 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ByteEnum.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+package android.aidl.tests;
+/** Hello, world! */
+public @interface ByteEnum {
+  // Comment about FOO.
+  public static final byte FOO = 1;
+  public static final byte BAR = 2;
+  public static final byte BAZ = 3;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ByteEnum.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ByteEnum.java.d
new file mode 100644
index 0000000..cf9a22f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ByteEnum.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ByteEnum.java : \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/CircularParcelable.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/CircularParcelable.java
new file mode 100644
index 0000000..a91dddc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/CircularParcelable.java
@@ -0,0 +1,51 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/CircularParcelable.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+package android.aidl.tests;
+public class CircularParcelable implements android.os.Parcelable
+{
+  public android.aidl.tests.ITestService testService;
+  public static final android.os.Parcelable.Creator<CircularParcelable> CREATOR = new android.os.Parcelable.Creator<CircularParcelable>() {
+    @Override
+    public CircularParcelable createFromParcel(android.os.Parcel _aidl_source) {
+      CircularParcelable _aidl_out = new CircularParcelable();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public CircularParcelable[] newArray(int _aidl_size) {
+      return new CircularParcelable[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeStrongInterface(testService);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      testService = android.aidl.tests.ITestService.Stub.asInterface(_aidl_parcel.readStrongBinder());
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/CircularParcelable.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/CircularParcelable.java.d
new file mode 100644
index 0000000..bf6f8ca
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/CircularParcelable.java.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/CircularParcelable.java : \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ConstantExpressionEnum.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ConstantExpressionEnum.java
new file mode 100644
index 0000000..0e86ef9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ConstantExpressionEnum.java
@@ -0,0 +1,24 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ConstantExpressionEnum.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+package android.aidl.tests;
+public @interface ConstantExpressionEnum {
+  // Should be all true / ones.
+  // dec literals are either int or long
+  public static final int decInt32_1 = 1;
+  public static final int decInt32_2 = 1;
+  public static final int decInt64_1 = 1;
+  public static final int decInt64_2 = 1;
+  public static final int decInt64_3 = 1;
+  public static final int decInt64_4 = 1;
+  // hex literals could be int or long
+  // 0x7fffffff is int, hence can be negated
+  public static final int hexInt32_1 = 1;
+  // 0x80000000 is int32_t max + 1
+  public static final int hexInt32_2 = 1;
+  // 0xFFFFFFFF is int32_t, not long; if it were long then ~(long)0xFFFFFFFF != 0
+  public static final int hexInt32_3 = 1;
+  // 0x7FFFFFFFFFFFFFFF is long, hence can be negated
+  public static final int hexInt64_1 = 1;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ConstantExpressionEnum.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ConstantExpressionEnum.java.d
new file mode 100644
index 0000000..deebbb2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ConstantExpressionEnum.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ConstantExpressionEnum.java : \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java
new file mode 100644
index 0000000..4daec2b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java
@@ -0,0 +1,12 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+package android.aidl.tests;
+/** @deprecated test */
+@Deprecated
+public @interface DeprecatedEnum {
+  public static final int A = 0;
+  public static final int B = 1;
+  public static final int C = 2;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java.d
new file mode 100644
index 0000000..e471625
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java
new file mode 100644
index 0000000..7c1935a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java
@@ -0,0 +1,49 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+package android.aidl.tests;
+/** @deprecated test */
+@Deprecated
+public class DeprecatedParcelable implements android.os.Parcelable
+{
+  public static final android.os.Parcelable.Creator<DeprecatedParcelable> CREATOR = new android.os.Parcelable.Creator<DeprecatedParcelable>() {
+    @Override
+    public DeprecatedParcelable createFromParcel(android.os.Parcel _aidl_source) {
+      DeprecatedParcelable _aidl_out = new DeprecatedParcelable();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public DeprecatedParcelable[] newArray(int _aidl_size) {
+      return new DeprecatedParcelable[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java.d
new file mode 100644
index 0000000..94f6de2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/FixedSize.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/FixedSize.java
new file mode 100644
index 0000000..0e13b1a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/FixedSize.java
@@ -0,0 +1,419 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/FixedSize.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+package android.aidl.tests;
+public class FixedSize implements android.os.Parcelable
+{
+  public static final android.os.Parcelable.Creator<FixedSize> CREATOR = new android.os.Parcelable.Creator<FixedSize>() {
+    @Override
+    public FixedSize createFromParcel(android.os.Parcel _aidl_source) {
+      FixedSize _aidl_out = new FixedSize();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public FixedSize[] newArray(int _aidl_size) {
+      return new FixedSize[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+  public static class FixedParcelable implements android.os.Parcelable
+  {
+    public boolean booleanValue = false;
+    public byte byteValue = 0;
+    public char charValue = '\0';
+    public int intValue = 0;
+    public long longValue = 0L;
+    public float floatValue = 0.000000f;
+    public double doubleValue = 0.000000;
+    public long enumValue = android.aidl.tests.LongEnum.FOO;
+    public android.aidl.tests.FixedSize.FixedUnion parcelableValue;
+    public static final android.os.Parcelable.Creator<FixedParcelable> CREATOR = new android.os.Parcelable.Creator<FixedParcelable>() {
+      @Override
+      public FixedParcelable createFromParcel(android.os.Parcel _aidl_source) {
+        FixedParcelable _aidl_out = new FixedParcelable();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public FixedParcelable[] newArray(int _aidl_size) {
+        return new FixedParcelable[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeBoolean(booleanValue);
+      _aidl_parcel.writeByte(byteValue);
+      _aidl_parcel.writeInt(((int)charValue));
+      _aidl_parcel.writeInt(intValue);
+      _aidl_parcel.writeLong(longValue);
+      _aidl_parcel.writeFloat(floatValue);
+      _aidl_parcel.writeDouble(doubleValue);
+      _aidl_parcel.writeLong(enumValue);
+      _aidl_parcel.writeTypedObject(parcelableValue, _aidl_flag);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        booleanValue = _aidl_parcel.readBoolean();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        byteValue = _aidl_parcel.readByte();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        charValue = (char)_aidl_parcel.readInt();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        intValue = _aidl_parcel.readInt();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        longValue = _aidl_parcel.readLong();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        floatValue = _aidl_parcel.readFloat();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        doubleValue = _aidl_parcel.readDouble();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        enumValue = _aidl_parcel.readLong();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        parcelableValue = _aidl_parcel.readTypedObject(android.aidl.tests.FixedSize.FixedUnion.CREATOR);
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      _mask |= describeContents(parcelableValue);
+      return _mask;
+    }
+    private int describeContents(Object _v) {
+      if (_v == null) return 0;
+      if (_v instanceof android.os.Parcelable) {
+        return ((android.os.Parcelable) _v).describeContents();
+      }
+      return 0;
+    }
+  }
+  public static final class FixedUnion implements android.os.Parcelable {
+    // tags for union fields
+    public final static int booleanValue = 0;  // boolean booleanValue;
+    public final static int byteValue = 1;  // byte byteValue;
+    public final static int charValue = 2;  // char charValue;
+    public final static int intValue = 3;  // int intValue;
+    public final static int longValue = 4;  // long longValue;
+    public final static int floatValue = 5;  // float floatValue;
+    public final static int doubleValue = 6;  // double doubleValue;
+    public final static int enumValue = 7;  // android.aidl.tests.LongEnum enumValue;
+
+    private int _tag;
+    private Object _value;
+
+    public FixedUnion() {
+      boolean _value = false;
+      this._tag = booleanValue;
+      this._value = _value;
+    }
+
+    private FixedUnion(android.os.Parcel _aidl_parcel) {
+      readFromParcel(_aidl_parcel);
+    }
+
+    private FixedUnion(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+
+    public int getTag() {
+      return _tag;
+    }
+
+    // boolean booleanValue;
+
+    public static FixedUnion booleanValue(boolean _value) {
+      return new FixedUnion(booleanValue, _value);
+    }
+
+    public boolean getBooleanValue() {
+      _assertTag(booleanValue);
+      return (boolean) _value;
+    }
+
+    public void setBooleanValue(boolean _value) {
+      _set(booleanValue, _value);
+    }
+
+    // byte byteValue;
+
+    public static FixedUnion byteValue(byte _value) {
+      return new FixedUnion(byteValue, _value);
+    }
+
+    public byte getByteValue() {
+      _assertTag(byteValue);
+      return (byte) _value;
+    }
+
+    public void setByteValue(byte _value) {
+      _set(byteValue, _value);
+    }
+
+    // char charValue;
+
+    public static FixedUnion charValue(char _value) {
+      return new FixedUnion(charValue, _value);
+    }
+
+    public char getCharValue() {
+      _assertTag(charValue);
+      return (char) _value;
+    }
+
+    public void setCharValue(char _value) {
+      _set(charValue, _value);
+    }
+
+    // int intValue;
+
+    public static FixedUnion intValue(int _value) {
+      return new FixedUnion(intValue, _value);
+    }
+
+    public int getIntValue() {
+      _assertTag(intValue);
+      return (int) _value;
+    }
+
+    public void setIntValue(int _value) {
+      _set(intValue, _value);
+    }
+
+    // long longValue;
+
+    public static FixedUnion longValue(long _value) {
+      return new FixedUnion(longValue, _value);
+    }
+
+    public long getLongValue() {
+      _assertTag(longValue);
+      return (long) _value;
+    }
+
+    public void setLongValue(long _value) {
+      _set(longValue, _value);
+    }
+
+    // float floatValue;
+
+    public static FixedUnion floatValue(float _value) {
+      return new FixedUnion(floatValue, _value);
+    }
+
+    public float getFloatValue() {
+      _assertTag(floatValue);
+      return (float) _value;
+    }
+
+    public void setFloatValue(float _value) {
+      _set(floatValue, _value);
+    }
+
+    // double doubleValue;
+
+    public static FixedUnion doubleValue(double _value) {
+      return new FixedUnion(doubleValue, _value);
+    }
+
+    public double getDoubleValue() {
+      _assertTag(doubleValue);
+      return (double) _value;
+    }
+
+    public void setDoubleValue(double _value) {
+      _set(doubleValue, _value);
+    }
+
+    // android.aidl.tests.LongEnum enumValue;
+
+    public static FixedUnion enumValue(long _value) {
+      return new FixedUnion(enumValue, _value);
+    }
+
+    public long getEnumValue() {
+      _assertTag(enumValue);
+      return (long) _value;
+    }
+
+    public void setEnumValue(long _value) {
+      _set(enumValue, _value);
+    }
+
+    public static final android.os.Parcelable.Creator<FixedUnion> CREATOR = new android.os.Parcelable.Creator<FixedUnion>() {
+      @Override
+      public FixedUnion createFromParcel(android.os.Parcel _aidl_source) {
+        return new FixedUnion(_aidl_source);
+      }
+      @Override
+      public FixedUnion[] newArray(int _aidl_size) {
+        return new FixedUnion[_aidl_size];
+      }
+    };
+
+    @Override
+    public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+      _aidl_parcel.writeInt(_tag);
+      switch (_tag) {
+      case booleanValue:
+        _aidl_parcel.writeBoolean(getBooleanValue());
+        break;
+      case byteValue:
+        _aidl_parcel.writeByte(getByteValue());
+        break;
+      case charValue:
+        _aidl_parcel.writeInt(((int)getCharValue()));
+        break;
+      case intValue:
+        _aidl_parcel.writeInt(getIntValue());
+        break;
+      case longValue:
+        _aidl_parcel.writeLong(getLongValue());
+        break;
+      case floatValue:
+        _aidl_parcel.writeFloat(getFloatValue());
+        break;
+      case doubleValue:
+        _aidl_parcel.writeDouble(getDoubleValue());
+        break;
+      case enumValue:
+        _aidl_parcel.writeLong(getEnumValue());
+        break;
+      }
+    }
+
+    public void readFromParcel(android.os.Parcel _aidl_parcel) {
+      int _aidl_tag;
+      _aidl_tag = _aidl_parcel.readInt();
+      switch (_aidl_tag) {
+      case booleanValue: {
+        boolean _aidl_value;
+        _aidl_value = _aidl_parcel.readBoolean();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case byteValue: {
+        byte _aidl_value;
+        _aidl_value = _aidl_parcel.readByte();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case charValue: {
+        char _aidl_value;
+        _aidl_value = (char)_aidl_parcel.readInt();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case intValue: {
+        int _aidl_value;
+        _aidl_value = _aidl_parcel.readInt();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case longValue: {
+        long _aidl_value;
+        _aidl_value = _aidl_parcel.readLong();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case floatValue: {
+        float _aidl_value;
+        _aidl_value = _aidl_parcel.readFloat();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case doubleValue: {
+        double _aidl_value;
+        _aidl_value = _aidl_parcel.readDouble();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case enumValue: {
+        long _aidl_value;
+        _aidl_value = _aidl_parcel.readLong();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      }
+      throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+    }
+
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      switch (getTag()) {
+      }
+      return _mask;
+    }
+
+    private void _assertTag(int tag) {
+      if (getTag() != tag) {
+        throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+      }
+    }
+
+    private String _tagString(int _tag) {
+      switch (_tag) {
+      case booleanValue: return "booleanValue";
+      case byteValue: return "byteValue";
+      case charValue: return "charValue";
+      case intValue: return "intValue";
+      case longValue: return "longValue";
+      case floatValue: return "floatValue";
+      case doubleValue: return "doubleValue";
+      case enumValue: return "enumValue";
+      }
+      throw new IllegalStateException("unknown field: " + _tag);
+    }
+
+    private void _set(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+    public static @interface Tag {
+      public static final byte booleanValue = 0;
+      public static final byte byteValue = 1;
+      public static final byte charValue = 2;
+      public static final byte intValue = 3;
+      public static final byte longValue = 4;
+      public static final byte floatValue = 5;
+      public static final byte doubleValue = 6;
+      public static final byte enumValue = 7;
+    }
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/FixedSize.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/FixedSize.java.d
new file mode 100644
index 0000000..74b092c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/FixedSize.java.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/FixedSize.java : \
+  system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/GenericStructuredParcelable.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/GenericStructuredParcelable.java
new file mode 100644
index 0000000..f29a82f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/GenericStructuredParcelable.java
@@ -0,0 +1,62 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/GenericStructuredParcelable.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+package android.aidl.tests;
+public class GenericStructuredParcelable<T,U,B> implements android.os.Parcelable
+{
+  public int a = 0;
+  public int b = 0;
+  public static final android.os.Parcelable.Creator<GenericStructuredParcelable> CREATOR = new android.os.Parcelable.Creator<GenericStructuredParcelable>() {
+    @Override
+    public GenericStructuredParcelable createFromParcel(android.os.Parcel _aidl_source) {
+      GenericStructuredParcelable _aidl_out = new GenericStructuredParcelable();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public GenericStructuredParcelable[] newArray(int _aidl_size) {
+      return new GenericStructuredParcelable[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(a);
+    _aidl_parcel.writeInt(b);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      a = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      b = _aidl_parcel.readInt();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public String toString() {
+    java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "{", "}");
+    _aidl_sj.add("a: " + (a));
+    _aidl_sj.add("b: " + (b));
+    return "GenericStructuredParcelable" + _aidl_sj.toString()  ;
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/GenericStructuredParcelable.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/GenericStructuredParcelable.java.d
new file mode 100644
index 0000000..a78038d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/GenericStructuredParcelable.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/GenericStructuredParcelable.java : \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ICircular.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ICircular.java
new file mode 100644
index 0000000..3211f00
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ICircular.java
@@ -0,0 +1,135 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ICircular.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+package android.aidl.tests;
+public interface ICircular extends android.os.IInterface
+{
+  /** Default implementation for ICircular. */
+  public static class Default implements android.aidl.tests.ICircular
+  {
+    @Override public android.aidl.tests.ITestService GetTestService() throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ICircular
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.ICircular interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.ICircular asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.ICircular))) {
+        return ((android.aidl.tests.ICircular)iin);
+      }
+      return new android.aidl.tests.ICircular.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_GetTestService:
+        {
+          return "GetTestService";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_GetTestService:
+        {
+          android.aidl.tests.ITestService _result = this.GetTestService();
+          reply.writeNoException();
+          reply.writeStrongInterface(_result);
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.ICircular
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public android.aidl.tests.ITestService GetTestService() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.ITestService _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetTestService, _data, _reply, 0);
+          _reply.readException();
+          _result = android.aidl.tests.ITestService.Stub.asInterface(_reply.readStrongBinder());
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+    }
+    static final int TRANSACTION_GetTestService = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 0;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ICircular";
+  public android.aidl.tests.ITestService GetTestService() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ICircular.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ICircular.java.d
new file mode 100644
index 0000000..1add0dd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ICircular.java.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ICircular.java : \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java
new file mode 100644
index 0000000..a17e304
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java
@@ -0,0 +1,99 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+package android.aidl.tests;
+/** @deprecated test */
+@Deprecated
+public interface IDeprecated extends android.os.IInterface
+{
+  /** Default implementation for IDeprecated. */
+  public static class Default implements android.aidl.tests.IDeprecated
+  {
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.IDeprecated
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.IDeprecated interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.IDeprecated asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.IDeprecated))) {
+        return ((android.aidl.tests.IDeprecated)iin);
+      }
+      return new android.aidl.tests.IDeprecated.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+    }
+    private static class Proxy implements android.aidl.tests.IDeprecated
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+    }
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 0;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.IDeprecated";
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java.d
new file mode 100644
index 0000000..f97a90c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java : \
+  system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/INamedCallback.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/INamedCallback.java
new file mode 100644
index 0000000..0a11b72
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/INamedCallback.java
@@ -0,0 +1,135 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/INamedCallback.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+package android.aidl.tests;
+public interface INamedCallback extends android.os.IInterface
+{
+  /** Default implementation for INamedCallback. */
+  public static class Default implements android.aidl.tests.INamedCallback
+  {
+    @Override public java.lang.String GetName() throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.INamedCallback
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.INamedCallback interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.INamedCallback asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.INamedCallback))) {
+        return ((android.aidl.tests.INamedCallback)iin);
+      }
+      return new android.aidl.tests.INamedCallback.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_GetName:
+        {
+          return "GetName";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_GetName:
+        {
+          java.lang.String _result = this.GetName();
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.INamedCallback
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public java.lang.String GetName() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetName, _data, _reply, 0);
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+    }
+    static final int TRANSACTION_GetName = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 0;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.INamedCallback";
+  public java.lang.String GetName() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/INamedCallback.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/INamedCallback.java.d
new file mode 100644
index 0000000..c262450
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/INamedCallback.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/INamedCallback.java : \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/INewName.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/INewName.java
new file mode 100644
index 0000000..b668bf6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/INewName.java
@@ -0,0 +1,135 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/INewName.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+package android.aidl.tests;
+public interface INewName extends android.os.IInterface
+{
+  /** Default implementation for INewName. */
+  public static class Default implements android.aidl.tests.INewName
+  {
+    @Override public java.lang.String RealName() throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.INewName
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.INewName interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.INewName asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.INewName))) {
+        return ((android.aidl.tests.INewName)iin);
+      }
+      return new android.aidl.tests.INewName.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_RealName:
+        {
+          return "RealName";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_RealName:
+        {
+          java.lang.String _result = this.RealName();
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.INewName
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public java.lang.String RealName() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RealName, _data, _reply, 0);
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+    }
+    static final int TRANSACTION_RealName = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 0;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.IOldName";
+  public java.lang.String RealName() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/INewName.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/INewName.java.d
new file mode 100644
index 0000000..431e219
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/INewName.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/INewName.java : \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IOldName.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IOldName.java
new file mode 100644
index 0000000..5f21edc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IOldName.java
@@ -0,0 +1,135 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/IOldName.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+package android.aidl.tests;
+public interface IOldName extends android.os.IInterface
+{
+  /** Default implementation for IOldName. */
+  public static class Default implements android.aidl.tests.IOldName
+  {
+    @Override public java.lang.String RealName() throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.IOldName
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.IOldName interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.IOldName asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.IOldName))) {
+        return ((android.aidl.tests.IOldName)iin);
+      }
+      return new android.aidl.tests.IOldName.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_RealName:
+        {
+          return "RealName";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_RealName:
+        {
+          java.lang.String _result = this.RealName();
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.IOldName
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public java.lang.String RealName() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RealName, _data, _reply, 0);
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+    }
+    static final int TRANSACTION_RealName = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 0;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.IOldName";
+  public java.lang.String RealName() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IOldName.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IOldName.java.d
new file mode 100644
index 0000000..9bc46ea
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IOldName.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/IOldName.java : \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java
new file mode 100644
index 0000000..b4ed7bc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java
@@ -0,0 +1,4510 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+package android.aidl.tests;
+/** interface comment */
+public interface ITestService extends android.os.IInterface
+{
+  /** Default implementation for ITestService. */
+  public static class Default implements android.aidl.tests.ITestService
+  {
+    // This is to emulate a method that is added after the service is implemented.
+    // So the client cannot assume that a call to this method will be successful
+    // or not. However, inside the test environment, we can't build client and
+    // the server with different version of this AIDL file. So, we let the server
+    // actually implement this and intercept the dispatch to the method
+    // inside onTransact().
+    // WARNING: Must be first method.
+    // This requires hard coding the transaction number. As long as this method is
+    // the first in this interface, it can keep the
+    // "::android::IBinder::FIRST_CALL_TRANSACTION + 0" value and allow
+    // methods to be added and removed.
+    @Override public int UnimplementedMethod(int arg) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    /**
+     * @deprecated to make sure we have something in system/tools/aidl which does a compile check
+     *     of deprecated and make sure this is reflected in goldens
+     */
+    @Override public void Deprecated() throws android.os.RemoteException
+    {
+    }
+    @Override public void TestOneway() throws android.os.RemoteException
+    {
+    }
+    // Test that primitives work as parameters and return types.
+    @Override public boolean RepeatBoolean(boolean token) throws android.os.RemoteException
+    {
+      return false;
+    }
+    @Override public byte RepeatByte(byte token) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public char RepeatChar(char token) throws android.os.RemoteException
+    {
+      return '\u0000';
+    }
+    @Override public int RepeatInt(int token) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public long RepeatLong(long token) throws android.os.RemoteException
+    {
+      return 0L;
+    }
+    @Override public float RepeatFloat(float token) throws android.os.RemoteException
+    {
+      return 0.0f;
+    }
+    @Override public double RepeatDouble(double token) throws android.os.RemoteException
+    {
+      return 0.0d;
+    }
+    @Override public java.lang.String RepeatString(java.lang.String token) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public byte RepeatByteEnum(byte token) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public int RepeatIntEnum(int token) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public long RepeatLongEnum(long token) throws android.os.RemoteException
+    {
+      return 0L;
+    }
+    // Test that arrays work as parameters and return types.
+    @Override public boolean[] ReverseBoolean(boolean[] input, boolean[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public byte[] ReverseByte(byte[] input, byte[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public char[] ReverseChar(char[] input, char[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public int[] ReverseInt(int[] input, int[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public long[] ReverseLong(long[] input, long[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public float[] ReverseFloat(float[] input, float[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public double[] ReverseDouble(double[] input, double[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public java.lang.String[] ReverseString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public byte[] ReverseByteEnum(byte[] input, byte[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public int[] ReverseIntEnum(int[] input, int[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public long[] ReverseLongEnum(long[] input, long[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    // Test that clients can send and receive Binders.
+    @Override public android.aidl.tests.INamedCallback GetOtherTestService(java.lang.String name) throws android.os.RemoteException
+    {
+      return null;
+    }
+    // returns true if the same service is already registered with the same name
+    @Override public boolean SetOtherTestService(java.lang.String name, android.aidl.tests.INamedCallback service) throws android.os.RemoteException
+    {
+      return false;
+    }
+    @Override public boolean VerifyName(android.aidl.tests.INamedCallback service, java.lang.String name) throws android.os.RemoteException
+    {
+      return false;
+    }
+    @Override public android.aidl.tests.INamedCallback[] GetInterfaceArray(java.lang.String[] names) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public boolean VerifyNamesWithInterfaceArray(android.aidl.tests.INamedCallback[] services, java.lang.String[] names) throws android.os.RemoteException
+    {
+      return false;
+    }
+    @Override public android.aidl.tests.INamedCallback[] GetNullableInterfaceArray(java.lang.String[] names) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public boolean VerifyNamesWithNullableInterfaceArray(android.aidl.tests.INamedCallback[] services, java.lang.String[] names) throws android.os.RemoteException
+    {
+      return false;
+    }
+    @Override public java.util.List<android.aidl.tests.INamedCallback> GetInterfaceList(java.lang.String[] names) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public boolean VerifyNamesWithInterfaceList(java.util.List<android.aidl.tests.INamedCallback> services, java.lang.String[] names) throws android.os.RemoteException
+    {
+      return false;
+    }
+    // Test that List<T> types work correctly.
+    @Override public java.util.List<java.lang.String> ReverseStringList(java.util.List<java.lang.String> input, java.util.List<java.lang.String> repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public android.os.ParcelFileDescriptor RepeatParcelFileDescriptor(android.os.ParcelFileDescriptor read) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public android.os.ParcelFileDescriptor[] ReverseParcelFileDescriptorArray(android.os.ParcelFileDescriptor[] input, android.os.ParcelFileDescriptor[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    // Test that service specific exceptions work correctly.
+    @Override public void ThrowServiceException(int code) throws android.os.RemoteException
+    {
+    }
+    // Test nullability
+    @Override public int[] RepeatNullableIntArray(int[] input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public byte[] RepeatNullableByteEnumArray(byte[] input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public int[] RepeatNullableIntEnumArray(int[] input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public long[] RepeatNullableLongEnumArray(long[] input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public java.lang.String RepeatNullableString(java.lang.String input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public java.util.List<java.lang.String> RepeatNullableStringList(java.util.List<java.lang.String> input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public android.aidl.tests.ITestService.Empty RepeatNullableParcelable(android.aidl.tests.ITestService.Empty input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public android.aidl.tests.ITestService.Empty[] RepeatNullableParcelableArray(android.aidl.tests.ITestService.Empty[] input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public java.util.List<android.aidl.tests.ITestService.Empty> RepeatNullableParcelableList(java.util.List<android.aidl.tests.ITestService.Empty> input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public void TakesAnIBinder(android.os.IBinder input) throws android.os.RemoteException
+    {
+    }
+    @Override public void TakesANullableIBinder(android.os.IBinder input) throws android.os.RemoteException
+    {
+    }
+    @Override public void TakesAnIBinderList(java.util.List<android.os.IBinder> input) throws android.os.RemoteException
+    {
+    }
+    @Override public void TakesANullableIBinderList(java.util.List<android.os.IBinder> input) throws android.os.RemoteException
+    {
+    }
+    // Test utf8 decoding from utf16 wire format
+    @Override public java.lang.String RepeatUtf8CppString(java.lang.String token) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public java.lang.String RepeatNullableUtf8CppString(java.lang.String token) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public java.lang.String[] ReverseUtf8CppString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public java.lang.String[] ReverseNullableUtf8CppString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public java.util.List<java.lang.String> ReverseUtf8CppStringList(java.util.List<java.lang.String> input, java.util.List<java.lang.String> repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    /** comment before annotation */
+    @Override public android.aidl.tests.INamedCallback GetCallback(boolean return_null) throws android.os.RemoteException
+    {
+      return null;
+    }
+    // Since this paracelable has clearly defined default values, it would be
+    // inefficient to use an IPC to fill it out in practice.
+    @Override public void FillOutStructuredParcelable(android.aidl.tests.StructuredParcelable parcel) throws android.os.RemoteException
+    {
+    }
+    @Override public void RepeatExtendableParcelable(android.aidl.tests.extension.ExtendableParcelable ep, android.aidl.tests.extension.ExtendableParcelable ep2) throws android.os.RemoteException
+    {
+    }
+    @Override public android.aidl.tests.RecursiveList ReverseList(android.aidl.tests.RecursiveList list) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public android.os.IBinder[] ReverseIBinderArray(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public android.os.IBinder[] ReverseNullableIBinderArray(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public android.aidl.tests.IOldName GetOldNameInterface() throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public android.aidl.tests.INewName GetNewNameInterface() throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public int[] GetUnionTags(android.aidl.tests.Union[] input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    // Retrieve the ICppJavaTests if the server supports it
+    @Override public android.os.IBinder GetCppJavaTests() throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public byte getBackendType() throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public android.aidl.tests.ICircular GetCircular(android.aidl.tests.CircularParcelable cp) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Delegator implementation for ITestService. */
+  public static class Delegator extends android.aidl.tests.ITestService.Stub
+  {
+    public Delegator(android.aidl.tests.ITestService impl) {
+      this.mImpl = impl;
+    }
+    // This is to emulate a method that is added after the service is implemented.
+    // So the client cannot assume that a call to this method will be successful
+    // or not. However, inside the test environment, we can't build client and
+    // the server with different version of this AIDL file. So, we let the server
+    // actually implement this and intercept the dispatch to the method
+    // inside onTransact().
+    // WARNING: Must be first method.
+    // This requires hard coding the transaction number. As long as this method is
+    // the first in this interface, it can keep the
+    // "::android::IBinder::FIRST_CALL_TRANSACTION + 0" value and allow
+    // methods to be added and removed.
+    @Override public int UnimplementedMethod(int arg) throws android.os.RemoteException
+    {
+      return mImpl.UnimplementedMethod(arg);
+    }
+    /**
+     * @deprecated to make sure we have something in system/tools/aidl which does a compile check
+     *     of deprecated and make sure this is reflected in goldens
+     */
+    @Override public void Deprecated() throws android.os.RemoteException
+    {
+      mImpl.Deprecated();
+    }
+    @Override public void TestOneway() throws android.os.RemoteException
+    {
+      mImpl.TestOneway();
+    }
+    // Test that primitives work as parameters and return types.
+    @Override public boolean RepeatBoolean(boolean token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatBoolean(token);
+    }
+    @Override public byte RepeatByte(byte token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatByte(token);
+    }
+    @Override public char RepeatChar(char token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatChar(token);
+    }
+    @Override public int RepeatInt(int token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatInt(token);
+    }
+    @Override public long RepeatLong(long token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatLong(token);
+    }
+    @Override public float RepeatFloat(float token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatFloat(token);
+    }
+    @Override public double RepeatDouble(double token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatDouble(token);
+    }
+    @Override public java.lang.String RepeatString(java.lang.String token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatString(token);
+    }
+    @Override public byte RepeatByteEnum(byte token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatByteEnum(token);
+    }
+    @Override public int RepeatIntEnum(int token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatIntEnum(token);
+    }
+    @Override public long RepeatLongEnum(long token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatLongEnum(token);
+    }
+    // Test that arrays work as parameters and return types.
+    @Override public boolean[] ReverseBoolean(boolean[] input, boolean[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseBoolean(input,repeated);
+    }
+    @Override public byte[] ReverseByte(byte[] input, byte[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseByte(input,repeated);
+    }
+    @Override public char[] ReverseChar(char[] input, char[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseChar(input,repeated);
+    }
+    @Override public int[] ReverseInt(int[] input, int[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseInt(input,repeated);
+    }
+    @Override public long[] ReverseLong(long[] input, long[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseLong(input,repeated);
+    }
+    @Override public float[] ReverseFloat(float[] input, float[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseFloat(input,repeated);
+    }
+    @Override public double[] ReverseDouble(double[] input, double[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseDouble(input,repeated);
+    }
+    @Override public java.lang.String[] ReverseString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseString(input,repeated);
+    }
+    @Override public byte[] ReverseByteEnum(byte[] input, byte[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseByteEnum(input,repeated);
+    }
+    @Override public int[] ReverseIntEnum(int[] input, int[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseIntEnum(input,repeated);
+    }
+    @Override public long[] ReverseLongEnum(long[] input, long[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseLongEnum(input,repeated);
+    }
+    // Test that clients can send and receive Binders.
+    @Override public android.aidl.tests.INamedCallback GetOtherTestService(java.lang.String name) throws android.os.RemoteException
+    {
+      return mImpl.GetOtherTestService(name);
+    }
+    // returns true if the same service is already registered with the same name
+    @Override public boolean SetOtherTestService(java.lang.String name, android.aidl.tests.INamedCallback service) throws android.os.RemoteException
+    {
+      return mImpl.SetOtherTestService(name,service);
+    }
+    @Override public boolean VerifyName(android.aidl.tests.INamedCallback service, java.lang.String name) throws android.os.RemoteException
+    {
+      return mImpl.VerifyName(service,name);
+    }
+    @Override public android.aidl.tests.INamedCallback[] GetInterfaceArray(java.lang.String[] names) throws android.os.RemoteException
+    {
+      return mImpl.GetInterfaceArray(names);
+    }
+    @Override public boolean VerifyNamesWithInterfaceArray(android.aidl.tests.INamedCallback[] services, java.lang.String[] names) throws android.os.RemoteException
+    {
+      return mImpl.VerifyNamesWithInterfaceArray(services,names);
+    }
+    @Override public android.aidl.tests.INamedCallback[] GetNullableInterfaceArray(java.lang.String[] names) throws android.os.RemoteException
+    {
+      return mImpl.GetNullableInterfaceArray(names);
+    }
+    @Override public boolean VerifyNamesWithNullableInterfaceArray(android.aidl.tests.INamedCallback[] services, java.lang.String[] names) throws android.os.RemoteException
+    {
+      return mImpl.VerifyNamesWithNullableInterfaceArray(services,names);
+    }
+    @Override public java.util.List<android.aidl.tests.INamedCallback> GetInterfaceList(java.lang.String[] names) throws android.os.RemoteException
+    {
+      return mImpl.GetInterfaceList(names);
+    }
+    @Override public boolean VerifyNamesWithInterfaceList(java.util.List<android.aidl.tests.INamedCallback> services, java.lang.String[] names) throws android.os.RemoteException
+    {
+      return mImpl.VerifyNamesWithInterfaceList(services,names);
+    }
+    // Test that List<T> types work correctly.
+    @Override public java.util.List<java.lang.String> ReverseStringList(java.util.List<java.lang.String> input, java.util.List<java.lang.String> repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseStringList(input,repeated);
+    }
+    @Override public android.os.ParcelFileDescriptor RepeatParcelFileDescriptor(android.os.ParcelFileDescriptor read) throws android.os.RemoteException
+    {
+      return mImpl.RepeatParcelFileDescriptor(read);
+    }
+    @Override public android.os.ParcelFileDescriptor[] ReverseParcelFileDescriptorArray(android.os.ParcelFileDescriptor[] input, android.os.ParcelFileDescriptor[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseParcelFileDescriptorArray(input,repeated);
+    }
+    // Test that service specific exceptions work correctly.
+    @Override public void ThrowServiceException(int code) throws android.os.RemoteException
+    {
+      mImpl.ThrowServiceException(code);
+    }
+    // Test nullability
+    @Override public int[] RepeatNullableIntArray(int[] input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableIntArray(input);
+    }
+    @Override public byte[] RepeatNullableByteEnumArray(byte[] input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableByteEnumArray(input);
+    }
+    @Override public int[] RepeatNullableIntEnumArray(int[] input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableIntEnumArray(input);
+    }
+    @Override public long[] RepeatNullableLongEnumArray(long[] input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableLongEnumArray(input);
+    }
+    @Override public java.lang.String RepeatNullableString(java.lang.String input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableString(input);
+    }
+    @Override public java.util.List<java.lang.String> RepeatNullableStringList(java.util.List<java.lang.String> input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableStringList(input);
+    }
+    @Override public android.aidl.tests.ITestService.Empty RepeatNullableParcelable(android.aidl.tests.ITestService.Empty input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableParcelable(input);
+    }
+    @Override public android.aidl.tests.ITestService.Empty[] RepeatNullableParcelableArray(android.aidl.tests.ITestService.Empty[] input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableParcelableArray(input);
+    }
+    @Override public java.util.List<android.aidl.tests.ITestService.Empty> RepeatNullableParcelableList(java.util.List<android.aidl.tests.ITestService.Empty> input) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableParcelableList(input);
+    }
+    @Override public void TakesAnIBinder(android.os.IBinder input) throws android.os.RemoteException
+    {
+      mImpl.TakesAnIBinder(input);
+    }
+    @Override public void TakesANullableIBinder(android.os.IBinder input) throws android.os.RemoteException
+    {
+      mImpl.TakesANullableIBinder(input);
+    }
+    @Override public void TakesAnIBinderList(java.util.List<android.os.IBinder> input) throws android.os.RemoteException
+    {
+      mImpl.TakesAnIBinderList(input);
+    }
+    @Override public void TakesANullableIBinderList(java.util.List<android.os.IBinder> input) throws android.os.RemoteException
+    {
+      mImpl.TakesANullableIBinderList(input);
+    }
+    // Test utf8 decoding from utf16 wire format
+    @Override public java.lang.String RepeatUtf8CppString(java.lang.String token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatUtf8CppString(token);
+    }
+    @Override public java.lang.String RepeatNullableUtf8CppString(java.lang.String token) throws android.os.RemoteException
+    {
+      return mImpl.RepeatNullableUtf8CppString(token);
+    }
+    @Override public java.lang.String[] ReverseUtf8CppString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseUtf8CppString(input,repeated);
+    }
+    @Override public java.lang.String[] ReverseNullableUtf8CppString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseNullableUtf8CppString(input,repeated);
+    }
+    @Override public java.util.List<java.lang.String> ReverseUtf8CppStringList(java.util.List<java.lang.String> input, java.util.List<java.lang.String> repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseUtf8CppStringList(input,repeated);
+    }
+    /** comment before annotation */
+    @Override public android.aidl.tests.INamedCallback GetCallback(boolean return_null) throws android.os.RemoteException
+    {
+      return mImpl.GetCallback(return_null);
+    }
+    // Since this paracelable has clearly defined default values, it would be
+    // inefficient to use an IPC to fill it out in practice.
+    @Override public void FillOutStructuredParcelable(android.aidl.tests.StructuredParcelable parcel) throws android.os.RemoteException
+    {
+      mImpl.FillOutStructuredParcelable(parcel);
+    }
+    @Override public void RepeatExtendableParcelable(android.aidl.tests.extension.ExtendableParcelable ep, android.aidl.tests.extension.ExtendableParcelable ep2) throws android.os.RemoteException
+    {
+      mImpl.RepeatExtendableParcelable(ep,ep2);
+    }
+    @Override public android.aidl.tests.RecursiveList ReverseList(android.aidl.tests.RecursiveList list) throws android.os.RemoteException
+    {
+      return mImpl.ReverseList(list);
+    }
+    @Override public android.os.IBinder[] ReverseIBinderArray(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseIBinderArray(input,repeated);
+    }
+    @Override public android.os.IBinder[] ReverseNullableIBinderArray(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException
+    {
+      return mImpl.ReverseNullableIBinderArray(input,repeated);
+    }
+    @Override public android.aidl.tests.IOldName GetOldNameInterface() throws android.os.RemoteException
+    {
+      return mImpl.GetOldNameInterface();
+    }
+    @Override public android.aidl.tests.INewName GetNewNameInterface() throws android.os.RemoteException
+    {
+      return mImpl.GetNewNameInterface();
+    }
+    @Override public int[] GetUnionTags(android.aidl.tests.Union[] input) throws android.os.RemoteException
+    {
+      return mImpl.GetUnionTags(input);
+    }
+    // Retrieve the ICppJavaTests if the server supports it
+    @Override public android.os.IBinder GetCppJavaTests() throws android.os.RemoteException
+    {
+      return mImpl.GetCppJavaTests();
+    }
+    @Override public byte getBackendType() throws android.os.RemoteException
+    {
+      return mImpl.getBackendType();
+    }
+    @Override public android.aidl.tests.ICircular GetCircular(android.aidl.tests.CircularParcelable cp) throws android.os.RemoteException
+    {
+      return mImpl.GetCircular(cp);
+    }
+    android.aidl.tests.ITestService mImpl;
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ITestService
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.ITestService interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.ITestService asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.ITestService))) {
+        return ((android.aidl.tests.ITestService)iin);
+      }
+      return new android.aidl.tests.ITestService.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_UnimplementedMethod:
+        {
+          return "UnimplementedMethod";
+        }
+        case TRANSACTION_Deprecated:
+        {
+          return "Deprecated";
+        }
+        case TRANSACTION_TestOneway:
+        {
+          return "TestOneway";
+        }
+        case TRANSACTION_RepeatBoolean:
+        {
+          return "RepeatBoolean";
+        }
+        case TRANSACTION_RepeatByte:
+        {
+          return "RepeatByte";
+        }
+        case TRANSACTION_RepeatChar:
+        {
+          return "RepeatChar";
+        }
+        case TRANSACTION_RepeatInt:
+        {
+          return "RepeatInt";
+        }
+        case TRANSACTION_RepeatLong:
+        {
+          return "RepeatLong";
+        }
+        case TRANSACTION_RepeatFloat:
+        {
+          return "RepeatFloat";
+        }
+        case TRANSACTION_RepeatDouble:
+        {
+          return "RepeatDouble";
+        }
+        case TRANSACTION_RepeatString:
+        {
+          return "RepeatString";
+        }
+        case TRANSACTION_RepeatByteEnum:
+        {
+          return "RepeatByteEnum";
+        }
+        case TRANSACTION_RepeatIntEnum:
+        {
+          return "RepeatIntEnum";
+        }
+        case TRANSACTION_RepeatLongEnum:
+        {
+          return "RepeatLongEnum";
+        }
+        case TRANSACTION_ReverseBoolean:
+        {
+          return "ReverseBoolean";
+        }
+        case TRANSACTION_ReverseByte:
+        {
+          return "ReverseByte";
+        }
+        case TRANSACTION_ReverseChar:
+        {
+          return "ReverseChar";
+        }
+        case TRANSACTION_ReverseInt:
+        {
+          return "ReverseInt";
+        }
+        case TRANSACTION_ReverseLong:
+        {
+          return "ReverseLong";
+        }
+        case TRANSACTION_ReverseFloat:
+        {
+          return "ReverseFloat";
+        }
+        case TRANSACTION_ReverseDouble:
+        {
+          return "ReverseDouble";
+        }
+        case TRANSACTION_ReverseString:
+        {
+          return "ReverseString";
+        }
+        case TRANSACTION_ReverseByteEnum:
+        {
+          return "ReverseByteEnum";
+        }
+        case TRANSACTION_ReverseIntEnum:
+        {
+          return "ReverseIntEnum";
+        }
+        case TRANSACTION_ReverseLongEnum:
+        {
+          return "ReverseLongEnum";
+        }
+        case TRANSACTION_GetOtherTestService:
+        {
+          return "GetOtherTestService";
+        }
+        case TRANSACTION_SetOtherTestService:
+        {
+          return "SetOtherTestService";
+        }
+        case TRANSACTION_VerifyName:
+        {
+          return "VerifyName";
+        }
+        case TRANSACTION_GetInterfaceArray:
+        {
+          return "GetInterfaceArray";
+        }
+        case TRANSACTION_VerifyNamesWithInterfaceArray:
+        {
+          return "VerifyNamesWithInterfaceArray";
+        }
+        case TRANSACTION_GetNullableInterfaceArray:
+        {
+          return "GetNullableInterfaceArray";
+        }
+        case TRANSACTION_VerifyNamesWithNullableInterfaceArray:
+        {
+          return "VerifyNamesWithNullableInterfaceArray";
+        }
+        case TRANSACTION_GetInterfaceList:
+        {
+          return "GetInterfaceList";
+        }
+        case TRANSACTION_VerifyNamesWithInterfaceList:
+        {
+          return "VerifyNamesWithInterfaceList";
+        }
+        case TRANSACTION_ReverseStringList:
+        {
+          return "ReverseStringList";
+        }
+        case TRANSACTION_RepeatParcelFileDescriptor:
+        {
+          return "RepeatParcelFileDescriptor";
+        }
+        case TRANSACTION_ReverseParcelFileDescriptorArray:
+        {
+          return "ReverseParcelFileDescriptorArray";
+        }
+        case TRANSACTION_ThrowServiceException:
+        {
+          return "ThrowServiceException";
+        }
+        case TRANSACTION_RepeatNullableIntArray:
+        {
+          return "RepeatNullableIntArray";
+        }
+        case TRANSACTION_RepeatNullableByteEnumArray:
+        {
+          return "RepeatNullableByteEnumArray";
+        }
+        case TRANSACTION_RepeatNullableIntEnumArray:
+        {
+          return "RepeatNullableIntEnumArray";
+        }
+        case TRANSACTION_RepeatNullableLongEnumArray:
+        {
+          return "RepeatNullableLongEnumArray";
+        }
+        case TRANSACTION_RepeatNullableString:
+        {
+          return "RepeatNullableString";
+        }
+        case TRANSACTION_RepeatNullableStringList:
+        {
+          return "RepeatNullableStringList";
+        }
+        case TRANSACTION_RepeatNullableParcelable:
+        {
+          return "RepeatNullableParcelable";
+        }
+        case TRANSACTION_RepeatNullableParcelableArray:
+        {
+          return "RepeatNullableParcelableArray";
+        }
+        case TRANSACTION_RepeatNullableParcelableList:
+        {
+          return "RepeatNullableParcelableList";
+        }
+        case TRANSACTION_TakesAnIBinder:
+        {
+          return "TakesAnIBinder";
+        }
+        case TRANSACTION_TakesANullableIBinder:
+        {
+          return "TakesANullableIBinder";
+        }
+        case TRANSACTION_TakesAnIBinderList:
+        {
+          return "TakesAnIBinderList";
+        }
+        case TRANSACTION_TakesANullableIBinderList:
+        {
+          return "TakesANullableIBinderList";
+        }
+        case TRANSACTION_RepeatUtf8CppString:
+        {
+          return "RepeatUtf8CppString";
+        }
+        case TRANSACTION_RepeatNullableUtf8CppString:
+        {
+          return "RepeatNullableUtf8CppString";
+        }
+        case TRANSACTION_ReverseUtf8CppString:
+        {
+          return "ReverseUtf8CppString";
+        }
+        case TRANSACTION_ReverseNullableUtf8CppString:
+        {
+          return "ReverseNullableUtf8CppString";
+        }
+        case TRANSACTION_ReverseUtf8CppStringList:
+        {
+          return "ReverseUtf8CppStringList";
+        }
+        case TRANSACTION_GetCallback:
+        {
+          return "GetCallback";
+        }
+        case TRANSACTION_FillOutStructuredParcelable:
+        {
+          return "FillOutStructuredParcelable";
+        }
+        case TRANSACTION_RepeatExtendableParcelable:
+        {
+          return "RepeatExtendableParcelable";
+        }
+        case TRANSACTION_ReverseList:
+        {
+          return "ReverseList";
+        }
+        case TRANSACTION_ReverseIBinderArray:
+        {
+          return "ReverseIBinderArray";
+        }
+        case TRANSACTION_ReverseNullableIBinderArray:
+        {
+          return "ReverseNullableIBinderArray";
+        }
+        case TRANSACTION_GetOldNameInterface:
+        {
+          return "GetOldNameInterface";
+        }
+        case TRANSACTION_GetNewNameInterface:
+        {
+          return "GetNewNameInterface";
+        }
+        case TRANSACTION_GetUnionTags:
+        {
+          return "GetUnionTags";
+        }
+        case TRANSACTION_GetCppJavaTests:
+        {
+          return "GetCppJavaTests";
+        }
+        case TRANSACTION_getBackendType:
+        {
+          return "getBackendType";
+        }
+        case TRANSACTION_GetCircular:
+        {
+          return "GetCircular";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_UnimplementedMethod:
+        {
+          int _arg0;
+          _arg0 = data.readInt();
+          data.enforceNoDataAvail();
+          int _result = this.UnimplementedMethod(_arg0);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          break;
+        }
+        case TRANSACTION_Deprecated:
+        {
+          this.Deprecated();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_TestOneway:
+        {
+          this.TestOneway();
+          break;
+        }
+        case TRANSACTION_RepeatBoolean:
+        {
+          boolean _arg0;
+          _arg0 = data.readBoolean();
+          data.enforceNoDataAvail();
+          boolean _result = this.RepeatBoolean(_arg0);
+          reply.writeNoException();
+          reply.writeBoolean(_result);
+          break;
+        }
+        case TRANSACTION_RepeatByte:
+        {
+          byte _arg0;
+          _arg0 = data.readByte();
+          data.enforceNoDataAvail();
+          byte _result = this.RepeatByte(_arg0);
+          reply.writeNoException();
+          reply.writeByte(_result);
+          break;
+        }
+        case TRANSACTION_RepeatChar:
+        {
+          char _arg0;
+          _arg0 = (char)data.readInt();
+          data.enforceNoDataAvail();
+          char _result = this.RepeatChar(_arg0);
+          reply.writeNoException();
+          reply.writeInt(((int)_result));
+          break;
+        }
+        case TRANSACTION_RepeatInt:
+        {
+          int _arg0;
+          _arg0 = data.readInt();
+          data.enforceNoDataAvail();
+          int _result = this.RepeatInt(_arg0);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          break;
+        }
+        case TRANSACTION_RepeatLong:
+        {
+          long _arg0;
+          _arg0 = data.readLong();
+          data.enforceNoDataAvail();
+          long _result = this.RepeatLong(_arg0);
+          reply.writeNoException();
+          reply.writeLong(_result);
+          break;
+        }
+        case TRANSACTION_RepeatFloat:
+        {
+          float _arg0;
+          _arg0 = data.readFloat();
+          data.enforceNoDataAvail();
+          float _result = this.RepeatFloat(_arg0);
+          reply.writeNoException();
+          reply.writeFloat(_result);
+          break;
+        }
+        case TRANSACTION_RepeatDouble:
+        {
+          double _arg0;
+          _arg0 = data.readDouble();
+          data.enforceNoDataAvail();
+          double _result = this.RepeatDouble(_arg0);
+          reply.writeNoException();
+          reply.writeDouble(_result);
+          break;
+        }
+        case TRANSACTION_RepeatString:
+        {
+          java.lang.String _arg0;
+          _arg0 = data.readString();
+          data.enforceNoDataAvail();
+          java.lang.String _result = this.RepeatString(_arg0);
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        case TRANSACTION_RepeatByteEnum:
+        {
+          byte _arg0;
+          _arg0 = data.readByte();
+          data.enforceNoDataAvail();
+          byte _result = this.RepeatByteEnum(_arg0);
+          reply.writeNoException();
+          reply.writeByte(_result);
+          break;
+        }
+        case TRANSACTION_RepeatIntEnum:
+        {
+          int _arg0;
+          _arg0 = data.readInt();
+          data.enforceNoDataAvail();
+          int _result = this.RepeatIntEnum(_arg0);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          break;
+        }
+        case TRANSACTION_RepeatLongEnum:
+        {
+          long _arg0;
+          _arg0 = data.readLong();
+          data.enforceNoDataAvail();
+          long _result = this.RepeatLongEnum(_arg0);
+          reply.writeNoException();
+          reply.writeLong(_result);
+          break;
+        }
+        case TRANSACTION_ReverseBoolean:
+        {
+          boolean[] _arg0;
+          _arg0 = data.createBooleanArray();
+          boolean[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new boolean[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          boolean[] _result = this.ReverseBoolean(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeBooleanArray(_result);
+          reply.writeBooleanArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseByte:
+        {
+          byte[] _arg0;
+          _arg0 = data.createByteArray();
+          byte[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new byte[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          byte[] _result = this.ReverseByte(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeByteArray(_result);
+          reply.writeByteArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseChar:
+        {
+          char[] _arg0;
+          _arg0 = data.createCharArray();
+          char[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new char[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          char[] _result = this.ReverseChar(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeCharArray(_result);
+          reply.writeCharArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseInt:
+        {
+          int[] _arg0;
+          _arg0 = data.createIntArray();
+          int[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new int[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          int[] _result = this.ReverseInt(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeIntArray(_result);
+          reply.writeIntArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseLong:
+        {
+          long[] _arg0;
+          _arg0 = data.createLongArray();
+          long[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new long[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          long[] _result = this.ReverseLong(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeLongArray(_result);
+          reply.writeLongArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseFloat:
+        {
+          float[] _arg0;
+          _arg0 = data.createFloatArray();
+          float[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new float[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          float[] _result = this.ReverseFloat(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeFloatArray(_result);
+          reply.writeFloatArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseDouble:
+        {
+          double[] _arg0;
+          _arg0 = data.createDoubleArray();
+          double[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new double[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          double[] _result = this.ReverseDouble(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeDoubleArray(_result);
+          reply.writeDoubleArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseString:
+        {
+          java.lang.String[] _arg0;
+          _arg0 = data.createStringArray();
+          java.lang.String[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new java.lang.String[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          java.lang.String[] _result = this.ReverseString(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeStringArray(_result);
+          reply.writeStringArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseByteEnum:
+        {
+          byte[] _arg0;
+          _arg0 = data.createByteArray();
+          byte[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new byte[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          byte[] _result = this.ReverseByteEnum(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeByteArray(_result);
+          reply.writeByteArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseIntEnum:
+        {
+          int[] _arg0;
+          _arg0 = data.createIntArray();
+          int[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new int[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          int[] _result = this.ReverseIntEnum(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeIntArray(_result);
+          reply.writeIntArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseLongEnum:
+        {
+          long[] _arg0;
+          _arg0 = data.createLongArray();
+          long[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new long[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          long[] _result = this.ReverseLongEnum(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeLongArray(_result);
+          reply.writeLongArray(_arg1);
+          break;
+        }
+        case TRANSACTION_GetOtherTestService:
+        {
+          java.lang.String _arg0;
+          _arg0 = data.readString();
+          data.enforceNoDataAvail();
+          android.aidl.tests.INamedCallback _result = this.GetOtherTestService(_arg0);
+          reply.writeNoException();
+          reply.writeStrongInterface(_result);
+          break;
+        }
+        case TRANSACTION_SetOtherTestService:
+        {
+          java.lang.String _arg0;
+          _arg0 = data.readString();
+          android.aidl.tests.INamedCallback _arg1;
+          _arg1 = android.aidl.tests.INamedCallback.Stub.asInterface(data.readStrongBinder());
+          data.enforceNoDataAvail();
+          boolean _result = this.SetOtherTestService(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeBoolean(_result);
+          break;
+        }
+        case TRANSACTION_VerifyName:
+        {
+          android.aidl.tests.INamedCallback _arg0;
+          _arg0 = android.aidl.tests.INamedCallback.Stub.asInterface(data.readStrongBinder());
+          java.lang.String _arg1;
+          _arg1 = data.readString();
+          data.enforceNoDataAvail();
+          boolean _result = this.VerifyName(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeBoolean(_result);
+          break;
+        }
+        case TRANSACTION_GetInterfaceArray:
+        {
+          java.lang.String[] _arg0;
+          _arg0 = data.createStringArray();
+          data.enforceNoDataAvail();
+          android.aidl.tests.INamedCallback[] _result = this.GetInterfaceArray(_arg0);
+          reply.writeNoException();
+          reply.writeInterfaceArray(_result);
+          break;
+        }
+        case TRANSACTION_VerifyNamesWithInterfaceArray:
+        {
+          android.aidl.tests.INamedCallback[] _arg0;
+          _arg0 = data.createInterfaceArray(android.aidl.tests.INamedCallback[]::new, android.aidl.tests.INamedCallback.Stub::asInterface);
+          java.lang.String[] _arg1;
+          _arg1 = data.createStringArray();
+          data.enforceNoDataAvail();
+          boolean _result = this.VerifyNamesWithInterfaceArray(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeBoolean(_result);
+          break;
+        }
+        case TRANSACTION_GetNullableInterfaceArray:
+        {
+          java.lang.String[] _arg0;
+          _arg0 = data.createStringArray();
+          data.enforceNoDataAvail();
+          android.aidl.tests.INamedCallback[] _result = this.GetNullableInterfaceArray(_arg0);
+          reply.writeNoException();
+          reply.writeInterfaceArray(_result);
+          break;
+        }
+        case TRANSACTION_VerifyNamesWithNullableInterfaceArray:
+        {
+          android.aidl.tests.INamedCallback[] _arg0;
+          _arg0 = data.createInterfaceArray(android.aidl.tests.INamedCallback[]::new, android.aidl.tests.INamedCallback.Stub::asInterface);
+          java.lang.String[] _arg1;
+          _arg1 = data.createStringArray();
+          data.enforceNoDataAvail();
+          boolean _result = this.VerifyNamesWithNullableInterfaceArray(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeBoolean(_result);
+          break;
+        }
+        case TRANSACTION_GetInterfaceList:
+        {
+          java.lang.String[] _arg0;
+          _arg0 = data.createStringArray();
+          data.enforceNoDataAvail();
+          java.util.List<android.aidl.tests.INamedCallback> _result = this.GetInterfaceList(_arg0);
+          reply.writeNoException();
+          reply.writeInterfaceList(_result);
+          break;
+        }
+        case TRANSACTION_VerifyNamesWithInterfaceList:
+        {
+          java.util.List<android.aidl.tests.INamedCallback> _arg0;
+          _arg0 = data.createInterfaceArrayList(android.aidl.tests.INamedCallback.Stub::asInterface);
+          java.lang.String[] _arg1;
+          _arg1 = data.createStringArray();
+          data.enforceNoDataAvail();
+          boolean _result = this.VerifyNamesWithInterfaceList(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeBoolean(_result);
+          break;
+        }
+        case TRANSACTION_ReverseStringList:
+        {
+          java.util.List<java.lang.String> _arg0;
+          _arg0 = data.createStringArrayList();
+          java.util.List<java.lang.String> _arg1;
+          _arg1 = new java.util.ArrayList<java.lang.String>();
+          data.enforceNoDataAvail();
+          java.util.List<java.lang.String> _result = this.ReverseStringList(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeStringList(_result);
+          reply.writeStringList(_arg1);
+          break;
+        }
+        case TRANSACTION_RepeatParcelFileDescriptor:
+        {
+          android.os.ParcelFileDescriptor _arg0;
+          _arg0 = data.readTypedObject(android.os.ParcelFileDescriptor.CREATOR);
+          data.enforceNoDataAvail();
+          android.os.ParcelFileDescriptor _result = this.RepeatParcelFileDescriptor(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_ReverseParcelFileDescriptorArray:
+        {
+          android.os.ParcelFileDescriptor[] _arg0;
+          _arg0 = data.createTypedArray(android.os.ParcelFileDescriptor.CREATOR);
+          android.os.ParcelFileDescriptor[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new android.os.ParcelFileDescriptor[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          android.os.ParcelFileDescriptor[] _result = this.ReverseParcelFileDescriptorArray(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          reply.writeTypedArray(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_ThrowServiceException:
+        {
+          int _arg0;
+          _arg0 = data.readInt();
+          data.enforceNoDataAvail();
+          this.ThrowServiceException(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_RepeatNullableIntArray:
+        {
+          int[] _arg0;
+          _arg0 = data.createIntArray();
+          data.enforceNoDataAvail();
+          int[] _result = this.RepeatNullableIntArray(_arg0);
+          reply.writeNoException();
+          reply.writeIntArray(_result);
+          break;
+        }
+        case TRANSACTION_RepeatNullableByteEnumArray:
+        {
+          byte[] _arg0;
+          _arg0 = data.createByteArray();
+          data.enforceNoDataAvail();
+          byte[] _result = this.RepeatNullableByteEnumArray(_arg0);
+          reply.writeNoException();
+          reply.writeByteArray(_result);
+          break;
+        }
+        case TRANSACTION_RepeatNullableIntEnumArray:
+        {
+          int[] _arg0;
+          _arg0 = data.createIntArray();
+          data.enforceNoDataAvail();
+          int[] _result = this.RepeatNullableIntEnumArray(_arg0);
+          reply.writeNoException();
+          reply.writeIntArray(_result);
+          break;
+        }
+        case TRANSACTION_RepeatNullableLongEnumArray:
+        {
+          long[] _arg0;
+          _arg0 = data.createLongArray();
+          data.enforceNoDataAvail();
+          long[] _result = this.RepeatNullableLongEnumArray(_arg0);
+          reply.writeNoException();
+          reply.writeLongArray(_result);
+          break;
+        }
+        case TRANSACTION_RepeatNullableString:
+        {
+          java.lang.String _arg0;
+          _arg0 = data.readString();
+          data.enforceNoDataAvail();
+          java.lang.String _result = this.RepeatNullableString(_arg0);
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        case TRANSACTION_RepeatNullableStringList:
+        {
+          java.util.List<java.lang.String> _arg0;
+          _arg0 = data.createStringArrayList();
+          data.enforceNoDataAvail();
+          java.util.List<java.lang.String> _result = this.RepeatNullableStringList(_arg0);
+          reply.writeNoException();
+          reply.writeStringList(_result);
+          break;
+        }
+        case TRANSACTION_RepeatNullableParcelable:
+        {
+          android.aidl.tests.ITestService.Empty _arg0;
+          _arg0 = data.readTypedObject(android.aidl.tests.ITestService.Empty.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.tests.ITestService.Empty _result = this.RepeatNullableParcelable(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_RepeatNullableParcelableArray:
+        {
+          android.aidl.tests.ITestService.Empty[] _arg0;
+          _arg0 = data.createTypedArray(android.aidl.tests.ITestService.Empty.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.tests.ITestService.Empty[] _result = this.RepeatNullableParcelableArray(_arg0);
+          reply.writeNoException();
+          reply.writeTypedArray(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_RepeatNullableParcelableList:
+        {
+          java.util.List<android.aidl.tests.ITestService.Empty> _arg0;
+          _arg0 = data.createTypedArrayList(android.aidl.tests.ITestService.Empty.CREATOR);
+          data.enforceNoDataAvail();
+          java.util.List<android.aidl.tests.ITestService.Empty> _result = this.RepeatNullableParcelableList(_arg0);
+          reply.writeNoException();
+          reply.writeTypedList(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_TakesAnIBinder:
+        {
+          android.os.IBinder _arg0;
+          _arg0 = data.readStrongBinder();
+          data.enforceNoDataAvail();
+          this.TakesAnIBinder(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_TakesANullableIBinder:
+        {
+          android.os.IBinder _arg0;
+          _arg0 = data.readStrongBinder();
+          data.enforceNoDataAvail();
+          this.TakesANullableIBinder(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_TakesAnIBinderList:
+        {
+          java.util.List<android.os.IBinder> _arg0;
+          _arg0 = data.createBinderArrayList();
+          data.enforceNoDataAvail();
+          this.TakesAnIBinderList(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_TakesANullableIBinderList:
+        {
+          java.util.List<android.os.IBinder> _arg0;
+          _arg0 = data.createBinderArrayList();
+          data.enforceNoDataAvail();
+          this.TakesANullableIBinderList(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_RepeatUtf8CppString:
+        {
+          java.lang.String _arg0;
+          _arg0 = data.readString();
+          data.enforceNoDataAvail();
+          java.lang.String _result = this.RepeatUtf8CppString(_arg0);
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        case TRANSACTION_RepeatNullableUtf8CppString:
+        {
+          java.lang.String _arg0;
+          _arg0 = data.readString();
+          data.enforceNoDataAvail();
+          java.lang.String _result = this.RepeatNullableUtf8CppString(_arg0);
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        case TRANSACTION_ReverseUtf8CppString:
+        {
+          java.lang.String[] _arg0;
+          _arg0 = data.createStringArray();
+          java.lang.String[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new java.lang.String[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          java.lang.String[] _result = this.ReverseUtf8CppString(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeStringArray(_result);
+          reply.writeStringArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseNullableUtf8CppString:
+        {
+          java.lang.String[] _arg0;
+          _arg0 = data.createStringArray();
+          java.lang.String[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new java.lang.String[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          java.lang.String[] _result = this.ReverseNullableUtf8CppString(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeStringArray(_result);
+          reply.writeStringArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseUtf8CppStringList:
+        {
+          java.util.List<java.lang.String> _arg0;
+          _arg0 = data.createStringArrayList();
+          java.util.List<java.lang.String> _arg1;
+          _arg1 = new java.util.ArrayList<java.lang.String>();
+          data.enforceNoDataAvail();
+          java.util.List<java.lang.String> _result = this.ReverseUtf8CppStringList(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeStringList(_result);
+          reply.writeStringList(_arg1);
+          break;
+        }
+        case TRANSACTION_GetCallback:
+        {
+          boolean _arg0;
+          _arg0 = data.readBoolean();
+          data.enforceNoDataAvail();
+          android.aidl.tests.INamedCallback _result = this.GetCallback(_arg0);
+          reply.writeNoException();
+          reply.writeStrongInterface(_result);
+          break;
+        }
+        case TRANSACTION_FillOutStructuredParcelable:
+        {
+          android.aidl.tests.StructuredParcelable _arg0;
+          _arg0 = data.readTypedObject(android.aidl.tests.StructuredParcelable.CREATOR);
+          data.enforceNoDataAvail();
+          this.FillOutStructuredParcelable(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_arg0, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_RepeatExtendableParcelable:
+        {
+          android.aidl.tests.extension.ExtendableParcelable _arg0;
+          _arg0 = data.readTypedObject(android.aidl.tests.extension.ExtendableParcelable.CREATOR);
+          android.aidl.tests.extension.ExtendableParcelable _arg1;
+          _arg1 = new android.aidl.tests.extension.ExtendableParcelable();
+          data.enforceNoDataAvail();
+          this.RepeatExtendableParcelable(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeTypedObject(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_ReverseList:
+        {
+          android.aidl.tests.RecursiveList _arg0;
+          _arg0 = data.readTypedObject(android.aidl.tests.RecursiveList.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.tests.RecursiveList _result = this.ReverseList(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_ReverseIBinderArray:
+        {
+          android.os.IBinder[] _arg0;
+          _arg0 = data.createBinderArray();
+          android.os.IBinder[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new android.os.IBinder[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          android.os.IBinder[] _result = this.ReverseIBinderArray(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeBinderArray(_result);
+          reply.writeBinderArray(_arg1);
+          break;
+        }
+        case TRANSACTION_ReverseNullableIBinderArray:
+        {
+          android.os.IBinder[] _arg0;
+          _arg0 = data.createBinderArray();
+          android.os.IBinder[] _arg1;
+          int _arg1_length = data.readInt();
+          if (_arg1_length < 0) {
+            _arg1 = null;
+          } else {
+            _arg1 = new android.os.IBinder[_arg1_length];
+          }
+          data.enforceNoDataAvail();
+          android.os.IBinder[] _result = this.ReverseNullableIBinderArray(_arg0, _arg1);
+          reply.writeNoException();
+          reply.writeBinderArray(_result);
+          reply.writeBinderArray(_arg1);
+          break;
+        }
+        case TRANSACTION_GetOldNameInterface:
+        {
+          android.aidl.tests.IOldName _result = this.GetOldNameInterface();
+          reply.writeNoException();
+          reply.writeStrongInterface(_result);
+          break;
+        }
+        case TRANSACTION_GetNewNameInterface:
+        {
+          android.aidl.tests.INewName _result = this.GetNewNameInterface();
+          reply.writeNoException();
+          reply.writeStrongInterface(_result);
+          break;
+        }
+        case TRANSACTION_GetUnionTags:
+        {
+          android.aidl.tests.Union[] _arg0;
+          _arg0 = data.createTypedArray(android.aidl.tests.Union.CREATOR);
+          data.enforceNoDataAvail();
+          int[] _result = this.GetUnionTags(_arg0);
+          reply.writeNoException();
+          reply.writeIntArray(_result);
+          break;
+        }
+        case TRANSACTION_GetCppJavaTests:
+        {
+          android.os.IBinder _result = this.GetCppJavaTests();
+          reply.writeNoException();
+          reply.writeStrongBinder(_result);
+          break;
+        }
+        case TRANSACTION_getBackendType:
+        {
+          byte _result = this.getBackendType();
+          reply.writeNoException();
+          reply.writeByte(_result);
+          break;
+        }
+        case TRANSACTION_GetCircular:
+        {
+          android.aidl.tests.CircularParcelable _arg0;
+          _arg0 = new android.aidl.tests.CircularParcelable();
+          data.enforceNoDataAvail();
+          android.aidl.tests.ICircular _result = this.GetCircular(_arg0);
+          reply.writeNoException();
+          reply.writeStrongInterface(_result);
+          reply.writeTypedObject(_arg0, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.ITestService
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      // This is to emulate a method that is added after the service is implemented.
+      // So the client cannot assume that a call to this method will be successful
+      // or not. However, inside the test environment, we can't build client and
+      // the server with different version of this AIDL file. So, we let the server
+      // actually implement this and intercept the dispatch to the method
+      // inside onTransact().
+      // WARNING: Must be first method.
+      // This requires hard coding the transaction number. As long as this method is
+      // the first in this interface, it can keep the
+      // "::android::IBinder::FIRST_CALL_TRANSACTION + 0" value and allow
+      // methods to be added and removed.
+      @Override public int UnimplementedMethod(int arg) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeInt(arg);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_UnimplementedMethod, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().UnimplementedMethod(arg);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      /**
+       * @deprecated to make sure we have something in system/tools/aidl which does a compile check
+       *     of deprecated and make sure this is reflected in goldens
+       */
+      @Override public void Deprecated() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_Deprecated, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().Deprecated();
+              return;
+            }
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void TestOneway() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_TestOneway, _data, null, android.os.IBinder.FLAG_ONEWAY | android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().TestOneway();
+              return;
+            }
+          }
+        }
+        finally {
+          _data.recycle();
+        }
+      }
+      // Test that primitives work as parameters and return types.
+      @Override public boolean RepeatBoolean(boolean token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        boolean _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeBoolean(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatBoolean, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatBoolean(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readBoolean();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public byte RepeatByte(byte token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        byte _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeByte(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatByte, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatByte(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readByte();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public char RepeatChar(char token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        char _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeInt(((int)token));
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatChar, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatChar(token);
+            }
+          }
+          _reply.readException();
+          _result = (char)_reply.readInt();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int RepeatInt(int token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeInt(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatInt, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatInt(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public long RepeatLong(long token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        long _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeLong(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatLong, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatLong(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readLong();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public float RepeatFloat(float token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        float _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeFloat(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatFloat, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatFloat(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readFloat();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public double RepeatDouble(double token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        double _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeDouble(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatDouble, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatDouble(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readDouble();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.lang.String RepeatString(java.lang.String token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeString(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatString, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatString(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public byte RepeatByteEnum(byte token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        byte _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeByte(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatByteEnum, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatByteEnum(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readByte();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int RepeatIntEnum(int token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeInt(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatIntEnum, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatIntEnum(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public long RepeatLongEnum(long token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        long _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeLong(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatLongEnum, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatLongEnum(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readLong();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      // Test that arrays work as parameters and return types.
+      @Override public boolean[] ReverseBoolean(boolean[] input, boolean[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        boolean[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeBooleanArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseBoolean, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseBoolean(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createBooleanArray();
+          _reply.readBooleanArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public byte[] ReverseByte(byte[] input, byte[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        byte[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeByteArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseByte, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseByte(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createByteArray();
+          _reply.readByteArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public char[] ReverseChar(char[] input, char[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        char[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeCharArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseChar, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseChar(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createCharArray();
+          _reply.readCharArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int[] ReverseInt(int[] input, int[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeIntArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseInt, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseInt(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createIntArray();
+          _reply.readIntArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public long[] ReverseLong(long[] input, long[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        long[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeLongArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseLong, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseLong(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createLongArray();
+          _reply.readLongArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public float[] ReverseFloat(float[] input, float[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        float[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeFloatArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseFloat, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseFloat(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createFloatArray();
+          _reply.readFloatArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public double[] ReverseDouble(double[] input, double[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        double[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeDoubleArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseDouble, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseDouble(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createDoubleArray();
+          _reply.readDoubleArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.lang.String[] ReverseString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseString, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseString(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createStringArray();
+          _reply.readStringArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public byte[] ReverseByteEnum(byte[] input, byte[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        byte[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeByteArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseByteEnum, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseByteEnum(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createByteArray();
+          _reply.readByteArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int[] ReverseIntEnum(int[] input, int[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeIntArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseIntEnum, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseIntEnum(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createIntArray();
+          _reply.readIntArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public long[] ReverseLongEnum(long[] input, long[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        long[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeLongArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseLongEnum, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseLongEnum(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createLongArray();
+          _reply.readLongArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      // Test that clients can send and receive Binders.
+      @Override public android.aidl.tests.INamedCallback GetOtherTestService(java.lang.String name) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.INamedCallback _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeString(name);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetOtherTestService, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          _reply.setPropagateAllowBlocking();
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetOtherTestService(name);
+            }
+          }
+          _reply.readException();
+          _result = android.aidl.tests.INamedCallback.Stub.asInterface(_reply.readStrongBinder());
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      // returns true if the same service is already registered with the same name
+      @Override public boolean SetOtherTestService(java.lang.String name, android.aidl.tests.INamedCallback service) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        boolean _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeString(name);
+          _data.writeStrongInterface(service);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_SetOtherTestService, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().SetOtherTestService(name, service);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readBoolean();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public boolean VerifyName(android.aidl.tests.INamedCallback service, java.lang.String name) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        boolean _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStrongInterface(service);
+          _data.writeString(name);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_VerifyName, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().VerifyName(service, name);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readBoolean();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.tests.INamedCallback[] GetInterfaceArray(java.lang.String[] names) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.INamedCallback[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringArray(names);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetInterfaceArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetInterfaceArray(names);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createInterfaceArray(android.aidl.tests.INamedCallback[]::new, android.aidl.tests.INamedCallback.Stub::asInterface);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public boolean VerifyNamesWithInterfaceArray(android.aidl.tests.INamedCallback[] services, java.lang.String[] names) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        boolean _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeInterfaceArray(services);
+          _data.writeStringArray(names);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_VerifyNamesWithInterfaceArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().VerifyNamesWithInterfaceArray(services, names);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readBoolean();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.tests.INamedCallback[] GetNullableInterfaceArray(java.lang.String[] names) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.INamedCallback[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringArray(names);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetNullableInterfaceArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetNullableInterfaceArray(names);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createInterfaceArray(android.aidl.tests.INamedCallback[]::new, android.aidl.tests.INamedCallback.Stub::asInterface);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public boolean VerifyNamesWithNullableInterfaceArray(android.aidl.tests.INamedCallback[] services, java.lang.String[] names) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        boolean _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeInterfaceArray(services);
+          _data.writeStringArray(names);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_VerifyNamesWithNullableInterfaceArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().VerifyNamesWithNullableInterfaceArray(services, names);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readBoolean();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.util.List<android.aidl.tests.INamedCallback> GetInterfaceList(java.lang.String[] names) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.util.List<android.aidl.tests.INamedCallback> _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringArray(names);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetInterfaceList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetInterfaceList(names);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createInterfaceArrayList(android.aidl.tests.INamedCallback.Stub::asInterface);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public boolean VerifyNamesWithInterfaceList(java.util.List<android.aidl.tests.INamedCallback> services, java.lang.String[] names) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        boolean _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeInterfaceList(services);
+          _data.writeStringArray(names);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_VerifyNamesWithInterfaceList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().VerifyNamesWithInterfaceList(services, names);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readBoolean();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      // Test that List<T> types work correctly.
+      @Override public java.util.List<java.lang.String> ReverseStringList(java.util.List<java.lang.String> input, java.util.List<java.lang.String> repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.util.List<java.lang.String> _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringList(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseStringList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseStringList(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createStringArrayList();
+          _reply.readStringList(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.os.ParcelFileDescriptor RepeatParcelFileDescriptor(android.os.ParcelFileDescriptor read) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.os.ParcelFileDescriptor _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(read, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatParcelFileDescriptor, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatParcelFileDescriptor(read);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readTypedObject(android.os.ParcelFileDescriptor.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.os.ParcelFileDescriptor[] ReverseParcelFileDescriptorArray(android.os.ParcelFileDescriptor[] input, android.os.ParcelFileDescriptor[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.os.ParcelFileDescriptor[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedArray(input, 0);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseParcelFileDescriptorArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseParcelFileDescriptorArray(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createTypedArray(android.os.ParcelFileDescriptor.CREATOR);
+          _reply.readTypedArray(repeated, android.os.ParcelFileDescriptor.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      // Test that service specific exceptions work correctly.
+      @Override public void ThrowServiceException(int code) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeInt(code);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ThrowServiceException, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().ThrowServiceException(code);
+              return;
+            }
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      // Test nullability
+      @Override public int[] RepeatNullableIntArray(int[] input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeIntArray(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableIntArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableIntArray(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createIntArray();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public byte[] RepeatNullableByteEnumArray(byte[] input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        byte[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeByteArray(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableByteEnumArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableByteEnumArray(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createByteArray();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int[] RepeatNullableIntEnumArray(int[] input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeIntArray(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableIntEnumArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableIntEnumArray(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createIntArray();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public long[] RepeatNullableLongEnumArray(long[] input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        long[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeLongArray(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableLongEnumArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableLongEnumArray(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createLongArray();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.lang.String RepeatNullableString(java.lang.String input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeString(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableString, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableString(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.util.List<java.lang.String> RepeatNullableStringList(java.util.List<java.lang.String> input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.util.List<java.lang.String> _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringList(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableStringList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableStringList(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createStringArrayList();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.tests.ITestService.Empty RepeatNullableParcelable(android.aidl.tests.ITestService.Empty input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.ITestService.Empty _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableParcelable, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableParcelable(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readTypedObject(android.aidl.tests.ITestService.Empty.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.tests.ITestService.Empty[] RepeatNullableParcelableArray(android.aidl.tests.ITestService.Empty[] input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.ITestService.Empty[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedArray(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableParcelableArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableParcelableArray(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createTypedArray(android.aidl.tests.ITestService.Empty.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.util.List<android.aidl.tests.ITestService.Empty> RepeatNullableParcelableList(java.util.List<android.aidl.tests.ITestService.Empty> input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.util.List<android.aidl.tests.ITestService.Empty> _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedList(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableParcelableList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableParcelableList(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createTypedArrayList(android.aidl.tests.ITestService.Empty.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public void TakesAnIBinder(android.os.IBinder input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStrongBinder(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_TakesAnIBinder, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().TakesAnIBinder(input);
+              return;
+            }
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void TakesANullableIBinder(android.os.IBinder input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStrongBinder(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_TakesANullableIBinder, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().TakesANullableIBinder(input);
+              return;
+            }
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void TakesAnIBinderList(java.util.List<android.os.IBinder> input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeBinderList(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_TakesAnIBinderList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().TakesAnIBinderList(input);
+              return;
+            }
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void TakesANullableIBinderList(java.util.List<android.os.IBinder> input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeBinderList(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_TakesANullableIBinderList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().TakesANullableIBinderList(input);
+              return;
+            }
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      // Test utf8 decoding from utf16 wire format
+      @Override public java.lang.String RepeatUtf8CppString(java.lang.String token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeString(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatUtf8CppString, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatUtf8CppString(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.lang.String RepeatNullableUtf8CppString(java.lang.String token) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeString(token);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatNullableUtf8CppString, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().RepeatNullableUtf8CppString(token);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.lang.String[] ReverseUtf8CppString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseUtf8CppString, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseUtf8CppString(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createStringArray();
+          _reply.readStringArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.lang.String[] ReverseNullableUtf8CppString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseNullableUtf8CppString, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseNullableUtf8CppString(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createStringArray();
+          _reply.readStringArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public java.util.List<java.lang.String> ReverseUtf8CppStringList(java.util.List<java.lang.String> input, java.util.List<java.lang.String> repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.util.List<java.lang.String> _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStringList(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseUtf8CppStringList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseUtf8CppStringList(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createStringArrayList();
+          _reply.readStringList(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      /** comment before annotation */
+      @Override public android.aidl.tests.INamedCallback GetCallback(boolean return_null) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.INamedCallback _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeBoolean(return_null);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetCallback, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetCallback(return_null);
+            }
+          }
+          _reply.readException();
+          _result = android.aidl.tests.INamedCallback.Stub.asInterface(_reply.readStrongBinder());
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      // Since this paracelable has clearly defined default values, it would be
+      // inefficient to use an IPC to fill it out in practice.
+      @Override public void FillOutStructuredParcelable(android.aidl.tests.StructuredParcelable parcel) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(parcel, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_FillOutStructuredParcelable, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().FillOutStructuredParcelable(parcel);
+              return;
+            }
+          }
+          _reply.readException();
+          if ((0!=_reply.readInt())) {
+            parcel.readFromParcel(_reply);
+          }
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void RepeatExtendableParcelable(android.aidl.tests.extension.ExtendableParcelable ep, android.aidl.tests.extension.ExtendableParcelable ep2) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(ep, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RepeatExtendableParcelable, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              getDefaultImpl().RepeatExtendableParcelable(ep, ep2);
+              return;
+            }
+          }
+          _reply.readException();
+          if ((0!=_reply.readInt())) {
+            ep2.readFromParcel(_reply);
+          }
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public android.aidl.tests.RecursiveList ReverseList(android.aidl.tests.RecursiveList list) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.RecursiveList _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(list, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseList, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseList(list);
+            }
+          }
+          _reply.readException();
+          _result = _reply.readTypedObject(android.aidl.tests.RecursiveList.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.os.IBinder[] ReverseIBinderArray(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.os.IBinder[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeBinderArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseIBinderArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseIBinderArray(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createBinderArray();
+          _reply.readBinderArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.os.IBinder[] ReverseNullableIBinderArray(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.os.IBinder[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeBinderArray(input);
+          _data.writeInt(repeated.length);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ReverseNullableIBinderArray, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().ReverseNullableIBinderArray(input, repeated);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createBinderArray();
+          _reply.readBinderArray(repeated);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.tests.IOldName GetOldNameInterface() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.IOldName _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetOldNameInterface, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetOldNameInterface();
+            }
+          }
+          _reply.readException();
+          _result = android.aidl.tests.IOldName.Stub.asInterface(_reply.readStrongBinder());
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.tests.INewName GetNewNameInterface() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.INewName _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetNewNameInterface, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetNewNameInterface();
+            }
+          }
+          _reply.readException();
+          _result = android.aidl.tests.INewName.Stub.asInterface(_reply.readStrongBinder());
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int[] GetUnionTags(android.aidl.tests.Union[] input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedArray(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetUnionTags, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetUnionTags(input);
+            }
+          }
+          _reply.readException();
+          _result = _reply.createIntArray();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      // Retrieve the ICppJavaTests if the server supports it
+      @Override public android.os.IBinder GetCppJavaTests() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.os.IBinder _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetCppJavaTests, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetCppJavaTests();
+            }
+          }
+          _reply.readException();
+          _result = _reply.readStrongBinder();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public byte getBackendType() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        byte _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_getBackendType, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().getBackendType();
+            }
+          }
+          _reply.readException();
+          _result = _reply.readByte();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.tests.ICircular GetCircular(android.aidl.tests.CircularParcelable cp) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        _data.markSensitive();
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.ICircular _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_GetCircular, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+          if (!_status) {
+            if (getDefaultImpl() != null) {
+              return getDefaultImpl().GetCircular(cp);
+            }
+          }
+          _reply.readException();
+          _result = android.aidl.tests.ICircular.Stub.asInterface(_reply.readStrongBinder());
+          if ((0!=_reply.readInt())) {
+            cp.readFromParcel(_reply);
+          }
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      public static android.aidl.tests.ITestService sDefaultImpl;
+    }
+    static final int TRANSACTION_UnimplementedMethod = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    static final int TRANSACTION_Deprecated = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    static final int TRANSACTION_TestOneway = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+    static final int TRANSACTION_RepeatBoolean = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+    static final int TRANSACTION_RepeatByte = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
+    static final int TRANSACTION_RepeatChar = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5);
+    static final int TRANSACTION_RepeatInt = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6);
+    static final int TRANSACTION_RepeatLong = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7);
+    static final int TRANSACTION_RepeatFloat = (android.os.IBinder.FIRST_CALL_TRANSACTION + 8);
+    static final int TRANSACTION_RepeatDouble = (android.os.IBinder.FIRST_CALL_TRANSACTION + 9);
+    static final int TRANSACTION_RepeatString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 10);
+    static final int TRANSACTION_RepeatByteEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 11);
+    static final int TRANSACTION_RepeatIntEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 12);
+    static final int TRANSACTION_RepeatLongEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 13);
+    static final int TRANSACTION_ReverseBoolean = (android.os.IBinder.FIRST_CALL_TRANSACTION + 14);
+    static final int TRANSACTION_ReverseByte = (android.os.IBinder.FIRST_CALL_TRANSACTION + 15);
+    static final int TRANSACTION_ReverseChar = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16);
+    static final int TRANSACTION_ReverseInt = (android.os.IBinder.FIRST_CALL_TRANSACTION + 17);
+    static final int TRANSACTION_ReverseLong = (android.os.IBinder.FIRST_CALL_TRANSACTION + 18);
+    static final int TRANSACTION_ReverseFloat = (android.os.IBinder.FIRST_CALL_TRANSACTION + 19);
+    static final int TRANSACTION_ReverseDouble = (android.os.IBinder.FIRST_CALL_TRANSACTION + 20);
+    static final int TRANSACTION_ReverseString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 21);
+    static final int TRANSACTION_ReverseByteEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 22);
+    static final int TRANSACTION_ReverseIntEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 23);
+    static final int TRANSACTION_ReverseLongEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 24);
+    static final int TRANSACTION_GetOtherTestService = (android.os.IBinder.FIRST_CALL_TRANSACTION + 25);
+    static final int TRANSACTION_SetOtherTestService = (android.os.IBinder.FIRST_CALL_TRANSACTION + 26);
+    static final int TRANSACTION_VerifyName = (android.os.IBinder.FIRST_CALL_TRANSACTION + 27);
+    static final int TRANSACTION_GetInterfaceArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 28);
+    static final int TRANSACTION_VerifyNamesWithInterfaceArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 29);
+    static final int TRANSACTION_GetNullableInterfaceArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 30);
+    static final int TRANSACTION_VerifyNamesWithNullableInterfaceArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 31);
+    static final int TRANSACTION_GetInterfaceList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 32);
+    static final int TRANSACTION_VerifyNamesWithInterfaceList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 33);
+    static final int TRANSACTION_ReverseStringList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 34);
+    static final int TRANSACTION_RepeatParcelFileDescriptor = (android.os.IBinder.FIRST_CALL_TRANSACTION + 35);
+    static final int TRANSACTION_ReverseParcelFileDescriptorArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 36);
+    static final int TRANSACTION_ThrowServiceException = (android.os.IBinder.FIRST_CALL_TRANSACTION + 37);
+    static final int TRANSACTION_RepeatNullableIntArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 38);
+    static final int TRANSACTION_RepeatNullableByteEnumArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 39);
+    static final int TRANSACTION_RepeatNullableIntEnumArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 40);
+    static final int TRANSACTION_RepeatNullableLongEnumArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 41);
+    static final int TRANSACTION_RepeatNullableString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 42);
+    static final int TRANSACTION_RepeatNullableStringList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 43);
+    static final int TRANSACTION_RepeatNullableParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 44);
+    static final int TRANSACTION_RepeatNullableParcelableArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 45);
+    static final int TRANSACTION_RepeatNullableParcelableList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 46);
+    static final int TRANSACTION_TakesAnIBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 47);
+    static final int TRANSACTION_TakesANullableIBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 48);
+    static final int TRANSACTION_TakesAnIBinderList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 49);
+    static final int TRANSACTION_TakesANullableIBinderList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 50);
+    static final int TRANSACTION_RepeatUtf8CppString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 51);
+    static final int TRANSACTION_RepeatNullableUtf8CppString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 52);
+    static final int TRANSACTION_ReverseUtf8CppString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 53);
+    static final int TRANSACTION_ReverseNullableUtf8CppString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 54);
+    static final int TRANSACTION_ReverseUtf8CppStringList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 55);
+    static final int TRANSACTION_GetCallback = (android.os.IBinder.FIRST_CALL_TRANSACTION + 56);
+    static final int TRANSACTION_FillOutStructuredParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 57);
+    static final int TRANSACTION_RepeatExtendableParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 58);
+    static final int TRANSACTION_ReverseList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 59);
+    static final int TRANSACTION_ReverseIBinderArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 60);
+    static final int TRANSACTION_ReverseNullableIBinderArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 61);
+    static final int TRANSACTION_GetOldNameInterface = (android.os.IBinder.FIRST_CALL_TRANSACTION + 62);
+    static final int TRANSACTION_GetNewNameInterface = (android.os.IBinder.FIRST_CALL_TRANSACTION + 63);
+    static final int TRANSACTION_GetUnionTags = (android.os.IBinder.FIRST_CALL_TRANSACTION + 64);
+    static final int TRANSACTION_GetCppJavaTests = (android.os.IBinder.FIRST_CALL_TRANSACTION + 65);
+    static final int TRANSACTION_getBackendType = (android.os.IBinder.FIRST_CALL_TRANSACTION + 66);
+    static final int TRANSACTION_GetCircular = (android.os.IBinder.FIRST_CALL_TRANSACTION + 67);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 67;
+    }
+    public static boolean setDefaultImpl(android.aidl.tests.ITestService impl) {
+      // Only one user of this interface can use this function
+      // at a time. This is a heuristic to detect if two different
+      // users in the same process use this function.
+      if (Stub.Proxy.sDefaultImpl != null) {
+        throw new IllegalStateException("setDefaultImpl() called twice");
+      }
+      if (impl != null) {
+        Stub.Proxy.sDefaultImpl = impl;
+        return true;
+      }
+      return false;
+    }
+    public static android.aidl.tests.ITestService getDefaultImpl() {
+      return Stub.Proxy.sDefaultImpl;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ITestService";
+  // Test that constants are accessible
+  /** extra doc comment */
+  // extra line comment
+  /* extra regular comment */
+  /** const comment */
+  public static final int CONSTANT = 42;
+  public static final int CONSTANT2 = -42;
+  public static final int CONSTANT3 = 42;
+  public static final int CONSTANT4 = 4;
+  public static final int CONSTANT5 = -4;
+  public static final int CONSTANT6 = 0;
+  public static final int CONSTANT7 = 0;
+  public static final int CONSTANT8 = 0;
+  public static final int CONSTANT9 = 86;
+  public static final int CONSTANT10 = 165;
+  public static final int CONSTANT11 = 250;
+  public static final int CONSTANT12 = -1;
+  public static final byte BYTE_CONSTANT = 17;
+  public static final long LONG_CONSTANT = 1099511627776L;
+  public static final String STRING_CONSTANT = "foo";
+  public static final String STRING_CONSTANT2 = "bar";
+  public static final float FLOAT_CONSTANT = 1.000000f;
+  public static final float FLOAT_CONSTANT2 = -1.000000f;
+  public static final float FLOAT_CONSTANT3 = 1.000000f;
+  public static final float FLOAT_CONSTANT4 = 2.200000f;
+  public static final float FLOAT_CONSTANT5 = -2.200000f;
+  public static final float FLOAT_CONSTANT6 = -0.000000f;
+  public static final float FLOAT_CONSTANT7 = 0.000000f;
+  public static final double DOUBLE_CONSTANT = 1.000000;
+  public static final double DOUBLE_CONSTANT2 = -1.000000;
+  public static final double DOUBLE_CONSTANT3 = 1.000000;
+  public static final double DOUBLE_CONSTANT4 = 2.200000;
+  public static final double DOUBLE_CONSTANT5 = -2.200000;
+  public static final double DOUBLE_CONSTANT6 = -0.000000;
+  public static final double DOUBLE_CONSTANT7 = 0.000000;
+  public static final double DOUBLE_CONSTANT8 = 1.100000;
+  public static final double DOUBLE_CONSTANT9 = -1.100000;
+  public static final String STRING_CONSTANT_UTF8 = "baz";
+  // All these constant expressions should be equal to 1
+  public static final int A1 = 1;
+  public static final int A2 = 1;
+  public static final int A3 = 1;
+  public static final int A4 = 1;
+  public static final int A5 = 1;
+  public static final int A6 = 1;
+  public static final int A7 = 1;
+  public static final int A8 = 1;
+  public static final int A9 = 1;
+  public static final int A10 = 1;
+  public static final int A11 = 1;
+  public static final int A12 = 1;
+  public static final int A13 = 1;
+  public static final int A14 = 1;
+  public static final int A15 = 1;
+  public static final int A16 = 1;
+  public static final int A17 = 1;
+  public static final int A18 = 1;
+  public static final int A19 = 1;
+  public static final int A20 = 1;
+  public static final int A21 = 1;
+  public static final int A22 = 1;
+  public static final int A23 = 1;
+  public static final int A24 = 1;
+  public static final int A25 = 1;
+  public static final int A26 = 1;
+  public static final int A27 = 1;
+  public static final int A28 = 1;
+  public static final int A29 = 1;
+  public static final int A30 = 1;
+  public static final int A31 = 1;
+  public static final int A32 = 1;
+  public static final int A33 = 1;
+  public static final int A34 = 1;
+  public static final int A35 = 1;
+  public static final int A36 = 1;
+  public static final int A37 = 1;
+  public static final int A38 = 1;
+  public static final int A39 = 1;
+  public static final int A40 = 1;
+  public static final int A41 = 1;
+  public static final int A42 = 1;
+  public static final int A43 = 1;
+  public static final int A44 = 1;
+  // && higher than ||
+  public static final int A45 = 1;
+  public static final int A46 = 1;
+  public static final int A47 = 1;
+  public static final int A48 = 1;
+  public static final int A49 = 1;
+  public static final int A50 = 1;
+  public static final int A51 = 1;
+  public static final int A52 = 1;
+  public static final int A53 = 1;
+  // & higher than ^
+  public static final int A54 = 1;
+  public static final int A55 = 1;
+  public static final int A56 = 1;
+  public static final int A57 = 1;
+  // This is to emulate a method that is added after the service is implemented.
+  // So the client cannot assume that a call to this method will be successful
+  // or not. However, inside the test environment, we can't build client and
+  // the server with different version of this AIDL file. So, we let the server
+  // actually implement this and intercept the dispatch to the method
+  // inside onTransact().
+  // WARNING: Must be first method.
+  // This requires hard coding the transaction number. As long as this method is
+  // the first in this interface, it can keep the
+  // "::android::IBinder::FIRST_CALL_TRANSACTION + 0" value and allow
+  // methods to be added and removed.
+  public int UnimplementedMethod(int arg) throws android.os.RemoteException;
+  /**
+   * @deprecated to make sure we have something in system/tools/aidl which does a compile check
+   *     of deprecated and make sure this is reflected in goldens
+   */
+  @Deprecated
+  public void Deprecated() throws android.os.RemoteException;
+  public void TestOneway() throws android.os.RemoteException;
+  // Test that primitives work as parameters and return types.
+  public boolean RepeatBoolean(boolean token) throws android.os.RemoteException;
+  public byte RepeatByte(byte token) throws android.os.RemoteException;
+  public char RepeatChar(char token) throws android.os.RemoteException;
+  public int RepeatInt(int token) throws android.os.RemoteException;
+  public long RepeatLong(long token) throws android.os.RemoteException;
+  public float RepeatFloat(float token) throws android.os.RemoteException;
+  public double RepeatDouble(double token) throws android.os.RemoteException;
+  public java.lang.String RepeatString(java.lang.String token) throws android.os.RemoteException;
+  public byte RepeatByteEnum(byte token) throws android.os.RemoteException;
+  public int RepeatIntEnum(int token) throws android.os.RemoteException;
+  public long RepeatLongEnum(long token) throws android.os.RemoteException;
+  // Test that arrays work as parameters and return types.
+  public boolean[] ReverseBoolean(boolean[] input, boolean[] repeated) throws android.os.RemoteException;
+  public byte[] ReverseByte(byte[] input, byte[] repeated) throws android.os.RemoteException;
+  public char[] ReverseChar(char[] input, char[] repeated) throws android.os.RemoteException;
+  public int[] ReverseInt(int[] input, int[] repeated) throws android.os.RemoteException;
+  public long[] ReverseLong(long[] input, long[] repeated) throws android.os.RemoteException;
+  public float[] ReverseFloat(float[] input, float[] repeated) throws android.os.RemoteException;
+  public double[] ReverseDouble(double[] input, double[] repeated) throws android.os.RemoteException;
+  public java.lang.String[] ReverseString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException;
+  public byte[] ReverseByteEnum(byte[] input, byte[] repeated) throws android.os.RemoteException;
+  public int[] ReverseIntEnum(int[] input, int[] repeated) throws android.os.RemoteException;
+  public long[] ReverseLongEnum(long[] input, long[] repeated) throws android.os.RemoteException;
+  // Test that clients can send and receive Binders.
+  public android.aidl.tests.INamedCallback GetOtherTestService(java.lang.String name) throws android.os.RemoteException;
+  // returns true if the same service is already registered with the same name
+  public boolean SetOtherTestService(java.lang.String name, android.aidl.tests.INamedCallback service) throws android.os.RemoteException;
+  public boolean VerifyName(android.aidl.tests.INamedCallback service, java.lang.String name) throws android.os.RemoteException;
+  public android.aidl.tests.INamedCallback[] GetInterfaceArray(java.lang.String[] names) throws android.os.RemoteException;
+  public boolean VerifyNamesWithInterfaceArray(android.aidl.tests.INamedCallback[] services, java.lang.String[] names) throws android.os.RemoteException;
+  public android.aidl.tests.INamedCallback[] GetNullableInterfaceArray(java.lang.String[] names) throws android.os.RemoteException;
+  public boolean VerifyNamesWithNullableInterfaceArray(android.aidl.tests.INamedCallback[] services, java.lang.String[] names) throws android.os.RemoteException;
+  public java.util.List<android.aidl.tests.INamedCallback> GetInterfaceList(java.lang.String[] names) throws android.os.RemoteException;
+  public boolean VerifyNamesWithInterfaceList(java.util.List<android.aidl.tests.INamedCallback> services, java.lang.String[] names) throws android.os.RemoteException;
+  // Test that List<T> types work correctly.
+  public java.util.List<java.lang.String> ReverseStringList(java.util.List<java.lang.String> input, java.util.List<java.lang.String> repeated) throws android.os.RemoteException;
+  public android.os.ParcelFileDescriptor RepeatParcelFileDescriptor(android.os.ParcelFileDescriptor read) throws android.os.RemoteException;
+  public android.os.ParcelFileDescriptor[] ReverseParcelFileDescriptorArray(android.os.ParcelFileDescriptor[] input, android.os.ParcelFileDescriptor[] repeated) throws android.os.RemoteException;
+  // Test that service specific exceptions work correctly.
+  public void ThrowServiceException(int code) throws android.os.RemoteException;
+  // Test nullability
+  public int[] RepeatNullableIntArray(int[] input) throws android.os.RemoteException;
+  public byte[] RepeatNullableByteEnumArray(byte[] input) throws android.os.RemoteException;
+  public int[] RepeatNullableIntEnumArray(int[] input) throws android.os.RemoteException;
+  public long[] RepeatNullableLongEnumArray(long[] input) throws android.os.RemoteException;
+  public java.lang.String RepeatNullableString(java.lang.String input) throws android.os.RemoteException;
+  public java.util.List<java.lang.String> RepeatNullableStringList(java.util.List<java.lang.String> input) throws android.os.RemoteException;
+  public android.aidl.tests.ITestService.Empty RepeatNullableParcelable(android.aidl.tests.ITestService.Empty input) throws android.os.RemoteException;
+  public android.aidl.tests.ITestService.Empty[] RepeatNullableParcelableArray(android.aidl.tests.ITestService.Empty[] input) throws android.os.RemoteException;
+  public java.util.List<android.aidl.tests.ITestService.Empty> RepeatNullableParcelableList(java.util.List<android.aidl.tests.ITestService.Empty> input) throws android.os.RemoteException;
+  public void TakesAnIBinder(android.os.IBinder input) throws android.os.RemoteException;
+  public void TakesANullableIBinder(android.os.IBinder input) throws android.os.RemoteException;
+  public void TakesAnIBinderList(java.util.List<android.os.IBinder> input) throws android.os.RemoteException;
+  public void TakesANullableIBinderList(java.util.List<android.os.IBinder> input) throws android.os.RemoteException;
+  // Test utf8 decoding from utf16 wire format
+  public java.lang.String RepeatUtf8CppString(java.lang.String token) throws android.os.RemoteException;
+  public java.lang.String RepeatNullableUtf8CppString(java.lang.String token) throws android.os.RemoteException;
+  public java.lang.String[] ReverseUtf8CppString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException;
+  public java.lang.String[] ReverseNullableUtf8CppString(java.lang.String[] input, java.lang.String[] repeated) throws android.os.RemoteException;
+  public java.util.List<java.lang.String> ReverseUtf8CppStringList(java.util.List<java.lang.String> input, java.util.List<java.lang.String> repeated) throws android.os.RemoteException;
+  /** comment before annotation */
+  public android.aidl.tests.INamedCallback GetCallback(boolean return_null) throws android.os.RemoteException;
+  // Since this paracelable has clearly defined default values, it would be
+  // inefficient to use an IPC to fill it out in practice.
+  public void FillOutStructuredParcelable(android.aidl.tests.StructuredParcelable parcel) throws android.os.RemoteException;
+  public void RepeatExtendableParcelable(android.aidl.tests.extension.ExtendableParcelable ep, android.aidl.tests.extension.ExtendableParcelable ep2) throws android.os.RemoteException;
+  public android.aidl.tests.RecursiveList ReverseList(android.aidl.tests.RecursiveList list) throws android.os.RemoteException;
+  public android.os.IBinder[] ReverseIBinderArray(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException;
+  public android.os.IBinder[] ReverseNullableIBinderArray(android.os.IBinder[] input, android.os.IBinder[] repeated) throws android.os.RemoteException;
+  public android.aidl.tests.IOldName GetOldNameInterface() throws android.os.RemoteException;
+  public android.aidl.tests.INewName GetNewNameInterface() throws android.os.RemoteException;
+  public int[] GetUnionTags(android.aidl.tests.Union[] input) throws android.os.RemoteException;
+  // Retrieve the ICppJavaTests if the server supports it
+  public android.os.IBinder GetCppJavaTests() throws android.os.RemoteException;
+  public byte getBackendType() throws android.os.RemoteException;
+  public android.aidl.tests.ICircular GetCircular(android.aidl.tests.CircularParcelable cp) throws android.os.RemoteException;
+  // Small empty parcelable for nullability check
+  public static class Empty implements android.os.Parcelable
+  {
+    public static final android.os.Parcelable.Creator<Empty> CREATOR = new android.os.Parcelable.Creator<Empty>() {
+      @Override
+      public Empty createFromParcel(android.os.Parcel _aidl_source) {
+        Empty _aidl_out = new Empty();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public Empty[] newArray(int _aidl_size) {
+        return new Empty[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public boolean equals(Object other) {
+      if (this == other) return true;
+      if (other == null) return false;
+      if (!(other instanceof Empty)) return false;
+      Empty that = (Empty)other;
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return java.util.Arrays.deepHashCode(java.util.Arrays.asList().toArray());
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+  public static class CompilerChecks implements android.os.Parcelable
+  {
+    // IBinder
+    public android.os.IBinder binder;
+    public android.os.IBinder nullable_binder;
+    public android.os.IBinder[] binder_array;
+    public android.os.IBinder[] nullable_binder_array;
+    public java.util.List<android.os.IBinder> binder_list;
+    public java.util.List<android.os.IBinder> nullable_binder_list;
+    // ParcelFileDescriptor
+    public android.os.ParcelFileDescriptor pfd;
+    public android.os.ParcelFileDescriptor nullable_pfd;
+    public android.os.ParcelFileDescriptor[] pfd_array;
+    public android.os.ParcelFileDescriptor[] nullable_pfd_array;
+    public java.util.List<android.os.ParcelFileDescriptor> pfd_list;
+    public java.util.List<android.os.ParcelFileDescriptor> nullable_pfd_list;
+    // parcelable
+    public android.aidl.tests.ITestService.Empty parcel;
+    public android.aidl.tests.ITestService.Empty nullable_parcel;
+    public android.aidl.tests.ITestService.Empty[] parcel_array;
+    public android.aidl.tests.ITestService.Empty[] nullable_parcel_array;
+    public java.util.List<android.aidl.tests.ITestService.Empty> parcel_list;
+    public java.util.List<android.aidl.tests.ITestService.Empty> nullable_parcel_list;
+    public static final android.os.Parcelable.Creator<CompilerChecks> CREATOR = new android.os.Parcelable.Creator<CompilerChecks>() {
+      @Override
+      public CompilerChecks createFromParcel(android.os.Parcel _aidl_source) {
+        CompilerChecks _aidl_out = new CompilerChecks();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public CompilerChecks[] newArray(int _aidl_size) {
+        return new CompilerChecks[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeStrongBinder(binder);
+      _aidl_parcel.writeStrongBinder(nullable_binder);
+      _aidl_parcel.writeBinderArray(binder_array);
+      _aidl_parcel.writeBinderArray(nullable_binder_array);
+      _aidl_parcel.writeBinderList(binder_list);
+      _aidl_parcel.writeBinderList(nullable_binder_list);
+      _aidl_parcel.writeTypedObject(pfd, _aidl_flag);
+      _aidl_parcel.writeTypedObject(nullable_pfd, _aidl_flag);
+      _aidl_parcel.writeTypedArray(pfd_array, _aidl_flag);
+      _aidl_parcel.writeTypedArray(nullable_pfd_array, _aidl_flag);
+      _aidl_parcel.writeTypedList(pfd_list, _aidl_flag);
+      _aidl_parcel.writeTypedList(nullable_pfd_list, _aidl_flag);
+      _aidl_parcel.writeTypedObject(parcel, _aidl_flag);
+      _aidl_parcel.writeTypedObject(nullable_parcel, _aidl_flag);
+      _aidl_parcel.writeTypedArray(parcel_array, _aidl_flag);
+      _aidl_parcel.writeTypedArray(nullable_parcel_array, _aidl_flag);
+      _aidl_parcel.writeTypedList(parcel_list, _aidl_flag);
+      _aidl_parcel.writeTypedList(nullable_parcel_list, _aidl_flag);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        binder = _aidl_parcel.readStrongBinder();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_binder = _aidl_parcel.readStrongBinder();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        binder_array = _aidl_parcel.createBinderArray();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_binder_array = _aidl_parcel.createBinderArray();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        binder_list = _aidl_parcel.createBinderArrayList();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_binder_list = _aidl_parcel.createBinderArrayList();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        pfd = _aidl_parcel.readTypedObject(android.os.ParcelFileDescriptor.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_pfd = _aidl_parcel.readTypedObject(android.os.ParcelFileDescriptor.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        pfd_array = _aidl_parcel.createTypedArray(android.os.ParcelFileDescriptor.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_pfd_array = _aidl_parcel.createTypedArray(android.os.ParcelFileDescriptor.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        pfd_list = _aidl_parcel.createTypedArrayList(android.os.ParcelFileDescriptor.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_pfd_list = _aidl_parcel.createTypedArrayList(android.os.ParcelFileDescriptor.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        parcel = _aidl_parcel.readTypedObject(android.aidl.tests.ITestService.Empty.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_parcel = _aidl_parcel.readTypedObject(android.aidl.tests.ITestService.Empty.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        parcel_array = _aidl_parcel.createTypedArray(android.aidl.tests.ITestService.Empty.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_parcel_array = _aidl_parcel.createTypedArray(android.aidl.tests.ITestService.Empty.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        parcel_list = _aidl_parcel.createTypedArrayList(android.aidl.tests.ITestService.Empty.CREATOR);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_parcel_list = _aidl_parcel.createTypedArrayList(android.aidl.tests.ITestService.Empty.CREATOR);
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      _mask |= describeContents(pfd);
+      _mask |= describeContents(nullable_pfd);
+      _mask |= describeContents(pfd_array);
+      _mask |= describeContents(nullable_pfd_array);
+      _mask |= describeContents(pfd_list);
+      _mask |= describeContents(nullable_pfd_list);
+      _mask |= describeContents(parcel);
+      _mask |= describeContents(nullable_parcel);
+      _mask |= describeContents(parcel_array);
+      _mask |= describeContents(nullable_parcel_array);
+      _mask |= describeContents(parcel_list);
+      _mask |= describeContents(nullable_parcel_list);
+      return _mask;
+    }
+    private int describeContents(Object _v) {
+      if (_v == null) return 0;
+      if (_v instanceof Object[]) {
+        int _mask = 0;
+        for (Object o : (Object[]) _v) {
+          _mask |= describeContents(o);
+        }
+        return _mask;
+      }
+      if (_v instanceof java.util.Collection) {
+        int _mask = 0;
+        for (Object o : (java.util.Collection) _v) {
+          _mask |= describeContents(o);
+        }
+        return _mask;
+      }
+      if (_v instanceof android.os.Parcelable) {
+        return ((android.os.Parcelable) _v).describeContents();
+      }
+      return 0;
+    }
+    // interface without I-
+    public interface Foo extends android.os.IInterface
+    {
+      /** Default implementation for Foo. */
+      public static class Default implements android.aidl.tests.ITestService.CompilerChecks.Foo
+      {
+        @Override
+        public android.os.IBinder asBinder() {
+          return null;
+        }
+      }
+      /** Local-side IPC implementation stub class. */
+      public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ITestService.CompilerChecks.Foo
+      {
+        /** Construct the stub at attach it to the interface. */
+        public Stub()
+        {
+          this.attachInterface(this, DESCRIPTOR);
+        }
+        /**
+         * Cast an IBinder object into an android.aidl.tests.ITestService.CompilerChecks.Foo interface,
+         * generating a proxy if needed.
+         */
+        public static android.aidl.tests.ITestService.CompilerChecks.Foo asInterface(android.os.IBinder obj)
+        {
+          if ((obj==null)) {
+            return null;
+          }
+          android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+          if (((iin!=null)&&(iin instanceof android.aidl.tests.ITestService.CompilerChecks.Foo))) {
+            return ((android.aidl.tests.ITestService.CompilerChecks.Foo)iin);
+          }
+          return new android.aidl.tests.ITestService.CompilerChecks.Foo.Stub.Proxy(obj);
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return this;
+        }
+        /** @hide */
+        public static java.lang.String getDefaultTransactionName(int transactionCode)
+        {
+          switch (transactionCode)
+          {
+            default:
+            {
+              return null;
+            }
+          }
+        }
+        /** @hide */
+        public java.lang.String getTransactionName(int transactionCode)
+        {
+          return this.getDefaultTransactionName(transactionCode);
+        }
+        @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+        {
+          java.lang.String descriptor = DESCRIPTOR;
+          if (code == INTERFACE_TRANSACTION) {
+            reply.writeString(descriptor);
+            return true;
+          }
+          switch (code)
+          {
+            default:
+            {
+              return super.onTransact(code, data, reply, flags);
+            }
+          }
+        }
+        private static class Proxy implements android.aidl.tests.ITestService.CompilerChecks.Foo
+        {
+          private android.os.IBinder mRemote;
+          Proxy(android.os.IBinder remote)
+          {
+            mRemote = remote;
+          }
+          @Override public android.os.IBinder asBinder()
+          {
+            return mRemote;
+          }
+          public java.lang.String getInterfaceDescriptor()
+          {
+            return DESCRIPTOR;
+          }
+        }
+        /** @hide */
+        public int getMaxTransactionId()
+        {
+          return 0;
+        }
+      }
+      public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ITestService.CompilerChecks.Foo";
+    }
+    public static class HasDeprecated implements android.os.Parcelable
+    {
+      /** @deprecated field */
+      @Deprecated
+      public int deprecated = 0;
+      public static final android.os.Parcelable.Creator<HasDeprecated> CREATOR = new android.os.Parcelable.Creator<HasDeprecated>() {
+        @Override
+        public HasDeprecated createFromParcel(android.os.Parcel _aidl_source) {
+          HasDeprecated _aidl_out = new HasDeprecated();
+          _aidl_out.readFromParcel(_aidl_source);
+          return _aidl_out;
+        }
+        @Override
+        public HasDeprecated[] newArray(int _aidl_size) {
+          return new HasDeprecated[_aidl_size];
+        }
+      };
+      @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+      {
+        int _aidl_start_pos = _aidl_parcel.dataPosition();
+        _aidl_parcel.writeInt(0);
+        _aidl_parcel.writeInt(deprecated);
+        int _aidl_end_pos = _aidl_parcel.dataPosition();
+        _aidl_parcel.setDataPosition(_aidl_start_pos);
+        _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+        _aidl_parcel.setDataPosition(_aidl_end_pos);
+      }
+      public final void readFromParcel(android.os.Parcel _aidl_parcel)
+      {
+        int _aidl_start_pos = _aidl_parcel.dataPosition();
+        int _aidl_parcelable_size = _aidl_parcel.readInt();
+        try {
+          if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+          if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+          deprecated = _aidl_parcel.readInt();
+        } finally {
+          if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+            throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+          }
+          _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+        }
+      }
+      @Override
+      public int describeContents() {
+        int _mask = 0;
+        return _mask;
+      }
+    }
+    public static final class UsingHasDeprecated implements android.os.Parcelable {
+      // tags for union fields
+      public final static int n = 0;  // int n;
+      public final static int m = 1;  // android.aidl.tests.ITestService.CompilerChecks.HasDeprecated m;
+
+      private int _tag;
+      private Object _value;
+
+      public UsingHasDeprecated() {
+        int _value = 0;
+        this._tag = n;
+        this._value = _value;
+      }
+
+      private UsingHasDeprecated(android.os.Parcel _aidl_parcel) {
+        readFromParcel(_aidl_parcel);
+      }
+
+      private UsingHasDeprecated(int _tag, Object _value) {
+        this._tag = _tag;
+        this._value = _value;
+      }
+
+      public int getTag() {
+        return _tag;
+      }
+
+      // int n;
+
+      public static UsingHasDeprecated n(int _value) {
+        return new UsingHasDeprecated(n, _value);
+      }
+
+      public int getN() {
+        _assertTag(n);
+        return (int) _value;
+      }
+
+      public void setN(int _value) {
+        _set(n, _value);
+      }
+
+      // android.aidl.tests.ITestService.CompilerChecks.HasDeprecated m;
+
+      public static UsingHasDeprecated m(android.aidl.tests.ITestService.CompilerChecks.HasDeprecated _value) {
+        return new UsingHasDeprecated(m, _value);
+      }
+
+      public android.aidl.tests.ITestService.CompilerChecks.HasDeprecated getM() {
+        _assertTag(m);
+        return (android.aidl.tests.ITestService.CompilerChecks.HasDeprecated) _value;
+      }
+
+      public void setM(android.aidl.tests.ITestService.CompilerChecks.HasDeprecated _value) {
+        _set(m, _value);
+      }
+
+      public static final android.os.Parcelable.Creator<UsingHasDeprecated> CREATOR = new android.os.Parcelable.Creator<UsingHasDeprecated>() {
+        @Override
+        public UsingHasDeprecated createFromParcel(android.os.Parcel _aidl_source) {
+          return new UsingHasDeprecated(_aidl_source);
+        }
+        @Override
+        public UsingHasDeprecated[] newArray(int _aidl_size) {
+          return new UsingHasDeprecated[_aidl_size];
+        }
+      };
+
+      @Override
+      public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+        _aidl_parcel.writeInt(_tag);
+        switch (_tag) {
+        case n:
+          _aidl_parcel.writeInt(getN());
+          break;
+        case m:
+          _aidl_parcel.writeTypedObject(getM(), _aidl_flag);
+          break;
+        }
+      }
+
+      public void readFromParcel(android.os.Parcel _aidl_parcel) {
+        int _aidl_tag;
+        _aidl_tag = _aidl_parcel.readInt();
+        switch (_aidl_tag) {
+        case n: {
+          int _aidl_value;
+          _aidl_value = _aidl_parcel.readInt();
+          _set(_aidl_tag, _aidl_value);
+          return; }
+        case m: {
+          android.aidl.tests.ITestService.CompilerChecks.HasDeprecated _aidl_value;
+          _aidl_value = _aidl_parcel.readTypedObject(android.aidl.tests.ITestService.CompilerChecks.HasDeprecated.CREATOR);
+          _set(_aidl_tag, _aidl_value);
+          return; }
+        }
+        throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+      }
+
+      @Override
+      public int describeContents() {
+        int _mask = 0;
+        switch (getTag()) {
+        case m:
+          _mask |= describeContents(getM());
+          break;
+        }
+        return _mask;
+      }
+      private int describeContents(Object _v) {
+        if (_v == null) return 0;
+        if (_v instanceof android.os.Parcelable) {
+          return ((android.os.Parcelable) _v).describeContents();
+        }
+        return 0;
+      }
+
+      private void _assertTag(int tag) {
+        if (getTag() != tag) {
+          throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+        }
+      }
+
+      private String _tagString(int _tag) {
+        switch (_tag) {
+        case n: return "n";
+        case m: return "m";
+        }
+        throw new IllegalStateException("unknown field: " + _tag);
+      }
+
+      private void _set(int _tag, Object _value) {
+        this._tag = _tag;
+        this._value = _value;
+      }
+      public static @interface Tag {
+        public static final int n = 0;
+        public static final int m = 1;
+      }
+    }
+    public interface NoPrefixInterface extends android.os.IInterface
+    {
+      /** Default implementation for NoPrefixInterface. */
+      public static class Default implements android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface
+      {
+        @Override public void foo() throws android.os.RemoteException
+        {
+        }
+        @Override
+        public android.os.IBinder asBinder() {
+          return null;
+        }
+      }
+      /** Local-side IPC implementation stub class. */
+      public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface
+      {
+        /** Construct the stub at attach it to the interface. */
+        public Stub()
+        {
+          this.attachInterface(this, DESCRIPTOR);
+        }
+        /**
+         * Cast an IBinder object into an android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface interface,
+         * generating a proxy if needed.
+         */
+        public static android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface asInterface(android.os.IBinder obj)
+        {
+          if ((obj==null)) {
+            return null;
+          }
+          android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+          if (((iin!=null)&&(iin instanceof android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface))) {
+            return ((android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface)iin);
+          }
+          return new android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.Stub.Proxy(obj);
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return this;
+        }
+        /** @hide */
+        public static java.lang.String getDefaultTransactionName(int transactionCode)
+        {
+          switch (transactionCode)
+          {
+            case TRANSACTION_foo:
+            {
+              return "foo";
+            }
+            default:
+            {
+              return null;
+            }
+          }
+        }
+        /** @hide */
+        public java.lang.String getTransactionName(int transactionCode)
+        {
+          return this.getDefaultTransactionName(transactionCode);
+        }
+        @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+        {
+          java.lang.String descriptor = DESCRIPTOR;
+          if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+            data.enforceInterface(descriptor);
+          }
+          if (code == INTERFACE_TRANSACTION) {
+            reply.writeString(descriptor);
+            return true;
+          }
+          switch (code)
+          {
+            case TRANSACTION_foo:
+            {
+              this.foo();
+              reply.writeNoException();
+              break;
+            }
+            default:
+            {
+              return super.onTransact(code, data, reply, flags);
+            }
+          }
+          return true;
+        }
+        private static class Proxy implements android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface
+        {
+          private android.os.IBinder mRemote;
+          Proxy(android.os.IBinder remote)
+          {
+            mRemote = remote;
+          }
+          @Override public android.os.IBinder asBinder()
+          {
+            return mRemote;
+          }
+          public java.lang.String getInterfaceDescriptor()
+          {
+            return DESCRIPTOR;
+          }
+          @Override public void foo() throws android.os.RemoteException
+          {
+            android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+            android.os.Parcel _reply = android.os.Parcel.obtain();
+            try {
+              _data.writeInterfaceToken(DESCRIPTOR);
+              boolean _status = mRemote.transact(Stub.TRANSACTION_foo, _data, _reply, 0);
+              _reply.readException();
+            }
+            finally {
+              _reply.recycle();
+              _data.recycle();
+            }
+          }
+        }
+        static final int TRANSACTION_foo = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+        /** @hide */
+        public int getMaxTransactionId()
+        {
+          return 0;
+        }
+      }
+      public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface";
+      public void foo() throws android.os.RemoteException;
+      public static class Nested implements android.os.Parcelable
+      {
+        public static final android.os.Parcelable.Creator<Nested> CREATOR = new android.os.Parcelable.Creator<Nested>() {
+          @Override
+          public Nested createFromParcel(android.os.Parcel _aidl_source) {
+            Nested _aidl_out = new Nested();
+            _aidl_out.readFromParcel(_aidl_source);
+            return _aidl_out;
+          }
+          @Override
+          public Nested[] newArray(int _aidl_size) {
+            return new Nested[_aidl_size];
+          }
+        };
+        @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+        {
+          int _aidl_start_pos = _aidl_parcel.dataPosition();
+          _aidl_parcel.writeInt(0);
+          int _aidl_end_pos = _aidl_parcel.dataPosition();
+          _aidl_parcel.setDataPosition(_aidl_start_pos);
+          _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+          _aidl_parcel.setDataPosition(_aidl_end_pos);
+        }
+        public final void readFromParcel(android.os.Parcel _aidl_parcel)
+        {
+          int _aidl_start_pos = _aidl_parcel.dataPosition();
+          int _aidl_parcelable_size = _aidl_parcel.readInt();
+          try {
+            if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+          } finally {
+            if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+              throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+            }
+            _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+          }
+        }
+        @Override
+        public int describeContents() {
+          int _mask = 0;
+          return _mask;
+        }
+      }
+      public interface NestedNoPrefixInterface extends android.os.IInterface
+      {
+        /** Default implementation for NestedNoPrefixInterface. */
+        public static class Default implements android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface
+        {
+          @Override public void foo() throws android.os.RemoteException
+          {
+          }
+          @Override
+          public android.os.IBinder asBinder() {
+            return null;
+          }
+        }
+        /** Local-side IPC implementation stub class. */
+        public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface
+        {
+          /** Construct the stub at attach it to the interface. */
+          public Stub()
+          {
+            this.attachInterface(this, DESCRIPTOR);
+          }
+          /**
+           * Cast an IBinder object into an android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface interface,
+           * generating a proxy if needed.
+           */
+          public static android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface asInterface(android.os.IBinder obj)
+          {
+            if ((obj==null)) {
+              return null;
+            }
+            android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+            if (((iin!=null)&&(iin instanceof android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface))) {
+              return ((android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface)iin);
+            }
+            return new android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface.Stub.Proxy(obj);
+          }
+          @Override public android.os.IBinder asBinder()
+          {
+            return this;
+          }
+          /** @hide */
+          public static java.lang.String getDefaultTransactionName(int transactionCode)
+          {
+            switch (transactionCode)
+            {
+              case TRANSACTION_foo:
+              {
+                return "foo";
+              }
+              default:
+              {
+                return null;
+              }
+            }
+          }
+          /** @hide */
+          public java.lang.String getTransactionName(int transactionCode)
+          {
+            return this.getDefaultTransactionName(transactionCode);
+          }
+          @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+          {
+            java.lang.String descriptor = DESCRIPTOR;
+            if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+              data.enforceInterface(descriptor);
+            }
+            if (code == INTERFACE_TRANSACTION) {
+              reply.writeString(descriptor);
+              return true;
+            }
+            switch (code)
+            {
+              case TRANSACTION_foo:
+              {
+                this.foo();
+                reply.writeNoException();
+                break;
+              }
+              default:
+              {
+                return super.onTransact(code, data, reply, flags);
+              }
+            }
+            return true;
+          }
+          private static class Proxy implements android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface
+          {
+            private android.os.IBinder mRemote;
+            Proxy(android.os.IBinder remote)
+            {
+              mRemote = remote;
+            }
+            @Override public android.os.IBinder asBinder()
+            {
+              return mRemote;
+            }
+            public java.lang.String getInterfaceDescriptor()
+            {
+              return DESCRIPTOR;
+            }
+            @Override public void foo() throws android.os.RemoteException
+            {
+              android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+              android.os.Parcel _reply = android.os.Parcel.obtain();
+              try {
+                _data.writeInterfaceToken(DESCRIPTOR);
+                boolean _status = mRemote.transact(Stub.TRANSACTION_foo, _data, _reply, 0);
+                _reply.readException();
+              }
+              finally {
+                _reply.recycle();
+                _data.recycle();
+              }
+            }
+          }
+          static final int TRANSACTION_foo = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+          /** @hide */
+          public int getMaxTransactionId()
+          {
+            return 0;
+          }
+        }
+        public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface";
+        public void foo() throws android.os.RemoteException;
+      }
+    }
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java.d
new file mode 100644
index 0000000..34f4255
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java : \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IntEnum.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IntEnum.java
new file mode 100644
index 0000000..8c5b408
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IntEnum.java
@@ -0,0 +1,40 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/IntEnum.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+package android.aidl.tests;
+public @interface IntEnum {
+  public static final int FOO = 1000;
+  public static final int BAR = 2000;
+  public static final int BAZ = 2001;
+  /** @deprecated do not use this */
+  @Deprecated
+  public static final int QUX = 2002;
+  interface $ {
+    static String toString(int _aidl_v) {
+      if (_aidl_v == FOO) return "FOO";
+      if (_aidl_v == BAR) return "BAR";
+      if (_aidl_v == BAZ) return "BAZ";
+      if (_aidl_v == QUX) return "QUX";
+      return Integer.toString(_aidl_v);
+    }
+    static String arrayToString(Object _aidl_v) {
+      if (_aidl_v == null) return "null";
+      Class<?> _aidl_cls = _aidl_v.getClass();
+      if (!_aidl_cls.isArray()) throw new IllegalArgumentException("not an array: " + _aidl_v);
+      Class<?> comp = _aidl_cls.getComponentType();
+      java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "[", "]");
+      if (comp.isArray()) {
+        for (int _aidl_i = 0; _aidl_i < java.lang.reflect.Array.getLength(_aidl_v); _aidl_i++) {
+          _aidl_sj.add(arrayToString(java.lang.reflect.Array.get(_aidl_v, _aidl_i)));
+        }
+      } else {
+        if (_aidl_cls != int[].class) throw new IllegalArgumentException("wrong type: " + _aidl_cls);
+        for (int e : (int[]) _aidl_v) {
+          _aidl_sj.add(toString(e));
+        }
+      }
+      return _aidl_sj.toString();
+    }
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IntEnum.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IntEnum.java.d
new file mode 100644
index 0000000..c3c8c4c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/IntEnum.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/IntEnum.java : \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ListOfInterfaces.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ListOfInterfaces.java
new file mode 100644
index 0000000..753aa51
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ListOfInterfaces.java
@@ -0,0 +1,594 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ListOfInterfaces.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+package android.aidl.tests;
+public class ListOfInterfaces implements android.os.Parcelable
+{
+  public static final android.os.Parcelable.Creator<ListOfInterfaces> CREATOR = new android.os.Parcelable.Creator<ListOfInterfaces>() {
+    @Override
+    public ListOfInterfaces createFromParcel(android.os.Parcel _aidl_source) {
+      ListOfInterfaces _aidl_out = new ListOfInterfaces();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public ListOfInterfaces[] newArray(int _aidl_size) {
+      return new ListOfInterfaces[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+  public interface IEmptyInterface extends android.os.IInterface
+  {
+    /** Default implementation for IEmptyInterface. */
+    public static class Default implements android.aidl.tests.ListOfInterfaces.IEmptyInterface
+    {
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ListOfInterfaces.IEmptyInterface
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.tests.ListOfInterfaces.IEmptyInterface interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.tests.ListOfInterfaces.IEmptyInterface asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.tests.ListOfInterfaces.IEmptyInterface))) {
+          return ((android.aidl.tests.ListOfInterfaces.IEmptyInterface)iin);
+        }
+        return new android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      /** @hide */
+      public static java.lang.String getDefaultTransactionName(int transactionCode)
+      {
+        switch (transactionCode)
+        {
+          default:
+          {
+            return null;
+          }
+        }
+      }
+      /** @hide */
+      public java.lang.String getTransactionName(int transactionCode)
+      {
+        return this.getDefaultTransactionName(transactionCode);
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        switch (code)
+        {
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+      }
+      private static class Proxy implements android.aidl.tests.ListOfInterfaces.IEmptyInterface
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+      }
+      /** @hide */
+      public int getMaxTransactionId()
+      {
+        return 0;
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ListOfInterfaces.IEmptyInterface";
+  }
+  public interface IMyInterface extends android.os.IInterface
+  {
+    /** Default implementation for IMyInterface. */
+    public static class Default implements android.aidl.tests.ListOfInterfaces.IMyInterface
+    {
+      @Override public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> methodWithInterfaces(android.aidl.tests.ListOfInterfaces.IEmptyInterface iface, android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_inout, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_inout) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ListOfInterfaces.IMyInterface
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.tests.ListOfInterfaces.IMyInterface interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.tests.ListOfInterfaces.IMyInterface asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.tests.ListOfInterfaces.IMyInterface))) {
+          return ((android.aidl.tests.ListOfInterfaces.IMyInterface)iin);
+        }
+        return new android.aidl.tests.ListOfInterfaces.IMyInterface.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      /** @hide */
+      public static java.lang.String getDefaultTransactionName(int transactionCode)
+      {
+        switch (transactionCode)
+        {
+          case TRANSACTION_methodWithInterfaces:
+          {
+            return "methodWithInterfaces";
+          }
+          default:
+          {
+            return null;
+          }
+        }
+      }
+      /** @hide */
+      public java.lang.String getTransactionName(int transactionCode)
+      {
+        return this.getDefaultTransactionName(transactionCode);
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+          data.enforceInterface(descriptor);
+        }
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        switch (code)
+        {
+          case TRANSACTION_methodWithInterfaces:
+          {
+            android.aidl.tests.ListOfInterfaces.IEmptyInterface _arg0;
+            _arg0 = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(data.readStrongBinder());
+            android.aidl.tests.ListOfInterfaces.IEmptyInterface _arg1;
+            _arg1 = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(data.readStrongBinder());
+            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg2;
+            _arg2 = data.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg3;
+            _arg3 = new java.util.ArrayList<android.aidl.tests.ListOfInterfaces.IEmptyInterface>();
+            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg4;
+            _arg4 = data.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg5;
+            _arg5 = data.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg6;
+            _arg6 = new java.util.ArrayList<android.aidl.tests.ListOfInterfaces.IEmptyInterface>();
+            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg7;
+            _arg7 = data.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+            data.enforceNoDataAvail();
+            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _result = this.methodWithInterfaces(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
+            reply.writeNoException();
+            reply.writeInterfaceList(_result);
+            reply.writeInterfaceList(_arg3);
+            reply.writeInterfaceList(_arg4);
+            reply.writeInterfaceList(_arg6);
+            reply.writeInterfaceList(_arg7);
+            break;
+          }
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+        return true;
+      }
+      private static class Proxy implements android.aidl.tests.ListOfInterfaces.IMyInterface
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+        @Override public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> methodWithInterfaces(android.aidl.tests.ListOfInterfaces.IEmptyInterface iface, android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_inout, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_inout) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeStrongInterface(iface);
+            _data.writeStrongInterface(nullable_iface);
+            _data.writeInterfaceList(iface_list_in);
+            _data.writeInterfaceList(iface_list_inout);
+            _data.writeInterfaceList(nullable_iface_list_in);
+            _data.writeInterfaceList(nullable_iface_list_inout);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_methodWithInterfaces, _data, _reply, 0);
+            _reply.readException();
+            _result = _reply.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+            _reply.readInterfaceList(iface_list_out, android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+            _reply.readInterfaceList(iface_list_inout, android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+            _reply.readInterfaceList(nullable_iface_list_out, android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+            _reply.readInterfaceList(nullable_iface_list_inout, android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+      }
+      static final int TRANSACTION_methodWithInterfaces = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+      /** @hide */
+      public int getMaxTransactionId()
+      {
+        return 0;
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android.aidl.tests.ListOfInterfaces.IMyInterface";
+    public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> methodWithInterfaces(android.aidl.tests.ListOfInterfaces.IEmptyInterface iface, android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_inout, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_inout) throws android.os.RemoteException;
+  }
+  public static class MyParcelable implements android.os.Parcelable
+  {
+    public android.aidl.tests.ListOfInterfaces.IEmptyInterface iface;
+    public android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface;
+    public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list;
+    public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list;
+    public static final android.os.Parcelable.Creator<MyParcelable> CREATOR = new android.os.Parcelable.Creator<MyParcelable>() {
+      @Override
+      public MyParcelable createFromParcel(android.os.Parcel _aidl_source) {
+        MyParcelable _aidl_out = new MyParcelable();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public MyParcelable[] newArray(int _aidl_size) {
+        return new MyParcelable[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeStrongInterface(iface);
+      _aidl_parcel.writeStrongInterface(nullable_iface);
+      _aidl_parcel.writeInterfaceList(iface_list);
+      _aidl_parcel.writeInterfaceList(nullable_iface_list);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        iface = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_iface = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        iface_list = _aidl_parcel.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        nullable_iface_list = _aidl_parcel.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public String toString() {
+      java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "{", "}");
+      _aidl_sj.add("iface: " + (java.util.Objects.toString(iface)));
+      _aidl_sj.add("nullable_iface: " + (java.util.Objects.toString(nullable_iface)));
+      _aidl_sj.add("iface_list: " + (java.util.Objects.toString(iface_list)));
+      _aidl_sj.add("nullable_iface_list: " + (java.util.Objects.toString(nullable_iface_list)));
+      return "MyParcelable" + _aidl_sj.toString()  ;
+    }
+    @Override
+    public boolean equals(Object other) {
+      if (this == other) return true;
+      if (other == null) return false;
+      if (!(other instanceof MyParcelable)) return false;
+      MyParcelable that = (MyParcelable)other;
+      if (!java.util.Objects.deepEquals(iface, that.iface)) return false;
+      if (!java.util.Objects.deepEquals(nullable_iface, that.nullable_iface)) return false;
+      if (!java.util.Objects.deepEquals(iface_list, that.iface_list)) return false;
+      if (!java.util.Objects.deepEquals(nullable_iface_list, that.nullable_iface_list)) return false;
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return java.util.Arrays.deepHashCode(java.util.Arrays.asList(iface, nullable_iface, iface_list, nullable_iface_list).toArray());
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+  public static final class MyUnion implements android.os.Parcelable {
+    // tags for union fields
+    public final static int iface = 0;  // android.aidl.tests.ListOfInterfaces.IEmptyInterface iface;
+    public final static int nullable_iface = 1;  // android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface;
+    public final static int iface_list = 2;  // List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list;
+    public final static int nullable_iface_list = 3;  // List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list;
+
+    private int _tag;
+    private Object _value;
+
+    public MyUnion() {
+      android.aidl.tests.ListOfInterfaces.IEmptyInterface _value = null;
+      this._tag = iface;
+      this._value = _value;
+    }
+
+    private MyUnion(android.os.Parcel _aidl_parcel) {
+      readFromParcel(_aidl_parcel);
+    }
+
+    private MyUnion(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+
+    public int getTag() {
+      return _tag;
+    }
+
+    // android.aidl.tests.ListOfInterfaces.IEmptyInterface iface;
+
+    public static MyUnion iface(android.aidl.tests.ListOfInterfaces.IEmptyInterface _value) {
+      return new MyUnion(iface, _value);
+    }
+
+    public android.aidl.tests.ListOfInterfaces.IEmptyInterface getIface() {
+      _assertTag(iface);
+      return (android.aidl.tests.ListOfInterfaces.IEmptyInterface) _value;
+    }
+
+    public void setIface(android.aidl.tests.ListOfInterfaces.IEmptyInterface _value) {
+      _set(iface, _value);
+    }
+
+    // android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface;
+
+    public static MyUnion nullable_iface(android.aidl.tests.ListOfInterfaces.IEmptyInterface _value) {
+      return new MyUnion(nullable_iface, _value);
+    }
+
+    public android.aidl.tests.ListOfInterfaces.IEmptyInterface getNullable_iface() {
+      _assertTag(nullable_iface);
+      return (android.aidl.tests.ListOfInterfaces.IEmptyInterface) _value;
+    }
+
+    public void setNullable_iface(android.aidl.tests.ListOfInterfaces.IEmptyInterface _value) {
+      _set(nullable_iface, _value);
+    }
+
+    // List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list;
+
+    public static MyUnion iface_list(java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _value) {
+      return new MyUnion(iface_list, _value);
+    }
+
+    @SuppressWarnings("unchecked")
+    public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> getIface_list() {
+      _assertTag(iface_list);
+      return (java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface>) _value;
+    }
+
+    public void setIface_list(java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _value) {
+      _set(iface_list, _value);
+    }
+
+    // List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list;
+
+    public static MyUnion nullable_iface_list(java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _value) {
+      return new MyUnion(nullable_iface_list, _value);
+    }
+
+    @SuppressWarnings("unchecked")
+    public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> getNullable_iface_list() {
+      _assertTag(nullable_iface_list);
+      return (java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface>) _value;
+    }
+
+    public void setNullable_iface_list(java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _value) {
+      _set(nullable_iface_list, _value);
+    }
+
+    public static final android.os.Parcelable.Creator<MyUnion> CREATOR = new android.os.Parcelable.Creator<MyUnion>() {
+      @Override
+      public MyUnion createFromParcel(android.os.Parcel _aidl_source) {
+        return new MyUnion(_aidl_source);
+      }
+      @Override
+      public MyUnion[] newArray(int _aidl_size) {
+        return new MyUnion[_aidl_size];
+      }
+    };
+
+    @Override
+    public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+      _aidl_parcel.writeInt(_tag);
+      switch (_tag) {
+      case iface:
+        _aidl_parcel.writeStrongInterface(getIface());
+        break;
+      case nullable_iface:
+        _aidl_parcel.writeStrongInterface(getNullable_iface());
+        break;
+      case iface_list:
+        _aidl_parcel.writeInterfaceList(getIface_list());
+        break;
+      case nullable_iface_list:
+        _aidl_parcel.writeInterfaceList(getNullable_iface_list());
+        break;
+      }
+    }
+
+    public void readFromParcel(android.os.Parcel _aidl_parcel) {
+      int _aidl_tag;
+      _aidl_tag = _aidl_parcel.readInt();
+      switch (_aidl_tag) {
+      case iface: {
+        android.aidl.tests.ListOfInterfaces.IEmptyInterface _aidl_value;
+        _aidl_value = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case nullable_iface: {
+        android.aidl.tests.ListOfInterfaces.IEmptyInterface _aidl_value;
+        _aidl_value = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case iface_list: {
+        java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _aidl_value;
+        _aidl_value = _aidl_parcel.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case nullable_iface_list: {
+        java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _aidl_value;
+        _aidl_value = _aidl_parcel.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      }
+      throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+    }
+
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      switch (getTag()) {
+      }
+      return _mask;
+    }
+
+    @Override
+    public String toString() {
+      switch (_tag) {
+      case iface: return "MyUnion.iface(" + (java.util.Objects.toString(getIface())) + ")";
+      case nullable_iface: return "MyUnion.nullable_iface(" + (java.util.Objects.toString(getNullable_iface())) + ")";
+      case iface_list: return "MyUnion.iface_list(" + (java.util.Objects.toString(getIface_list())) + ")";
+      case nullable_iface_list: return "MyUnion.nullable_iface_list(" + (java.util.Objects.toString(getNullable_iface_list())) + ")";
+      }
+      throw new IllegalStateException("unknown field: " + _tag);
+    }
+    @Override
+    public boolean equals(Object other) {
+      if (this == other) return true;
+      if (other == null) return false;
+      if (!(other instanceof MyUnion)) return false;
+      MyUnion that = (MyUnion)other;
+      if (_tag != that._tag) return false;
+      if (!java.util.Objects.deepEquals(_value, that._value)) return false;
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return java.util.Arrays.deepHashCode(java.util.Arrays.asList(_tag, _value).toArray());
+    }
+
+    private void _assertTag(int tag) {
+      if (getTag() != tag) {
+        throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+      }
+    }
+
+    private String _tagString(int _tag) {
+      switch (_tag) {
+      case iface: return "iface";
+      case nullable_iface: return "nullable_iface";
+      case iface_list: return "iface_list";
+      case nullable_iface_list: return "nullable_iface_list";
+      }
+      throw new IllegalStateException("unknown field: " + _tag);
+    }
+
+    private void _set(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+    public static @interface Tag {
+      public static final int iface = 0;
+      public static final int nullable_iface = 1;
+      public static final int iface_list = 2;
+      public static final int nullable_iface_list = 3;
+    }
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ListOfInterfaces.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ListOfInterfaces.java.d
new file mode 100644
index 0000000..3387036
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ListOfInterfaces.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ListOfInterfaces.java : \
+  system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/LongEnum.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/LongEnum.java
new file mode 100644
index 0000000..741dde7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/LongEnum.java
@@ -0,0 +1,10 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/LongEnum.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+package android.aidl.tests;
+public @interface LongEnum {
+  public static final long FOO = 100000000000L;
+  public static final long BAR = 200000000000L;
+  public static final long BAZ = 200000000001L;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/LongEnum.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/LongEnum.java.d
new file mode 100644
index 0000000..aae0f69
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/LongEnum.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/LongEnum.java : \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/OtherParcelableForToString.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/OtherParcelableForToString.java
new file mode 100644
index 0000000..f5c7bbb
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/OtherParcelableForToString.java
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/OtherParcelableForToString.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+package android.aidl.tests;
+public class OtherParcelableForToString implements android.os.Parcelable
+{
+  public java.lang.String field;
+  public static final android.os.Parcelable.Creator<OtherParcelableForToString> CREATOR = new android.os.Parcelable.Creator<OtherParcelableForToString>() {
+    @Override
+    public OtherParcelableForToString createFromParcel(android.os.Parcel _aidl_source) {
+      OtherParcelableForToString _aidl_out = new OtherParcelableForToString();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public OtherParcelableForToString[] newArray(int _aidl_size) {
+      return new OtherParcelableForToString[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeString(field);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      field = _aidl_parcel.readString();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public String toString() {
+    java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "{", "}");
+    _aidl_sj.add("field: " + (java.util.Objects.toString(field)));
+    return "OtherParcelableForToString" + _aidl_sj.toString()  ;
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/OtherParcelableForToString.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/OtherParcelableForToString.java.d
new file mode 100644
index 0000000..a5c675b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/OtherParcelableForToString.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/OtherParcelableForToString.java : \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ParcelableForToString.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ParcelableForToString.java
new file mode 100644
index 0000000..a15bb73
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ParcelableForToString.java
@@ -0,0 +1,185 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ParcelableForToString.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+package android.aidl.tests;
+public class ParcelableForToString implements android.os.Parcelable
+{
+  public int intValue = 0;
+  public int[] intArray;
+  public long longValue = 0L;
+  public long[] longArray;
+  public double doubleValue = 0.000000;
+  public double[] doubleArray;
+  public float floatValue = 0.000000f;
+  public float[] floatArray;
+  public byte byteValue = 0;
+  public byte[] byteArray;
+  public boolean booleanValue = false;
+  public boolean[] booleanArray;
+  public java.lang.String stringValue;
+  public java.lang.String[] stringArray;
+  public java.util.List<java.lang.String> stringList;
+  public android.aidl.tests.OtherParcelableForToString parcelableValue;
+  public android.aidl.tests.OtherParcelableForToString[] parcelableArray;
+  public int enumValue = android.aidl.tests.IntEnum.FOO;
+  public int[] enumArray;
+  public java.lang.String[] nullArray;
+  public java.util.List<java.lang.String> nullList;
+  public android.aidl.tests.GenericStructuredParcelable<Integer,android.aidl.tests.StructuredParcelable,Integer> parcelableGeneric;
+  public android.aidl.tests.Union unionValue;
+  public static final android.os.Parcelable.Creator<ParcelableForToString> CREATOR = new android.os.Parcelable.Creator<ParcelableForToString>() {
+    @Override
+    public ParcelableForToString createFromParcel(android.os.Parcel _aidl_source) {
+      ParcelableForToString _aidl_out = new ParcelableForToString();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public ParcelableForToString[] newArray(int _aidl_size) {
+      return new ParcelableForToString[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(intValue);
+    _aidl_parcel.writeIntArray(intArray);
+    _aidl_parcel.writeLong(longValue);
+    _aidl_parcel.writeLongArray(longArray);
+    _aidl_parcel.writeDouble(doubleValue);
+    _aidl_parcel.writeDoubleArray(doubleArray);
+    _aidl_parcel.writeFloat(floatValue);
+    _aidl_parcel.writeFloatArray(floatArray);
+    _aidl_parcel.writeByte(byteValue);
+    _aidl_parcel.writeByteArray(byteArray);
+    _aidl_parcel.writeBoolean(booleanValue);
+    _aidl_parcel.writeBooleanArray(booleanArray);
+    _aidl_parcel.writeString(stringValue);
+    _aidl_parcel.writeStringArray(stringArray);
+    _aidl_parcel.writeStringList(stringList);
+    _aidl_parcel.writeTypedObject(parcelableValue, _aidl_flag);
+    _aidl_parcel.writeTypedArray(parcelableArray, _aidl_flag);
+    _aidl_parcel.writeInt(enumValue);
+    _aidl_parcel.writeIntArray(enumArray);
+    _aidl_parcel.writeStringArray(nullArray);
+    _aidl_parcel.writeStringList(nullList);
+    _aidl_parcel.writeTypedObject(parcelableGeneric, _aidl_flag);
+    _aidl_parcel.writeTypedObject(unionValue, _aidl_flag);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intValue = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intArray = _aidl_parcel.createIntArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longValue = _aidl_parcel.readLong();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longArray = _aidl_parcel.createLongArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      doubleValue = _aidl_parcel.readDouble();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      doubleArray = _aidl_parcel.createDoubleArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      floatValue = _aidl_parcel.readFloat();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      floatArray = _aidl_parcel.createFloatArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteValue = _aidl_parcel.readByte();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteArray = _aidl_parcel.createByteArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      booleanValue = _aidl_parcel.readBoolean();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      booleanArray = _aidl_parcel.createBooleanArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      stringValue = _aidl_parcel.readString();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      stringArray = _aidl_parcel.createStringArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      stringList = _aidl_parcel.createStringArrayList();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      parcelableValue = _aidl_parcel.readTypedObject(android.aidl.tests.OtherParcelableForToString.CREATOR);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      parcelableArray = _aidl_parcel.createTypedArray(android.aidl.tests.OtherParcelableForToString.CREATOR);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      enumValue = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      enumArray = _aidl_parcel.createIntArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      nullArray = _aidl_parcel.createStringArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      nullList = _aidl_parcel.createStringArrayList();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      parcelableGeneric = _aidl_parcel.readTypedObject(android.aidl.tests.GenericStructuredParcelable.CREATOR);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      unionValue = _aidl_parcel.readTypedObject(android.aidl.tests.Union.CREATOR);
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public String toString() {
+    java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "{", "}");
+    _aidl_sj.add("intValue: " + (intValue));
+    _aidl_sj.add("intArray: " + (java.util.Arrays.toString(intArray)));
+    _aidl_sj.add("longValue: " + (longValue));
+    _aidl_sj.add("longArray: " + (java.util.Arrays.toString(longArray)));
+    _aidl_sj.add("doubleValue: " + (doubleValue));
+    _aidl_sj.add("doubleArray: " + (java.util.Arrays.toString(doubleArray)));
+    _aidl_sj.add("floatValue: " + (floatValue));
+    _aidl_sj.add("floatArray: " + (java.util.Arrays.toString(floatArray)));
+    _aidl_sj.add("byteValue: " + (byteValue));
+    _aidl_sj.add("byteArray: " + (java.util.Arrays.toString(byteArray)));
+    _aidl_sj.add("booleanValue: " + (booleanValue));
+    _aidl_sj.add("booleanArray: " + (java.util.Arrays.toString(booleanArray)));
+    _aidl_sj.add("stringValue: " + (java.util.Objects.toString(stringValue)));
+    _aidl_sj.add("stringArray: " + (java.util.Arrays.toString(stringArray)));
+    _aidl_sj.add("stringList: " + (java.util.Objects.toString(stringList)));
+    _aidl_sj.add("parcelableValue: " + (java.util.Objects.toString(parcelableValue)));
+    _aidl_sj.add("parcelableArray: " + (java.util.Arrays.toString(parcelableArray)));
+    _aidl_sj.add("enumValue: " + (android.aidl.tests.IntEnum.$.toString(enumValue)));
+    _aidl_sj.add("enumArray: " + (android.aidl.tests.IntEnum.$.arrayToString(enumArray)));
+    _aidl_sj.add("nullArray: " + (java.util.Arrays.toString(nullArray)));
+    _aidl_sj.add("nullList: " + (java.util.Objects.toString(nullList)));
+    _aidl_sj.add("parcelableGeneric: " + (java.util.Objects.toString(parcelableGeneric)));
+    _aidl_sj.add("unionValue: " + (java.util.Objects.toString(unionValue)));
+    return "ParcelableForToString" + _aidl_sj.toString()  ;
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    _mask |= describeContents(parcelableValue);
+    _mask |= describeContents(parcelableArray);
+    _mask |= describeContents(parcelableGeneric);
+    _mask |= describeContents(unionValue);
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof Object[]) {
+      int _mask = 0;
+      for (Object o : (Object[]) _v) {
+        _mask |= describeContents(o);
+      }
+      return _mask;
+    }
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ParcelableForToString.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ParcelableForToString.java.d
new file mode 100644
index 0000000..013e62c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/ParcelableForToString.java.d
@@ -0,0 +1,10 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/ParcelableForToString.java : \
+  system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/RecursiveList.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/RecursiveList.java
new file mode 100644
index 0000000..9a023ee
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/RecursiveList.java
@@ -0,0 +1,63 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/RecursiveList.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+package android.aidl.tests;
+public class RecursiveList implements android.os.Parcelable
+{
+  public int value = 0;
+  public android.aidl.tests.RecursiveList next;
+  public static final android.os.Parcelable.Creator<RecursiveList> CREATOR = new android.os.Parcelable.Creator<RecursiveList>() {
+    @Override
+    public RecursiveList createFromParcel(android.os.Parcel _aidl_source) {
+      RecursiveList _aidl_out = new RecursiveList();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public RecursiveList[] newArray(int _aidl_size) {
+      return new RecursiveList[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(value);
+    _aidl_parcel.writeTypedObject(next, _aidl_flag);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      value = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      next = _aidl_parcel.readTypedObject(android.aidl.tests.RecursiveList.CREATOR);
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    _mask |= describeContents(next);
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/RecursiveList.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/RecursiveList.java.d
new file mode 100644
index 0000000..826c4ea
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/RecursiveList.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/RecursiveList.java : \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/StructuredParcelable.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/StructuredParcelable.java
new file mode 100644
index 0000000..797d05c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/StructuredParcelable.java
@@ -0,0 +1,473 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/StructuredParcelable.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+package android.aidl.tests;
+public class StructuredParcelable implements android.os.Parcelable
+{
+  public int[] shouldContainThreeFs;
+  public int f = 0;
+  public java.lang.String shouldBeJerry;
+  public byte shouldBeByteBar;
+  public int shouldBeIntBar;
+  public long shouldBeLongBar;
+  public byte[] shouldContainTwoByteFoos;
+  public int[] shouldContainTwoIntFoos;
+  public long[] shouldContainTwoLongFoos;
+  public java.lang.String stringDefaultsToFoo = "foo";
+  public byte byteDefaultsToFour = 4;
+  public int intDefaultsToFive = 5;
+  public long longDefaultsToNegativeSeven = -7L;
+  public boolean booleanDefaultsToTrue = true;
+  public char charDefaultsToC = 'C';
+  public float floatDefaultsToPi = 3.140000f;
+  public double doubleWithDefault = -314000000000000000.000000;
+  public int[] arrayDefaultsTo123 = {1, 2, 3};
+  public int[] arrayDefaultsToEmpty = {};
+  public boolean boolDefault = false;
+  public byte byteDefault = 0;
+  public int intDefault = 0;
+  public long longDefault = 0L;
+  public float floatDefault = 0.000000f;
+  public double doubleDefault = 0.000000;
+  // parse checks only
+  public double checkDoubleFromFloat = 3.140000;
+  public java.lang.String[] checkStringArray1 = {"a", "b"};
+  public java.lang.String[] checkStringArray2 = {"a", "b"};
+  // Add test to verify corner cases
+  public int int32_min = -2147483648;
+  public int int32_max = 2147483647;
+  public long int64_max = 9223372036854775807L;
+  public int hexInt32_neg_1 = -1;
+  public android.os.IBinder ibinder;
+  public android.aidl.tests.StructuredParcelable.Empty empty;
+  // Constant expressions that evaluate to 1
+  public byte[] int8_1 = {1, 1, 1, 1, 1};
+  public int[] int32_1 = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
+  public long[] int64_1 = {1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L};
+  public int hexInt32_pos_1 = 1;
+  public int hexInt64_pos_1 = 1;
+  public int const_exprs_1;
+  public int const_exprs_2;
+  public int const_exprs_3;
+  public int const_exprs_4;
+  public int const_exprs_5;
+  public int const_exprs_6;
+  public int const_exprs_7;
+  public int const_exprs_8;
+  public int const_exprs_9;
+  public int const_exprs_10;
+  // String expressions
+  public java.lang.String addString1 = "hello world!";
+  public java.lang.String addString2 = "The quick brown fox jumps over the lazy dog.";
+  public int shouldSetBit0AndBit2 = 0;
+  public android.aidl.tests.Union u;
+  public android.aidl.tests.Union shouldBeConstS1;
+  public int defaultWithFoo = android.aidl.tests.IntEnum.FOO;
+  public static final android.os.Parcelable.Creator<StructuredParcelable> CREATOR = new android.os.Parcelable.Creator<StructuredParcelable>() {
+    @Override
+    public StructuredParcelable createFromParcel(android.os.Parcel _aidl_source) {
+      StructuredParcelable _aidl_out = new StructuredParcelable();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public StructuredParcelable[] newArray(int _aidl_size) {
+      return new StructuredParcelable[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeIntArray(shouldContainThreeFs);
+    _aidl_parcel.writeInt(f);
+    _aidl_parcel.writeString(shouldBeJerry);
+    _aidl_parcel.writeByte(shouldBeByteBar);
+    _aidl_parcel.writeInt(shouldBeIntBar);
+    _aidl_parcel.writeLong(shouldBeLongBar);
+    _aidl_parcel.writeByteArray(shouldContainTwoByteFoos);
+    _aidl_parcel.writeIntArray(shouldContainTwoIntFoos);
+    _aidl_parcel.writeLongArray(shouldContainTwoLongFoos);
+    _aidl_parcel.writeString(stringDefaultsToFoo);
+    _aidl_parcel.writeByte(byteDefaultsToFour);
+    _aidl_parcel.writeInt(intDefaultsToFive);
+    _aidl_parcel.writeLong(longDefaultsToNegativeSeven);
+    _aidl_parcel.writeBoolean(booleanDefaultsToTrue);
+    _aidl_parcel.writeInt(((int)charDefaultsToC));
+    _aidl_parcel.writeFloat(floatDefaultsToPi);
+    _aidl_parcel.writeDouble(doubleWithDefault);
+    _aidl_parcel.writeIntArray(arrayDefaultsTo123);
+    _aidl_parcel.writeIntArray(arrayDefaultsToEmpty);
+    _aidl_parcel.writeBoolean(boolDefault);
+    _aidl_parcel.writeByte(byteDefault);
+    _aidl_parcel.writeInt(intDefault);
+    _aidl_parcel.writeLong(longDefault);
+    _aidl_parcel.writeFloat(floatDefault);
+    _aidl_parcel.writeDouble(doubleDefault);
+    _aidl_parcel.writeDouble(checkDoubleFromFloat);
+    _aidl_parcel.writeStringArray(checkStringArray1);
+    _aidl_parcel.writeStringArray(checkStringArray2);
+    _aidl_parcel.writeInt(int32_min);
+    _aidl_parcel.writeInt(int32_max);
+    _aidl_parcel.writeLong(int64_max);
+    _aidl_parcel.writeInt(hexInt32_neg_1);
+    _aidl_parcel.writeStrongBinder(ibinder);
+    _aidl_parcel.writeTypedObject(empty, _aidl_flag);
+    _aidl_parcel.writeByteArray(int8_1);
+    _aidl_parcel.writeIntArray(int32_1);
+    _aidl_parcel.writeLongArray(int64_1);
+    _aidl_parcel.writeInt(hexInt32_pos_1);
+    _aidl_parcel.writeInt(hexInt64_pos_1);
+    _aidl_parcel.writeInt(const_exprs_1);
+    _aidl_parcel.writeInt(const_exprs_2);
+    _aidl_parcel.writeInt(const_exprs_3);
+    _aidl_parcel.writeInt(const_exprs_4);
+    _aidl_parcel.writeInt(const_exprs_5);
+    _aidl_parcel.writeInt(const_exprs_6);
+    _aidl_parcel.writeInt(const_exprs_7);
+    _aidl_parcel.writeInt(const_exprs_8);
+    _aidl_parcel.writeInt(const_exprs_9);
+    _aidl_parcel.writeInt(const_exprs_10);
+    _aidl_parcel.writeString(addString1);
+    _aidl_parcel.writeString(addString2);
+    _aidl_parcel.writeInt(shouldSetBit0AndBit2);
+    _aidl_parcel.writeTypedObject(u, _aidl_flag);
+    _aidl_parcel.writeTypedObject(shouldBeConstS1, _aidl_flag);
+    _aidl_parcel.writeInt(defaultWithFoo);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldContainThreeFs = _aidl_parcel.createIntArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      f = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldBeJerry = _aidl_parcel.readString();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldBeByteBar = _aidl_parcel.readByte();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldBeIntBar = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldBeLongBar = _aidl_parcel.readLong();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldContainTwoByteFoos = _aidl_parcel.createByteArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldContainTwoIntFoos = _aidl_parcel.createIntArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldContainTwoLongFoos = _aidl_parcel.createLongArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      stringDefaultsToFoo = _aidl_parcel.readString();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteDefaultsToFour = _aidl_parcel.readByte();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intDefaultsToFive = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longDefaultsToNegativeSeven = _aidl_parcel.readLong();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      booleanDefaultsToTrue = _aidl_parcel.readBoolean();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      charDefaultsToC = (char)_aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      floatDefaultsToPi = _aidl_parcel.readFloat();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      doubleWithDefault = _aidl_parcel.readDouble();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      arrayDefaultsTo123 = _aidl_parcel.createIntArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      arrayDefaultsToEmpty = _aidl_parcel.createIntArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      boolDefault = _aidl_parcel.readBoolean();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      byteDefault = _aidl_parcel.readByte();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intDefault = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      longDefault = _aidl_parcel.readLong();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      floatDefault = _aidl_parcel.readFloat();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      doubleDefault = _aidl_parcel.readDouble();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      checkDoubleFromFloat = _aidl_parcel.readDouble();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      checkStringArray1 = _aidl_parcel.createStringArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      checkStringArray2 = _aidl_parcel.createStringArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      int32_min = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      int32_max = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      int64_max = _aidl_parcel.readLong();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      hexInt32_neg_1 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      ibinder = _aidl_parcel.readStrongBinder();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      empty = _aidl_parcel.readTypedObject(android.aidl.tests.StructuredParcelable.Empty.CREATOR);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      int8_1 = _aidl_parcel.createByteArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      int32_1 = _aidl_parcel.createIntArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      int64_1 = _aidl_parcel.createLongArray();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      hexInt32_pos_1 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      hexInt64_pos_1 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_1 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_2 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_3 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_4 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_5 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_6 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_7 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_8 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_9 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      const_exprs_10 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      addString1 = _aidl_parcel.readString();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      addString2 = _aidl_parcel.readString();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldSetBit0AndBit2 = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      u = _aidl_parcel.readTypedObject(android.aidl.tests.Union.CREATOR);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      shouldBeConstS1 = _aidl_parcel.readTypedObject(android.aidl.tests.Union.CREATOR);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      defaultWithFoo = _aidl_parcel.readInt();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  public static final int BIT0 = 1;
+  public static final int BIT1 = 2;
+  public static final int BIT2 = 4;
+  @Override
+  public String toString() {
+    java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "{", "}");
+    _aidl_sj.add("shouldContainThreeFs: " + (java.util.Arrays.toString(shouldContainThreeFs)));
+    _aidl_sj.add("f: " + (f));
+    _aidl_sj.add("shouldBeJerry: " + (java.util.Objects.toString(shouldBeJerry)));
+    _aidl_sj.add("shouldBeByteBar: " + (shouldBeByteBar));
+    _aidl_sj.add("shouldBeIntBar: " + (android.aidl.tests.IntEnum.$.toString(shouldBeIntBar)));
+    _aidl_sj.add("shouldBeLongBar: " + (shouldBeLongBar));
+    _aidl_sj.add("shouldContainTwoByteFoos: " + (java.util.Arrays.toString(shouldContainTwoByteFoos)));
+    _aidl_sj.add("shouldContainTwoIntFoos: " + (android.aidl.tests.IntEnum.$.arrayToString(shouldContainTwoIntFoos)));
+    _aidl_sj.add("shouldContainTwoLongFoos: " + (java.util.Arrays.toString(shouldContainTwoLongFoos)));
+    _aidl_sj.add("stringDefaultsToFoo: " + (java.util.Objects.toString(stringDefaultsToFoo)));
+    _aidl_sj.add("byteDefaultsToFour: " + (byteDefaultsToFour));
+    _aidl_sj.add("intDefaultsToFive: " + (intDefaultsToFive));
+    _aidl_sj.add("longDefaultsToNegativeSeven: " + (longDefaultsToNegativeSeven));
+    _aidl_sj.add("booleanDefaultsToTrue: " + (booleanDefaultsToTrue));
+    _aidl_sj.add("charDefaultsToC: " + (charDefaultsToC));
+    _aidl_sj.add("floatDefaultsToPi: " + (floatDefaultsToPi));
+    _aidl_sj.add("doubleWithDefault: " + (doubleWithDefault));
+    _aidl_sj.add("arrayDefaultsTo123: " + (java.util.Arrays.toString(arrayDefaultsTo123)));
+    _aidl_sj.add("arrayDefaultsToEmpty: " + (java.util.Arrays.toString(arrayDefaultsToEmpty)));
+    _aidl_sj.add("boolDefault: " + (boolDefault));
+    _aidl_sj.add("byteDefault: " + (byteDefault));
+    _aidl_sj.add("intDefault: " + (intDefault));
+    _aidl_sj.add("longDefault: " + (longDefault));
+    _aidl_sj.add("floatDefault: " + (floatDefault));
+    _aidl_sj.add("doubleDefault: " + (doubleDefault));
+    _aidl_sj.add("checkDoubleFromFloat: " + (checkDoubleFromFloat));
+    _aidl_sj.add("checkStringArray1: " + (java.util.Arrays.toString(checkStringArray1)));
+    _aidl_sj.add("checkStringArray2: " + (java.util.Arrays.toString(checkStringArray2)));
+    _aidl_sj.add("int32_min: " + (int32_min));
+    _aidl_sj.add("int32_max: " + (int32_max));
+    _aidl_sj.add("int64_max: " + (int64_max));
+    _aidl_sj.add("hexInt32_neg_1: " + (hexInt32_neg_1));
+    _aidl_sj.add("ibinder: " + (java.util.Objects.toString(ibinder)));
+    _aidl_sj.add("empty: " + (java.util.Objects.toString(empty)));
+    _aidl_sj.add("int8_1: " + (java.util.Arrays.toString(int8_1)));
+    _aidl_sj.add("int32_1: " + (java.util.Arrays.toString(int32_1)));
+    _aidl_sj.add("int64_1: " + (java.util.Arrays.toString(int64_1)));
+    _aidl_sj.add("hexInt32_pos_1: " + (hexInt32_pos_1));
+    _aidl_sj.add("hexInt64_pos_1: " + (hexInt64_pos_1));
+    _aidl_sj.add("const_exprs_1: " + (const_exprs_1));
+    _aidl_sj.add("const_exprs_2: " + (const_exprs_2));
+    _aidl_sj.add("const_exprs_3: " + (const_exprs_3));
+    _aidl_sj.add("const_exprs_4: " + (const_exprs_4));
+    _aidl_sj.add("const_exprs_5: " + (const_exprs_5));
+    _aidl_sj.add("const_exprs_6: " + (const_exprs_6));
+    _aidl_sj.add("const_exprs_7: " + (const_exprs_7));
+    _aidl_sj.add("const_exprs_8: " + (const_exprs_8));
+    _aidl_sj.add("const_exprs_9: " + (const_exprs_9));
+    _aidl_sj.add("const_exprs_10: " + (const_exprs_10));
+    _aidl_sj.add("addString1: " + (java.util.Objects.toString(addString1)));
+    _aidl_sj.add("addString2: " + (java.util.Objects.toString(addString2)));
+    _aidl_sj.add("shouldSetBit0AndBit2: " + (shouldSetBit0AndBit2));
+    _aidl_sj.add("u: " + (java.util.Objects.toString(u)));
+    _aidl_sj.add("shouldBeConstS1: " + (java.util.Objects.toString(shouldBeConstS1)));
+    _aidl_sj.add("defaultWithFoo: " + (android.aidl.tests.IntEnum.$.toString(defaultWithFoo)));
+    return "StructuredParcelable" + _aidl_sj.toString()  ;
+  }
+  @Override
+  public boolean equals(Object other) {
+    if (this == other) return true;
+    if (other == null) return false;
+    if (!(other instanceof StructuredParcelable)) return false;
+    StructuredParcelable that = (StructuredParcelable)other;
+    if (!java.util.Objects.deepEquals(shouldContainThreeFs, that.shouldContainThreeFs)) return false;
+    if (!java.util.Objects.deepEquals(f, that.f)) return false;
+    if (!java.util.Objects.deepEquals(shouldBeJerry, that.shouldBeJerry)) return false;
+    if (!java.util.Objects.deepEquals(shouldBeByteBar, that.shouldBeByteBar)) return false;
+    if (!java.util.Objects.deepEquals(shouldBeIntBar, that.shouldBeIntBar)) return false;
+    if (!java.util.Objects.deepEquals(shouldBeLongBar, that.shouldBeLongBar)) return false;
+    if (!java.util.Objects.deepEquals(shouldContainTwoByteFoos, that.shouldContainTwoByteFoos)) return false;
+    if (!java.util.Objects.deepEquals(shouldContainTwoIntFoos, that.shouldContainTwoIntFoos)) return false;
+    if (!java.util.Objects.deepEquals(shouldContainTwoLongFoos, that.shouldContainTwoLongFoos)) return false;
+    if (!java.util.Objects.deepEquals(stringDefaultsToFoo, that.stringDefaultsToFoo)) return false;
+    if (!java.util.Objects.deepEquals(byteDefaultsToFour, that.byteDefaultsToFour)) return false;
+    if (!java.util.Objects.deepEquals(intDefaultsToFive, that.intDefaultsToFive)) return false;
+    if (!java.util.Objects.deepEquals(longDefaultsToNegativeSeven, that.longDefaultsToNegativeSeven)) return false;
+    if (!java.util.Objects.deepEquals(booleanDefaultsToTrue, that.booleanDefaultsToTrue)) return false;
+    if (!java.util.Objects.deepEquals(charDefaultsToC, that.charDefaultsToC)) return false;
+    if (!java.util.Objects.deepEquals(floatDefaultsToPi, that.floatDefaultsToPi)) return false;
+    if (!java.util.Objects.deepEquals(doubleWithDefault, that.doubleWithDefault)) return false;
+    if (!java.util.Objects.deepEquals(arrayDefaultsTo123, that.arrayDefaultsTo123)) return false;
+    if (!java.util.Objects.deepEquals(arrayDefaultsToEmpty, that.arrayDefaultsToEmpty)) return false;
+    if (!java.util.Objects.deepEquals(boolDefault, that.boolDefault)) return false;
+    if (!java.util.Objects.deepEquals(byteDefault, that.byteDefault)) return false;
+    if (!java.util.Objects.deepEquals(intDefault, that.intDefault)) return false;
+    if (!java.util.Objects.deepEquals(longDefault, that.longDefault)) return false;
+    if (!java.util.Objects.deepEquals(floatDefault, that.floatDefault)) return false;
+    if (!java.util.Objects.deepEquals(doubleDefault, that.doubleDefault)) return false;
+    if (!java.util.Objects.deepEquals(checkDoubleFromFloat, that.checkDoubleFromFloat)) return false;
+    if (!java.util.Objects.deepEquals(checkStringArray1, that.checkStringArray1)) return false;
+    if (!java.util.Objects.deepEquals(checkStringArray2, that.checkStringArray2)) return false;
+    if (!java.util.Objects.deepEquals(int32_min, that.int32_min)) return false;
+    if (!java.util.Objects.deepEquals(int32_max, that.int32_max)) return false;
+    if (!java.util.Objects.deepEquals(int64_max, that.int64_max)) return false;
+    if (!java.util.Objects.deepEquals(hexInt32_neg_1, that.hexInt32_neg_1)) return false;
+    if (!java.util.Objects.deepEquals(ibinder, that.ibinder)) return false;
+    if (!java.util.Objects.deepEquals(empty, that.empty)) return false;
+    if (!java.util.Objects.deepEquals(int8_1, that.int8_1)) return false;
+    if (!java.util.Objects.deepEquals(int32_1, that.int32_1)) return false;
+    if (!java.util.Objects.deepEquals(int64_1, that.int64_1)) return false;
+    if (!java.util.Objects.deepEquals(hexInt32_pos_1, that.hexInt32_pos_1)) return false;
+    if (!java.util.Objects.deepEquals(hexInt64_pos_1, that.hexInt64_pos_1)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_1, that.const_exprs_1)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_2, that.const_exprs_2)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_3, that.const_exprs_3)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_4, that.const_exprs_4)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_5, that.const_exprs_5)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_6, that.const_exprs_6)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_7, that.const_exprs_7)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_8, that.const_exprs_8)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_9, that.const_exprs_9)) return false;
+    if (!java.util.Objects.deepEquals(const_exprs_10, that.const_exprs_10)) return false;
+    if (!java.util.Objects.deepEquals(addString1, that.addString1)) return false;
+    if (!java.util.Objects.deepEquals(addString2, that.addString2)) return false;
+    if (!java.util.Objects.deepEquals(shouldSetBit0AndBit2, that.shouldSetBit0AndBit2)) return false;
+    if (!java.util.Objects.deepEquals(u, that.u)) return false;
+    if (!java.util.Objects.deepEquals(shouldBeConstS1, that.shouldBeConstS1)) return false;
+    if (!java.util.Objects.deepEquals(defaultWithFoo, that.defaultWithFoo)) return false;
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return java.util.Arrays.deepHashCode(java.util.Arrays.asList(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo).toArray());
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    _mask |= describeContents(empty);
+    _mask |= describeContents(u);
+    _mask |= describeContents(shouldBeConstS1);
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+  // Make sure we can send an empty parcelable
+  public static class Empty implements android.os.Parcelable
+  {
+    public static final android.os.Parcelable.Creator<Empty> CREATOR = new android.os.Parcelable.Creator<Empty>() {
+      @Override
+      public Empty createFromParcel(android.os.Parcel _aidl_source) {
+        Empty _aidl_out = new Empty();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public Empty[] newArray(int _aidl_size) {
+        return new Empty[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public String toString() {
+      java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "{", "}");
+      return "Empty" + _aidl_sj.toString()  ;
+    }
+    @Override
+    public boolean equals(Object other) {
+      if (this == other) return true;
+      if (other == null) return false;
+      if (!(other instanceof Empty)) return false;
+      Empty that = (Empty)other;
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return java.util.Arrays.deepHashCode(java.util.Arrays.asList().toArray());
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/StructuredParcelable.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/StructuredParcelable.java.d
new file mode 100644
index 0000000..5381770
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/StructuredParcelable.java.d
@@ -0,0 +1,7 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/StructuredParcelable.java : \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/Union.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/Union.java
new file mode 100644
index 0000000..0ff6e12
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/Union.java
@@ -0,0 +1,296 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/Union.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+package android.aidl.tests;
+public final class Union implements android.os.Parcelable {
+  // tags for union fields
+  public final static int ns = 0;  // int[] ns;
+  public final static int n = 1;  // int n;
+  public final static int m = 2;  // int m;
+  public final static int s = 3;  // String s;
+  public final static int ibinder = 4;  // IBinder ibinder;
+  public final static int ss = 5;  // List<String> ss;
+  public final static int be = 6;  // android.aidl.tests.ByteEnum be;
+
+  private int _tag;
+  private Object _value;
+
+  public Union() {
+    int[] _value = {};
+    this._tag = ns;
+    this._value = _value;
+  }
+
+  private Union(android.os.Parcel _aidl_parcel) {
+    readFromParcel(_aidl_parcel);
+  }
+
+  private Union(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+
+  public int getTag() {
+    return _tag;
+  }
+
+  // int[] ns;
+
+  public static Union ns(int[] _value) {
+    return new Union(ns, _value);
+  }
+
+  public int[] getNs() {
+    _assertTag(ns);
+    return (int[]) _value;
+  }
+
+  public void setNs(int[] _value) {
+    _set(ns, _value);
+  }
+
+  // int n;
+
+  public static Union n(int _value) {
+    return new Union(n, _value);
+  }
+
+  public int getN() {
+    _assertTag(n);
+    return (int) _value;
+  }
+
+  public void setN(int _value) {
+    _set(n, _value);
+  }
+
+  // int m;
+
+  public static Union m(int _value) {
+    return new Union(m, _value);
+  }
+
+  public int getM() {
+    _assertTag(m);
+    return (int) _value;
+  }
+
+  public void setM(int _value) {
+    _set(m, _value);
+  }
+
+  // String s;
+
+  public static Union s(java.lang.String _value) {
+    return new Union(s, _value);
+  }
+
+  public java.lang.String getS() {
+    _assertTag(s);
+    return (java.lang.String) _value;
+  }
+
+  public void setS(java.lang.String _value) {
+    _set(s, _value);
+  }
+
+  // IBinder ibinder;
+
+  public static Union ibinder(android.os.IBinder _value) {
+    return new Union(ibinder, _value);
+  }
+
+  public android.os.IBinder getIbinder() {
+    _assertTag(ibinder);
+    return (android.os.IBinder) _value;
+  }
+
+  public void setIbinder(android.os.IBinder _value) {
+    _set(ibinder, _value);
+  }
+
+  // List<String> ss;
+
+  public static Union ss(java.util.List<java.lang.String> _value) {
+    return new Union(ss, _value);
+  }
+
+  @SuppressWarnings("unchecked")
+  public java.util.List<java.lang.String> getSs() {
+    _assertTag(ss);
+    return (java.util.List<java.lang.String>) _value;
+  }
+
+  public void setSs(java.util.List<java.lang.String> _value) {
+    _set(ss, _value);
+  }
+
+  // android.aidl.tests.ByteEnum be;
+
+  public static Union be(byte _value) {
+    return new Union(be, _value);
+  }
+
+  public byte getBe() {
+    _assertTag(be);
+    return (byte) _value;
+  }
+
+  public void setBe(byte _value) {
+    _set(be, _value);
+  }
+
+  public static final android.os.Parcelable.Creator<Union> CREATOR = new android.os.Parcelable.Creator<Union>() {
+    @Override
+    public Union createFromParcel(android.os.Parcel _aidl_source) {
+      return new Union(_aidl_source);
+    }
+    @Override
+    public Union[] newArray(int _aidl_size) {
+      return new Union[_aidl_size];
+    }
+  };
+
+  @Override
+  public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+    _aidl_parcel.writeInt(_tag);
+    switch (_tag) {
+    case ns:
+      _aidl_parcel.writeIntArray(getNs());
+      break;
+    case n:
+      _aidl_parcel.writeInt(getN());
+      break;
+    case m:
+      _aidl_parcel.writeInt(getM());
+      break;
+    case s:
+      _aidl_parcel.writeString(getS());
+      break;
+    case ibinder:
+      _aidl_parcel.writeStrongBinder(getIbinder());
+      break;
+    case ss:
+      _aidl_parcel.writeStringList(getSs());
+      break;
+    case be:
+      _aidl_parcel.writeByte(getBe());
+      break;
+    }
+  }
+
+  public void readFromParcel(android.os.Parcel _aidl_parcel) {
+    int _aidl_tag;
+    _aidl_tag = _aidl_parcel.readInt();
+    switch (_aidl_tag) {
+    case ns: {
+      int[] _aidl_value;
+      _aidl_value = _aidl_parcel.createIntArray();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case n: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case m: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case s: {
+      java.lang.String _aidl_value;
+      _aidl_value = _aidl_parcel.readString();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case ibinder: {
+      android.os.IBinder _aidl_value;
+      _aidl_value = _aidl_parcel.readStrongBinder();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case ss: {
+      java.util.List<java.lang.String> _aidl_value;
+      _aidl_value = _aidl_parcel.createStringArrayList();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case be: {
+      byte _aidl_value;
+      _aidl_value = _aidl_parcel.readByte();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    }
+    throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+  }
+
+  public static final String S1 = "a string constant in union";
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    switch (getTag()) {
+    }
+    return _mask;
+  }
+
+  @Override
+  public String toString() {
+    switch (_tag) {
+    case ns: return "Union.ns(" + (java.util.Arrays.toString(getNs())) + ")";
+    case n: return "Union.n(" + (getN()) + ")";
+    case m: return "Union.m(" + (getM()) + ")";
+    case s: return "Union.s(" + (java.util.Objects.toString(getS())) + ")";
+    case ibinder: return "Union.ibinder(" + (java.util.Objects.toString(getIbinder())) + ")";
+    case ss: return "Union.ss(" + (java.util.Objects.toString(getSs())) + ")";
+    case be: return "Union.be(" + (getBe()) + ")";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+  @Override
+  public boolean equals(Object other) {
+    if (this == other) return true;
+    if (other == null) return false;
+    if (!(other instanceof Union)) return false;
+    Union that = (Union)other;
+    if (_tag != that._tag) return false;
+    if (!java.util.Objects.deepEquals(_value, that._value)) return false;
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return java.util.Arrays.deepHashCode(java.util.Arrays.asList(_tag, _value).toArray());
+  }
+
+  private void _assertTag(int tag) {
+    if (getTag() != tag) {
+      throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+    }
+  }
+
+  private String _tagString(int _tag) {
+    switch (_tag) {
+    case ns: return "ns";
+    case n: return "n";
+    case m: return "m";
+    case s: return "s";
+    case ibinder: return "ibinder";
+    case ss: return "ss";
+    case be: return "be";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+
+  private void _set(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+  public static @interface Tag {
+    public static final int ns = 0;
+    public static final int n = 1;
+    public static final int m = 2;
+    public static final int s = 3;
+    public static final int ibinder = 4;
+    public static final int ss = 5;
+    public static final int be = 6;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/Union.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/Union.java.d
new file mode 100644
index 0000000..58d449e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/Union.java.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/Union.java : \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/UnionWithFd.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/UnionWithFd.java
new file mode 100644
index 0000000..90849d2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/UnionWithFd.java
@@ -0,0 +1,145 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/UnionWithFd.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+package android.aidl.tests;
+public final class UnionWithFd implements android.os.Parcelable {
+  // tags for union fields
+  public final static int num = 0;  // int num;
+  public final static int pfd = 1;  // ParcelFileDescriptor pfd;
+
+  private int _tag;
+  private Object _value;
+
+  public UnionWithFd() {
+    int _value = 0;
+    this._tag = num;
+    this._value = _value;
+  }
+
+  private UnionWithFd(android.os.Parcel _aidl_parcel) {
+    readFromParcel(_aidl_parcel);
+  }
+
+  private UnionWithFd(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+
+  public int getTag() {
+    return _tag;
+  }
+
+  // int num;
+
+  public static UnionWithFd num(int _value) {
+    return new UnionWithFd(num, _value);
+  }
+
+  public int getNum() {
+    _assertTag(num);
+    return (int) _value;
+  }
+
+  public void setNum(int _value) {
+    _set(num, _value);
+  }
+
+  // ParcelFileDescriptor pfd;
+
+  public static UnionWithFd pfd(android.os.ParcelFileDescriptor _value) {
+    return new UnionWithFd(pfd, _value);
+  }
+
+  public android.os.ParcelFileDescriptor getPfd() {
+    _assertTag(pfd);
+    return (android.os.ParcelFileDescriptor) _value;
+  }
+
+  public void setPfd(android.os.ParcelFileDescriptor _value) {
+    _set(pfd, _value);
+  }
+
+  public static final android.os.Parcelable.Creator<UnionWithFd> CREATOR = new android.os.Parcelable.Creator<UnionWithFd>() {
+    @Override
+    public UnionWithFd createFromParcel(android.os.Parcel _aidl_source) {
+      return new UnionWithFd(_aidl_source);
+    }
+    @Override
+    public UnionWithFd[] newArray(int _aidl_size) {
+      return new UnionWithFd[_aidl_size];
+    }
+  };
+
+  @Override
+  public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+    _aidl_parcel.writeInt(_tag);
+    switch (_tag) {
+    case num:
+      _aidl_parcel.writeInt(getNum());
+      break;
+    case pfd:
+      _aidl_parcel.writeTypedObject(getPfd(), _aidl_flag);
+      break;
+    }
+  }
+
+  public void readFromParcel(android.os.Parcel _aidl_parcel) {
+    int _aidl_tag;
+    _aidl_tag = _aidl_parcel.readInt();
+    switch (_aidl_tag) {
+    case num: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case pfd: {
+      android.os.ParcelFileDescriptor _aidl_value;
+      _aidl_value = _aidl_parcel.readTypedObject(android.os.ParcelFileDescriptor.CREATOR);
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    }
+    throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+  }
+
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    switch (getTag()) {
+    case pfd:
+      _mask |= describeContents(getPfd());
+      break;
+    }
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+
+  private void _assertTag(int tag) {
+    if (getTag() != tag) {
+      throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+    }
+  }
+
+  private String _tagString(int _tag) {
+    switch (_tag) {
+    case num: return "num";
+    case pfd: return "pfd";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+
+  private void _set(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+  public static @interface Tag {
+    public static final int num = 0;
+    public static final int pfd = 1;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/UnionWithFd.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/UnionWithFd.java.d
new file mode 100644
index 0000000..2b2d668
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/UnionWithFd.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/UnionWithFd.java : \
+  system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/ExtendableParcelable.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/ExtendableParcelable.java
new file mode 100644
index 0000000..78d3563
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/ExtendableParcelable.java
@@ -0,0 +1,80 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/extension/ExtendableParcelable.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+package android.aidl.tests.extension;
+public class ExtendableParcelable implements android.os.Parcelable
+{
+  public int a = 0;
+  public java.lang.String b;
+  public final android.os.ParcelableHolder ext = new android.os.ParcelableHolder(android.os.Parcelable.PARCELABLE_STABILITY_LOCAL);
+  public long c = 0L;
+  public final android.os.ParcelableHolder ext2 = new android.os.ParcelableHolder(android.os.Parcelable.PARCELABLE_STABILITY_LOCAL);
+  public static final android.os.Parcelable.Creator<ExtendableParcelable> CREATOR = new android.os.Parcelable.Creator<ExtendableParcelable>() {
+    @Override
+    public ExtendableParcelable createFromParcel(android.os.Parcel _aidl_source) {
+      ExtendableParcelable _aidl_out = new ExtendableParcelable();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public ExtendableParcelable[] newArray(int _aidl_size) {
+      return new ExtendableParcelable[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(a);
+    _aidl_parcel.writeString(b);
+    _aidl_parcel.writeTypedObject(ext, 0);
+    _aidl_parcel.writeLong(c);
+    _aidl_parcel.writeTypedObject(ext2, 0);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      a = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      b = _aidl_parcel.readString();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      if ((0!=_aidl_parcel.readInt())) {
+        ext.readFromParcel(_aidl_parcel);
+      }
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      c = _aidl_parcel.readLong();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      if ((0!=_aidl_parcel.readInt())) {
+        ext2.readFromParcel(_aidl_parcel);
+      }
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    _mask |= describeContents(ext);
+    _mask |= describeContents(ext2);
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/ExtendableParcelable.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/ExtendableParcelable.java.d
new file mode 100644
index 0000000..18ee116
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/ExtendableParcelable.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/extension/ExtendableParcelable.java : \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt.java
new file mode 100644
index 0000000..cb2600c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt.java
@@ -0,0 +1,55 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+package android.aidl.tests.extension;
+public class MyExt implements android.os.Parcelable
+{
+  public int a = 0;
+  public java.lang.String b;
+  public static final android.os.Parcelable.Creator<MyExt> CREATOR = new android.os.Parcelable.Creator<MyExt>() {
+    @Override
+    public MyExt createFromParcel(android.os.Parcel _aidl_source) {
+      MyExt _aidl_out = new MyExt();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public MyExt[] newArray(int _aidl_size) {
+      return new MyExt[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(a);
+    _aidl_parcel.writeString(b);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      a = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      b = _aidl_parcel.readString();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt.java.d
new file mode 100644
index 0000000..3a1efb9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt.java : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt2.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt2.java
new file mode 100644
index 0000000..d40d551
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt2.java
@@ -0,0 +1,67 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt2.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+package android.aidl.tests.extension;
+public class MyExt2 implements android.os.Parcelable
+{
+  public int a = 0;
+  public android.aidl.tests.extension.MyExt b;
+  public java.lang.String c;
+  public static final android.os.Parcelable.Creator<MyExt2> CREATOR = new android.os.Parcelable.Creator<MyExt2>() {
+    @Override
+    public MyExt2 createFromParcel(android.os.Parcel _aidl_source) {
+      MyExt2 _aidl_out = new MyExt2();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public MyExt2[] newArray(int _aidl_size) {
+      return new MyExt2[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(a);
+    _aidl_parcel.writeTypedObject(b, _aidl_flag);
+    _aidl_parcel.writeString(c);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      a = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      b = _aidl_parcel.readTypedObject(android.aidl.tests.extension.MyExt.CREATOR);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      c = _aidl_parcel.readString();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    _mask |= describeContents(b);
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt2.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt2.java.d
new file mode 100644
index 0000000..bac99f4
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt2.java.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExt2.java : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExtLike.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExtLike.java
new file mode 100644
index 0000000..71b2a7d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExtLike.java
@@ -0,0 +1,55 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExtLike.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+package android.aidl.tests.extension;
+public class MyExtLike implements android.os.Parcelable
+{
+  public int a = 0;
+  public java.lang.String b;
+  public static final android.os.Parcelable.Creator<MyExtLike> CREATOR = new android.os.Parcelable.Creator<MyExtLike>() {
+    @Override
+    public MyExtLike createFromParcel(android.os.Parcel _aidl_source) {
+      MyExtLike _aidl_out = new MyExtLike();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public MyExtLike[] newArray(int _aidl_size) {
+      return new MyExtLike[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(a);
+    _aidl_parcel.writeString(b);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      a = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      b = _aidl_parcel.readString();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExtLike.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExtLike.java.d
new file mode 100644
index 0000000..87f852f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExtLike.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/extension/MyExtLike.java : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/DeeplyNested.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/DeeplyNested.java
new file mode 100644
index 0000000..a377fa4
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/DeeplyNested.java
@@ -0,0 +1,223 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/nested/DeeplyNested.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+package android.aidl.tests.nested;
+public class DeeplyNested implements android.os.Parcelable
+{
+  public static final android.os.Parcelable.Creator<DeeplyNested> CREATOR = new android.os.Parcelable.Creator<DeeplyNested>() {
+    @Override
+    public DeeplyNested createFromParcel(android.os.Parcel _aidl_source) {
+      DeeplyNested _aidl_out = new DeeplyNested();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public DeeplyNested[] newArray(int _aidl_size) {
+      return new DeeplyNested[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+  public static class A implements android.os.Parcelable
+  {
+    // Can reference deeply nested type of a sibling type.
+    public byte e = android.aidl.tests.nested.DeeplyNested.B.C.D.E.OK;
+    public static final android.os.Parcelable.Creator<A> CREATOR = new android.os.Parcelable.Creator<A>() {
+      @Override
+      public A createFromParcel(android.os.Parcel _aidl_source) {
+        A _aidl_out = new A();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public A[] newArray(int _aidl_size) {
+        return new A[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeByte(e);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        e = _aidl_parcel.readByte();
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+  public static class B implements android.os.Parcelable
+  {
+    public static final android.os.Parcelable.Creator<B> CREATOR = new android.os.Parcelable.Creator<B>() {
+      @Override
+      public B createFromParcel(android.os.Parcel _aidl_source) {
+        B _aidl_out = new B();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public B[] newArray(int _aidl_size) {
+        return new B[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+    public static class C implements android.os.Parcelable
+    {
+      public static final android.os.Parcelable.Creator<C> CREATOR = new android.os.Parcelable.Creator<C>() {
+        @Override
+        public C createFromParcel(android.os.Parcel _aidl_source) {
+          C _aidl_out = new C();
+          _aidl_out.readFromParcel(_aidl_source);
+          return _aidl_out;
+        }
+        @Override
+        public C[] newArray(int _aidl_size) {
+          return new C[_aidl_size];
+        }
+      };
+      @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+      {
+        int _aidl_start_pos = _aidl_parcel.dataPosition();
+        _aidl_parcel.writeInt(0);
+        int _aidl_end_pos = _aidl_parcel.dataPosition();
+        _aidl_parcel.setDataPosition(_aidl_start_pos);
+        _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+        _aidl_parcel.setDataPosition(_aidl_end_pos);
+      }
+      public final void readFromParcel(android.os.Parcel _aidl_parcel)
+      {
+        int _aidl_start_pos = _aidl_parcel.dataPosition();
+        int _aidl_parcelable_size = _aidl_parcel.readInt();
+        try {
+          if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        } finally {
+          if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+            throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+          }
+          _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+        }
+      }
+      @Override
+      public int describeContents() {
+        int _mask = 0;
+        return _mask;
+      }
+      public static class D implements android.os.Parcelable
+      {
+        public static final android.os.Parcelable.Creator<D> CREATOR = new android.os.Parcelable.Creator<D>() {
+          @Override
+          public D createFromParcel(android.os.Parcel _aidl_source) {
+            D _aidl_out = new D();
+            _aidl_out.readFromParcel(_aidl_source);
+            return _aidl_out;
+          }
+          @Override
+          public D[] newArray(int _aidl_size) {
+            return new D[_aidl_size];
+          }
+        };
+        @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+        {
+          int _aidl_start_pos = _aidl_parcel.dataPosition();
+          _aidl_parcel.writeInt(0);
+          int _aidl_end_pos = _aidl_parcel.dataPosition();
+          _aidl_parcel.setDataPosition(_aidl_start_pos);
+          _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+          _aidl_parcel.setDataPosition(_aidl_end_pos);
+        }
+        public final void readFromParcel(android.os.Parcel _aidl_parcel)
+        {
+          int _aidl_start_pos = _aidl_parcel.dataPosition();
+          int _aidl_parcelable_size = _aidl_parcel.readInt();
+          try {
+            if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+          } finally {
+            if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+              throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+            }
+            _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+          }
+        }
+        @Override
+        public int describeContents() {
+          int _mask = 0;
+          return _mask;
+        }
+        public static @interface E {
+          public static final byte OK = 0;
+        }
+      }
+    }
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/DeeplyNested.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/DeeplyNested.java.d
new file mode 100644
index 0000000..8576ab7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/DeeplyNested.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/nested/DeeplyNested.java : \
+  system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/INestedService.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/INestedService.java
new file mode 100644
index 0000000..f675468
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/INestedService.java
@@ -0,0 +1,350 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/nested/INestedService.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+package android.aidl.tests.nested;
+public interface INestedService extends android.os.IInterface
+{
+  /** Default implementation for INestedService. */
+  public static class Default implements android.aidl.tests.nested.INestedService
+  {
+    @Override public android.aidl.tests.nested.INestedService.Result flipStatus(android.aidl.tests.nested.ParcelableWithNested p) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public void flipStatusWithCallback(byte status, android.aidl.tests.nested.INestedService.ICallback cb) throws android.os.RemoteException
+    {
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.nested.INestedService
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.nested.INestedService interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.nested.INestedService asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.nested.INestedService))) {
+        return ((android.aidl.tests.nested.INestedService)iin);
+      }
+      return new android.aidl.tests.nested.INestedService.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_flipStatus:
+        {
+          return "flipStatus";
+        }
+        case TRANSACTION_flipStatusWithCallback:
+        {
+          return "flipStatusWithCallback";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_flipStatus:
+        {
+          android.aidl.tests.nested.ParcelableWithNested _arg0;
+          _arg0 = data.readTypedObject(android.aidl.tests.nested.ParcelableWithNested.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.tests.nested.INestedService.Result _result = this.flipStatus(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_flipStatusWithCallback:
+        {
+          byte _arg0;
+          _arg0 = data.readByte();
+          android.aidl.tests.nested.INestedService.ICallback _arg1;
+          _arg1 = android.aidl.tests.nested.INestedService.ICallback.Stub.asInterface(data.readStrongBinder());
+          data.enforceNoDataAvail();
+          this.flipStatusWithCallback(_arg0, _arg1);
+          reply.writeNoException();
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.nested.INestedService
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public android.aidl.tests.nested.INestedService.Result flipStatus(android.aidl.tests.nested.ParcelableWithNested p) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.tests.nested.INestedService.Result _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(p, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_flipStatus, _data, _reply, 0);
+          _reply.readException();
+          _result = _reply.readTypedObject(android.aidl.tests.nested.INestedService.Result.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public void flipStatusWithCallback(byte status, android.aidl.tests.nested.INestedService.ICallback cb) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeByte(status);
+          _data.writeStrongInterface(cb);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_flipStatusWithCallback, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+    }
+    static final int TRANSACTION_flipStatus = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    static final int TRANSACTION_flipStatusWithCallback = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 1;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.nested.INestedService";
+  public android.aidl.tests.nested.INestedService.Result flipStatus(android.aidl.tests.nested.ParcelableWithNested p) throws android.os.RemoteException;
+  public void flipStatusWithCallback(byte status, android.aidl.tests.nested.INestedService.ICallback cb) throws android.os.RemoteException;
+  public static class Result implements android.os.Parcelable
+  {
+    public byte status = android.aidl.tests.nested.ParcelableWithNested.Status.OK;
+    public static final android.os.Parcelable.Creator<Result> CREATOR = new android.os.Parcelable.Creator<Result>() {
+      @Override
+      public Result createFromParcel(android.os.Parcel _aidl_source) {
+        Result _aidl_out = new Result();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public Result[] newArray(int _aidl_size) {
+        return new Result[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeByte(status);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        status = _aidl_parcel.readByte();
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+  public interface ICallback extends android.os.IInterface
+  {
+    /** Default implementation for ICallback. */
+    public static class Default implements android.aidl.tests.nested.INestedService.ICallback
+    {
+      @Override public void done(byte status) throws android.os.RemoteException
+      {
+      }
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.tests.nested.INestedService.ICallback
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.tests.nested.INestedService.ICallback interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.tests.nested.INestedService.ICallback asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.tests.nested.INestedService.ICallback))) {
+          return ((android.aidl.tests.nested.INestedService.ICallback)iin);
+        }
+        return new android.aidl.tests.nested.INestedService.ICallback.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      /** @hide */
+      public static java.lang.String getDefaultTransactionName(int transactionCode)
+      {
+        switch (transactionCode)
+        {
+          case TRANSACTION_done:
+          {
+            return "done";
+          }
+          default:
+          {
+            return null;
+          }
+        }
+      }
+      /** @hide */
+      public java.lang.String getTransactionName(int transactionCode)
+      {
+        return this.getDefaultTransactionName(transactionCode);
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+          data.enforceInterface(descriptor);
+        }
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        switch (code)
+        {
+          case TRANSACTION_done:
+          {
+            byte _arg0;
+            _arg0 = data.readByte();
+            data.enforceNoDataAvail();
+            this.done(_arg0);
+            reply.writeNoException();
+            break;
+          }
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+        return true;
+      }
+      private static class Proxy implements android.aidl.tests.nested.INestedService.ICallback
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+        @Override public void done(byte status) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeByte(status);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_done, _data, _reply, 0);
+            _reply.readException();
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+        }
+      }
+      static final int TRANSACTION_done = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+      /** @hide */
+      public int getMaxTransactionId()
+      {
+        return 0;
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android.aidl.tests.nested.INestedService.ICallback";
+    public void done(byte status) throws android.os.RemoteException;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/INestedService.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/INestedService.java.d
new file mode 100644
index 0000000..83a9e41
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/INestedService.java.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/nested/INestedService.java : \
+  system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/ParcelableWithNested.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/ParcelableWithNested.java
new file mode 100644
index 0000000..22b7bc6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/ParcelableWithNested.java
@@ -0,0 +1,55 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/nested/ParcelableWithNested.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+package android.aidl.tests.nested;
+public class ParcelableWithNested implements android.os.Parcelable
+{
+  public byte status = android.aidl.tests.nested.ParcelableWithNested.Status.OK;
+  public static final android.os.Parcelable.Creator<ParcelableWithNested> CREATOR = new android.os.Parcelable.Creator<ParcelableWithNested>() {
+    @Override
+    public ParcelableWithNested createFromParcel(android.os.Parcel _aidl_source) {
+      ParcelableWithNested _aidl_out = new ParcelableWithNested();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public ParcelableWithNested[] newArray(int _aidl_size) {
+      return new ParcelableWithNested[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeByte(status);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      status = _aidl_parcel.readByte();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+  public static @interface Status {
+    public static final byte OK = 0;
+    public static final byte NOT_OK = 1;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/ParcelableWithNested.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/ParcelableWithNested.java.d
new file mode 100644
index 0000000..0f7a8c4
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/nested/ParcelableWithNested.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/nested/ParcelableWithNested.java : \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/unions/EnumUnion.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/unions/EnumUnion.java
new file mode 100644
index 0000000..2841c14
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/unions/EnumUnion.java
@@ -0,0 +1,190 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/unions/EnumUnion.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+package android.aidl.tests.unions;
+public final class EnumUnion implements android.os.Parcelable {
+  // tags for union fields
+  public final static int intEnum = 0;  // android.aidl.tests.IntEnum intEnum;
+  public final static int longEnum = 1;  // android.aidl.tests.LongEnum longEnum;
+  public final static int deprecatedField = 2;  // int deprecatedField;
+
+  private int _tag;
+  private Object _value;
+
+  public EnumUnion() {
+    int _value = android.aidl.tests.IntEnum.FOO;
+    this._tag = intEnum;
+    this._value = _value;
+  }
+
+  private EnumUnion(android.os.Parcel _aidl_parcel) {
+    readFromParcel(_aidl_parcel);
+  }
+
+  private EnumUnion(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+
+  public int getTag() {
+    return _tag;
+  }
+
+  // android.aidl.tests.IntEnum intEnum;
+
+  public static EnumUnion intEnum(int _value) {
+    return new EnumUnion(intEnum, _value);
+  }
+
+  public int getIntEnum() {
+    _assertTag(intEnum);
+    return (int) _value;
+  }
+
+  public void setIntEnum(int _value) {
+    _set(intEnum, _value);
+  }
+
+  // android.aidl.tests.LongEnum longEnum;
+
+  public static EnumUnion longEnum(long _value) {
+    return new EnumUnion(longEnum, _value);
+  }
+
+  public long getLongEnum() {
+    _assertTag(longEnum);
+    return (long) _value;
+  }
+
+  public void setLongEnum(long _value) {
+    _set(longEnum, _value);
+  }
+
+  // int deprecatedField;
+
+  /** @deprecated do not use this */
+  @Deprecated
+  public static EnumUnion deprecatedField(int _value) {
+    return new EnumUnion(deprecatedField, _value);
+  }
+
+  public int getDeprecatedField() {
+    _assertTag(deprecatedField);
+    return (int) _value;
+  }
+
+  public void setDeprecatedField(int _value) {
+    _set(deprecatedField, _value);
+  }
+
+  public static final android.os.Parcelable.Creator<EnumUnion> CREATOR = new android.os.Parcelable.Creator<EnumUnion>() {
+    @Override
+    public EnumUnion createFromParcel(android.os.Parcel _aidl_source) {
+      return new EnumUnion(_aidl_source);
+    }
+    @Override
+    public EnumUnion[] newArray(int _aidl_size) {
+      return new EnumUnion[_aidl_size];
+    }
+  };
+
+  @Override
+  public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+    _aidl_parcel.writeInt(_tag);
+    switch (_tag) {
+    case intEnum:
+      _aidl_parcel.writeInt(getIntEnum());
+      break;
+    case longEnum:
+      _aidl_parcel.writeLong(getLongEnum());
+      break;
+    case deprecatedField:
+      _aidl_parcel.writeInt(getDeprecatedField());
+      break;
+    }
+  }
+
+  public void readFromParcel(android.os.Parcel _aidl_parcel) {
+    int _aidl_tag;
+    _aidl_tag = _aidl_parcel.readInt();
+    switch (_aidl_tag) {
+    case intEnum: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case longEnum: {
+      long _aidl_value;
+      _aidl_value = _aidl_parcel.readLong();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case deprecatedField: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    }
+    throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+  }
+
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    switch (getTag()) {
+    }
+    return _mask;
+  }
+
+  @Override
+  public String toString() {
+    switch (_tag) {
+    case intEnum: return "EnumUnion.intEnum(" + (android.aidl.tests.IntEnum.$.toString(getIntEnum())) + ")";
+    case longEnum: return "EnumUnion.longEnum(" + (getLongEnum()) + ")";
+    case deprecatedField: return "EnumUnion.deprecatedField(" + (getDeprecatedField()) + ")";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+  @Override
+  public boolean equals(Object other) {
+    if (this == other) return true;
+    if (other == null) return false;
+    if (!(other instanceof EnumUnion)) return false;
+    EnumUnion that = (EnumUnion)other;
+    if (_tag != that._tag) return false;
+    if (!java.util.Objects.deepEquals(_value, that._value)) return false;
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return java.util.Arrays.deepHashCode(java.util.Arrays.asList(_tag, _value).toArray());
+  }
+
+  private void _assertTag(int tag) {
+    if (getTag() != tag) {
+      throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+    }
+  }
+
+  private String _tagString(int _tag) {
+    switch (_tag) {
+    case intEnum: return "intEnum";
+    case longEnum: return "longEnum";
+    case deprecatedField: return "deprecatedField";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+
+  private void _set(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+  public static @interface Tag {
+    public static final int intEnum = 0;
+    public static final int longEnum = 1;
+    /** @deprecated do not use this */
+    @Deprecated
+    public static final int deprecatedField = 2;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/unions/EnumUnion.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/unions/EnumUnion.java.d
new file mode 100644
index 0000000..d7b0669
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/unions/EnumUnion.java.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/unions/EnumUnion.java : \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/unions/UnionInUnion.java b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/unions/UnionInUnion.java
new file mode 100644
index 0000000..e40020f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/unions/UnionInUnion.java
@@ -0,0 +1,169 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/unions/UnionInUnion.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+package android.aidl.tests.unions;
+public final class UnionInUnion implements android.os.Parcelable {
+  // tags for union fields
+  public final static int first = 0;  // android.aidl.tests.unions.EnumUnion first;
+  public final static int second = 1;  // int second;
+
+  private int _tag;
+  private Object _value;
+
+  public UnionInUnion() {
+    android.aidl.tests.unions.EnumUnion _value = null;
+    this._tag = first;
+    this._value = _value;
+  }
+
+  private UnionInUnion(android.os.Parcel _aidl_parcel) {
+    readFromParcel(_aidl_parcel);
+  }
+
+  private UnionInUnion(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+
+  public int getTag() {
+    return _tag;
+  }
+
+  // android.aidl.tests.unions.EnumUnion first;
+
+  public static UnionInUnion first(android.aidl.tests.unions.EnumUnion _value) {
+    return new UnionInUnion(first, _value);
+  }
+
+  public android.aidl.tests.unions.EnumUnion getFirst() {
+    _assertTag(first);
+    return (android.aidl.tests.unions.EnumUnion) _value;
+  }
+
+  public void setFirst(android.aidl.tests.unions.EnumUnion _value) {
+    _set(first, _value);
+  }
+
+  // int second;
+
+  public static UnionInUnion second(int _value) {
+    return new UnionInUnion(second, _value);
+  }
+
+  public int getSecond() {
+    _assertTag(second);
+    return (int) _value;
+  }
+
+  public void setSecond(int _value) {
+    _set(second, _value);
+  }
+
+  public static final android.os.Parcelable.Creator<UnionInUnion> CREATOR = new android.os.Parcelable.Creator<UnionInUnion>() {
+    @Override
+    public UnionInUnion createFromParcel(android.os.Parcel _aidl_source) {
+      return new UnionInUnion(_aidl_source);
+    }
+    @Override
+    public UnionInUnion[] newArray(int _aidl_size) {
+      return new UnionInUnion[_aidl_size];
+    }
+  };
+
+  @Override
+  public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+    _aidl_parcel.writeInt(_tag);
+    switch (_tag) {
+    case first:
+      _aidl_parcel.writeTypedObject(getFirst(), _aidl_flag);
+      break;
+    case second:
+      _aidl_parcel.writeInt(getSecond());
+      break;
+    }
+  }
+
+  public void readFromParcel(android.os.Parcel _aidl_parcel) {
+    int _aidl_tag;
+    _aidl_tag = _aidl_parcel.readInt();
+    switch (_aidl_tag) {
+    case first: {
+      android.aidl.tests.unions.EnumUnion _aidl_value;
+      _aidl_value = _aidl_parcel.readTypedObject(android.aidl.tests.unions.EnumUnion.CREATOR);
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case second: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    }
+    throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+  }
+
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    switch (getTag()) {
+    case first:
+      _mask |= describeContents(getFirst());
+      break;
+    }
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+
+  @Override
+  public String toString() {
+    switch (_tag) {
+    case first: return "UnionInUnion.first(" + (java.util.Objects.toString(getFirst())) + ")";
+    case second: return "UnionInUnion.second(" + (getSecond()) + ")";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+  @Override
+  public boolean equals(Object other) {
+    if (this == other) return true;
+    if (other == null) return false;
+    if (!(other instanceof UnionInUnion)) return false;
+    UnionInUnion that = (UnionInUnion)other;
+    if (_tag != that._tag) return false;
+    if (!java.util.Objects.deepEquals(_value, that._value)) return false;
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return java.util.Arrays.deepHashCode(java.util.Arrays.asList(_tag, _value).toArray());
+  }
+
+  private void _assertTag(int tag) {
+    if (getTag() != tag) {
+      throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+    }
+  }
+
+  private String _tagString(int _tag) {
+    switch (_tag) {
+    case first: return "first";
+    case second: return "second";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+
+  private void _set(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+  public static @interface Tag {
+    public static final int first = 0;
+    public static final int second = 1;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/unions/UnionInUnion.java.d b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/unions/UnionInUnion.java.d
new file mode 100644
index 0000000..7d27fdd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/android/aidl/tests/unions/UnionInUnion.java.d
@@ -0,0 +1,5 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/unions/UnionInUnion.java : \
+  system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-java-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-java-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp
new file mode 100644
index 0000000..4708a51
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp
@@ -0,0 +1,499 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#include "aidl/android/aidl/tests/ArrayOfInterfaces.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ArrayOfInterfaces::descriptor = "android.aidl.tests.ArrayOfInterfaces";
+
+binder_status_t ArrayOfInterfaces::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ArrayOfInterfaces::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_ArrayOfInterfaces_IEmptyInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  (void)_aidl_binder;
+  (void)_aidl_code;
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ArrayOfInterfaces_IEmptyInterface_clazz = ::ndk::ICInterface::defineClass(ArrayOfInterfaces::IEmptyInterface::descriptor, _aidl_android_aidl_tests_ArrayOfInterfaces_IEmptyInterface_onTransact);
+
+ArrayOfInterfaces::BpEmptyInterface::BpEmptyInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ArrayOfInterfaces::BpEmptyInterface::~BpEmptyInterface() {}
+
+// Source for BnEmptyInterface
+ArrayOfInterfaces::BnEmptyInterface::BnEmptyInterface() {}
+ArrayOfInterfaces::BnEmptyInterface::~BnEmptyInterface() {}
+::ndk::SpAIBinder ArrayOfInterfaces::BnEmptyInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ArrayOfInterfaces_IEmptyInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IEmptyInterface
+const char* ArrayOfInterfaces::IEmptyInterface::descriptor = "android.aidl.tests.ArrayOfInterfaces.IEmptyInterface";
+ArrayOfInterfaces::IEmptyInterface::IEmptyInterface() {}
+ArrayOfInterfaces::IEmptyInterface::~IEmptyInterface() {}
+
+
+std::shared_ptr<ArrayOfInterfaces::IEmptyInterface> ArrayOfInterfaces::IEmptyInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ArrayOfInterfaces_IEmptyInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ArrayOfInterfaces::BpEmptyInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IEmptyInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ArrayOfInterfaces::BpEmptyInterface>(binder);
+}
+
+binder_status_t ArrayOfInterfaces::IEmptyInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<IEmptyInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ArrayOfInterfaces::IEmptyInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<IEmptyInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IEmptyInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ArrayOfInterfaces::IEmptyInterface::setDefaultImpl(const std::shared_ptr<IEmptyInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IEmptyInterface::default_impl);
+  if (impl) {
+    IEmptyInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ArrayOfInterfaces::IEmptyInterface>& ArrayOfInterfaces::IEmptyInterface::getDefaultImpl() {
+  return IEmptyInterface::default_impl;
+}
+std::shared_ptr<ArrayOfInterfaces::IEmptyInterface> ArrayOfInterfaces::IEmptyInterface::default_impl = nullptr;
+::ndk::SpAIBinder ArrayOfInterfaces::IEmptyInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ArrayOfInterfaces::IEmptyInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_ArrayOfInterfaces_IMyInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<ArrayOfInterfaces::BnMyInterface> _aidl_impl = std::static_pointer_cast<ArrayOfInterfaces::BnMyInterface>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*methodWithInterfaces*/): {
+      std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> in_iface;
+      std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> in_nullable_iface;
+      std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> in_iface_array_in;
+      std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> out_iface_array_out;
+      std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> in_iface_array_inout;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> in_nullable_iface_array_in;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> out_nullable_iface_array_out;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> in_nullable_iface_array_inout;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_iface);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_nullable_iface);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_iface_array_in);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_iface_array_out);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_iface_array_inout);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_nullable_iface_array_in);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_nullable_iface_array_out);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_nullable_iface_array_inout);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->methodWithInterfaces(in_iface, in_nullable_iface, in_iface_array_in, &out_iface_array_out, &in_iface_array_inout, in_nullable_iface_array_in, &out_nullable_iface_array_out, &in_nullable_iface_array_inout, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_iface_array_out);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_iface_array_inout);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, out_nullable_iface_array_out);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, in_nullable_iface_array_inout);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ArrayOfInterfaces_IMyInterface_clazz = ::ndk::ICInterface::defineClass(ArrayOfInterfaces::IMyInterface::descriptor, _aidl_android_aidl_tests_ArrayOfInterfaces_IMyInterface_onTransact);
+
+ArrayOfInterfaces::BpMyInterface::BpMyInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ArrayOfInterfaces::BpMyInterface::~BpMyInterface() {}
+
+::ndk::ScopedAStatus ArrayOfInterfaces::BpMyInterface::methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& in_iface, const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& in_nullable_iface, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& in_iface_array_in, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* out_iface_array_out, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* in_iface_array_inout, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& in_nullable_iface_array_in, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* out_nullable_iface_array_out, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* in_nullable_iface_array_inout, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_iface);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_nullable_iface);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_iface_array_in);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_iface_array_out);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_iface_array_inout);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_nullable_iface_array_in);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_nullable_iface_array_out);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), *in_nullable_iface_array_inout);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*methodWithInterfaces*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyInterface::getDefaultImpl()) {
+    _aidl_status = IMyInterface::getDefaultImpl()->methodWithInterfaces(in_iface, in_nullable_iface, in_iface_array_in, out_iface_array_out, in_iface_array_inout, in_nullable_iface_array_in, out_nullable_iface_array_out, in_nullable_iface_array_inout, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_iface_array_out);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_iface_array_inout);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), out_nullable_iface_array_out);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), in_nullable_iface_array_inout);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnMyInterface
+ArrayOfInterfaces::BnMyInterface::BnMyInterface() {}
+ArrayOfInterfaces::BnMyInterface::~BnMyInterface() {}
+::ndk::SpAIBinder ArrayOfInterfaces::BnMyInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ArrayOfInterfaces_IMyInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IMyInterface
+const char* ArrayOfInterfaces::IMyInterface::descriptor = "android.aidl.tests.ArrayOfInterfaces.IMyInterface";
+ArrayOfInterfaces::IMyInterface::IMyInterface() {}
+ArrayOfInterfaces::IMyInterface::~IMyInterface() {}
+
+
+std::shared_ptr<ArrayOfInterfaces::IMyInterface> ArrayOfInterfaces::IMyInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ArrayOfInterfaces_IMyInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ArrayOfInterfaces::BpMyInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IMyInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ArrayOfInterfaces::BpMyInterface>(binder);
+}
+
+binder_status_t ArrayOfInterfaces::IMyInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<IMyInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ArrayOfInterfaces::IMyInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<IMyInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IMyInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ArrayOfInterfaces::IMyInterface::setDefaultImpl(const std::shared_ptr<IMyInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IMyInterface::default_impl);
+  if (impl) {
+    IMyInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ArrayOfInterfaces::IMyInterface>& ArrayOfInterfaces::IMyInterface::getDefaultImpl() {
+  return IMyInterface::default_impl;
+}
+std::shared_ptr<ArrayOfInterfaces::IMyInterface> ArrayOfInterfaces::IMyInterface::default_impl = nullptr;
+::ndk::ScopedAStatus ArrayOfInterfaces::IMyInterfaceDefault::methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& /*in_iface*/, const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& /*in_nullable_iface*/, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& /*in_iface_array_in*/, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* /*out_iface_array_out*/, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* /*in_iface_array_inout*/, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& /*in_nullable_iface_array_in*/, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* /*out_nullable_iface_array_out*/, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* /*in_nullable_iface_array_inout*/, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder ArrayOfInterfaces::IMyInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ArrayOfInterfaces::IMyInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ArrayOfInterfaces::MyParcelable::descriptor = "android.aidl.tests.ArrayOfInterfaces.MyParcelable";
+
+binder_status_t ArrayOfInterfaces::MyParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &iface);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_iface);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &iface_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_iface_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ArrayOfInterfaces::MyParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, iface);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_iface);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, iface_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_iface_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ArrayOfInterfaces::MyUnion::descriptor = "android.aidl.tests.ArrayOfInterfaces.MyUnion";
+
+binder_status_t ArrayOfInterfaces::MyUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case iface: {
+    std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>) {
+      set<iface>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<iface>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case nullable_iface: {
+    std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readNullableData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>) {
+      set<nullable_iface>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<nullable_iface>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case iface_array: {
+    std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>) {
+      set<iface_array>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<iface_array>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case nullable_iface_array: {
+    std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readNullableData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>>) {
+      set<nullable_iface_array>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<nullable_iface_array>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t ArrayOfInterfaces::MyUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case iface: return ::ndk::AParcel_writeData(_parcel, get<iface>());
+  case nullable_iface: return ::ndk::AParcel_writeNullableData(_parcel, get<nullable_iface>());
+  case iface_array: return ::ndk::AParcel_writeData(_parcel, get<iface_array>());
+  case nullable_iface_array: return ::ndk::AParcel_writeNullableData(_parcel, get<nullable_iface_array>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d
new file mode 100644
index 0000000..d67076b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/ArrayOfInterfaces.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/BackendType.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/BackendType.cpp
new file mode 100644
index 0000000..a9210ae
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/BackendType.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/BackendType.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/BackendType.cpp.d
new file mode 100644
index 0000000..89a9bf9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/BackendType.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/BackendType.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ByteEnum.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ByteEnum.cpp
new file mode 100644
index 0000000..ee759d8
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ByteEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ByteEnum.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ByteEnum.cpp.d
new file mode 100644
index 0000000..c858c80
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ByteEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/ByteEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/CircularParcelable.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/CircularParcelable.cpp
new file mode 100644
index 0000000..1023776
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/CircularParcelable.cpp
@@ -0,0 +1,68 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#include "aidl/android/aidl/tests/CircularParcelable.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/tests/BnCircular.h>
+#include <aidl/android/aidl/tests/BnNamedCallback.h>
+#include <aidl/android/aidl/tests/BnNewName.h>
+#include <aidl/android/aidl/tests/BnOldName.h>
+#include <aidl/android/aidl/tests/BnTestService.h>
+#include <aidl/android/aidl/tests/BpCircular.h>
+#include <aidl/android/aidl/tests/BpNamedCallback.h>
+#include <aidl/android/aidl/tests/BpNewName.h>
+#include <aidl/android/aidl/tests/BpOldName.h>
+#include <aidl/android/aidl/tests/BpTestService.h>
+#include <aidl/android/aidl/tests/ICircular.h>
+#include <aidl/android/aidl/tests/INamedCallback.h>
+#include <aidl/android/aidl/tests/INewName.h>
+#include <aidl/android/aidl/tests/IOldName.h>
+#include <aidl/android/aidl/tests/ITestService.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* CircularParcelable::descriptor = "android.aidl.tests.CircularParcelable";
+
+binder_status_t CircularParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &testService);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t CircularParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, testService);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/CircularParcelable.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/CircularParcelable.cpp.d
new file mode 100644
index 0000000..a455283
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/CircularParcelable.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/CircularParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp
new file mode 100644
index 0000000..d521ac6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d
new file mode 100644
index 0000000..d0ab502
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/ConstantExpressionEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedEnum.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedEnum.cpp
new file mode 100644
index 0000000..b6b6bc1
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d
new file mode 100644
index 0000000..e25ec9e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedParcelable.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedParcelable.cpp
new file mode 100644
index 0000000..470496a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedParcelable.cpp
@@ -0,0 +1,43 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#include "aidl/android/aidl/tests/DeprecatedParcelable.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* DeprecatedParcelable::descriptor = "android.aidl.tests.DeprecatedParcelable";
+
+binder_status_t DeprecatedParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t DeprecatedParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d
new file mode 100644
index 0000000..fcc436c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/DeprecatedParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/FixedSize.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/FixedSize.cpp
new file mode 100644
index 0000000..1e58c5d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/FixedSize.cpp
@@ -0,0 +1,282 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#include "aidl/android/aidl/tests/FixedSize.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* FixedSize::descriptor = "android.aidl.tests.FixedSize";
+
+binder_status_t FixedSize::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t FixedSize::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* FixedSize::FixedParcelable::descriptor = "android.aidl.tests.FixedSize.FixedParcelable";
+
+binder_status_t FixedSize::FixedParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &booleanValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &charValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &floatValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &doubleValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &enumValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcelableValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t FixedSize::FixedParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, booleanValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, charValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, floatValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, doubleValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, enumValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcelableValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* FixedSize::FixedUnion::descriptor = "android.aidl.tests.FixedSize.FixedUnion";
+
+binder_status_t FixedSize::FixedUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case booleanValue: {
+    bool _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<bool>) {
+      set<booleanValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<booleanValue>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case byteValue: {
+    int8_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int8_t>) {
+      set<byteValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<byteValue>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case charValue: {
+    char16_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<char16_t>) {
+      set<charValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<charValue>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case intValue: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<intValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intValue>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case longValue: {
+    int64_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int64_t>) {
+      set<longValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<longValue>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case floatValue: {
+    float _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<float>) {
+      set<floatValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<floatValue>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case doubleValue: {
+    double _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<double>) {
+      set<doubleValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<doubleValue>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case enumValue: {
+    ::aidl::android::aidl::tests::LongEnum _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::aidl::android::aidl::tests::LongEnum>) {
+      set<enumValue>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<enumValue>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t FixedSize::FixedUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case booleanValue: return ::ndk::AParcel_writeData(_parcel, get<booleanValue>());
+  case byteValue: return ::ndk::AParcel_writeData(_parcel, get<byteValue>());
+  case charValue: return ::ndk::AParcel_writeData(_parcel, get<charValue>());
+  case intValue: return ::ndk::AParcel_writeData(_parcel, get<intValue>());
+  case longValue: return ::ndk::AParcel_writeData(_parcel, get<longValue>());
+  case floatValue: return ::ndk::AParcel_writeData(_parcel, get<floatValue>());
+  case doubleValue: return ::ndk::AParcel_writeData(_parcel, get<doubleValue>());
+  case enumValue: return ::ndk::AParcel_writeData(_parcel, get<enumValue>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/FixedSize.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/FixedSize.cpp.d
new file mode 100644
index 0000000..b27ad3e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/FixedSize.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/FixedSize.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp
new file mode 100644
index 0000000..8b42714
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp
@@ -0,0 +1,4 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d
new file mode 100644
index 0000000..06b2f5d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/GenericStructuredParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ICircular.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ICircular.cpp
new file mode 100644
index 0000000..e8ff550
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ICircular.cpp
@@ -0,0 +1,166 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#include "aidl/android/aidl/tests/ICircular.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/tests/BnCircular.h>
+#include <aidl/android/aidl/tests/BnNamedCallback.h>
+#include <aidl/android/aidl/tests/BnNewName.h>
+#include <aidl/android/aidl/tests/BnOldName.h>
+#include <aidl/android/aidl/tests/BnTestService.h>
+#include <aidl/android/aidl/tests/BpCircular.h>
+#include <aidl/android/aidl/tests/BpNamedCallback.h>
+#include <aidl/android/aidl/tests/BpNewName.h>
+#include <aidl/android/aidl/tests/BpOldName.h>
+#include <aidl/android/aidl/tests/BpTestService.h>
+#include <aidl/android/aidl/tests/INamedCallback.h>
+#include <aidl/android/aidl/tests/INewName.h>
+#include <aidl/android/aidl/tests/IOldName.h>
+#include <aidl/android/aidl/tests/ITestService.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_ICircular_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnCircular> _aidl_impl = std::static_pointer_cast<BnCircular>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*GetTestService*/): {
+      std::shared_ptr<::aidl::android::aidl::tests::ITestService> _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetTestService(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ICircular_clazz = ::ndk::ICInterface::defineClass(ICircular::descriptor, _aidl_android_aidl_tests_ICircular_onTransact);
+
+BpCircular::BpCircular(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpCircular::~BpCircular() {}
+
+::ndk::ScopedAStatus BpCircular::GetTestService(std::shared_ptr<::aidl::android::aidl::tests::ITestService>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*GetTestService*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ICircular::getDefaultImpl()) {
+    _aidl_status = ICircular::getDefaultImpl()->GetTestService(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnCircular
+BnCircular::BnCircular() {}
+BnCircular::~BnCircular() {}
+::ndk::SpAIBinder BnCircular::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ICircular_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for ICircular
+const char* ICircular::descriptor = "android.aidl.tests.ICircular";
+ICircular::ICircular() {}
+ICircular::~ICircular() {}
+
+
+std::shared_ptr<ICircular> ICircular::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ICircular_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpCircular>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<ICircular>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpCircular>(binder);
+}
+
+binder_status_t ICircular::writeToParcel(AParcel* parcel, const std::shared_ptr<ICircular>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ICircular::readFromParcel(const AParcel* parcel, std::shared_ptr<ICircular>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = ICircular::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ICircular::setDefaultImpl(const std::shared_ptr<ICircular>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!ICircular::default_impl);
+  if (impl) {
+    ICircular::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ICircular>& ICircular::getDefaultImpl() {
+  return ICircular::default_impl;
+}
+std::shared_ptr<ICircular> ICircular::default_impl = nullptr;
+::ndk::ScopedAStatus ICircularDefault::GetTestService(std::shared_ptr<::aidl::android::aidl::tests::ITestService>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder ICircularDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ICircularDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ICircular.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ICircular.cpp.d
new file mode 100644
index 0000000..3c20e3a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ICircular.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/ICircular.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IDeprecated.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IDeprecated.cpp
new file mode 100644
index 0000000..88d52b1
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IDeprecated.cpp
@@ -0,0 +1,100 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#include "aidl/android/aidl/tests/IDeprecated.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/tests/BnDeprecated.h>
+#include <aidl/android/aidl/tests/BpDeprecated.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated"
+static binder_status_t _aidl_android_aidl_tests_IDeprecated_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  (void)_aidl_binder;
+  (void)_aidl_code;
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_IDeprecated_clazz = ::ndk::ICInterface::defineClass(IDeprecated::descriptor, _aidl_android_aidl_tests_IDeprecated_onTransact);
+
+#pragma clang diagnostic pop
+BpDeprecated::BpDeprecated(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpDeprecated::~BpDeprecated() {}
+
+// Source for BnDeprecated
+BnDeprecated::BnDeprecated() {}
+BnDeprecated::~BnDeprecated() {}
+::ndk::SpAIBinder BnDeprecated::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_IDeprecated_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IDeprecated
+const char* IDeprecated::descriptor = "android.aidl.tests.IDeprecated";
+IDeprecated::IDeprecated() {}
+IDeprecated::~IDeprecated() {}
+
+
+std::shared_ptr<IDeprecated> IDeprecated::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_IDeprecated_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpDeprecated>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IDeprecated>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpDeprecated>(binder);
+}
+
+binder_status_t IDeprecated::writeToParcel(AParcel* parcel, const std::shared_ptr<IDeprecated>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t IDeprecated::readFromParcel(const AParcel* parcel, std::shared_ptr<IDeprecated>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IDeprecated::fromBinder(binder);
+  return STATUS_OK;
+}
+bool IDeprecated::setDefaultImpl(const std::shared_ptr<IDeprecated>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IDeprecated::default_impl);
+  if (impl) {
+    IDeprecated::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<IDeprecated>& IDeprecated::getDefaultImpl() {
+  return IDeprecated::default_impl;
+}
+std::shared_ptr<IDeprecated> IDeprecated::default_impl = nullptr;
+::ndk::SpAIBinder IDeprecatedDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool IDeprecatedDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IDeprecated.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IDeprecated.cpp.d
new file mode 100644
index 0000000..d92d4e5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IDeprecated.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/IDeprecated.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/INamedCallback.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/INamedCallback.cpp
new file mode 100644
index 0000000..147cfde
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/INamedCallback.cpp
@@ -0,0 +1,154 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#include "aidl/android/aidl/tests/INamedCallback.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/tests/BnNamedCallback.h>
+#include <aidl/android/aidl/tests/BpNamedCallback.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_INamedCallback_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnNamedCallback> _aidl_impl = std::static_pointer_cast<BnNamedCallback>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*GetName*/): {
+      std::string _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetName(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_INamedCallback_clazz = ::ndk::ICInterface::defineClass(INamedCallback::descriptor, _aidl_android_aidl_tests_INamedCallback_onTransact);
+
+BpNamedCallback::BpNamedCallback(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpNamedCallback::~BpNamedCallback() {}
+
+::ndk::ScopedAStatus BpNamedCallback::GetName(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*GetName*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && INamedCallback::getDefaultImpl()) {
+    _aidl_status = INamedCallback::getDefaultImpl()->GetName(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnNamedCallback
+BnNamedCallback::BnNamedCallback() {}
+BnNamedCallback::~BnNamedCallback() {}
+::ndk::SpAIBinder BnNamedCallback::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_INamedCallback_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for INamedCallback
+const char* INamedCallback::descriptor = "android.aidl.tests.INamedCallback";
+INamedCallback::INamedCallback() {}
+INamedCallback::~INamedCallback() {}
+
+
+std::shared_ptr<INamedCallback> INamedCallback::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_INamedCallback_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpNamedCallback>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<INamedCallback>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpNamedCallback>(binder);
+}
+
+binder_status_t INamedCallback::writeToParcel(AParcel* parcel, const std::shared_ptr<INamedCallback>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t INamedCallback::readFromParcel(const AParcel* parcel, std::shared_ptr<INamedCallback>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = INamedCallback::fromBinder(binder);
+  return STATUS_OK;
+}
+bool INamedCallback::setDefaultImpl(const std::shared_ptr<INamedCallback>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!INamedCallback::default_impl);
+  if (impl) {
+    INamedCallback::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<INamedCallback>& INamedCallback::getDefaultImpl() {
+  return INamedCallback::default_impl;
+}
+std::shared_ptr<INamedCallback> INamedCallback::default_impl = nullptr;
+::ndk::ScopedAStatus INamedCallbackDefault::GetName(std::string* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder INamedCallbackDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool INamedCallbackDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/INamedCallback.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/INamedCallback.cpp.d
new file mode 100644
index 0000000..b6ec5e6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/INamedCallback.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/INamedCallback.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/INewName.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/INewName.cpp
new file mode 100644
index 0000000..73f954c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/INewName.cpp
@@ -0,0 +1,154 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#include "aidl/android/aidl/tests/INewName.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/tests/BnNewName.h>
+#include <aidl/android/aidl/tests/BpNewName.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_INewName_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnNewName> _aidl_impl = std::static_pointer_cast<BnNewName>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*RealName*/): {
+      std::string _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RealName(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_INewName_clazz = ::ndk::ICInterface::defineClass(INewName::descriptor, _aidl_android_aidl_tests_INewName_onTransact);
+
+BpNewName::BpNewName(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpNewName::~BpNewName() {}
+
+::ndk::ScopedAStatus BpNewName::RealName(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*RealName*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && INewName::getDefaultImpl()) {
+    _aidl_status = INewName::getDefaultImpl()->RealName(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnNewName
+BnNewName::BnNewName() {}
+BnNewName::~BnNewName() {}
+::ndk::SpAIBinder BnNewName::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_INewName_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for INewName
+const char* INewName::descriptor = "android.aidl.tests.IOldName";
+INewName::INewName() {}
+INewName::~INewName() {}
+
+
+std::shared_ptr<INewName> INewName::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_INewName_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpNewName>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<INewName>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpNewName>(binder);
+}
+
+binder_status_t INewName::writeToParcel(AParcel* parcel, const std::shared_ptr<INewName>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t INewName::readFromParcel(const AParcel* parcel, std::shared_ptr<INewName>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = INewName::fromBinder(binder);
+  return STATUS_OK;
+}
+bool INewName::setDefaultImpl(const std::shared_ptr<INewName>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!INewName::default_impl);
+  if (impl) {
+    INewName::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<INewName>& INewName::getDefaultImpl() {
+  return INewName::default_impl;
+}
+std::shared_ptr<INewName> INewName::default_impl = nullptr;
+::ndk::ScopedAStatus INewNameDefault::RealName(std::string* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder INewNameDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool INewNameDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/INewName.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/INewName.cpp.d
new file mode 100644
index 0000000..459e176
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/INewName.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/INewName.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IOldName.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IOldName.cpp
new file mode 100644
index 0000000..284757a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IOldName.cpp
@@ -0,0 +1,154 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#include "aidl/android/aidl/tests/IOldName.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/tests/BnOldName.h>
+#include <aidl/android/aidl/tests/BpOldName.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_IOldName_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnOldName> _aidl_impl = std::static_pointer_cast<BnOldName>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*RealName*/): {
+      std::string _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RealName(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_IOldName_clazz = ::ndk::ICInterface::defineClass(IOldName::descriptor, _aidl_android_aidl_tests_IOldName_onTransact);
+
+BpOldName::BpOldName(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpOldName::~BpOldName() {}
+
+::ndk::ScopedAStatus BpOldName::RealName(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*RealName*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IOldName::getDefaultImpl()) {
+    _aidl_status = IOldName::getDefaultImpl()->RealName(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnOldName
+BnOldName::BnOldName() {}
+BnOldName::~BnOldName() {}
+::ndk::SpAIBinder BnOldName::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_IOldName_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IOldName
+const char* IOldName::descriptor = "android.aidl.tests.IOldName";
+IOldName::IOldName() {}
+IOldName::~IOldName() {}
+
+
+std::shared_ptr<IOldName> IOldName::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_IOldName_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpOldName>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IOldName>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpOldName>(binder);
+}
+
+binder_status_t IOldName::writeToParcel(AParcel* parcel, const std::shared_ptr<IOldName>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t IOldName::readFromParcel(const AParcel* parcel, std::shared_ptr<IOldName>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IOldName::fromBinder(binder);
+  return STATUS_OK;
+}
+bool IOldName::setDefaultImpl(const std::shared_ptr<IOldName>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IOldName::default_impl);
+  if (impl) {
+    IOldName::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<IOldName>& IOldName::getDefaultImpl() {
+  return IOldName::default_impl;
+}
+std::shared_ptr<IOldName> IOldName::default_impl = nullptr;
+::ndk::ScopedAStatus IOldNameDefault::RealName(std::string* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder IOldNameDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool IOldNameDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IOldName.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IOldName.cpp.d
new file mode 100644
index 0000000..1ca4239
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IOldName.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/IOldName.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ITestService.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ITestService.cpp
new file mode 100644
index 0000000..04b5a06
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ITestService.cpp
@@ -0,0 +1,5367 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#include "aidl/android/aidl/tests/ITestService.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/tests/BnCircular.h>
+#include <aidl/android/aidl/tests/BnNamedCallback.h>
+#include <aidl/android/aidl/tests/BnNewName.h>
+#include <aidl/android/aidl/tests/BnOldName.h>
+#include <aidl/android/aidl/tests/BnTestService.h>
+#include <aidl/android/aidl/tests/BpCircular.h>
+#include <aidl/android/aidl/tests/BpNamedCallback.h>
+#include <aidl/android/aidl/tests/BpNewName.h>
+#include <aidl/android/aidl/tests/BpOldName.h>
+#include <aidl/android/aidl/tests/BpTestService.h>
+#include <aidl/android/aidl/tests/ICircular.h>
+#include <aidl/android/aidl/tests/INamedCallback.h>
+#include <aidl/android/aidl/tests/INewName.h>
+#include <aidl/android/aidl/tests/IOldName.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated"
+static binder_status_t _aidl_android_aidl_tests_ITestService_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnTestService> _aidl_impl = std::static_pointer_cast<BnTestService>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*UnimplementedMethod*/): {
+      int32_t in_arg;
+      int32_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_arg);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->UnimplementedMethod(in_arg, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*Deprecated*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->Deprecated();
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*TestOneway*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->TestOneway();
+      _aidl_ret_status = STATUS_OK;
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 3 /*RepeatBoolean*/): {
+      bool in_token;
+      bool _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatBoolean(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 4 /*RepeatByte*/): {
+      int8_t in_token;
+      int8_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatByte(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 5 /*RepeatChar*/): {
+      char16_t in_token;
+      char16_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatChar(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 6 /*RepeatInt*/): {
+      int32_t in_token;
+      int32_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatInt(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 7 /*RepeatLong*/): {
+      int64_t in_token;
+      int64_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatLong(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 8 /*RepeatFloat*/): {
+      float in_token;
+      float _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatFloat(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 9 /*RepeatDouble*/): {
+      double in_token;
+      double _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatDouble(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 10 /*RepeatString*/): {
+      std::string in_token;
+      std::string _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatString(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 11 /*RepeatByteEnum*/): {
+      ::aidl::android::aidl::tests::ByteEnum in_token;
+      ::aidl::android::aidl::tests::ByteEnum _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatByteEnum(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 12 /*RepeatIntEnum*/): {
+      ::aidl::android::aidl::tests::IntEnum in_token;
+      ::aidl::android::aidl::tests::IntEnum _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatIntEnum(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 13 /*RepeatLongEnum*/): {
+      ::aidl::android::aidl::tests::LongEnum in_token;
+      ::aidl::android::aidl::tests::LongEnum _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatLongEnum(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 14 /*ReverseBoolean*/): {
+      std::vector<bool> in_input;
+      std::vector<bool> out_repeated;
+      std::vector<bool> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseBoolean(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 15 /*ReverseByte*/): {
+      std::vector<uint8_t> in_input;
+      std::vector<uint8_t> out_repeated;
+      std::vector<uint8_t> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseByte(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16 /*ReverseChar*/): {
+      std::vector<char16_t> in_input;
+      std::vector<char16_t> out_repeated;
+      std::vector<char16_t> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseChar(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 17 /*ReverseInt*/): {
+      std::vector<int32_t> in_input;
+      std::vector<int32_t> out_repeated;
+      std::vector<int32_t> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseInt(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 18 /*ReverseLong*/): {
+      std::vector<int64_t> in_input;
+      std::vector<int64_t> out_repeated;
+      std::vector<int64_t> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseLong(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 19 /*ReverseFloat*/): {
+      std::vector<float> in_input;
+      std::vector<float> out_repeated;
+      std::vector<float> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseFloat(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 20 /*ReverseDouble*/): {
+      std::vector<double> in_input;
+      std::vector<double> out_repeated;
+      std::vector<double> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseDouble(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 21 /*ReverseString*/): {
+      std::vector<std::string> in_input;
+      std::vector<std::string> out_repeated;
+      std::vector<std::string> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseString(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 22 /*ReverseByteEnum*/): {
+      std::vector<::aidl::android::aidl::tests::ByteEnum> in_input;
+      std::vector<::aidl::android::aidl::tests::ByteEnum> out_repeated;
+      std::vector<::aidl::android::aidl::tests::ByteEnum> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseByteEnum(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 23 /*ReverseIntEnum*/): {
+      std::vector<::aidl::android::aidl::tests::IntEnum> in_input;
+      std::vector<::aidl::android::aidl::tests::IntEnum> out_repeated;
+      std::vector<::aidl::android::aidl::tests::IntEnum> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseIntEnum(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 24 /*ReverseLongEnum*/): {
+      std::vector<::aidl::android::aidl::tests::LongEnum> in_input;
+      std::vector<::aidl::android::aidl::tests::LongEnum> out_repeated;
+      std::vector<::aidl::android::aidl::tests::LongEnum> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseLongEnum(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 25 /*GetOtherTestService*/): {
+      std::string in_name;
+      std::shared_ptr<::aidl::android::aidl::tests::INamedCallback> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_name);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetOtherTestService(in_name, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 26 /*SetOtherTestService*/): {
+      std::string in_name;
+      std::shared_ptr<::aidl::android::aidl::tests::INamedCallback> in_service;
+      bool _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_name);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_service);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->SetOtherTestService(in_name, in_service, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 27 /*VerifyName*/): {
+      std::shared_ptr<::aidl::android::aidl::tests::INamedCallback> in_service;
+      std::string in_name;
+      bool _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_service);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_name);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->VerifyName(in_service, in_name, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 28 /*GetInterfaceArray*/): {
+      std::vector<std::string> in_names;
+      std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_names);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetInterfaceArray(in_names, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 29 /*VerifyNamesWithInterfaceArray*/): {
+      std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>> in_services;
+      std::vector<std::string> in_names;
+      bool _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_services);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_names);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->VerifyNamesWithInterfaceArray(in_services, in_names, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 30 /*GetNullableInterfaceArray*/): {
+      std::optional<std::vector<std::optional<std::string>>> in_names;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_names);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetNullableInterfaceArray(in_names, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 31 /*VerifyNamesWithNullableInterfaceArray*/): {
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>> in_services;
+      std::optional<std::vector<std::optional<std::string>>> in_names;
+      bool _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_services);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_names);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->VerifyNamesWithNullableInterfaceArray(in_services, in_names, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 32 /*GetInterfaceList*/): {
+      std::optional<std::vector<std::optional<std::string>>> in_names;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_names);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetInterfaceList(in_names, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 33 /*VerifyNamesWithInterfaceList*/): {
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>> in_services;
+      std::optional<std::vector<std::optional<std::string>>> in_names;
+      bool _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_services);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_names);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->VerifyNamesWithInterfaceList(in_services, in_names, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 34 /*ReverseStringList*/): {
+      std::vector<std::string> in_input;
+      std::vector<std::string> out_repeated;
+      std::vector<std::string> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseStringList(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 35 /*RepeatParcelFileDescriptor*/): {
+      ::ndk::ScopedFileDescriptor in_read;
+      ::ndk::ScopedFileDescriptor _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_read);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatParcelFileDescriptor(in_read, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 36 /*ReverseParcelFileDescriptorArray*/): {
+      std::vector<::ndk::ScopedFileDescriptor> in_input;
+      std::vector<::ndk::ScopedFileDescriptor> out_repeated;
+      std::vector<::ndk::ScopedFileDescriptor> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseParcelFileDescriptorArray(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 37 /*ThrowServiceException*/): {
+      int32_t in_code;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_code);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ThrowServiceException(in_code);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 38 /*RepeatNullableIntArray*/): {
+      std::optional<std::vector<int32_t>> in_input;
+      std::optional<std::vector<int32_t>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableIntArray(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 39 /*RepeatNullableByteEnumArray*/): {
+      std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>> in_input;
+      std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableByteEnumArray(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 40 /*RepeatNullableIntEnumArray*/): {
+      std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>> in_input;
+      std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableIntEnumArray(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 41 /*RepeatNullableLongEnumArray*/): {
+      std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>> in_input;
+      std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableLongEnumArray(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 42 /*RepeatNullableString*/): {
+      std::optional<std::string> in_input;
+      std::optional<std::string> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableString(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 43 /*RepeatNullableStringList*/): {
+      std::optional<std::vector<std::optional<std::string>>> in_input;
+      std::optional<std::vector<std::optional<std::string>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableStringList(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 44 /*RepeatNullableParcelable*/): {
+      std::optional<::aidl::android::aidl::tests::ITestService::Empty> in_input;
+      std::optional<::aidl::android::aidl::tests::ITestService::Empty> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableParcelable(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 45 /*RepeatNullableParcelableArray*/): {
+      std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>> in_input;
+      std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableParcelableArray(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 46 /*RepeatNullableParcelableList*/): {
+      std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>> in_input;
+      std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableParcelableList(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 47 /*TakesAnIBinder*/): {
+      ::ndk::SpAIBinder in_input;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->TakesAnIBinder(in_input);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 48 /*TakesANullableIBinder*/): {
+      ::ndk::SpAIBinder in_input;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->TakesANullableIBinder(in_input);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 49 /*TakesAnIBinderList*/): {
+      std::vector<::ndk::SpAIBinder> in_input;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->TakesAnIBinderList(in_input);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 50 /*TakesANullableIBinderList*/): {
+      std::optional<std::vector<::ndk::SpAIBinder>> in_input;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->TakesANullableIBinderList(in_input);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 51 /*RepeatUtf8CppString*/): {
+      std::string in_token;
+      std::string _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatUtf8CppString(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 52 /*RepeatNullableUtf8CppString*/): {
+      std::optional<std::string> in_token;
+      std::optional<std::string> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_token);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatNullableUtf8CppString(in_token, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 53 /*ReverseUtf8CppString*/): {
+      std::vector<std::string> in_input;
+      std::vector<std::string> out_repeated;
+      std::vector<std::string> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseUtf8CppString(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 54 /*ReverseNullableUtf8CppString*/): {
+      std::optional<std::vector<std::optional<std::string>>> in_input;
+      std::optional<std::vector<std::optional<std::string>>> out_repeated;
+      std::optional<std::vector<std::optional<std::string>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseNullableUtf8CppString(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 55 /*ReverseUtf8CppStringList*/): {
+      std::optional<std::vector<std::optional<std::string>>> in_input;
+      std::optional<std::vector<std::optional<std::string>>> out_repeated;
+      std::optional<std::vector<std::optional<std::string>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseUtf8CppStringList(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 56 /*GetCallback*/): {
+      bool in_return_null;
+      std::shared_ptr<::aidl::android::aidl::tests::INamedCallback> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_return_null);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetCallback(in_return_null, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 57 /*FillOutStructuredParcelable*/): {
+      ::aidl::android::aidl::tests::StructuredParcelable in_parcel;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_parcel);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->FillOutStructuredParcelable(&in_parcel);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_parcel);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 58 /*RepeatExtendableParcelable*/): {
+      ::aidl::android::aidl::tests::extension::ExtendableParcelable in_ep;
+      ::aidl::android::aidl::tests::extension::ExtendableParcelable out_ep2;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_ep);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->RepeatExtendableParcelable(in_ep, &out_ep2);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_ep2);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 59 /*ReverseList*/): {
+      ::aidl::android::aidl::tests::RecursiveList in_list;
+      ::aidl::android::aidl::tests::RecursiveList _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_list);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseList(in_list, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 60 /*ReverseIBinderArray*/): {
+      std::vector<::ndk::SpAIBinder> in_input;
+      std::vector<::ndk::SpAIBinder> out_repeated;
+      std::vector<::ndk::SpAIBinder> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseIBinderArray(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 61 /*ReverseNullableIBinderArray*/): {
+      std::optional<std::vector<::ndk::SpAIBinder>> in_input;
+      std::optional<std::vector<::ndk::SpAIBinder>> out_repeated;
+      std::optional<std::vector<::ndk::SpAIBinder>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_resizeVector(_aidl_in, &out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ReverseNullableIBinderArray(in_input, &out_repeated, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, out_repeated);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 62 /*GetOldNameInterface*/): {
+      std::shared_ptr<::aidl::android::aidl::tests::IOldName> _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetOldNameInterface(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 63 /*GetNewNameInterface*/): {
+      std::shared_ptr<::aidl::android::aidl::tests::INewName> _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetNewNameInterface(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 64 /*GetUnionTags*/): {
+      std::vector<::aidl::android::aidl::tests::Union> in_input;
+      std::vector<::aidl::android::aidl::tests::Union::Tag> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetUnionTags(in_input, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 65 /*GetCppJavaTests*/): {
+      ::ndk::SpAIBinder _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetCppJavaTests(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 66 /*getBackendType*/): {
+      ::aidl::android::aidl::tests::BackendType _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getBackendType(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 67 /*GetCircular*/): {
+      ::aidl::android::aidl::tests::CircularParcelable out_cp;
+      std::shared_ptr<::aidl::android::aidl::tests::ICircular> _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetCircular(&out_cp, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_cp);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ITestService_clazz = ::ndk::ICInterface::defineClass(ITestService::descriptor, _aidl_android_aidl_tests_ITestService_onTransact);
+
+#pragma clang diagnostic pop
+BpTestService::BpTestService(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpTestService::~BpTestService() {}
+
+::ndk::ScopedAStatus BpTestService::UnimplementedMethod(int32_t in_arg, int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_arg);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*UnimplementedMethod*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->UnimplementedMethod(in_arg, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::Deprecated() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*Deprecated*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->Deprecated();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::TestOneway() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*TestOneway*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_ONEWAY | FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->TestOneway();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatBoolean(bool in_token, bool* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 3 /*RepeatBoolean*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatBoolean(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatByte(int8_t in_token, int8_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 4 /*RepeatByte*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatByte(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatChar(char16_t in_token, char16_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 5 /*RepeatChar*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatChar(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatInt(int32_t in_token, int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 6 /*RepeatInt*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatInt(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatLong(int64_t in_token, int64_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 7 /*RepeatLong*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatLong(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatFloat(float in_token, float* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 8 /*RepeatFloat*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatFloat(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatDouble(double in_token, double* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 9 /*RepeatDouble*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatDouble(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatString(const std::string& in_token, std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 10 /*RepeatString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatString(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatByteEnum(::aidl::android::aidl::tests::ByteEnum in_token, ::aidl::android::aidl::tests::ByteEnum* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 11 /*RepeatByteEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatByteEnum(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatIntEnum(::aidl::android::aidl::tests::IntEnum in_token, ::aidl::android::aidl::tests::IntEnum* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 12 /*RepeatIntEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatIntEnum(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatLongEnum(::aidl::android::aidl::tests::LongEnum in_token, ::aidl::android::aidl::tests::LongEnum* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 13 /*RepeatLongEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatLongEnum(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseBoolean(const std::vector<bool>& in_input, std::vector<bool>* out_repeated, std::vector<bool>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 14 /*ReverseBoolean*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseBoolean(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseByte(const std::vector<uint8_t>& in_input, std::vector<uint8_t>* out_repeated, std::vector<uint8_t>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 15 /*ReverseByte*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseByte(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseChar(const std::vector<char16_t>& in_input, std::vector<char16_t>* out_repeated, std::vector<char16_t>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16 /*ReverseChar*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseChar(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseInt(const std::vector<int32_t>& in_input, std::vector<int32_t>* out_repeated, std::vector<int32_t>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 17 /*ReverseInt*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseInt(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseLong(const std::vector<int64_t>& in_input, std::vector<int64_t>* out_repeated, std::vector<int64_t>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 18 /*ReverseLong*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseLong(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseFloat(const std::vector<float>& in_input, std::vector<float>* out_repeated, std::vector<float>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 19 /*ReverseFloat*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseFloat(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseDouble(const std::vector<double>& in_input, std::vector<double>* out_repeated, std::vector<double>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 20 /*ReverseDouble*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseDouble(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 21 /*ReverseString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseString(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseByteEnum(const std::vector<::aidl::android::aidl::tests::ByteEnum>& in_input, std::vector<::aidl::android::aidl::tests::ByteEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::ByteEnum>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 22 /*ReverseByteEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseByteEnum(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseIntEnum(const std::vector<::aidl::android::aidl::tests::IntEnum>& in_input, std::vector<::aidl::android::aidl::tests::IntEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::IntEnum>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 23 /*ReverseIntEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseIntEnum(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseLongEnum(const std::vector<::aidl::android::aidl::tests::LongEnum>& in_input, std::vector<::aidl::android::aidl::tests::LongEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::LongEnum>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 24 /*ReverseLongEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseLongEnum(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetOtherTestService(const std::string& in_name, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_name);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 25 /*GetOtherTestService*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetOtherTestService(in_name, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::SetOtherTestService(const std::string& in_name, const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, bool* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_name);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_service);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 26 /*SetOtherTestService*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->SetOtherTestService(in_name, in_service, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::VerifyName(const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, const std::string& in_name, bool* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_service);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_name);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 27 /*VerifyName*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->VerifyName(in_service, in_name, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetInterfaceArray(const std::vector<std::string>& in_names, std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_names);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 28 /*GetInterfaceArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetInterfaceArray(in_names, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::VerifyNamesWithInterfaceArray(const std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>& in_services, const std::vector<std::string>& in_names, bool* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_services);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_names);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 29 /*VerifyNamesWithInterfaceArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->VerifyNamesWithInterfaceArray(in_services, in_names, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetNullableInterfaceArray(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_names);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 30 /*GetNullableInterfaceArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetNullableInterfaceArray(in_names, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::VerifyNamesWithNullableInterfaceArray(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_services);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_names);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 31 /*VerifyNamesWithNullableInterfaceArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->VerifyNamesWithNullableInterfaceArray(in_services, in_names, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetInterfaceList(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_names);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 32 /*GetInterfaceList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetInterfaceList(in_names, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::VerifyNamesWithInterfaceList(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_services);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_names);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 33 /*VerifyNamesWithInterfaceList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->VerifyNamesWithInterfaceList(in_services, in_names, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseStringList(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 34 /*ReverseStringList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseStringList(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatParcelFileDescriptor(const ::ndk::ScopedFileDescriptor& in_read, ::ndk::ScopedFileDescriptor* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_read);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 35 /*RepeatParcelFileDescriptor*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatParcelFileDescriptor(in_read, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseParcelFileDescriptorArray(const std::vector<::ndk::ScopedFileDescriptor>& in_input, std::vector<::ndk::ScopedFileDescriptor>* out_repeated, std::vector<::ndk::ScopedFileDescriptor>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 36 /*ReverseParcelFileDescriptorArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseParcelFileDescriptorArray(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ThrowServiceException(int32_t in_code) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_code);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 37 /*ThrowServiceException*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ThrowServiceException(in_code);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableIntArray(const std::optional<std::vector<int32_t>>& in_input, std::optional<std::vector<int32_t>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 38 /*RepeatNullableIntArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableIntArray(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableByteEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 39 /*RepeatNullableByteEnumArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableByteEnumArray(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableIntEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 40 /*RepeatNullableIntEnumArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableIntEnumArray(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableLongEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 41 /*RepeatNullableLongEnumArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableLongEnumArray(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableString(const std::optional<std::string>& in_input, std::optional<std::string>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 42 /*RepeatNullableString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableString(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 43 /*RepeatNullableStringList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableStringList(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableParcelable(const std::optional<::aidl::android::aidl::tests::ITestService::Empty>& in_input, std::optional<::aidl::android::aidl::tests::ITestService::Empty>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 44 /*RepeatNullableParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableParcelable(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableParcelableArray(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 45 /*RepeatNullableParcelableArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableParcelableArray(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableParcelableList(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 46 /*RepeatNullableParcelableList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableParcelableList(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::TakesAnIBinder(const ::ndk::SpAIBinder& in_input) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 47 /*TakesAnIBinder*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->TakesAnIBinder(in_input);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::TakesANullableIBinder(const ::ndk::SpAIBinder& in_input) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 48 /*TakesANullableIBinder*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->TakesANullableIBinder(in_input);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::TakesAnIBinderList(const std::vector<::ndk::SpAIBinder>& in_input) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 49 /*TakesAnIBinderList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->TakesAnIBinderList(in_input);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::TakesANullableIBinderList(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 50 /*TakesANullableIBinderList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->TakesANullableIBinderList(in_input);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatUtf8CppString(const std::string& in_token, std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 51 /*RepeatUtf8CppString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatUtf8CppString(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatNullableUtf8CppString(const std::optional<std::string>& in_token, std::optional<std::string>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_token);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 52 /*RepeatNullableUtf8CppString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatNullableUtf8CppString(in_token, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseUtf8CppString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 53 /*ReverseUtf8CppString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseUtf8CppString(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseNullableUtf8CppString(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 54 /*ReverseNullableUtf8CppString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseNullableUtf8CppString(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseUtf8CppStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 55 /*ReverseUtf8CppStringList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseUtf8CppStringList(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetCallback(bool in_return_null, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_return_null);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 56 /*GetCallback*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetCallback(in_return_null, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::FillOutStructuredParcelable(::aidl::android::aidl::tests::StructuredParcelable* in_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_parcel);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 57 /*FillOutStructuredParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->FillOutStructuredParcelable(in_parcel);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_parcel);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::RepeatExtendableParcelable(const ::aidl::android::aidl::tests::extension::ExtendableParcelable& in_ep, ::aidl::android::aidl::tests::extension::ExtendableParcelable* out_ep2) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_ep);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 58 /*RepeatExtendableParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->RepeatExtendableParcelable(in_ep, out_ep2);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_ep2);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseList(const ::aidl::android::aidl::tests::RecursiveList& in_list, ::aidl::android::aidl::tests::RecursiveList* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_list);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 59 /*ReverseList*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseList(in_list, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseIBinderArray(const std::vector<::ndk::SpAIBinder>& in_input, std::vector<::ndk::SpAIBinder>* out_repeated, std::vector<::ndk::SpAIBinder>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 60 /*ReverseIBinderArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseIBinderArray(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::ReverseNullableIBinderArray(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input, std::optional<std::vector<::ndk::SpAIBinder>>* out_repeated, std::optional<std::vector<::ndk::SpAIBinder>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeVectorSize(_aidl_in.get(), *out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 61 /*ReverseNullableIBinderArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->ReverseNullableIBinderArray(in_input, out_repeated, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), out_repeated);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetOldNameInterface(std::shared_ptr<::aidl::android::aidl::tests::IOldName>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 62 /*GetOldNameInterface*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetOldNameInterface(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetNewNameInterface(std::shared_ptr<::aidl::android::aidl::tests::INewName>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 63 /*GetNewNameInterface*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetNewNameInterface(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetUnionTags(const std::vector<::aidl::android::aidl::tests::Union>& in_input, std::vector<::aidl::android::aidl::tests::Union::Tag>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 64 /*GetUnionTags*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetUnionTags(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetCppJavaTests(::ndk::SpAIBinder* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 65 /*GetCppJavaTests*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetCppJavaTests(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::getBackendType(::aidl::android::aidl::tests::BackendType* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 66 /*getBackendType*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->getBackendType(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTestService::GetCircular(::aidl::android::aidl::tests::CircularParcelable* out_cp, std::shared_ptr<::aidl::android::aidl::tests::ICircular>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  AParcel_markSensitive(_aidl_in.get());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 67 /*GetCircular*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    FLAG_CLEAR_BUF
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+    _aidl_status = ITestService::getDefaultImpl()->GetCircular(out_cp, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_cp);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnTestService
+BnTestService::BnTestService() {}
+BnTestService::~BnTestService() {}
+::ndk::SpAIBinder BnTestService::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ITestService_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for ITestService
+const char* ITestService::descriptor = "android.aidl.tests.ITestService";
+ITestService::ITestService() {}
+ITestService::~ITestService() {}
+
+const char* ITestService::STRING_CONSTANT = "foo";
+const char* ITestService::STRING_CONSTANT2 = "bar";
+const char* ITestService::STRING_CONSTANT_UTF8 = "baz";
+
+std::shared_ptr<ITestService> ITestService::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ITestService_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpTestService>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<ITestService>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpTestService>(binder);
+}
+
+binder_status_t ITestService::writeToParcel(AParcel* parcel, const std::shared_ptr<ITestService>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ITestService::readFromParcel(const AParcel* parcel, std::shared_ptr<ITestService>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = ITestService::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ITestService::setDefaultImpl(const std::shared_ptr<ITestService>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!ITestService::default_impl);
+  if (impl) {
+    ITestService::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ITestService>& ITestService::getDefaultImpl() {
+  return ITestService::default_impl;
+}
+std::shared_ptr<ITestService> ITestService::default_impl = nullptr;
+::ndk::ScopedAStatus ITestServiceDefault::UnimplementedMethod(int32_t /*in_arg*/, int32_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::Deprecated() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::TestOneway() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatBoolean(bool /*in_token*/, bool* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatByte(int8_t /*in_token*/, int8_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatChar(char16_t /*in_token*/, char16_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatInt(int32_t /*in_token*/, int32_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatLong(int64_t /*in_token*/, int64_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatFloat(float /*in_token*/, float* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatDouble(double /*in_token*/, double* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatString(const std::string& /*in_token*/, std::string* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatByteEnum(::aidl::android::aidl::tests::ByteEnum /*in_token*/, ::aidl::android::aidl::tests::ByteEnum* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatIntEnum(::aidl::android::aidl::tests::IntEnum /*in_token*/, ::aidl::android::aidl::tests::IntEnum* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatLongEnum(::aidl::android::aidl::tests::LongEnum /*in_token*/, ::aidl::android::aidl::tests::LongEnum* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseBoolean(const std::vector<bool>& /*in_input*/, std::vector<bool>* /*out_repeated*/, std::vector<bool>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseByte(const std::vector<uint8_t>& /*in_input*/, std::vector<uint8_t>* /*out_repeated*/, std::vector<uint8_t>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseChar(const std::vector<char16_t>& /*in_input*/, std::vector<char16_t>* /*out_repeated*/, std::vector<char16_t>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseInt(const std::vector<int32_t>& /*in_input*/, std::vector<int32_t>* /*out_repeated*/, std::vector<int32_t>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseLong(const std::vector<int64_t>& /*in_input*/, std::vector<int64_t>* /*out_repeated*/, std::vector<int64_t>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseFloat(const std::vector<float>& /*in_input*/, std::vector<float>* /*out_repeated*/, std::vector<float>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseDouble(const std::vector<double>& /*in_input*/, std::vector<double>* /*out_repeated*/, std::vector<double>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseString(const std::vector<std::string>& /*in_input*/, std::vector<std::string>* /*out_repeated*/, std::vector<std::string>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseByteEnum(const std::vector<::aidl::android::aidl::tests::ByteEnum>& /*in_input*/, std::vector<::aidl::android::aidl::tests::ByteEnum>* /*out_repeated*/, std::vector<::aidl::android::aidl::tests::ByteEnum>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseIntEnum(const std::vector<::aidl::android::aidl::tests::IntEnum>& /*in_input*/, std::vector<::aidl::android::aidl::tests::IntEnum>* /*out_repeated*/, std::vector<::aidl::android::aidl::tests::IntEnum>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseLongEnum(const std::vector<::aidl::android::aidl::tests::LongEnum>& /*in_input*/, std::vector<::aidl::android::aidl::tests::LongEnum>* /*out_repeated*/, std::vector<::aidl::android::aidl::tests::LongEnum>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetOtherTestService(const std::string& /*in_name*/, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::SetOtherTestService(const std::string& /*in_name*/, const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& /*in_service*/, bool* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::VerifyName(const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& /*in_service*/, const std::string& /*in_name*/, bool* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetInterfaceArray(const std::vector<std::string>& /*in_names*/, std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::VerifyNamesWithInterfaceArray(const std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>& /*in_services*/, const std::vector<std::string>& /*in_names*/, bool* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetNullableInterfaceArray(const std::optional<std::vector<std::optional<std::string>>>& /*in_names*/, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::VerifyNamesWithNullableInterfaceArray(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& /*in_services*/, const std::optional<std::vector<std::optional<std::string>>>& /*in_names*/, bool* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetInterfaceList(const std::optional<std::vector<std::optional<std::string>>>& /*in_names*/, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::VerifyNamesWithInterfaceList(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& /*in_services*/, const std::optional<std::vector<std::optional<std::string>>>& /*in_names*/, bool* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseStringList(const std::vector<std::string>& /*in_input*/, std::vector<std::string>* /*out_repeated*/, std::vector<std::string>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatParcelFileDescriptor(const ::ndk::ScopedFileDescriptor& /*in_read*/, ::ndk::ScopedFileDescriptor* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseParcelFileDescriptorArray(const std::vector<::ndk::ScopedFileDescriptor>& /*in_input*/, std::vector<::ndk::ScopedFileDescriptor>* /*out_repeated*/, std::vector<::ndk::ScopedFileDescriptor>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ThrowServiceException(int32_t /*in_code*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableIntArray(const std::optional<std::vector<int32_t>>& /*in_input*/, std::optional<std::vector<int32_t>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableByteEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>& /*in_input*/, std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableIntEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>& /*in_input*/, std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableLongEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>& /*in_input*/, std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableString(const std::optional<std::string>& /*in_input*/, std::optional<std::string>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableStringList(const std::optional<std::vector<std::optional<std::string>>>& /*in_input*/, std::optional<std::vector<std::optional<std::string>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableParcelable(const std::optional<::aidl::android::aidl::tests::ITestService::Empty>& /*in_input*/, std::optional<::aidl::android::aidl::tests::ITestService::Empty>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableParcelableArray(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& /*in_input*/, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableParcelableList(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& /*in_input*/, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::TakesAnIBinder(const ::ndk::SpAIBinder& /*in_input*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::TakesANullableIBinder(const ::ndk::SpAIBinder& /*in_input*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::TakesAnIBinderList(const std::vector<::ndk::SpAIBinder>& /*in_input*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::TakesANullableIBinderList(const std::optional<std::vector<::ndk::SpAIBinder>>& /*in_input*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatUtf8CppString(const std::string& /*in_token*/, std::string* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatNullableUtf8CppString(const std::optional<std::string>& /*in_token*/, std::optional<std::string>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseUtf8CppString(const std::vector<std::string>& /*in_input*/, std::vector<std::string>* /*out_repeated*/, std::vector<std::string>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseNullableUtf8CppString(const std::optional<std::vector<std::optional<std::string>>>& /*in_input*/, std::optional<std::vector<std::optional<std::string>>>* /*out_repeated*/, std::optional<std::vector<std::optional<std::string>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseUtf8CppStringList(const std::optional<std::vector<std::optional<std::string>>>& /*in_input*/, std::optional<std::vector<std::optional<std::string>>>* /*out_repeated*/, std::optional<std::vector<std::optional<std::string>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetCallback(bool /*in_return_null*/, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::FillOutStructuredParcelable(::aidl::android::aidl::tests::StructuredParcelable* /*in_parcel*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::RepeatExtendableParcelable(const ::aidl::android::aidl::tests::extension::ExtendableParcelable& /*in_ep*/, ::aidl::android::aidl::tests::extension::ExtendableParcelable* /*out_ep2*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseList(const ::aidl::android::aidl::tests::RecursiveList& /*in_list*/, ::aidl::android::aidl::tests::RecursiveList* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseIBinderArray(const std::vector<::ndk::SpAIBinder>& /*in_input*/, std::vector<::ndk::SpAIBinder>* /*out_repeated*/, std::vector<::ndk::SpAIBinder>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::ReverseNullableIBinderArray(const std::optional<std::vector<::ndk::SpAIBinder>>& /*in_input*/, std::optional<std::vector<::ndk::SpAIBinder>>* /*out_repeated*/, std::optional<std::vector<::ndk::SpAIBinder>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetOldNameInterface(std::shared_ptr<::aidl::android::aidl::tests::IOldName>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetNewNameInterface(std::shared_ptr<::aidl::android::aidl::tests::INewName>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetUnionTags(const std::vector<::aidl::android::aidl::tests::Union>& /*in_input*/, std::vector<::aidl::android::aidl::tests::Union::Tag>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetCppJavaTests(::ndk::SpAIBinder* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::getBackendType(::aidl::android::aidl::tests::BackendType* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITestServiceDefault::GetCircular(::aidl::android::aidl::tests::CircularParcelable* /*out_cp*/, std::shared_ptr<::aidl::android::aidl::tests::ICircular>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder ITestServiceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ITestServiceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ITestService::Empty::descriptor = "android.aidl.tests.ITestService.Empty";
+
+binder_status_t ITestService::Empty::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ITestService::Empty::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ITestService::CompilerChecks::descriptor = "android.aidl.tests.ITestService.CompilerChecks";
+
+binder_status_t ITestService::CompilerChecks::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &binder);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_binder);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &binder_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_binder_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &binder_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_binder_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &pfd);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_pfd);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &pfd_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_pfd_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &pfd_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_pfd_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcel);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_parcel);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcel_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_parcel_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcel_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_parcel_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ITestService::CompilerChecks::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, binder);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_binder);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, binder_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_binder_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, binder_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_binder_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, pfd);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_pfd);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, pfd_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_pfd_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, pfd_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_pfd_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcel);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_parcel);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcel_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_parcel_array);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcel_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_parcel_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_ITestService_CompilerChecks_Foo_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  (void)_aidl_binder;
+  (void)_aidl_code;
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ITestService_CompilerChecks_Foo_clazz = ::ndk::ICInterface::defineClass(ITestService::CompilerChecks::IFoo::descriptor, _aidl_android_aidl_tests_ITestService_CompilerChecks_Foo_onTransact);
+
+ITestService::CompilerChecks::BpFoo::BpFoo(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ITestService::CompilerChecks::BpFoo::~BpFoo() {}
+
+// Source for BnFoo
+ITestService::CompilerChecks::BnFoo::BnFoo() {}
+ITestService::CompilerChecks::BnFoo::~BnFoo() {}
+::ndk::SpAIBinder ITestService::CompilerChecks::BnFoo::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ITestService_CompilerChecks_Foo_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IFoo
+const char* ITestService::CompilerChecks::IFoo::descriptor = "android.aidl.tests.ITestService.CompilerChecks.Foo";
+ITestService::CompilerChecks::IFoo::IFoo() {}
+ITestService::CompilerChecks::IFoo::~IFoo() {}
+
+
+std::shared_ptr<ITestService::CompilerChecks::IFoo> ITestService::CompilerChecks::IFoo::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ITestService_CompilerChecks_Foo_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ITestService::CompilerChecks::BpFoo>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IFoo>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ITestService::CompilerChecks::BpFoo>(binder);
+}
+
+binder_status_t ITestService::CompilerChecks::IFoo::writeToParcel(AParcel* parcel, const std::shared_ptr<IFoo>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ITestService::CompilerChecks::IFoo::readFromParcel(const AParcel* parcel, std::shared_ptr<IFoo>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IFoo::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ITestService::CompilerChecks::IFoo::setDefaultImpl(const std::shared_ptr<IFoo>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IFoo::default_impl);
+  if (impl) {
+    IFoo::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ITestService::CompilerChecks::IFoo>& ITestService::CompilerChecks::IFoo::getDefaultImpl() {
+  return IFoo::default_impl;
+}
+std::shared_ptr<ITestService::CompilerChecks::IFoo> ITestService::CompilerChecks::IFoo::default_impl = nullptr;
+::ndk::SpAIBinder ITestService::CompilerChecks::IFooDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ITestService::CompilerChecks::IFooDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ITestService::CompilerChecks::HasDeprecated::descriptor = "android.aidl.tests.ITestService.CompilerChecks.HasDeprecated";
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+binder_status_t ITestService::CompilerChecks::HasDeprecated::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &deprecated);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ITestService::CompilerChecks::HasDeprecated::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, deprecated);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+#pragma clang diagnostic pop
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ITestService::CompilerChecks::UsingHasDeprecated::descriptor = "android.aidl.tests.ITestService.CompilerChecks.UsingHasDeprecated";
+
+binder_status_t ITestService::CompilerChecks::UsingHasDeprecated::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case n: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<n>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<n>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case m: {
+    ::aidl::android::aidl::tests::ITestService::CompilerChecks::HasDeprecated _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::aidl::android::aidl::tests::ITestService::CompilerChecks::HasDeprecated>) {
+      set<m>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<m>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t ITestService::CompilerChecks::UsingHasDeprecated::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case n: return ::ndk::AParcel_writeData(_parcel, get<n>());
+  case m: return ::ndk::AParcel_writeData(_parcel, get<m>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<ITestService::CompilerChecks::BnNoPrefixInterface> _aidl_impl = std::static_pointer_cast<ITestService::CompilerChecks::BnNoPrefixInterface>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*foo*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->foo();
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_clazz = ::ndk::ICInterface::defineClass(ITestService::CompilerChecks::INoPrefixInterface::descriptor, _aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_onTransact);
+
+ITestService::CompilerChecks::BpNoPrefixInterface::BpNoPrefixInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ITestService::CompilerChecks::BpNoPrefixInterface::~BpNoPrefixInterface() {}
+
+::ndk::ScopedAStatus ITestService::CompilerChecks::BpNoPrefixInterface::foo() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*foo*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && INoPrefixInterface::getDefaultImpl()) {
+    _aidl_status = INoPrefixInterface::getDefaultImpl()->foo();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnNoPrefixInterface
+ITestService::CompilerChecks::BnNoPrefixInterface::BnNoPrefixInterface() {}
+ITestService::CompilerChecks::BnNoPrefixInterface::~BnNoPrefixInterface() {}
+::ndk::SpAIBinder ITestService::CompilerChecks::BnNoPrefixInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for INoPrefixInterface
+const char* ITestService::CompilerChecks::INoPrefixInterface::descriptor = "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface";
+ITestService::CompilerChecks::INoPrefixInterface::INoPrefixInterface() {}
+ITestService::CompilerChecks::INoPrefixInterface::~INoPrefixInterface() {}
+
+
+std::shared_ptr<ITestService::CompilerChecks::INoPrefixInterface> ITestService::CompilerChecks::INoPrefixInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ITestService::CompilerChecks::BpNoPrefixInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<INoPrefixInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ITestService::CompilerChecks::BpNoPrefixInterface>(binder);
+}
+
+binder_status_t ITestService::CompilerChecks::INoPrefixInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<INoPrefixInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ITestService::CompilerChecks::INoPrefixInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<INoPrefixInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = INoPrefixInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ITestService::CompilerChecks::INoPrefixInterface::setDefaultImpl(const std::shared_ptr<INoPrefixInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!INoPrefixInterface::default_impl);
+  if (impl) {
+    INoPrefixInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ITestService::CompilerChecks::INoPrefixInterface>& ITestService::CompilerChecks::INoPrefixInterface::getDefaultImpl() {
+  return INoPrefixInterface::default_impl;
+}
+std::shared_ptr<ITestService::CompilerChecks::INoPrefixInterface> ITestService::CompilerChecks::INoPrefixInterface::default_impl = nullptr;
+::ndk::ScopedAStatus ITestService::CompilerChecks::INoPrefixInterfaceDefault::foo() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder ITestService::CompilerChecks::INoPrefixInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ITestService::CompilerChecks::INoPrefixInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ITestService::CompilerChecks::INoPrefixInterface::Nested::descriptor = "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.Nested";
+
+binder_status_t ITestService::CompilerChecks::INoPrefixInterface::Nested::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ITestService::CompilerChecks::INoPrefixInterface::Nested::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_NestedNoPrefixInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<ITestService::CompilerChecks::INoPrefixInterface::BnNestedNoPrefixInterface> _aidl_impl = std::static_pointer_cast<ITestService::CompilerChecks::INoPrefixInterface::BnNestedNoPrefixInterface>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*foo*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->foo();
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_NestedNoPrefixInterface_clazz = ::ndk::ICInterface::defineClass(ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::descriptor, _aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_NestedNoPrefixInterface_onTransact);
+
+ITestService::CompilerChecks::INoPrefixInterface::BpNestedNoPrefixInterface::BpNestedNoPrefixInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ITestService::CompilerChecks::INoPrefixInterface::BpNestedNoPrefixInterface::~BpNestedNoPrefixInterface() {}
+
+::ndk::ScopedAStatus ITestService::CompilerChecks::INoPrefixInterface::BpNestedNoPrefixInterface::foo() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*foo*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && INestedNoPrefixInterface::getDefaultImpl()) {
+    _aidl_status = INestedNoPrefixInterface::getDefaultImpl()->foo();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnNestedNoPrefixInterface
+ITestService::CompilerChecks::INoPrefixInterface::BnNestedNoPrefixInterface::BnNestedNoPrefixInterface() {}
+ITestService::CompilerChecks::INoPrefixInterface::BnNestedNoPrefixInterface::~BnNestedNoPrefixInterface() {}
+::ndk::SpAIBinder ITestService::CompilerChecks::INoPrefixInterface::BnNestedNoPrefixInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_NestedNoPrefixInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for INestedNoPrefixInterface
+const char* ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::descriptor = "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface";
+ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::INestedNoPrefixInterface() {}
+ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::~INestedNoPrefixInterface() {}
+
+
+std::shared_ptr<ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface> ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ITestService_CompilerChecks_NoPrefixInterface_NestedNoPrefixInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ITestService::CompilerChecks::INoPrefixInterface::BpNestedNoPrefixInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<INestedNoPrefixInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ITestService::CompilerChecks::INoPrefixInterface::BpNestedNoPrefixInterface>(binder);
+}
+
+binder_status_t ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<INestedNoPrefixInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<INestedNoPrefixInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = INestedNoPrefixInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::setDefaultImpl(const std::shared_ptr<INestedNoPrefixInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!INestedNoPrefixInterface::default_impl);
+  if (impl) {
+    INestedNoPrefixInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface>& ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::getDefaultImpl() {
+  return INestedNoPrefixInterface::default_impl;
+}
+std::shared_ptr<ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface> ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterface::default_impl = nullptr;
+::ndk::ScopedAStatus ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterfaceDefault::foo() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ITestService::CompilerChecks::INoPrefixInterface::INestedNoPrefixInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ITestService.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ITestService.cpp.d
new file mode 100644
index 0000000..6cdbb1b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ITestService.cpp.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/ITestService.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IntEnum.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IntEnum.cpp
new file mode 100644
index 0000000..c2afc84
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IntEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IntEnum.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IntEnum.cpp.d
new file mode 100644
index 0000000..65e3972
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/IntEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/IntEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ListOfInterfaces.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ListOfInterfaces.cpp
new file mode 100644
index 0000000..a4702c6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ListOfInterfaces.cpp
@@ -0,0 +1,487 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#include "aidl/android/aidl/tests/ListOfInterfaces.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ListOfInterfaces::descriptor = "android.aidl.tests.ListOfInterfaces";
+
+binder_status_t ListOfInterfaces::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ListOfInterfaces::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_ListOfInterfaces_IEmptyInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  (void)_aidl_binder;
+  (void)_aidl_code;
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ListOfInterfaces_IEmptyInterface_clazz = ::ndk::ICInterface::defineClass(ListOfInterfaces::IEmptyInterface::descriptor, _aidl_android_aidl_tests_ListOfInterfaces_IEmptyInterface_onTransact);
+
+ListOfInterfaces::BpEmptyInterface::BpEmptyInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ListOfInterfaces::BpEmptyInterface::~BpEmptyInterface() {}
+
+// Source for BnEmptyInterface
+ListOfInterfaces::BnEmptyInterface::BnEmptyInterface() {}
+ListOfInterfaces::BnEmptyInterface::~BnEmptyInterface() {}
+::ndk::SpAIBinder ListOfInterfaces::BnEmptyInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ListOfInterfaces_IEmptyInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IEmptyInterface
+const char* ListOfInterfaces::IEmptyInterface::descriptor = "android.aidl.tests.ListOfInterfaces.IEmptyInterface";
+ListOfInterfaces::IEmptyInterface::IEmptyInterface() {}
+ListOfInterfaces::IEmptyInterface::~IEmptyInterface() {}
+
+
+std::shared_ptr<ListOfInterfaces::IEmptyInterface> ListOfInterfaces::IEmptyInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ListOfInterfaces_IEmptyInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ListOfInterfaces::BpEmptyInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IEmptyInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ListOfInterfaces::BpEmptyInterface>(binder);
+}
+
+binder_status_t ListOfInterfaces::IEmptyInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<IEmptyInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ListOfInterfaces::IEmptyInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<IEmptyInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IEmptyInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ListOfInterfaces::IEmptyInterface::setDefaultImpl(const std::shared_ptr<IEmptyInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IEmptyInterface::default_impl);
+  if (impl) {
+    IEmptyInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ListOfInterfaces::IEmptyInterface>& ListOfInterfaces::IEmptyInterface::getDefaultImpl() {
+  return IEmptyInterface::default_impl;
+}
+std::shared_ptr<ListOfInterfaces::IEmptyInterface> ListOfInterfaces::IEmptyInterface::default_impl = nullptr;
+::ndk::SpAIBinder ListOfInterfaces::IEmptyInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ListOfInterfaces::IEmptyInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+static binder_status_t _aidl_android_aidl_tests_ListOfInterfaces_IMyInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<ListOfInterfaces::BnMyInterface> _aidl_impl = std::static_pointer_cast<ListOfInterfaces::BnMyInterface>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*methodWithInterfaces*/): {
+      std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface> in_iface;
+      std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface> in_nullable_iface;
+      std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> in_iface_list_in;
+      std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> out_iface_list_out;
+      std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> in_iface_list_inout;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> in_nullable_iface_list_in;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> out_nullable_iface_list_out;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> in_nullable_iface_list_inout;
+      std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_iface);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_nullable_iface);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_iface_list_in);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_iface_list_inout);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_nullable_iface_list_in);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_nullable_iface_list_inout);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->methodWithInterfaces(in_iface, in_nullable_iface, in_iface_list_in, &out_iface_list_out, &in_iface_list_inout, in_nullable_iface_list_in, &out_nullable_iface_list_out, &in_nullable_iface_list_inout, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_iface_list_out);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_iface_list_inout);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, out_nullable_iface_list_out);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, in_nullable_iface_list_inout);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_ListOfInterfaces_IMyInterface_clazz = ::ndk::ICInterface::defineClass(ListOfInterfaces::IMyInterface::descriptor, _aidl_android_aidl_tests_ListOfInterfaces_IMyInterface_onTransact);
+
+ListOfInterfaces::BpMyInterface::BpMyInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ListOfInterfaces::BpMyInterface::~BpMyInterface() {}
+
+::ndk::ScopedAStatus ListOfInterfaces::BpMyInterface::methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& in_iface, const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& in_nullable_iface, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& in_iface_list_in, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* out_iface_list_out, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* in_iface_list_inout, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& in_nullable_iface_list_in, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* out_nullable_iface_list_out, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* in_nullable_iface_list_inout, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_iface);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_nullable_iface);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_iface_list_in);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_iface_list_inout);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_nullable_iface_list_in);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), *in_nullable_iface_list_inout);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*methodWithInterfaces*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyInterface::getDefaultImpl()) {
+    _aidl_status = IMyInterface::getDefaultImpl()->methodWithInterfaces(in_iface, in_nullable_iface, in_iface_list_in, out_iface_list_out, in_iface_list_inout, in_nullable_iface_list_in, out_nullable_iface_list_out, in_nullable_iface_list_inout, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_iface_list_out);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_iface_list_inout);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), out_nullable_iface_list_out);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), in_nullable_iface_list_inout);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnMyInterface
+ListOfInterfaces::BnMyInterface::BnMyInterface() {}
+ListOfInterfaces::BnMyInterface::~BnMyInterface() {}
+::ndk::SpAIBinder ListOfInterfaces::BnMyInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_ListOfInterfaces_IMyInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for IMyInterface
+const char* ListOfInterfaces::IMyInterface::descriptor = "android.aidl.tests.ListOfInterfaces.IMyInterface";
+ListOfInterfaces::IMyInterface::IMyInterface() {}
+ListOfInterfaces::IMyInterface::~IMyInterface() {}
+
+
+std::shared_ptr<ListOfInterfaces::IMyInterface> ListOfInterfaces::IMyInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_ListOfInterfaces_IMyInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ListOfInterfaces::BpMyInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IMyInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ListOfInterfaces::BpMyInterface>(binder);
+}
+
+binder_status_t ListOfInterfaces::IMyInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<IMyInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ListOfInterfaces::IMyInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<IMyInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IMyInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ListOfInterfaces::IMyInterface::setDefaultImpl(const std::shared_ptr<IMyInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IMyInterface::default_impl);
+  if (impl) {
+    IMyInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ListOfInterfaces::IMyInterface>& ListOfInterfaces::IMyInterface::getDefaultImpl() {
+  return IMyInterface::default_impl;
+}
+std::shared_ptr<ListOfInterfaces::IMyInterface> ListOfInterfaces::IMyInterface::default_impl = nullptr;
+::ndk::ScopedAStatus ListOfInterfaces::IMyInterfaceDefault::methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& /*in_iface*/, const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& /*in_nullable_iface*/, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& /*in_iface_list_in*/, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* /*out_iface_list_out*/, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* /*in_iface_list_inout*/, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& /*in_nullable_iface_list_in*/, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* /*out_nullable_iface_list_out*/, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* /*in_nullable_iface_list_inout*/, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder ListOfInterfaces::IMyInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ListOfInterfaces::IMyInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ListOfInterfaces::MyParcelable::descriptor = "android.aidl.tests.ListOfInterfaces.MyParcelable";
+
+binder_status_t ListOfInterfaces::MyParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &iface);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_iface);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &iface_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &nullable_iface_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ListOfInterfaces::MyParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, iface);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_iface);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, iface_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, nullable_iface_list);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ListOfInterfaces::MyUnion::descriptor = "android.aidl.tests.ListOfInterfaces.MyUnion";
+
+binder_status_t ListOfInterfaces::MyUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case iface: {
+    std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>) {
+      set<iface>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<iface>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case nullable_iface: {
+    std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readNullableData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>) {
+      set<nullable_iface>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<nullable_iface>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case iface_list: {
+    std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>) {
+      set<iface_list>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<iface_list>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case nullable_iface_list: {
+    std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readNullableData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>>) {
+      set<nullable_iface_list>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<nullable_iface_list>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t ListOfInterfaces::MyUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case iface: return ::ndk::AParcel_writeData(_parcel, get<iface>());
+  case nullable_iface: return ::ndk::AParcel_writeNullableData(_parcel, get<nullable_iface>());
+  case iface_list: return ::ndk::AParcel_writeData(_parcel, get<iface_list>());
+  case nullable_iface_list: return ::ndk::AParcel_writeNullableData(_parcel, get<nullable_iface_list>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d
new file mode 100644
index 0000000..29da8d1
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ListOfInterfaces.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/ListOfInterfaces.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/LongEnum.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/LongEnum.cpp
new file mode 100644
index 0000000..62b922e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/LongEnum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/LongEnum.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/LongEnum.cpp.d
new file mode 100644
index 0000000..e26849e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/LongEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/LongEnum.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/OtherParcelableForToString.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/OtherParcelableForToString.cpp
new file mode 100644
index 0000000..4a42487
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/OtherParcelableForToString.cpp
@@ -0,0 +1,53 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#include "aidl/android/aidl/tests/OtherParcelableForToString.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* OtherParcelableForToString::descriptor = "android.aidl.tests.OtherParcelableForToString";
+
+binder_status_t OtherParcelableForToString::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &field);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t OtherParcelableForToString::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, field);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d
new file mode 100644
index 0000000..d8682ff
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/OtherParcelableForToString.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/OtherParcelableForToString.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ParcelableForToString.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ParcelableForToString.cpp
new file mode 100644
index 0000000..4808730
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ParcelableForToString.cpp
@@ -0,0 +1,273 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#include "aidl/android/aidl/tests/ParcelableForToString.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* ParcelableForToString::descriptor = "android.aidl.tests.ParcelableForToString";
+
+binder_status_t ParcelableForToString::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &doubleValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &doubleArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &floatValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &floatArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &booleanValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &booleanArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &stringValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &stringArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &stringList);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcelableValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcelableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &enumValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &enumArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &nullArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &nullList);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &parcelableGeneric);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &unionValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ParcelableForToString::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, doubleValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, doubleArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, floatValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, floatArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, booleanValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, booleanArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, stringValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, stringArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, stringList);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcelableValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcelableArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, enumValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, enumArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, nullArray);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, nullList);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, parcelableGeneric);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, unionValue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ParcelableForToString.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ParcelableForToString.cpp.d
new file mode 100644
index 0000000..1d654df
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/ParcelableForToString.cpp.d
@@ -0,0 +1,10 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/ParcelableForToString.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/RecursiveList.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/RecursiveList.cpp
new file mode 100644
index 0000000..4c282e9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/RecursiveList.cpp
@@ -0,0 +1,63 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#include "aidl/android/aidl/tests/RecursiveList.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* RecursiveList::descriptor = "android.aidl.tests.RecursiveList";
+
+binder_status_t RecursiveList::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &value);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &next);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t RecursiveList::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, value);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, next);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/RecursiveList.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/RecursiveList.cpp.d
new file mode 100644
index 0000000..d413961
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/RecursiveList.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/RecursiveList.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/StructuredParcelable.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/StructuredParcelable.cpp
new file mode 100644
index 0000000..3c396b1
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/StructuredParcelable.cpp
@@ -0,0 +1,628 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#include "aidl/android/aidl/tests/StructuredParcelable.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* StructuredParcelable::descriptor = "android.aidl.tests.StructuredParcelable";
+
+binder_status_t StructuredParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldContainThreeFs);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &f);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldBeJerry);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldBeByteBar);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldBeIntBar);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldBeLongBar);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldContainTwoByteFoos);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldContainTwoIntFoos);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldContainTwoLongFoos);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &stringDefaultsToFoo);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteDefaultsToFour);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intDefaultsToFive);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longDefaultsToNegativeSeven);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &booleanDefaultsToTrue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &charDefaultsToC);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &floatDefaultsToPi);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &doubleWithDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &arrayDefaultsTo123);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &arrayDefaultsToEmpty);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &boolDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &byteDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &longDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &floatDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &doubleDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &checkDoubleFromFloat);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &checkStringArray1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &checkStringArray2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &int32_min);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &int32_max);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &int64_max);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &hexInt32_neg_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &ibinder);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &empty);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &int8_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &int32_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &int64_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &hexInt32_pos_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &hexInt64_pos_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_3);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_4);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_5);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_6);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_7);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_8);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_9);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &const_exprs_10);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &addString1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &addString2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &shouldSetBit0AndBit2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &u);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_parcel, &shouldBeConstS1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &defaultWithFoo);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t StructuredParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldContainThreeFs);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, f);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldBeJerry);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldBeByteBar);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldBeIntBar);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldBeLongBar);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldContainTwoByteFoos);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldContainTwoIntFoos);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldContainTwoLongFoos);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, stringDefaultsToFoo);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteDefaultsToFour);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intDefaultsToFive);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longDefaultsToNegativeSeven);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, booleanDefaultsToTrue);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, charDefaultsToC);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, floatDefaultsToPi);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, doubleWithDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, arrayDefaultsTo123);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, arrayDefaultsToEmpty);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, boolDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, byteDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, longDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, floatDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, doubleDefault);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, checkDoubleFromFloat);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, checkStringArray1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, checkStringArray2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, int32_min);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, int32_max);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, int64_max);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, hexInt32_neg_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, ibinder);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, empty);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, int8_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, int32_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, int64_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, hexInt32_pos_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, hexInt64_pos_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_3);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_4);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_5);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_6);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_7);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_8);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_9);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, const_exprs_10);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, addString1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, addString2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, shouldSetBit0AndBit2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, u);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_parcel, shouldBeConstS1);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, defaultWithFoo);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* StructuredParcelable::Empty::descriptor = "android.aidl.tests.StructuredParcelable.Empty";
+
+binder_status_t StructuredParcelable::Empty::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t StructuredParcelable::Empty::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/StructuredParcelable.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/StructuredParcelable.cpp.d
new file mode 100644
index 0000000..7e7bdf7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/StructuredParcelable.cpp.d
@@ -0,0 +1,7 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/StructuredParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/Union.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/Union.cpp
new file mode 100644
index 0000000..026bfbe
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/Union.cpp
@@ -0,0 +1,112 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#include "aidl/android/aidl/tests/Union.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* Union::descriptor = "android.aidl.tests.Union";
+
+const char* Union::S1 = "a string constant in union";
+binder_status_t Union::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case ns: {
+    std::vector<int32_t> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::vector<int32_t>>) {
+      set<ns>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<ns>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case n: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<n>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<n>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case m: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<m>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<m>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case s: {
+    std::string _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::string>) {
+      set<s>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<s>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case ibinder: {
+    ::ndk::SpAIBinder _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readNullableData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::ndk::SpAIBinder>) {
+      set<ibinder>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<ibinder>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case ss: {
+    std::vector<std::string> _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::vector<std::string>>) {
+      set<ss>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<ss>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case be: {
+    ::aidl::android::aidl::tests::ByteEnum _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::aidl::android::aidl::tests::ByteEnum>) {
+      set<be>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<be>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t Union::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case ns: return ::ndk::AParcel_writeData(_parcel, get<ns>());
+  case n: return ::ndk::AParcel_writeData(_parcel, get<n>());
+  case m: return ::ndk::AParcel_writeData(_parcel, get<m>());
+  case s: return ::ndk::AParcel_writeData(_parcel, get<s>());
+  case ibinder: return ::ndk::AParcel_writeNullableData(_parcel, get<ibinder>());
+  case ss: return ::ndk::AParcel_writeData(_parcel, get<ss>());
+  case be: return ::ndk::AParcel_writeData(_parcel, get<be>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/Union.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/Union.cpp.d
new file mode 100644
index 0000000..2892180
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/Union.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/Union.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/UnionWithFd.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/UnionWithFd.cpp
new file mode 100644
index 0000000..68571ef
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/UnionWithFd.cpp
@@ -0,0 +1,56 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#include "aidl/android/aidl/tests/UnionWithFd.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* UnionWithFd::descriptor = "android.aidl.tests.UnionWithFd";
+
+binder_status_t UnionWithFd::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case num: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<num>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<num>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case pfd: {
+    ::ndk::ScopedFileDescriptor _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::ndk::ScopedFileDescriptor>) {
+      set<pfd>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<pfd>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t UnionWithFd::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case num: return ::ndk::AParcel_writeData(_parcel, get<num>());
+  case pfd: return ::ndk::AParcel_writeData(_parcel, get<pfd>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/UnionWithFd.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/UnionWithFd.cpp.d
new file mode 100644
index 0000000..a696bc6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/UnionWithFd.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/UnionWithFd.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp
new file mode 100644
index 0000000..9b05c83
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp
@@ -0,0 +1,95 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#include "aidl/android/aidl/tests/extension/ExtendableParcelable.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+const char* ExtendableParcelable::descriptor = "android.aidl.tests.extension.ExtendableParcelable";
+
+binder_status_t ExtendableParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &ext);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &c);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &ext2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ExtendableParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, ext);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, c);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, ext2);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d
new file mode 100644
index 0000000..92a1e5e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/ExtendableParcelable.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt.cpp
new file mode 100644
index 0000000..13f2718
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt.cpp
@@ -0,0 +1,65 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#include "aidl/android/aidl/tests/extension/MyExt.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+const char* MyExt::descriptor = "android.aidl.tests.extension.MyExt";
+
+binder_status_t MyExt::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t MyExt::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt.cpp.d
new file mode 100644
index 0000000..c15eb09
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt2.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt2.cpp
new file mode 100644
index 0000000..15321fd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt2.cpp
@@ -0,0 +1,75 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#include "aidl/android/aidl/tests/extension/MyExt2.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+const char* MyExt2::descriptor = "android.aidl.tests.extension.MyExt2";
+
+binder_status_t MyExt2::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &c);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t MyExt2::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, c);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt2.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt2.cpp.d
new file mode 100644
index 0000000..4d6062c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt2.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExt2.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExtLike.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExtLike.cpp
new file mode 100644
index 0000000..070f719
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExtLike.cpp
@@ -0,0 +1,65 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#include "aidl/android/aidl/tests/extension/MyExtLike.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+const char* MyExtLike::descriptor = "android.aidl.tests.extension.MyExtLike";
+
+binder_status_t MyExtLike::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t MyExtLike::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d
new file mode 100644
index 0000000..512292d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExtLike.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/extension/MyExtLike.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/DeeplyNested.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/DeeplyNested.cpp
new file mode 100644
index 0000000..1263acc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/DeeplyNested.cpp
@@ -0,0 +1,203 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#include "aidl/android/aidl/tests/nested/DeeplyNested.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+const char* DeeplyNested::descriptor = "android.aidl.tests.nested.DeeplyNested";
+
+binder_status_t DeeplyNested::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t DeeplyNested::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+const char* DeeplyNested::A::descriptor = "android.aidl.tests.nested.DeeplyNested.A";
+
+binder_status_t DeeplyNested::A::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &e);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t DeeplyNested::A::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, e);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+const char* DeeplyNested::B::descriptor = "android.aidl.tests.nested.DeeplyNested.B";
+
+binder_status_t DeeplyNested::B::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t DeeplyNested::B::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+const char* DeeplyNested::B::C::descriptor = "android.aidl.tests.nested.DeeplyNested.B.C";
+
+binder_status_t DeeplyNested::B::C::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t DeeplyNested::B::C::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+const char* DeeplyNested::B::C::D::descriptor = "android.aidl.tests.nested.DeeplyNested.B.C.D";
+
+binder_status_t DeeplyNested::B::C::D::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t DeeplyNested::B::C::D::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d
new file mode 100644
index 0000000..5965970
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/DeeplyNested.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/DeeplyNested.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/INestedService.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/INestedService.cpp
new file mode 100644
index 0000000..0ec9154
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/INestedService.cpp
@@ -0,0 +1,419 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#include "aidl/android/aidl/tests/nested/INestedService.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/tests/nested/BnNestedService.h>
+#include <aidl/android/aidl/tests/nested/BpNestedService.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+static binder_status_t _aidl_android_aidl_tests_nested_INestedService_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnNestedService> _aidl_impl = std::static_pointer_cast<BnNestedService>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*flipStatus*/): {
+      ::aidl::android::aidl::tests::nested::ParcelableWithNested in_p;
+      ::aidl::android::aidl::tests::nested::INestedService::Result _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_p);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->flipStatus(in_p, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*flipStatusWithCallback*/): {
+      ::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status;
+      std::shared_ptr<::aidl::android::aidl::tests::nested::INestedService::ICallback> in_cb;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_status);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_cb);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->flipStatusWithCallback(in_status, in_cb);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_nested_INestedService_clazz = ::ndk::ICInterface::defineClass(INestedService::descriptor, _aidl_android_aidl_tests_nested_INestedService_onTransact);
+
+BpNestedService::BpNestedService(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpNestedService::~BpNestedService() {}
+
+::ndk::ScopedAStatus BpNestedService::flipStatus(const ::aidl::android::aidl::tests::nested::ParcelableWithNested& in_p, ::aidl::android::aidl::tests::nested::INestedService::Result* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_p);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*flipStatus*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && INestedService::getDefaultImpl()) {
+    _aidl_status = INestedService::getDefaultImpl()->flipStatus(in_p, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpNestedService::flipStatusWithCallback(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status, const std::shared_ptr<::aidl::android::aidl::tests::nested::INestedService::ICallback>& in_cb) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_status);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_cb);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*flipStatusWithCallback*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && INestedService::getDefaultImpl()) {
+    _aidl_status = INestedService::getDefaultImpl()->flipStatusWithCallback(in_status, in_cb);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnNestedService
+BnNestedService::BnNestedService() {}
+BnNestedService::~BnNestedService() {}
+::ndk::SpAIBinder BnNestedService::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_nested_INestedService_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for INestedService
+const char* INestedService::descriptor = "android.aidl.tests.nested.INestedService";
+INestedService::INestedService() {}
+INestedService::~INestedService() {}
+
+
+std::shared_ptr<INestedService> INestedService::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_nested_INestedService_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpNestedService>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<INestedService>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpNestedService>(binder);
+}
+
+binder_status_t INestedService::writeToParcel(AParcel* parcel, const std::shared_ptr<INestedService>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t INestedService::readFromParcel(const AParcel* parcel, std::shared_ptr<INestedService>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = INestedService::fromBinder(binder);
+  return STATUS_OK;
+}
+bool INestedService::setDefaultImpl(const std::shared_ptr<INestedService>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!INestedService::default_impl);
+  if (impl) {
+    INestedService::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<INestedService>& INestedService::getDefaultImpl() {
+  return INestedService::default_impl;
+}
+std::shared_ptr<INestedService> INestedService::default_impl = nullptr;
+::ndk::ScopedAStatus INestedServiceDefault::flipStatus(const ::aidl::android::aidl::tests::nested::ParcelableWithNested& /*in_p*/, ::aidl::android::aidl::tests::nested::INestedService::Result* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus INestedServiceDefault::flipStatusWithCallback(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status /*in_status*/, const std::shared_ptr<::aidl::android::aidl::tests::nested::INestedService::ICallback>& /*in_cb*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder INestedServiceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool INestedServiceDefault::isRemote() {
+  return false;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+const char* INestedService::Result::descriptor = "android.aidl.tests.nested.INestedService.Result";
+
+binder_status_t INestedService::Result::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &status);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t INestedService::Result::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, status);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+static binder_status_t _aidl_android_aidl_tests_nested_INestedService_ICallback_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<INestedService::BnCallback> _aidl_impl = std::static_pointer_cast<INestedService::BnCallback>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*done*/): {
+      ::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_status);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->done(in_status);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_tests_nested_INestedService_ICallback_clazz = ::ndk::ICInterface::defineClass(INestedService::ICallback::descriptor, _aidl_android_aidl_tests_nested_INestedService_ICallback_onTransact);
+
+INestedService::BpCallback::BpCallback(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+INestedService::BpCallback::~BpCallback() {}
+
+::ndk::ScopedAStatus INestedService::BpCallback::done(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_status);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*done*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ICallback::getDefaultImpl()) {
+    _aidl_status = ICallback::getDefaultImpl()->done(in_status);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnCallback
+INestedService::BnCallback::BnCallback() {}
+INestedService::BnCallback::~BnCallback() {}
+::ndk::SpAIBinder INestedService::BnCallback::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_tests_nested_INestedService_ICallback_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for ICallback
+const char* INestedService::ICallback::descriptor = "android.aidl.tests.nested.INestedService.ICallback";
+INestedService::ICallback::ICallback() {}
+INestedService::ICallback::~ICallback() {}
+
+
+std::shared_ptr<INestedService::ICallback> INestedService::ICallback::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_tests_nested_INestedService_ICallback_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<INestedService::BpCallback>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<ICallback>(interface);
+  }
+  return ::ndk::SharedRefBase::make<INestedService::BpCallback>(binder);
+}
+
+binder_status_t INestedService::ICallback::writeToParcel(AParcel* parcel, const std::shared_ptr<ICallback>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t INestedService::ICallback::readFromParcel(const AParcel* parcel, std::shared_ptr<ICallback>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = ICallback::fromBinder(binder);
+  return STATUS_OK;
+}
+bool INestedService::ICallback::setDefaultImpl(const std::shared_ptr<ICallback>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!ICallback::default_impl);
+  if (impl) {
+    ICallback::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<INestedService::ICallback>& INestedService::ICallback::getDefaultImpl() {
+  return ICallback::default_impl;
+}
+std::shared_ptr<INestedService::ICallback> INestedService::ICallback::default_impl = nullptr;
+::ndk::ScopedAStatus INestedService::ICallbackDefault::done(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status /*in_status*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder INestedService::ICallbackDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool INestedService::ICallbackDefault::isRemote() {
+  return false;
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/INestedService.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/INestedService.cpp.d
new file mode 100644
index 0000000..0481ef2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/INestedService.cpp.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/INestedService.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp
new file mode 100644
index 0000000..d81941d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp
@@ -0,0 +1,55 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#include "aidl/android/aidl/tests/nested/ParcelableWithNested.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+const char* ParcelableWithNested::descriptor = "android.aidl.tests.nested.ParcelableWithNested";
+
+binder_status_t ParcelableWithNested::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &status);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ParcelableWithNested::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, status);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d
new file mode 100644
index 0000000..ce5f36a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/nested/ParcelableWithNested.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/EnumUnion.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/EnumUnion.cpp
new file mode 100644
index 0000000..9b6af60
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/EnumUnion.cpp
@@ -0,0 +1,75 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#include "aidl/android/aidl/tests/unions/EnumUnion.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+const char* EnumUnion::descriptor = "android.aidl.tests.unions.EnumUnion";
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+binder_status_t EnumUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case intEnum: {
+    ::aidl::android::aidl::tests::IntEnum _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::aidl::android::aidl::tests::IntEnum>) {
+      set<intEnum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intEnum>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case longEnum: {
+    ::aidl::android::aidl::tests::LongEnum _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::aidl::android::aidl::tests::LongEnum>) {
+      set<longEnum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<longEnum>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case deprecatedField: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<deprecatedField>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<deprecatedField>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t EnumUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case intEnum: return ::ndk::AParcel_writeData(_parcel, get<intEnum>());
+  case longEnum: return ::ndk::AParcel_writeData(_parcel, get<longEnum>());
+  #pragma clang diagnostic push
+  #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+  case deprecatedField: return ::ndk::AParcel_writeData(_parcel, get<deprecatedField>());
+  #pragma clang diagnostic pop
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+#pragma clang diagnostic pop
+
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d
new file mode 100644
index 0000000..9ad133c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/EnumUnion.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/EnumUnion.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/UnionInUnion.cpp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/UnionInUnion.cpp
new file mode 100644
index 0000000..fbdc456
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/UnionInUnion.cpp
@@ -0,0 +1,58 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#include "aidl/android/aidl/tests/unions/UnionInUnion.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+const char* UnionInUnion::descriptor = "android.aidl.tests.unions.UnionInUnion";
+
+binder_status_t UnionInUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case first: {
+    ::aidl::android::aidl::tests::unions::EnumUnion _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::aidl::android::aidl::tests::unions::EnumUnion>) {
+      set<first>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<first>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case second: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<second>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<second>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t UnionInUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case first: return ::ndk::AParcel_writeData(_parcel, get<first>());
+  case second: return ::ndk::AParcel_writeData(_parcel, get<second>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d
new file mode 100644
index 0000000..37113d9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/UnionInUnion.cpp.d
@@ -0,0 +1,5 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/android/aidl/tests/unions/UnionInUnion.cpp : \
+  system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ArrayOfInterfaces.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ArrayOfInterfaces.h
new file mode 100644
index 0000000..f266545
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ArrayOfInterfaces.h
@@ -0,0 +1,333 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_ibinder.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/ArrayOfInterfaces.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class ArrayOfInterfaces {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  class IEmptyInterfaceDelegator;
+
+  class IEmptyInterface : public ::ndk::ICInterface {
+  public:
+    typedef IEmptyInterfaceDelegator DefaultDelegator;
+    static const char* descriptor;
+    IEmptyInterface();
+    virtual ~IEmptyInterface();
+
+
+    static std::shared_ptr<IEmptyInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IEmptyInterface>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IEmptyInterface>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<IEmptyInterface>& impl);
+    static const std::shared_ptr<IEmptyInterface>& getDefaultImpl();
+  private:
+    static std::shared_ptr<IEmptyInterface> default_impl;
+  };
+  class IEmptyInterfaceDefault : public IEmptyInterface {
+  public:
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpEmptyInterface : public ::ndk::BpCInterface<IEmptyInterface> {
+  public:
+    explicit BpEmptyInterface(const ::ndk::SpAIBinder& binder);
+    virtual ~BpEmptyInterface();
+
+  };
+  class BnEmptyInterface : public ::ndk::BnCInterface<IEmptyInterface> {
+  public:
+    BnEmptyInterface();
+    virtual ~BnEmptyInterface();
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  class IMyInterfaceDelegator;
+
+  class IMyInterface : public ::ndk::ICInterface {
+  public:
+    typedef IMyInterfaceDelegator DefaultDelegator;
+    static const char* descriptor;
+    IMyInterface();
+    virtual ~IMyInterface();
+
+    static constexpr uint32_t TRANSACTION_methodWithInterfaces = FIRST_CALL_TRANSACTION + 0;
+
+    static std::shared_ptr<IMyInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IMyInterface>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IMyInterface>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<IMyInterface>& impl);
+    static const std::shared_ptr<IMyInterface>& getDefaultImpl();
+    virtual ::ndk::ScopedAStatus methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& in_iface, const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& in_nullable_iface, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& in_iface_array_in, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* out_iface_array_out, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* in_iface_array_inout, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& in_nullable_iface_array_in, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* out_nullable_iface_array_out, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* in_nullable_iface_array_inout, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) = 0;
+  private:
+    static std::shared_ptr<IMyInterface> default_impl;
+  };
+  class IMyInterfaceDefault : public IMyInterface {
+  public:
+    ::ndk::ScopedAStatus methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& in_iface, const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& in_nullable_iface, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& in_iface_array_in, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* out_iface_array_out, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* in_iface_array_inout, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& in_nullable_iface_array_in, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* out_nullable_iface_array_out, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* in_nullable_iface_array_inout, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) override;
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpMyInterface : public ::ndk::BpCInterface<IMyInterface> {
+  public:
+    explicit BpMyInterface(const ::ndk::SpAIBinder& binder);
+    virtual ~BpMyInterface();
+
+    ::ndk::ScopedAStatus methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& in_iface, const std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>& in_nullable_iface, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>& in_iface_array_in, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* out_iface_array_out, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>* in_iface_array_inout, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>& in_nullable_iface_array_in, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* out_nullable_iface_array_out, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* in_nullable_iface_array_inout, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>* _aidl_return) override;
+  };
+  class BnMyInterface : public ::ndk::BnCInterface<IMyInterface> {
+  public:
+    BnMyInterface();
+    virtual ~BnMyInterface();
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  class MyParcelable {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> iface;
+    std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface> nullable_iface;
+    std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>> iface_array;
+    std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>> nullable_iface_array;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) != std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator<(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) < std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator<=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) <= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator==(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) == std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator>(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) > std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+    inline bool operator>=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_array, nullable_iface_array) >= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_array, rhs.nullable_iface_array);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyParcelable{";
+      os << "iface: " << ::android::internal::ToString(iface);
+      os << ", nullable_iface: " << ::android::internal::ToString(nullable_iface);
+      os << ", iface_array: " << ::android::internal::ToString(iface_array);
+      os << ", nullable_iface_array: " << ::android::internal::ToString(nullable_iface_array);
+      os << "}";
+      return os.str();
+    }
+  };
+  class MyUnion {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    enum class Tag : int32_t {
+      iface = 0,
+      nullable_iface = 1,
+      iface_array = 2,
+      nullable_iface_array = 3,
+    };
+
+    // Expose tag symbols for legacy code
+    static const inline Tag iface = Tag::iface;
+    static const inline Tag nullable_iface = Tag::nullable_iface;
+    static const inline Tag iface_array = Tag::iface_array;
+    static const inline Tag nullable_iface_array = Tag::nullable_iface_array;
+
+    template<typename _Tp>
+    static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, MyUnion>;
+
+    MyUnion() : _value(std::in_place_index<static_cast<size_t>(iface)>, std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>()) { }
+
+    template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+    // NOLINTNEXTLINE(google-explicit-constructor)
+    constexpr MyUnion(_Tp&& _arg)
+        : _value(std::forward<_Tp>(_arg)) {}
+
+    template <size_t _Np, typename... _Tp>
+    constexpr explicit MyUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+        : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+    template <Tag _tag, typename... _Tp>
+    static MyUnion make(_Tp&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+    }
+
+    template <Tag _tag, typename _Tp, typename... _Up>
+    static MyUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+    }
+
+    Tag getTag() const {
+      return static_cast<Tag>(_value.index());
+    }
+
+    template <Tag _tag>
+    const auto& get() const {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag>
+    auto& get() {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag, typename... _Tp>
+    void set(_Tp&&... _args) {
+      _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+    }
+
+    binder_status_t readFromParcel(const AParcel* _parcel);
+    binder_status_t writeToParcel(AParcel* _parcel) const;
+
+    inline bool operator!=(const MyUnion& rhs) const {
+      return _value != rhs._value;
+    }
+    inline bool operator<(const MyUnion& rhs) const {
+      return _value < rhs._value;
+    }
+    inline bool operator<=(const MyUnion& rhs) const {
+      return _value <= rhs._value;
+    }
+    inline bool operator==(const MyUnion& rhs) const {
+      return _value == rhs._value;
+    }
+    inline bool operator>(const MyUnion& rhs) const {
+      return _value > rhs._value;
+    }
+    inline bool operator>=(const MyUnion& rhs) const {
+      return _value >= rhs._value;
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyUnion{";
+      switch (getTag()) {
+      case iface: os << "iface: " << ::android::internal::ToString(get<iface>()); break;
+      case nullable_iface: os << "nullable_iface: " << ::android::internal::ToString(get<nullable_iface>()); break;
+      case iface_array: os << "iface_array: " << ::android::internal::ToString(get<iface_array>()); break;
+      case nullable_iface_array: os << "nullable_iface_array: " << ::android::internal::ToString(get<nullable_iface_array>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    std::variant<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>, std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ArrayOfInterfaces::IEmptyInterface>>>> _value;
+  };
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const ArrayOfInterfaces&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const ArrayOfInterfaces&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const ArrayOfInterfaces&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const ArrayOfInterfaces&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const ArrayOfInterfaces&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const ArrayOfInterfaces&) const {
+    return std::tie() >= std::tie();
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ArrayOfInterfaces{";
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ArrayOfInterfaces::MyUnion::Tag val) {
+  switch(val) {
+  case ArrayOfInterfaces::MyUnion::Tag::iface:
+    return "iface";
+  case ArrayOfInterfaces::MyUnion::Tag::nullable_iface:
+    return "nullable_iface";
+  case ArrayOfInterfaces::MyUnion::Tag::iface_array:
+    return "iface_array";
+  case ArrayOfInterfaces::MyUnion::Tag::nullable_iface_array:
+    return "nullable_iface_array";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag, 4> enum_values<aidl::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag> = {
+  aidl::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::iface,
+  aidl::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::nullable_iface,
+  aidl::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::iface_array,
+  aidl::android::aidl::tests::ArrayOfInterfaces::MyUnion::Tag::nullable_iface_array,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BackendType.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BackendType.h
new file mode 100644
index 0000000..bca8a65
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BackendType.h
@@ -0,0 +1,68 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+enum class BackendType : int8_t {
+  CPP = 0,
+  JAVA = 1,
+  NDK = 2,
+  RUST = 3,
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(BackendType val) {
+  switch(val) {
+  case BackendType::CPP:
+    return "CPP";
+  case BackendType::JAVA:
+    return "JAVA";
+  case BackendType::NDK:
+    return "NDK";
+  case BackendType::RUST:
+    return "RUST";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::BackendType, 4> enum_values<aidl::android::aidl::tests::BackendType> = {
+  aidl::android::aidl::tests::BackendType::CPP,
+  aidl::android::aidl::tests::BackendType::JAVA,
+  aidl::android::aidl::tests::BackendType::NDK,
+  aidl::android::aidl::tests::BackendType::RUST,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnArrayOfInterfaces.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnArrayOfInterfaces.h
new file mode 100644
index 0000000..c1dc818
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnArrayOfInterfaces.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnBackendType.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnBackendType.h
new file mode 100644
index 0000000..124fac4
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnBackendType.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnByteEnum.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnByteEnum.h
new file mode 100644
index 0000000..e9b0f45
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnByteEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnCircular.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnCircular.h
new file mode 100644
index 0000000..5f63edf
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnCircular.h
@@ -0,0 +1,46 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/ICircular.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BnCircular : public ::ndk::BnCInterface<ICircular> {
+public:
+  BnCircular();
+  virtual ~BnCircular();
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class ICircularDelegator : public BnCircular {
+public:
+  explicit ICircularDelegator(const std::shared_ptr<ICircular> &impl) : _impl(impl) {
+  }
+
+  ::ndk::ScopedAStatus GetTestService(std::shared_ptr<::aidl::android::aidl::tests::ITestService>* _aidl_return) override {
+    return _impl->GetTestService(_aidl_return);
+  }
+protected:
+private:
+  std::shared_ptr<ICircular> _impl;
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnCircularParcelable.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnCircularParcelable.h
new file mode 100644
index 0000000..6b973ed
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnCircularParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnConstantExpressionEnum.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnConstantExpressionEnum.h
new file mode 100644
index 0000000..ed4a5e8
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnConstantExpressionEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecated.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecated.h
new file mode 100644
index 0000000..c1647fe
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecated.h
@@ -0,0 +1,43 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/IDeprecated.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class __attribute__((deprecated("test"))) BnDeprecated : public ::ndk::BnCInterface<IDeprecated> {
+public:
+  BnDeprecated();
+  virtual ~BnDeprecated();
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class __attribute__((deprecated("test"))) IDeprecatedDelegator : public BnDeprecated {
+public:
+  explicit IDeprecatedDelegator(const std::shared_ptr<IDeprecated> &impl) : _impl(impl) {
+  }
+
+protected:
+private:
+  std::shared_ptr<IDeprecated> _impl;
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecatedEnum.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecatedEnum.h
new file mode 100644
index 0000000..7910387
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecatedEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecatedParcelable.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecatedParcelable.h
new file mode 100644
index 0000000..ab17001
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnDeprecatedParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnFixedSize.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnFixedSize.h
new file mode 100644
index 0000000..2102f06
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnFixedSize.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnGenericStructuredParcelable.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnGenericStructuredParcelable.h
new file mode 100644
index 0000000..2d0984d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnGenericStructuredParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnIntEnum.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnIntEnum.h
new file mode 100644
index 0000000..0cb3e7e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnIntEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnListOfInterfaces.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnListOfInterfaces.h
new file mode 100644
index 0000000..d67e153
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnListOfInterfaces.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnLongEnum.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnLongEnum.h
new file mode 100644
index 0000000..364dbaf
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnLongEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnNamedCallback.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnNamedCallback.h
new file mode 100644
index 0000000..3d5af79
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnNamedCallback.h
@@ -0,0 +1,46 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/INamedCallback.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BnNamedCallback : public ::ndk::BnCInterface<INamedCallback> {
+public:
+  BnNamedCallback();
+  virtual ~BnNamedCallback();
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class INamedCallbackDelegator : public BnNamedCallback {
+public:
+  explicit INamedCallbackDelegator(const std::shared_ptr<INamedCallback> &impl) : _impl(impl) {
+  }
+
+  ::ndk::ScopedAStatus GetName(std::string* _aidl_return) override {
+    return _impl->GetName(_aidl_return);
+  }
+protected:
+private:
+  std::shared_ptr<INamedCallback> _impl;
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnNewName.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnNewName.h
new file mode 100644
index 0000000..ef00282
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnNewName.h
@@ -0,0 +1,46 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/INewName.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BnNewName : public ::ndk::BnCInterface<INewName> {
+public:
+  BnNewName();
+  virtual ~BnNewName();
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class INewNameDelegator : public BnNewName {
+public:
+  explicit INewNameDelegator(const std::shared_ptr<INewName> &impl) : _impl(impl) {
+  }
+
+  ::ndk::ScopedAStatus RealName(std::string* _aidl_return) override {
+    return _impl->RealName(_aidl_return);
+  }
+protected:
+private:
+  std::shared_ptr<INewName> _impl;
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnOldName.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnOldName.h
new file mode 100644
index 0000000..af49cab
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnOldName.h
@@ -0,0 +1,46 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/IOldName.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BnOldName : public ::ndk::BnCInterface<IOldName> {
+public:
+  BnOldName();
+  virtual ~BnOldName();
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class IOldNameDelegator : public BnOldName {
+public:
+  explicit IOldNameDelegator(const std::shared_ptr<IOldName> &impl) : _impl(impl) {
+  }
+
+  ::ndk::ScopedAStatus RealName(std::string* _aidl_return) override {
+    return _impl->RealName(_aidl_return);
+  }
+protected:
+private:
+  std::shared_ptr<IOldName> _impl;
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnOtherParcelableForToString.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnOtherParcelableForToString.h
new file mode 100644
index 0000000..2f031bc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnOtherParcelableForToString.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnParcelableForToString.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnParcelableForToString.h
new file mode 100644
index 0000000..bbe83a7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnParcelableForToString.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnRecursiveList.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnRecursiveList.h
new file mode 100644
index 0000000..27b58c5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnRecursiveList.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnStructuredParcelable.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnStructuredParcelable.h
new file mode 100644
index 0000000..3f2b153
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnStructuredParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnTestService.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnTestService.h
new file mode 100644
index 0000000..690e9cd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnTestService.h
@@ -0,0 +1,247 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/ITestService.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BnTestService : public ::ndk::BnCInterface<ITestService> {
+public:
+  BnTestService();
+  virtual ~BnTestService();
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class ITestServiceDelegator : public BnTestService {
+public:
+  explicit ITestServiceDelegator(const std::shared_ptr<ITestService> &impl) : _impl(impl) {
+  }
+
+  ::ndk::ScopedAStatus UnimplementedMethod(int32_t in_arg, int32_t* _aidl_return) override {
+    return _impl->UnimplementedMethod(in_arg, _aidl_return);
+  }
+  ::ndk::ScopedAStatus Deprecated() override __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"))) {
+    return _impl->Deprecated();
+  }
+  ::ndk::ScopedAStatus TestOneway() override {
+    return _impl->TestOneway();
+  }
+  ::ndk::ScopedAStatus RepeatBoolean(bool in_token, bool* _aidl_return) override {
+    return _impl->RepeatBoolean(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatByte(int8_t in_token, int8_t* _aidl_return) override {
+    return _impl->RepeatByte(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatChar(char16_t in_token, char16_t* _aidl_return) override {
+    return _impl->RepeatChar(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatInt(int32_t in_token, int32_t* _aidl_return) override {
+    return _impl->RepeatInt(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatLong(int64_t in_token, int64_t* _aidl_return) override {
+    return _impl->RepeatLong(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatFloat(float in_token, float* _aidl_return) override {
+    return _impl->RepeatFloat(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatDouble(double in_token, double* _aidl_return) override {
+    return _impl->RepeatDouble(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatString(const std::string& in_token, std::string* _aidl_return) override {
+    return _impl->RepeatString(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatByteEnum(::aidl::android::aidl::tests::ByteEnum in_token, ::aidl::android::aidl::tests::ByteEnum* _aidl_return) override {
+    return _impl->RepeatByteEnum(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatIntEnum(::aidl::android::aidl::tests::IntEnum in_token, ::aidl::android::aidl::tests::IntEnum* _aidl_return) override {
+    return _impl->RepeatIntEnum(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatLongEnum(::aidl::android::aidl::tests::LongEnum in_token, ::aidl::android::aidl::tests::LongEnum* _aidl_return) override {
+    return _impl->RepeatLongEnum(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseBoolean(const std::vector<bool>& in_input, std::vector<bool>* out_repeated, std::vector<bool>* _aidl_return) override {
+    return _impl->ReverseBoolean(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseByte(const std::vector<uint8_t>& in_input, std::vector<uint8_t>* out_repeated, std::vector<uint8_t>* _aidl_return) override {
+    return _impl->ReverseByte(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseChar(const std::vector<char16_t>& in_input, std::vector<char16_t>* out_repeated, std::vector<char16_t>* _aidl_return) override {
+    return _impl->ReverseChar(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseInt(const std::vector<int32_t>& in_input, std::vector<int32_t>* out_repeated, std::vector<int32_t>* _aidl_return) override {
+    return _impl->ReverseInt(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseLong(const std::vector<int64_t>& in_input, std::vector<int64_t>* out_repeated, std::vector<int64_t>* _aidl_return) override {
+    return _impl->ReverseLong(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseFloat(const std::vector<float>& in_input, std::vector<float>* out_repeated, std::vector<float>* _aidl_return) override {
+    return _impl->ReverseFloat(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseDouble(const std::vector<double>& in_input, std::vector<double>* out_repeated, std::vector<double>* _aidl_return) override {
+    return _impl->ReverseDouble(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override {
+    return _impl->ReverseString(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseByteEnum(const std::vector<::aidl::android::aidl::tests::ByteEnum>& in_input, std::vector<::aidl::android::aidl::tests::ByteEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::ByteEnum>* _aidl_return) override {
+    return _impl->ReverseByteEnum(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseIntEnum(const std::vector<::aidl::android::aidl::tests::IntEnum>& in_input, std::vector<::aidl::android::aidl::tests::IntEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::IntEnum>* _aidl_return) override {
+    return _impl->ReverseIntEnum(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseLongEnum(const std::vector<::aidl::android::aidl::tests::LongEnum>& in_input, std::vector<::aidl::android::aidl::tests::LongEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::LongEnum>* _aidl_return) override {
+    return _impl->ReverseLongEnum(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus GetOtherTestService(const std::string& in_name, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) override {
+    return _impl->GetOtherTestService(in_name, _aidl_return);
+  }
+  ::ndk::ScopedAStatus SetOtherTestService(const std::string& in_name, const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, bool* _aidl_return) override {
+    return _impl->SetOtherTestService(in_name, in_service, _aidl_return);
+  }
+  ::ndk::ScopedAStatus VerifyName(const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, const std::string& in_name, bool* _aidl_return) override {
+    return _impl->VerifyName(in_service, in_name, _aidl_return);
+  }
+  ::ndk::ScopedAStatus GetInterfaceArray(const std::vector<std::string>& in_names, std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>* _aidl_return) override {
+    return _impl->GetInterfaceArray(in_names, _aidl_return);
+  }
+  ::ndk::ScopedAStatus VerifyNamesWithInterfaceArray(const std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>& in_services, const std::vector<std::string>& in_names, bool* _aidl_return) override {
+    return _impl->VerifyNamesWithInterfaceArray(in_services, in_names, _aidl_return);
+  }
+  ::ndk::ScopedAStatus GetNullableInterfaceArray(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) override {
+    return _impl->GetNullableInterfaceArray(in_names, _aidl_return);
+  }
+  ::ndk::ScopedAStatus VerifyNamesWithNullableInterfaceArray(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) override {
+    return _impl->VerifyNamesWithNullableInterfaceArray(in_services, in_names, _aidl_return);
+  }
+  ::ndk::ScopedAStatus GetInterfaceList(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) override {
+    return _impl->GetInterfaceList(in_names, _aidl_return);
+  }
+  ::ndk::ScopedAStatus VerifyNamesWithInterfaceList(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) override {
+    return _impl->VerifyNamesWithInterfaceList(in_services, in_names, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseStringList(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override {
+    return _impl->ReverseStringList(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatParcelFileDescriptor(const ::ndk::ScopedFileDescriptor& in_read, ::ndk::ScopedFileDescriptor* _aidl_return) override {
+    return _impl->RepeatParcelFileDescriptor(in_read, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseParcelFileDescriptorArray(const std::vector<::ndk::ScopedFileDescriptor>& in_input, std::vector<::ndk::ScopedFileDescriptor>* out_repeated, std::vector<::ndk::ScopedFileDescriptor>* _aidl_return) override {
+    return _impl->ReverseParcelFileDescriptorArray(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ThrowServiceException(int32_t in_code) override {
+    return _impl->ThrowServiceException(in_code);
+  }
+  ::ndk::ScopedAStatus RepeatNullableIntArray(const std::optional<std::vector<int32_t>>& in_input, std::optional<std::vector<int32_t>>* _aidl_return) override {
+    return _impl->RepeatNullableIntArray(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableByteEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>* _aidl_return) override {
+    return _impl->RepeatNullableByteEnumArray(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableIntEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>* _aidl_return) override {
+    return _impl->RepeatNullableIntEnumArray(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableLongEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>* _aidl_return) override {
+    return _impl->RepeatNullableLongEnumArray(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableString(const std::optional<std::string>& in_input, std::optional<std::string>* _aidl_return) override {
+    return _impl->RepeatNullableString(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override {
+    return _impl->RepeatNullableStringList(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableParcelable(const std::optional<::aidl::android::aidl::tests::ITestService::Empty>& in_input, std::optional<::aidl::android::aidl::tests::ITestService::Empty>* _aidl_return) override {
+    return _impl->RepeatNullableParcelable(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableParcelableArray(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override {
+    return _impl->RepeatNullableParcelableArray(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableParcelableList(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override {
+    return _impl->RepeatNullableParcelableList(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus TakesAnIBinder(const ::ndk::SpAIBinder& in_input) override {
+    return _impl->TakesAnIBinder(in_input);
+  }
+  ::ndk::ScopedAStatus TakesANullableIBinder(const ::ndk::SpAIBinder& in_input) override {
+    return _impl->TakesANullableIBinder(in_input);
+  }
+  ::ndk::ScopedAStatus TakesAnIBinderList(const std::vector<::ndk::SpAIBinder>& in_input) override {
+    return _impl->TakesAnIBinderList(in_input);
+  }
+  ::ndk::ScopedAStatus TakesANullableIBinderList(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input) override {
+    return _impl->TakesANullableIBinderList(in_input);
+  }
+  ::ndk::ScopedAStatus RepeatUtf8CppString(const std::string& in_token, std::string* _aidl_return) override {
+    return _impl->RepeatUtf8CppString(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus RepeatNullableUtf8CppString(const std::optional<std::string>& in_token, std::optional<std::string>* _aidl_return) override {
+    return _impl->RepeatNullableUtf8CppString(in_token, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseUtf8CppString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override {
+    return _impl->ReverseUtf8CppString(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseNullableUtf8CppString(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override {
+    return _impl->ReverseNullableUtf8CppString(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseUtf8CppStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override {
+    return _impl->ReverseUtf8CppStringList(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus GetCallback(bool in_return_null, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) override {
+    return _impl->GetCallback(in_return_null, _aidl_return);
+  }
+  ::ndk::ScopedAStatus FillOutStructuredParcelable(::aidl::android::aidl::tests::StructuredParcelable* in_parcel) override {
+    return _impl->FillOutStructuredParcelable(in_parcel);
+  }
+  ::ndk::ScopedAStatus RepeatExtendableParcelable(const ::aidl::android::aidl::tests::extension::ExtendableParcelable& in_ep, ::aidl::android::aidl::tests::extension::ExtendableParcelable* out_ep2) override {
+    return _impl->RepeatExtendableParcelable(in_ep, out_ep2);
+  }
+  ::ndk::ScopedAStatus ReverseList(const ::aidl::android::aidl::tests::RecursiveList& in_list, ::aidl::android::aidl::tests::RecursiveList* _aidl_return) override {
+    return _impl->ReverseList(in_list, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseIBinderArray(const std::vector<::ndk::SpAIBinder>& in_input, std::vector<::ndk::SpAIBinder>* out_repeated, std::vector<::ndk::SpAIBinder>* _aidl_return) override {
+    return _impl->ReverseIBinderArray(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ReverseNullableIBinderArray(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input, std::optional<std::vector<::ndk::SpAIBinder>>* out_repeated, std::optional<std::vector<::ndk::SpAIBinder>>* _aidl_return) override {
+    return _impl->ReverseNullableIBinderArray(in_input, out_repeated, _aidl_return);
+  }
+  ::ndk::ScopedAStatus GetOldNameInterface(std::shared_ptr<::aidl::android::aidl::tests::IOldName>* _aidl_return) override {
+    return _impl->GetOldNameInterface(_aidl_return);
+  }
+  ::ndk::ScopedAStatus GetNewNameInterface(std::shared_ptr<::aidl::android::aidl::tests::INewName>* _aidl_return) override {
+    return _impl->GetNewNameInterface(_aidl_return);
+  }
+  ::ndk::ScopedAStatus GetUnionTags(const std::vector<::aidl::android::aidl::tests::Union>& in_input, std::vector<::aidl::android::aidl::tests::Union::Tag>* _aidl_return) override {
+    return _impl->GetUnionTags(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus GetCppJavaTests(::ndk::SpAIBinder* _aidl_return) override {
+    return _impl->GetCppJavaTests(_aidl_return);
+  }
+  ::ndk::ScopedAStatus getBackendType(::aidl::android::aidl::tests::BackendType* _aidl_return) override {
+    return _impl->getBackendType(_aidl_return);
+  }
+  ::ndk::ScopedAStatus GetCircular(::aidl::android::aidl::tests::CircularParcelable* out_cp, std::shared_ptr<::aidl::android::aidl::tests::ICircular>* _aidl_return) override {
+    return _impl->GetCircular(out_cp, _aidl_return);
+  }
+protected:
+private:
+  std::shared_ptr<ITestService> _impl;
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnUnion.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnUnion.h
new file mode 100644
index 0000000..3b631a8
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnUnionWithFd.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnUnionWithFd.h
new file mode 100644
index 0000000..a9a3aea
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BnUnionWithFd.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpArrayOfInterfaces.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpArrayOfInterfaces.h
new file mode 100644
index 0000000..2024751
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpArrayOfInterfaces.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ArrayOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpBackendType.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpBackendType.h
new file mode 100644
index 0000000..b76099e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpBackendType.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/BackendType.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpByteEnum.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpByteEnum.h
new file mode 100644
index 0000000..bf31320
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpByteEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpCircular.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpCircular.h
new file mode 100644
index 0000000..b048539
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpCircular.h
@@ -0,0 +1,25 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/ICircular.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BpCircular : public ::ndk::BpCInterface<ICircular> {
+public:
+  explicit BpCircular(const ::ndk::SpAIBinder& binder);
+  virtual ~BpCircular();
+
+  ::ndk::ScopedAStatus GetTestService(std::shared_ptr<::aidl::android::aidl::tests::ITestService>* _aidl_return) override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpCircularParcelable.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpCircularParcelable.h
new file mode 100644
index 0000000..10c5cae
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpCircularParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpConstantExpressionEnum.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpConstantExpressionEnum.h
new file mode 100644
index 0000000..dc9d2c2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpConstantExpressionEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecated.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecated.h
new file mode 100644
index 0000000..5ef793b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecated.h
@@ -0,0 +1,24 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/IDeprecated.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class __attribute__((deprecated("test"))) BpDeprecated : public ::ndk::BpCInterface<IDeprecated> {
+public:
+  explicit BpDeprecated(const ::ndk::SpAIBinder& binder);
+  virtual ~BpDeprecated();
+
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecatedEnum.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecatedEnum.h
new file mode 100644
index 0000000..e7ec47e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecatedEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecatedParcelable.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecatedParcelable.h
new file mode 100644
index 0000000..2000d78
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpDeprecatedParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpFixedSize.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpFixedSize.h
new file mode 100644
index 0000000..8ddd24c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpFixedSize.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpGenericStructuredParcelable.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpGenericStructuredParcelable.h
new file mode 100644
index 0000000..c14064e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpGenericStructuredParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpIntEnum.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpIntEnum.h
new file mode 100644
index 0000000..0df4606
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpIntEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpListOfInterfaces.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpListOfInterfaces.h
new file mode 100644
index 0000000..e9a633c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpListOfInterfaces.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpLongEnum.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpLongEnum.h
new file mode 100644
index 0000000..70569b1
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpLongEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpNamedCallback.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpNamedCallback.h
new file mode 100644
index 0000000..76dce29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpNamedCallback.h
@@ -0,0 +1,25 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/INamedCallback.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BpNamedCallback : public ::ndk::BpCInterface<INamedCallback> {
+public:
+  explicit BpNamedCallback(const ::ndk::SpAIBinder& binder);
+  virtual ~BpNamedCallback();
+
+  ::ndk::ScopedAStatus GetName(std::string* _aidl_return) override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpNewName.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpNewName.h
new file mode 100644
index 0000000..74b9985
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpNewName.h
@@ -0,0 +1,25 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/INewName.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BpNewName : public ::ndk::BpCInterface<INewName> {
+public:
+  explicit BpNewName(const ::ndk::SpAIBinder& binder);
+  virtual ~BpNewName();
+
+  ::ndk::ScopedAStatus RealName(std::string* _aidl_return) override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpOldName.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpOldName.h
new file mode 100644
index 0000000..8da9b8a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpOldName.h
@@ -0,0 +1,25 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/IOldName.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BpOldName : public ::ndk::BpCInterface<IOldName> {
+public:
+  explicit BpOldName(const ::ndk::SpAIBinder& binder);
+  virtual ~BpOldName();
+
+  ::ndk::ScopedAStatus RealName(std::string* _aidl_return) override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpOtherParcelableForToString.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpOtherParcelableForToString.h
new file mode 100644
index 0000000..b117665
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpOtherParcelableForToString.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpParcelableForToString.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpParcelableForToString.h
new file mode 100644
index 0000000..2312ef2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpParcelableForToString.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpRecursiveList.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpRecursiveList.h
new file mode 100644
index 0000000..1e91d8a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpRecursiveList.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpStructuredParcelable.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpStructuredParcelable.h
new file mode 100644
index 0000000..09a08ab
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpStructuredParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpTestService.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpTestService.h
new file mode 100644
index 0000000..e6e60c2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpTestService.h
@@ -0,0 +1,92 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/ITestService.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class BpTestService : public ::ndk::BpCInterface<ITestService> {
+public:
+  explicit BpTestService(const ::ndk::SpAIBinder& binder);
+  virtual ~BpTestService();
+
+  ::ndk::ScopedAStatus UnimplementedMethod(int32_t in_arg, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus Deprecated() override __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens")));
+  ::ndk::ScopedAStatus TestOneway() override;
+  ::ndk::ScopedAStatus RepeatBoolean(bool in_token, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatByte(int8_t in_token, int8_t* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatChar(char16_t in_token, char16_t* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatInt(int32_t in_token, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatLong(int64_t in_token, int64_t* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatFloat(float in_token, float* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatDouble(double in_token, double* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatString(const std::string& in_token, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatByteEnum(::aidl::android::aidl::tests::ByteEnum in_token, ::aidl::android::aidl::tests::ByteEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatIntEnum(::aidl::android::aidl::tests::IntEnum in_token, ::aidl::android::aidl::tests::IntEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatLongEnum(::aidl::android::aidl::tests::LongEnum in_token, ::aidl::android::aidl::tests::LongEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseBoolean(const std::vector<bool>& in_input, std::vector<bool>* out_repeated, std::vector<bool>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseByte(const std::vector<uint8_t>& in_input, std::vector<uint8_t>* out_repeated, std::vector<uint8_t>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseChar(const std::vector<char16_t>& in_input, std::vector<char16_t>* out_repeated, std::vector<char16_t>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseInt(const std::vector<int32_t>& in_input, std::vector<int32_t>* out_repeated, std::vector<int32_t>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseLong(const std::vector<int64_t>& in_input, std::vector<int64_t>* out_repeated, std::vector<int64_t>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseFloat(const std::vector<float>& in_input, std::vector<float>* out_repeated, std::vector<float>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseDouble(const std::vector<double>& in_input, std::vector<double>* out_repeated, std::vector<double>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseByteEnum(const std::vector<::aidl::android::aidl::tests::ByteEnum>& in_input, std::vector<::aidl::android::aidl::tests::ByteEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::ByteEnum>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseIntEnum(const std::vector<::aidl::android::aidl::tests::IntEnum>& in_input, std::vector<::aidl::android::aidl::tests::IntEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::IntEnum>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseLongEnum(const std::vector<::aidl::android::aidl::tests::LongEnum>& in_input, std::vector<::aidl::android::aidl::tests::LongEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::LongEnum>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetOtherTestService(const std::string& in_name, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) override;
+  ::ndk::ScopedAStatus SetOtherTestService(const std::string& in_name, const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus VerifyName(const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, const std::string& in_name, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus GetInterfaceArray(const std::vector<std::string>& in_names, std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>* _aidl_return) override;
+  ::ndk::ScopedAStatus VerifyNamesWithInterfaceArray(const std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>& in_services, const std::vector<std::string>& in_names, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus GetNullableInterfaceArray(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus VerifyNamesWithNullableInterfaceArray(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus GetInterfaceList(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus VerifyNamesWithInterfaceList(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseStringList(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatParcelFileDescriptor(const ::ndk::ScopedFileDescriptor& in_read, ::ndk::ScopedFileDescriptor* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseParcelFileDescriptorArray(const std::vector<::ndk::ScopedFileDescriptor>& in_input, std::vector<::ndk::ScopedFileDescriptor>* out_repeated, std::vector<::ndk::ScopedFileDescriptor>* _aidl_return) override;
+  ::ndk::ScopedAStatus ThrowServiceException(int32_t in_code) override;
+  ::ndk::ScopedAStatus RepeatNullableIntArray(const std::optional<std::vector<int32_t>>& in_input, std::optional<std::vector<int32_t>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableByteEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableIntEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableLongEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableString(const std::optional<std::string>& in_input, std::optional<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableParcelable(const std::optional<::aidl::android::aidl::tests::ITestService::Empty>& in_input, std::optional<::aidl::android::aidl::tests::ITestService::Empty>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableParcelableArray(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableParcelableList(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus TakesAnIBinder(const ::ndk::SpAIBinder& in_input) override;
+  ::ndk::ScopedAStatus TakesANullableIBinder(const ::ndk::SpAIBinder& in_input) override;
+  ::ndk::ScopedAStatus TakesAnIBinderList(const std::vector<::ndk::SpAIBinder>& in_input) override;
+  ::ndk::ScopedAStatus TakesANullableIBinderList(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input) override;
+  ::ndk::ScopedAStatus RepeatUtf8CppString(const std::string& in_token, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableUtf8CppString(const std::optional<std::string>& in_token, std::optional<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseUtf8CppString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseNullableUtf8CppString(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseUtf8CppStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetCallback(bool in_return_null, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) override;
+  ::ndk::ScopedAStatus FillOutStructuredParcelable(::aidl::android::aidl::tests::StructuredParcelable* in_parcel) override;
+  ::ndk::ScopedAStatus RepeatExtendableParcelable(const ::aidl::android::aidl::tests::extension::ExtendableParcelable& in_ep, ::aidl::android::aidl::tests::extension::ExtendableParcelable* out_ep2) override;
+  ::ndk::ScopedAStatus ReverseList(const ::aidl::android::aidl::tests::RecursiveList& in_list, ::aidl::android::aidl::tests::RecursiveList* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseIBinderArray(const std::vector<::ndk::SpAIBinder>& in_input, std::vector<::ndk::SpAIBinder>* out_repeated, std::vector<::ndk::SpAIBinder>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseNullableIBinderArray(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input, std::optional<std::vector<::ndk::SpAIBinder>>* out_repeated, std::optional<std::vector<::ndk::SpAIBinder>>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetOldNameInterface(std::shared_ptr<::aidl::android::aidl::tests::IOldName>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetNewNameInterface(std::shared_ptr<::aidl::android::aidl::tests::INewName>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetUnionTags(const std::vector<::aidl::android::aidl::tests::Union>& in_input, std::vector<::aidl::android::aidl::tests::Union::Tag>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetCppJavaTests(::ndk::SpAIBinder* _aidl_return) override;
+  ::ndk::ScopedAStatus getBackendType(::aidl::android::aidl::tests::BackendType* _aidl_return) override;
+  ::ndk::ScopedAStatus GetCircular(::aidl::android::aidl::tests::CircularParcelable* out_cp, std::shared_ptr<::aidl::android::aidl::tests::ICircular>* _aidl_return) override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpUnion.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpUnion.h
new file mode 100644
index 0000000..ffae148
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpUnionWithFd.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpUnionWithFd.h
new file mode 100644
index 0000000..34fb802
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/BpUnionWithFd.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ByteEnum.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ByteEnum.h
new file mode 100644
index 0000000..480e825
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ByteEnum.h
@@ -0,0 +1,64 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ByteEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+enum class ByteEnum : int8_t {
+  FOO = 1,
+  BAR = 2,
+  BAZ = 3,
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ByteEnum val) {
+  switch(val) {
+  case ByteEnum::FOO:
+    return "FOO";
+  case ByteEnum::BAR:
+    return "BAR";
+  case ByteEnum::BAZ:
+    return "BAZ";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::ByteEnum, 3> enum_values<aidl::android::aidl::tests::ByteEnum> = {
+  aidl::android::aidl::tests::ByteEnum::FOO,
+  aidl::android::aidl::tests::ByteEnum::BAR,
+  aidl::android::aidl::tests::ByteEnum::BAZ,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/CircularParcelable.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/CircularParcelable.h
new file mode 100644
index 0000000..cd814b1
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/CircularParcelable.h
@@ -0,0 +1,68 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/CircularParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/ITestService.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::tests {
+class ITestService;
+}  // namespace aidl::android::aidl::tests
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class CircularParcelable {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  std::shared_ptr<::aidl::android::aidl::tests::ITestService> testService;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const CircularParcelable& rhs) const {
+    return std::tie(testService) != std::tie(rhs.testService);
+  }
+  inline bool operator<(const CircularParcelable& rhs) const {
+    return std::tie(testService) < std::tie(rhs.testService);
+  }
+  inline bool operator<=(const CircularParcelable& rhs) const {
+    return std::tie(testService) <= std::tie(rhs.testService);
+  }
+  inline bool operator==(const CircularParcelable& rhs) const {
+    return std::tie(testService) == std::tie(rhs.testService);
+  }
+  inline bool operator>(const CircularParcelable& rhs) const {
+    return std::tie(testService) > std::tie(rhs.testService);
+  }
+  inline bool operator>=(const CircularParcelable& rhs) const {
+    return std::tie(testService) >= std::tie(rhs.testService);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "CircularParcelable{";
+    os << "testService: " << ::android::internal::ToString(testService);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ConstantExpressionEnum.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ConstantExpressionEnum.h
new file mode 100644
index 0000000..d4bdaab
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ConstantExpressionEnum.h
@@ -0,0 +1,74 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ConstantExpressionEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+enum class ConstantExpressionEnum : int32_t {
+  decInt32_1 = 1,
+  decInt32_2 = 1,
+  decInt64_1 = 1,
+  decInt64_2 = 1,
+  decInt64_3 = 1,
+  decInt64_4 = 1,
+  hexInt32_1 = 1,
+  hexInt32_2 = 1,
+  hexInt32_3 = 1,
+  hexInt64_1 = 1,
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ConstantExpressionEnum val) {
+  switch(val) {
+  case ConstantExpressionEnum::decInt32_1:
+    return "decInt32_1";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::ConstantExpressionEnum, 10> enum_values<aidl::android::aidl::tests::ConstantExpressionEnum> = {
+  aidl::android::aidl::tests::ConstantExpressionEnum::decInt32_1,
+  aidl::android::aidl::tests::ConstantExpressionEnum::decInt32_2,
+  aidl::android::aidl::tests::ConstantExpressionEnum::decInt64_1,
+  aidl::android::aidl::tests::ConstantExpressionEnum::decInt64_2,
+  aidl::android::aidl::tests::ConstantExpressionEnum::decInt64_3,
+  aidl::android::aidl::tests::ConstantExpressionEnum::decInt64_4,
+  aidl::android::aidl::tests::ConstantExpressionEnum::hexInt32_1,
+  aidl::android::aidl::tests::ConstantExpressionEnum::hexInt32_2,
+  aidl::android::aidl::tests::ConstantExpressionEnum::hexInt32_3,
+  aidl::android::aidl::tests::ConstantExpressionEnum::hexInt64_1,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/DeprecatedEnum.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/DeprecatedEnum.h
new file mode 100644
index 0000000..4c45d4e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/DeprecatedEnum.h
@@ -0,0 +1,68 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/DeprecatedEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+enum class __attribute__((deprecated("test"))) DeprecatedEnum : int32_t {
+  A = 0,
+  B = 1,
+  C = 2,
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+[[nodiscard]] static inline std::string toString(DeprecatedEnum val) {
+  switch(val) {
+  case DeprecatedEnum::A:
+    return "A";
+  case DeprecatedEnum::B:
+    return "B";
+  case DeprecatedEnum::C:
+    return "C";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+#pragma clang diagnostic pop
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::DeprecatedEnum, 3> enum_values<aidl::android::aidl::tests::DeprecatedEnum> = {
+  aidl::android::aidl::tests::DeprecatedEnum::A,
+  aidl::android::aidl::tests::DeprecatedEnum::B,
+  aidl::android::aidl::tests::DeprecatedEnum::C,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/DeprecatedParcelable.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/DeprecatedParcelable.h
new file mode 100644
index 0000000..cee8ba3
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/DeprecatedParcelable.h
@@ -0,0 +1,62 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/DeprecatedParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class __attribute__((deprecated("test"))) DeprecatedParcelable {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const DeprecatedParcelable&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const DeprecatedParcelable&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const DeprecatedParcelable&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const DeprecatedParcelable&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const DeprecatedParcelable&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const DeprecatedParcelable&) const {
+    return std::tie() >= std::tie();
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "DeprecatedParcelable{";
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/FixedSize.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/FixedSize.h
new file mode 100644
index 0000000..6e512ad
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/FixedSize.h
@@ -0,0 +1,299 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/FixedSize.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/FixedSize.h>
+#include <aidl/android/aidl/tests/LongEnum.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class FixedSize {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  class FixedUnion {
+  public:
+    typedef std::true_type fixed_size;
+    static const char* descriptor;
+
+    enum class Tag : int8_t {
+      booleanValue = 0,
+      byteValue = 1,
+      charValue = 2,
+      intValue = 3,
+      longValue = 4,
+      floatValue = 5,
+      doubleValue = 6,
+      enumValue = 7,
+    };
+
+    // Expose tag symbols for legacy code
+    static const inline Tag booleanValue = Tag::booleanValue;
+    static const inline Tag byteValue = Tag::byteValue;
+    static const inline Tag charValue = Tag::charValue;
+    static const inline Tag intValue = Tag::intValue;
+    static const inline Tag longValue = Tag::longValue;
+    static const inline Tag floatValue = Tag::floatValue;
+    static const inline Tag doubleValue = Tag::doubleValue;
+    static const inline Tag enumValue = Tag::enumValue;
+
+    template <Tag _Tag>
+    using _at = typename std::tuple_element<static_cast<size_t>(_Tag), std::tuple<bool, int8_t, char16_t, int32_t, int64_t, float, double, ::aidl::android::aidl::tests::LongEnum>>::type;
+    template <Tag _Tag, typename _Type>
+    static FixedUnion make(_Type&& _arg) {
+      FixedUnion _inst;
+      _inst.set<_Tag>(std::forward<_Type>(_arg));
+      return _inst;
+    }
+    constexpr Tag getTag() const {
+      return _tag;
+    }
+    template <Tag _Tag>
+    const _at<_Tag>& get() const {
+      if (_Tag != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return *(_at<_Tag>*)(&_value);
+    }
+    template <Tag _Tag>
+    _at<_Tag>& get() {
+      if (_Tag != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return *(_at<_Tag>*)(&_value);
+    }
+    template <Tag _Tag, typename _Type>
+    void set(_Type&& _arg) {
+      _tag = _Tag;
+      get<_Tag>() = std::forward<_Type>(_arg);
+    }
+    binder_status_t readFromParcel(const AParcel* _parcel);
+    binder_status_t writeToParcel(AParcel* _parcel) const;
+
+    static int _cmp(const FixedUnion& _lhs, const FixedUnion& _rhs) {
+      return _cmp_value(_lhs.getTag(), _rhs.getTag()) || _cmp_value_at<enumValue>(_lhs, _rhs);
+    }
+    template <Tag _Tag>
+    static int _cmp_value_at(const FixedUnion& _lhs, const FixedUnion& _rhs) {
+      if constexpr (_Tag == booleanValue) {
+        return _cmp_value(_lhs.get<_Tag>(), _rhs.get<_Tag>());
+      } else {
+        return (_lhs.getTag() == _Tag)
+          ? _cmp_value(_lhs.get<_Tag>(), _rhs.get<_Tag>())
+          : _cmp_value_at<static_cast<Tag>(static_cast<size_t>(_Tag)-1)>(_lhs, _rhs);
+      }
+    }
+    template <typename _Type>
+    static int _cmp_value(const _Type& _lhs, const _Type& _rhs) {
+      return (_lhs == _rhs) ? 0 : (_lhs < _rhs) ? -1 : 1;
+    }
+    inline bool operator!=(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) != 0;
+    }
+    inline bool operator<(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) < 0;
+    }
+    inline bool operator<=(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) <= 0;
+    }
+    inline bool operator==(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) == 0;
+    }
+    inline bool operator>(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) > 0;
+    }
+    inline bool operator>=(const FixedUnion&_rhs) const {
+      return _cmp(*this, _rhs) >= 0;
+    }
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "FixedUnion{";
+      switch (getTag()) {
+      case booleanValue: os << "booleanValue: " << ::android::internal::ToString(get<booleanValue>()); break;
+      case byteValue: os << "byteValue: " << ::android::internal::ToString(get<byteValue>()); break;
+      case charValue: os << "charValue: " << ::android::internal::ToString(get<charValue>()); break;
+      case intValue: os << "intValue: " << ::android::internal::ToString(get<intValue>()); break;
+      case longValue: os << "longValue: " << ::android::internal::ToString(get<longValue>()); break;
+      case floatValue: os << "floatValue: " << ::android::internal::ToString(get<floatValue>()); break;
+      case doubleValue: os << "doubleValue: " << ::android::internal::ToString(get<doubleValue>()); break;
+      case enumValue: os << "enumValue: " << ::android::internal::ToString(get<enumValue>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    Tag _tag = booleanValue;
+    union _value_t {
+      _value_t() {}
+      ~_value_t() {}
+      bool booleanValue __attribute__((aligned (1))) = bool(false);
+      int8_t byteValue __attribute__((aligned (1)));
+      char16_t charValue __attribute__((aligned (2)));
+      int32_t intValue __attribute__((aligned (4)));
+      int64_t longValue __attribute__((aligned (8)));
+      float floatValue __attribute__((aligned (4)));
+      double doubleValue __attribute__((aligned (8)));
+      ::aidl::android::aidl::tests::LongEnum enumValue __attribute__((aligned (8)));
+    } _value;
+  };
+  class FixedParcelable {
+  public:
+    typedef std::true_type fixed_size;
+    static const char* descriptor;
+
+    bool booleanValue __attribute__((aligned (1))) = false;
+    int8_t byteValue __attribute__((aligned (1))) = 0;
+    char16_t charValue __attribute__((aligned (2))) = '\0';
+    int32_t intValue __attribute__((aligned (4))) = 0;
+    int64_t longValue __attribute__((aligned (8))) = 0L;
+    float floatValue __attribute__((aligned (4))) = 0.000000f;
+    double doubleValue __attribute__((aligned (8))) = 0.000000;
+    ::aidl::android::aidl::tests::LongEnum enumValue __attribute__((aligned (8))) = ::aidl::android::aidl::tests::LongEnum::FOO;
+    ::aidl::android::aidl::tests::FixedSize::FixedUnion parcelableValue;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) != std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator<(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) < std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator<=(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) <= std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator==(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) == std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator>(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) > std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+    inline bool operator>=(const FixedParcelable& rhs) const {
+      return std::tie(booleanValue, byteValue, charValue, intValue, longValue, floatValue, doubleValue, enumValue, parcelableValue) >= std::tie(rhs.booleanValue, rhs.byteValue, rhs.charValue, rhs.intValue, rhs.longValue, rhs.floatValue, rhs.doubleValue, rhs.enumValue, rhs.parcelableValue);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "FixedParcelable{";
+      os << "booleanValue: " << ::android::internal::ToString(booleanValue);
+      os << ", byteValue: " << ::android::internal::ToString(byteValue);
+      os << ", charValue: " << ::android::internal::ToString(charValue);
+      os << ", intValue: " << ::android::internal::ToString(intValue);
+      os << ", longValue: " << ::android::internal::ToString(longValue);
+      os << ", floatValue: " << ::android::internal::ToString(floatValue);
+      os << ", doubleValue: " << ::android::internal::ToString(doubleValue);
+      os << ", enumValue: " << ::android::internal::ToString(enumValue);
+      os << ", parcelableValue: " << ::android::internal::ToString(parcelableValue);
+      os << "}";
+      return os.str();
+    }
+  };
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const FixedSize&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const FixedSize&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const FixedSize&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const FixedSize&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const FixedSize&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const FixedSize&) const {
+    return std::tie() >= std::tie();
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "FixedSize{";
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(FixedSize::FixedUnion::Tag val) {
+  switch(val) {
+  case FixedSize::FixedUnion::Tag::booleanValue:
+    return "booleanValue";
+  case FixedSize::FixedUnion::Tag::byteValue:
+    return "byteValue";
+  case FixedSize::FixedUnion::Tag::charValue:
+    return "charValue";
+  case FixedSize::FixedUnion::Tag::intValue:
+    return "intValue";
+  case FixedSize::FixedUnion::Tag::longValue:
+    return "longValue";
+  case FixedSize::FixedUnion::Tag::floatValue:
+    return "floatValue";
+  case FixedSize::FixedUnion::Tag::doubleValue:
+    return "doubleValue";
+  case FixedSize::FixedUnion::Tag::enumValue:
+    return "enumValue";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::FixedSize::FixedUnion::Tag, 8> enum_values<aidl::android::aidl::tests::FixedSize::FixedUnion::Tag> = {
+  aidl::android::aidl::tests::FixedSize::FixedUnion::Tag::booleanValue,
+  aidl::android::aidl::tests::FixedSize::FixedUnion::Tag::byteValue,
+  aidl::android::aidl::tests::FixedSize::FixedUnion::Tag::charValue,
+  aidl::android::aidl::tests::FixedSize::FixedUnion::Tag::intValue,
+  aidl::android::aidl::tests::FixedSize::FixedUnion::Tag::longValue,
+  aidl::android::aidl::tests::FixedSize::FixedUnion::Tag::floatValue,
+  aidl::android::aidl::tests::FixedSize::FixedUnion::Tag::doubleValue,
+  aidl::android::aidl::tests::FixedSize::FixedUnion::Tag::enumValue,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/GenericStructuredParcelable.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/GenericStructuredParcelable.h
new file mode 100644
index 0000000..3c14e70
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/GenericStructuredParcelable.h
@@ -0,0 +1,129 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/GenericStructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+template <typename T, typename U, typename B>
+class GenericStructuredParcelable {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t a = 0;
+  int32_t b = 0;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<=(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator==(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>=(const GenericStructuredParcelable& rhs) const {
+    return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "GenericStructuredParcelable{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+#include "aidl/android/aidl/tests/GenericStructuredParcelable.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+template <typename T, typename U, typename B>
+const char* GenericStructuredParcelable<T, U, B>::descriptor = "android.aidl.tests.GenericStructuredParcelable";
+
+template <typename T, typename U, typename B>
+binder_status_t GenericStructuredParcelable<T, U, B>::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+template <typename T, typename U, typename B>
+binder_status_t GenericStructuredParcelable<T, U, B>::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ICircular.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ICircular.h
new file mode 100644
index 0000000..72e9de9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ICircular.h
@@ -0,0 +1,54 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ICircular.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <aidl/android/aidl/tests/ITestService.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::tests {
+class ITestService;
+}  // namespace aidl::android::aidl::tests
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class ICircularDelegator;
+
+class ICircular : public ::ndk::ICInterface {
+public:
+  typedef ICircularDelegator DefaultDelegator;
+  static const char* descriptor;
+  ICircular();
+  virtual ~ICircular();
+
+  static constexpr uint32_t TRANSACTION_GetTestService = FIRST_CALL_TRANSACTION + 0;
+
+  static std::shared_ptr<ICircular> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<ICircular>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<ICircular>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<ICircular>& impl);
+  static const std::shared_ptr<ICircular>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus GetTestService(std::shared_ptr<::aidl::android::aidl::tests::ITestService>* _aidl_return) = 0;
+private:
+  static std::shared_ptr<ICircular> default_impl;
+};
+class ICircularDefault : public ICircular {
+public:
+  ::ndk::ScopedAStatus GetTestService(std::shared_ptr<::aidl::android::aidl::tests::ITestService>* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IDeprecated.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IDeprecated.h
new file mode 100644
index 0000000..6c70567
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IDeprecated.h
@@ -0,0 +1,47 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IDeprecated.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class IDeprecatedDelegator;
+
+class __attribute__((deprecated("test"))) IDeprecated : public ::ndk::ICInterface {
+public:
+  typedef IDeprecatedDelegator DefaultDelegator;
+  static const char* descriptor;
+  IDeprecated();
+  virtual ~IDeprecated();
+
+
+  static std::shared_ptr<IDeprecated> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IDeprecated>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IDeprecated>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<IDeprecated>& impl);
+  static const std::shared_ptr<IDeprecated>& getDefaultImpl();
+private:
+  static std::shared_ptr<IDeprecated> default_impl;
+};
+class __attribute__((deprecated("test"))) IDeprecatedDefault : public IDeprecated {
+public:
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/INamedCallback.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/INamedCallback.h
new file mode 100644
index 0000000..c6d263e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/INamedCallback.h
@@ -0,0 +1,50 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/INamedCallback.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class INamedCallbackDelegator;
+
+class INamedCallback : public ::ndk::ICInterface {
+public:
+  typedef INamedCallbackDelegator DefaultDelegator;
+  static const char* descriptor;
+  INamedCallback();
+  virtual ~INamedCallback();
+
+  static constexpr uint32_t TRANSACTION_GetName = FIRST_CALL_TRANSACTION + 0;
+
+  static std::shared_ptr<INamedCallback> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<INamedCallback>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<INamedCallback>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<INamedCallback>& impl);
+  static const std::shared_ptr<INamedCallback>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus GetName(std::string* _aidl_return) = 0;
+private:
+  static std::shared_ptr<INamedCallback> default_impl;
+};
+class INamedCallbackDefault : public INamedCallback {
+public:
+  ::ndk::ScopedAStatus GetName(std::string* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/INewName.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/INewName.h
new file mode 100644
index 0000000..535f0f6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/INewName.h
@@ -0,0 +1,50 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/INewName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class INewNameDelegator;
+
+class INewName : public ::ndk::ICInterface {
+public:
+  typedef INewNameDelegator DefaultDelegator;
+  static const char* descriptor;
+  INewName();
+  virtual ~INewName();
+
+  static constexpr uint32_t TRANSACTION_RealName = FIRST_CALL_TRANSACTION + 0;
+
+  static std::shared_ptr<INewName> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<INewName>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<INewName>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<INewName>& impl);
+  static const std::shared_ptr<INewName>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus RealName(std::string* _aidl_return) = 0;
+private:
+  static std::shared_ptr<INewName> default_impl;
+};
+class INewNameDefault : public INewName {
+public:
+  ::ndk::ScopedAStatus RealName(std::string* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IOldName.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IOldName.h
new file mode 100644
index 0000000..f728d1f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IOldName.h
@@ -0,0 +1,50 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IOldName.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class IOldNameDelegator;
+
+class IOldName : public ::ndk::ICInterface {
+public:
+  typedef IOldNameDelegator DefaultDelegator;
+  static const char* descriptor;
+  IOldName();
+  virtual ~IOldName();
+
+  static constexpr uint32_t TRANSACTION_RealName = FIRST_CALL_TRANSACTION + 0;
+
+  static std::shared_ptr<IOldName> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IOldName>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IOldName>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<IOldName>& impl);
+  static const std::shared_ptr<IOldName>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus RealName(std::string* _aidl_return) = 0;
+private:
+  static std::shared_ptr<IOldName> default_impl;
+};
+class IOldNameDefault : public IOldName {
+public:
+  ::ndk::ScopedAStatus RealName(std::string* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ITestService.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ITestService.h
new file mode 100644
index 0000000..3c16090
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ITestService.h
@@ -0,0 +1,811 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ITestService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_ibinder.h>
+#include <android/binder_ibinder_platform.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcel_platform.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/BackendType.h>
+#include <aidl/android/aidl/tests/ByteEnum.h>
+#include <aidl/android/aidl/tests/CircularParcelable.h>
+#include <aidl/android/aidl/tests/ICircular.h>
+#include <aidl/android/aidl/tests/INamedCallback.h>
+#include <aidl/android/aidl/tests/INewName.h>
+#include <aidl/android/aidl/tests/IOldName.h>
+#include <aidl/android/aidl/tests/ITestService.h>
+#include <aidl/android/aidl/tests/IntEnum.h>
+#include <aidl/android/aidl/tests/LongEnum.h>
+#include <aidl/android/aidl/tests/RecursiveList.h>
+#include <aidl/android/aidl/tests/StructuredParcelable.h>
+#include <aidl/android/aidl/tests/Union.h>
+#include <aidl/android/aidl/tests/extension/ExtendableParcelable.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl::android::aidl::tests {
+class CircularParcelable;
+class ICircular;
+class INamedCallback;
+class INewName;
+class IOldName;
+class RecursiveList;
+class StructuredParcelable;
+}  // namespace aidl::android::aidl::tests
+namespace aidl::android::aidl::tests::extension {
+class ExtendableParcelable;
+}  // namespace aidl::android::aidl::tests::extension
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class ITestServiceDelegator;
+
+class ITestService : public ::ndk::ICInterface {
+public:
+  typedef ITestServiceDelegator DefaultDelegator;
+  static const char* descriptor;
+  ITestService();
+  virtual ~ITestService();
+
+  class Empty {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const Empty&) const {
+      return std::tie() != std::tie();
+    }
+    inline bool operator<(const Empty&) const {
+      return std::tie() < std::tie();
+    }
+    inline bool operator<=(const Empty&) const {
+      return std::tie() <= std::tie();
+    }
+    inline bool operator==(const Empty&) const {
+      return std::tie() == std::tie();
+    }
+    inline bool operator>(const Empty&) const {
+      return std::tie() > std::tie();
+    }
+    inline bool operator>=(const Empty&) const {
+      return std::tie() >= std::tie();
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "Empty{";
+      os << "}";
+      return os.str();
+    }
+  };
+  class CompilerChecks {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    class IFooDelegator;
+
+    class IFoo : public ::ndk::ICInterface {
+    public:
+      typedef IFooDelegator DefaultDelegator;
+      static const char* descriptor;
+      IFoo();
+      virtual ~IFoo();
+
+
+      static std::shared_ptr<IFoo> fromBinder(const ::ndk::SpAIBinder& binder);
+      static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IFoo>& instance);
+      static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IFoo>* instance);
+      static bool setDefaultImpl(const std::shared_ptr<IFoo>& impl);
+      static const std::shared_ptr<IFoo>& getDefaultImpl();
+    private:
+      static std::shared_ptr<IFoo> default_impl;
+    };
+    class IFooDefault : public IFoo {
+    public:
+      ::ndk::SpAIBinder asBinder() override;
+      bool isRemote() override;
+    };
+    class BpFoo : public ::ndk::BpCInterface<IFoo> {
+    public:
+      explicit BpFoo(const ::ndk::SpAIBinder& binder);
+      virtual ~BpFoo();
+
+    };
+    class BnFoo : public ::ndk::BnCInterface<IFoo> {
+    public:
+      BnFoo();
+      virtual ~BnFoo();
+    protected:
+      ::ndk::SpAIBinder createBinder() override;
+    private:
+    };
+    #pragma clang diagnostic push
+    #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+    class HasDeprecated {
+    public:
+      typedef std::false_type fixed_size;
+      static const char* descriptor;
+
+      int32_t __attribute__((deprecated("field"))) deprecated = 0;
+
+      binder_status_t readFromParcel(const AParcel* parcel);
+      binder_status_t writeToParcel(AParcel* parcel) const;
+
+      inline bool operator!=(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) != std::tie(rhs.deprecated);
+      }
+      inline bool operator<(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) < std::tie(rhs.deprecated);
+      }
+      inline bool operator<=(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) <= std::tie(rhs.deprecated);
+      }
+      inline bool operator==(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) == std::tie(rhs.deprecated);
+      }
+      inline bool operator>(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) > std::tie(rhs.deprecated);
+      }
+      inline bool operator>=(const HasDeprecated& rhs) const {
+        return std::tie(deprecated) >= std::tie(rhs.deprecated);
+      }
+
+      static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+      inline std::string toString() const {
+        std::ostringstream os;
+        os << "HasDeprecated{";
+        os << "deprecated: " << ::android::internal::ToString(deprecated);
+        os << "}";
+        return os.str();
+      }
+    };
+    #pragma clang diagnostic pop
+    class UsingHasDeprecated {
+    public:
+      typedef std::false_type fixed_size;
+      static const char* descriptor;
+
+      enum class Tag : int32_t {
+        n = 0,
+        m = 1,
+      };
+
+      // Expose tag symbols for legacy code
+      static const inline Tag n = Tag::n;
+      static const inline Tag m = Tag::m;
+
+      template<typename _Tp>
+      static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, UsingHasDeprecated>;
+
+      UsingHasDeprecated() : _value(std::in_place_index<static_cast<size_t>(n)>, int32_t(0)) { }
+
+      template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+      // NOLINTNEXTLINE(google-explicit-constructor)
+      constexpr UsingHasDeprecated(_Tp&& _arg)
+          : _value(std::forward<_Tp>(_arg)) {}
+
+      template <size_t _Np, typename... _Tp>
+      constexpr explicit UsingHasDeprecated(std::in_place_index_t<_Np>, _Tp&&... _args)
+          : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+      template <Tag _tag, typename... _Tp>
+      static UsingHasDeprecated make(_Tp&&... _args) {
+        return UsingHasDeprecated(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+      }
+
+      template <Tag _tag, typename _Tp, typename... _Up>
+      static UsingHasDeprecated make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+        return UsingHasDeprecated(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+      }
+
+      Tag getTag() const {
+        return static_cast<Tag>(_value.index());
+      }
+
+      template <Tag _tag>
+      const auto& get() const {
+        if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+        return std::get<static_cast<size_t>(_tag)>(_value);
+      }
+
+      template <Tag _tag>
+      auto& get() {
+        if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+        return std::get<static_cast<size_t>(_tag)>(_value);
+      }
+
+      template <Tag _tag, typename... _Tp>
+      void set(_Tp&&... _args) {
+        _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+      }
+
+      binder_status_t readFromParcel(const AParcel* _parcel);
+      binder_status_t writeToParcel(AParcel* _parcel) const;
+
+      inline bool operator!=(const UsingHasDeprecated& rhs) const {
+        return _value != rhs._value;
+      }
+      inline bool operator<(const UsingHasDeprecated& rhs) const {
+        return _value < rhs._value;
+      }
+      inline bool operator<=(const UsingHasDeprecated& rhs) const {
+        return _value <= rhs._value;
+      }
+      inline bool operator==(const UsingHasDeprecated& rhs) const {
+        return _value == rhs._value;
+      }
+      inline bool operator>(const UsingHasDeprecated& rhs) const {
+        return _value > rhs._value;
+      }
+      inline bool operator>=(const UsingHasDeprecated& rhs) const {
+        return _value >= rhs._value;
+      }
+
+      static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+      inline std::string toString() const {
+        std::ostringstream os;
+        os << "UsingHasDeprecated{";
+        switch (getTag()) {
+        case n: os << "n: " << ::android::internal::ToString(get<n>()); break;
+        case m: os << "m: " << ::android::internal::ToString(get<m>()); break;
+        }
+        os << "}";
+        return os.str();
+      }
+    private:
+      std::variant<int32_t, ::aidl::android::aidl::tests::ITestService::CompilerChecks::HasDeprecated> _value;
+    };
+    class INoPrefixInterfaceDelegator;
+
+    class INoPrefixInterface : public ::ndk::ICInterface {
+    public:
+      typedef INoPrefixInterfaceDelegator DefaultDelegator;
+      static const char* descriptor;
+      INoPrefixInterface();
+      virtual ~INoPrefixInterface();
+
+      class Nested {
+      public:
+        typedef std::false_type fixed_size;
+        static const char* descriptor;
+
+
+        binder_status_t readFromParcel(const AParcel* parcel);
+        binder_status_t writeToParcel(AParcel* parcel) const;
+
+        inline bool operator!=(const Nested&) const {
+          return std::tie() != std::tie();
+        }
+        inline bool operator<(const Nested&) const {
+          return std::tie() < std::tie();
+        }
+        inline bool operator<=(const Nested&) const {
+          return std::tie() <= std::tie();
+        }
+        inline bool operator==(const Nested&) const {
+          return std::tie() == std::tie();
+        }
+        inline bool operator>(const Nested&) const {
+          return std::tie() > std::tie();
+        }
+        inline bool operator>=(const Nested&) const {
+          return std::tie() >= std::tie();
+        }
+
+        static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+        inline std::string toString() const {
+          std::ostringstream os;
+          os << "Nested{";
+          os << "}";
+          return os.str();
+        }
+      };
+      class INestedNoPrefixInterfaceDelegator;
+
+      class INestedNoPrefixInterface : public ::ndk::ICInterface {
+      public:
+        typedef INestedNoPrefixInterfaceDelegator DefaultDelegator;
+        static const char* descriptor;
+        INestedNoPrefixInterface();
+        virtual ~INestedNoPrefixInterface();
+
+        static constexpr uint32_t TRANSACTION_foo = FIRST_CALL_TRANSACTION + 0;
+
+        static std::shared_ptr<INestedNoPrefixInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+        static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<INestedNoPrefixInterface>& instance);
+        static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<INestedNoPrefixInterface>* instance);
+        static bool setDefaultImpl(const std::shared_ptr<INestedNoPrefixInterface>& impl);
+        static const std::shared_ptr<INestedNoPrefixInterface>& getDefaultImpl();
+        virtual ::ndk::ScopedAStatus foo() = 0;
+      private:
+        static std::shared_ptr<INestedNoPrefixInterface> default_impl;
+      };
+      class INestedNoPrefixInterfaceDefault : public INestedNoPrefixInterface {
+      public:
+        ::ndk::ScopedAStatus foo() override;
+        ::ndk::SpAIBinder asBinder() override;
+        bool isRemote() override;
+      };
+      class BpNestedNoPrefixInterface : public ::ndk::BpCInterface<INestedNoPrefixInterface> {
+      public:
+        explicit BpNestedNoPrefixInterface(const ::ndk::SpAIBinder& binder);
+        virtual ~BpNestedNoPrefixInterface();
+
+        ::ndk::ScopedAStatus foo() override;
+      };
+      class BnNestedNoPrefixInterface : public ::ndk::BnCInterface<INestedNoPrefixInterface> {
+      public:
+        BnNestedNoPrefixInterface();
+        virtual ~BnNestedNoPrefixInterface();
+      protected:
+        ::ndk::SpAIBinder createBinder() override;
+      private:
+      };
+      static constexpr uint32_t TRANSACTION_foo = FIRST_CALL_TRANSACTION + 0;
+
+      static std::shared_ptr<INoPrefixInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+      static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<INoPrefixInterface>& instance);
+      static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<INoPrefixInterface>* instance);
+      static bool setDefaultImpl(const std::shared_ptr<INoPrefixInterface>& impl);
+      static const std::shared_ptr<INoPrefixInterface>& getDefaultImpl();
+      virtual ::ndk::ScopedAStatus foo() = 0;
+    private:
+      static std::shared_ptr<INoPrefixInterface> default_impl;
+    };
+    class INoPrefixInterfaceDefault : public INoPrefixInterface {
+    public:
+      ::ndk::ScopedAStatus foo() override;
+      ::ndk::SpAIBinder asBinder() override;
+      bool isRemote() override;
+    };
+    class BpNoPrefixInterface : public ::ndk::BpCInterface<INoPrefixInterface> {
+    public:
+      explicit BpNoPrefixInterface(const ::ndk::SpAIBinder& binder);
+      virtual ~BpNoPrefixInterface();
+
+      ::ndk::ScopedAStatus foo() override;
+    };
+    class BnNoPrefixInterface : public ::ndk::BnCInterface<INoPrefixInterface> {
+    public:
+      BnNoPrefixInterface();
+      virtual ~BnNoPrefixInterface();
+    protected:
+      ::ndk::SpAIBinder createBinder() override;
+    private:
+    };
+    ::ndk::SpAIBinder binder;
+    ::ndk::SpAIBinder nullable_binder;
+    std::vector<::ndk::SpAIBinder> binder_array;
+    std::optional<std::vector<::ndk::SpAIBinder>> nullable_binder_array;
+    std::vector<::ndk::SpAIBinder> binder_list;
+    std::optional<std::vector<::ndk::SpAIBinder>> nullable_binder_list;
+    ::ndk::ScopedFileDescriptor pfd;
+    ::ndk::ScopedFileDescriptor nullable_pfd;
+    std::vector<::ndk::ScopedFileDescriptor> pfd_array;
+    std::optional<std::vector<::ndk::ScopedFileDescriptor>> nullable_pfd_array;
+    std::vector<::ndk::ScopedFileDescriptor> pfd_list;
+    std::optional<std::vector<::ndk::ScopedFileDescriptor>> nullable_pfd_list;
+    ::aidl::android::aidl::tests::ITestService::Empty parcel;
+    std::optional<::aidl::android::aidl::tests::ITestService::Empty> nullable_parcel;
+    std::vector<::aidl::android::aidl::tests::ITestService::Empty> parcel_array;
+    std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>> nullable_parcel_array;
+    std::vector<::aidl::android::aidl::tests::ITestService::Empty> parcel_list;
+    std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>> nullable_parcel_list;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) != std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator<(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) < std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator<=(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) <= std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator==(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) == std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator>(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) > std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+    inline bool operator>=(const CompilerChecks& rhs) const {
+      return std::tie(binder, nullable_binder, binder_array, nullable_binder_array, binder_list, nullable_binder_list, pfd, nullable_pfd, pfd_array, nullable_pfd_array, pfd_list, nullable_pfd_list, parcel, nullable_parcel, parcel_array, nullable_parcel_array, parcel_list, nullable_parcel_list) >= std::tie(rhs.binder, rhs.nullable_binder, rhs.binder_array, rhs.nullable_binder_array, rhs.binder_list, rhs.nullable_binder_list, rhs.pfd, rhs.nullable_pfd, rhs.pfd_array, rhs.nullable_pfd_array, rhs.pfd_list, rhs.nullable_pfd_list, rhs.parcel, rhs.nullable_parcel, rhs.parcel_array, rhs.nullable_parcel_array, rhs.parcel_list, rhs.nullable_parcel_list);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "CompilerChecks{";
+      os << "binder: " << ::android::internal::ToString(binder);
+      os << ", nullable_binder: " << ::android::internal::ToString(nullable_binder);
+      os << ", binder_array: " << ::android::internal::ToString(binder_array);
+      os << ", nullable_binder_array: " << ::android::internal::ToString(nullable_binder_array);
+      os << ", binder_list: " << ::android::internal::ToString(binder_list);
+      os << ", nullable_binder_list: " << ::android::internal::ToString(nullable_binder_list);
+      os << ", pfd: " << ::android::internal::ToString(pfd);
+      os << ", nullable_pfd: " << ::android::internal::ToString(nullable_pfd);
+      os << ", pfd_array: " << ::android::internal::ToString(pfd_array);
+      os << ", nullable_pfd_array: " << ::android::internal::ToString(nullable_pfd_array);
+      os << ", pfd_list: " << ::android::internal::ToString(pfd_list);
+      os << ", nullable_pfd_list: " << ::android::internal::ToString(nullable_pfd_list);
+      os << ", parcel: " << ::android::internal::ToString(parcel);
+      os << ", nullable_parcel: " << ::android::internal::ToString(nullable_parcel);
+      os << ", parcel_array: " << ::android::internal::ToString(parcel_array);
+      os << ", nullable_parcel_array: " << ::android::internal::ToString(nullable_parcel_array);
+      os << ", parcel_list: " << ::android::internal::ToString(parcel_list);
+      os << ", nullable_parcel_list: " << ::android::internal::ToString(nullable_parcel_list);
+      os << "}";
+      return os.str();
+    }
+  };
+  enum : int32_t { CONSTANT = 42 };
+  enum : int32_t { CONSTANT2 = -42 };
+  enum : int32_t { CONSTANT3 = 42 };
+  enum : int32_t { CONSTANT4 = 4 };
+  enum : int32_t { CONSTANT5 = -4 };
+  enum : int32_t { CONSTANT6 = 0 };
+  enum : int32_t { CONSTANT7 = 0 };
+  enum : int32_t { CONSTANT8 = 0 };
+  enum : int32_t { CONSTANT9 = 86 };
+  enum : int32_t { CONSTANT10 = 165 };
+  enum : int32_t { CONSTANT11 = 250 };
+  enum : int32_t { CONSTANT12 = -1 };
+  enum : int8_t { BYTE_CONSTANT = 17 };
+  enum : int64_t { LONG_CONSTANT = 1099511627776L };
+  static const char* STRING_CONSTANT;
+  static const char* STRING_CONSTANT2;
+  static constexpr float FLOAT_CONSTANT = 1.000000f;
+  static constexpr float FLOAT_CONSTANT2 = -1.000000f;
+  static constexpr float FLOAT_CONSTANT3 = 1.000000f;
+  static constexpr float FLOAT_CONSTANT4 = 2.200000f;
+  static constexpr float FLOAT_CONSTANT5 = -2.200000f;
+  static constexpr float FLOAT_CONSTANT6 = -0.000000f;
+  static constexpr float FLOAT_CONSTANT7 = 0.000000f;
+  static constexpr double DOUBLE_CONSTANT = 1.000000;
+  static constexpr double DOUBLE_CONSTANT2 = -1.000000;
+  static constexpr double DOUBLE_CONSTANT3 = 1.000000;
+  static constexpr double DOUBLE_CONSTANT4 = 2.200000;
+  static constexpr double DOUBLE_CONSTANT5 = -2.200000;
+  static constexpr double DOUBLE_CONSTANT6 = -0.000000;
+  static constexpr double DOUBLE_CONSTANT7 = 0.000000;
+  static constexpr double DOUBLE_CONSTANT8 = 1.100000;
+  static constexpr double DOUBLE_CONSTANT9 = -1.100000;
+  static const char* STRING_CONSTANT_UTF8;
+  enum : int32_t { A1 = 1 };
+  enum : int32_t { A2 = 1 };
+  enum : int32_t { A3 = 1 };
+  enum : int32_t { A4 = 1 };
+  enum : int32_t { A5 = 1 };
+  enum : int32_t { A6 = 1 };
+  enum : int32_t { A7 = 1 };
+  enum : int32_t { A8 = 1 };
+  enum : int32_t { A9 = 1 };
+  enum : int32_t { A10 = 1 };
+  enum : int32_t { A11 = 1 };
+  enum : int32_t { A12 = 1 };
+  enum : int32_t { A13 = 1 };
+  enum : int32_t { A14 = 1 };
+  enum : int32_t { A15 = 1 };
+  enum : int32_t { A16 = 1 };
+  enum : int32_t { A17 = 1 };
+  enum : int32_t { A18 = 1 };
+  enum : int32_t { A19 = 1 };
+  enum : int32_t { A20 = 1 };
+  enum : int32_t { A21 = 1 };
+  enum : int32_t { A22 = 1 };
+  enum : int32_t { A23 = 1 };
+  enum : int32_t { A24 = 1 };
+  enum : int32_t { A25 = 1 };
+  enum : int32_t { A26 = 1 };
+  enum : int32_t { A27 = 1 };
+  enum : int32_t { A28 = 1 };
+  enum : int32_t { A29 = 1 };
+  enum : int32_t { A30 = 1 };
+  enum : int32_t { A31 = 1 };
+  enum : int32_t { A32 = 1 };
+  enum : int32_t { A33 = 1 };
+  enum : int32_t { A34 = 1 };
+  enum : int32_t { A35 = 1 };
+  enum : int32_t { A36 = 1 };
+  enum : int32_t { A37 = 1 };
+  enum : int32_t { A38 = 1 };
+  enum : int32_t { A39 = 1 };
+  enum : int32_t { A40 = 1 };
+  enum : int32_t { A41 = 1 };
+  enum : int32_t { A42 = 1 };
+  enum : int32_t { A43 = 1 };
+  enum : int32_t { A44 = 1 };
+  enum : int32_t { A45 = 1 };
+  enum : int32_t { A46 = 1 };
+  enum : int32_t { A47 = 1 };
+  enum : int32_t { A48 = 1 };
+  enum : int32_t { A49 = 1 };
+  enum : int32_t { A50 = 1 };
+  enum : int32_t { A51 = 1 };
+  enum : int32_t { A52 = 1 };
+  enum : int32_t { A53 = 1 };
+  enum : int32_t { A54 = 1 };
+  enum : int32_t { A55 = 1 };
+  enum : int32_t { A56 = 1 };
+  enum : int32_t { A57 = 1 };
+  static constexpr uint32_t TRANSACTION_UnimplementedMethod = FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_Deprecated = FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_TestOneway = FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_RepeatBoolean = FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_RepeatByte = FIRST_CALL_TRANSACTION + 4;
+  static constexpr uint32_t TRANSACTION_RepeatChar = FIRST_CALL_TRANSACTION + 5;
+  static constexpr uint32_t TRANSACTION_RepeatInt = FIRST_CALL_TRANSACTION + 6;
+  static constexpr uint32_t TRANSACTION_RepeatLong = FIRST_CALL_TRANSACTION + 7;
+  static constexpr uint32_t TRANSACTION_RepeatFloat = FIRST_CALL_TRANSACTION + 8;
+  static constexpr uint32_t TRANSACTION_RepeatDouble = FIRST_CALL_TRANSACTION + 9;
+  static constexpr uint32_t TRANSACTION_RepeatString = FIRST_CALL_TRANSACTION + 10;
+  static constexpr uint32_t TRANSACTION_RepeatByteEnum = FIRST_CALL_TRANSACTION + 11;
+  static constexpr uint32_t TRANSACTION_RepeatIntEnum = FIRST_CALL_TRANSACTION + 12;
+  static constexpr uint32_t TRANSACTION_RepeatLongEnum = FIRST_CALL_TRANSACTION + 13;
+  static constexpr uint32_t TRANSACTION_ReverseBoolean = FIRST_CALL_TRANSACTION + 14;
+  static constexpr uint32_t TRANSACTION_ReverseByte = FIRST_CALL_TRANSACTION + 15;
+  static constexpr uint32_t TRANSACTION_ReverseChar = FIRST_CALL_TRANSACTION + 16;
+  static constexpr uint32_t TRANSACTION_ReverseInt = FIRST_CALL_TRANSACTION + 17;
+  static constexpr uint32_t TRANSACTION_ReverseLong = FIRST_CALL_TRANSACTION + 18;
+  static constexpr uint32_t TRANSACTION_ReverseFloat = FIRST_CALL_TRANSACTION + 19;
+  static constexpr uint32_t TRANSACTION_ReverseDouble = FIRST_CALL_TRANSACTION + 20;
+  static constexpr uint32_t TRANSACTION_ReverseString = FIRST_CALL_TRANSACTION + 21;
+  static constexpr uint32_t TRANSACTION_ReverseByteEnum = FIRST_CALL_TRANSACTION + 22;
+  static constexpr uint32_t TRANSACTION_ReverseIntEnum = FIRST_CALL_TRANSACTION + 23;
+  static constexpr uint32_t TRANSACTION_ReverseLongEnum = FIRST_CALL_TRANSACTION + 24;
+  static constexpr uint32_t TRANSACTION_GetOtherTestService = FIRST_CALL_TRANSACTION + 25;
+  static constexpr uint32_t TRANSACTION_SetOtherTestService = FIRST_CALL_TRANSACTION + 26;
+  static constexpr uint32_t TRANSACTION_VerifyName = FIRST_CALL_TRANSACTION + 27;
+  static constexpr uint32_t TRANSACTION_GetInterfaceArray = FIRST_CALL_TRANSACTION + 28;
+  static constexpr uint32_t TRANSACTION_VerifyNamesWithInterfaceArray = FIRST_CALL_TRANSACTION + 29;
+  static constexpr uint32_t TRANSACTION_GetNullableInterfaceArray = FIRST_CALL_TRANSACTION + 30;
+  static constexpr uint32_t TRANSACTION_VerifyNamesWithNullableInterfaceArray = FIRST_CALL_TRANSACTION + 31;
+  static constexpr uint32_t TRANSACTION_GetInterfaceList = FIRST_CALL_TRANSACTION + 32;
+  static constexpr uint32_t TRANSACTION_VerifyNamesWithInterfaceList = FIRST_CALL_TRANSACTION + 33;
+  static constexpr uint32_t TRANSACTION_ReverseStringList = FIRST_CALL_TRANSACTION + 34;
+  static constexpr uint32_t TRANSACTION_RepeatParcelFileDescriptor = FIRST_CALL_TRANSACTION + 35;
+  static constexpr uint32_t TRANSACTION_ReverseParcelFileDescriptorArray = FIRST_CALL_TRANSACTION + 36;
+  static constexpr uint32_t TRANSACTION_ThrowServiceException = FIRST_CALL_TRANSACTION + 37;
+  static constexpr uint32_t TRANSACTION_RepeatNullableIntArray = FIRST_CALL_TRANSACTION + 38;
+  static constexpr uint32_t TRANSACTION_RepeatNullableByteEnumArray = FIRST_CALL_TRANSACTION + 39;
+  static constexpr uint32_t TRANSACTION_RepeatNullableIntEnumArray = FIRST_CALL_TRANSACTION + 40;
+  static constexpr uint32_t TRANSACTION_RepeatNullableLongEnumArray = FIRST_CALL_TRANSACTION + 41;
+  static constexpr uint32_t TRANSACTION_RepeatNullableString = FIRST_CALL_TRANSACTION + 42;
+  static constexpr uint32_t TRANSACTION_RepeatNullableStringList = FIRST_CALL_TRANSACTION + 43;
+  static constexpr uint32_t TRANSACTION_RepeatNullableParcelable = FIRST_CALL_TRANSACTION + 44;
+  static constexpr uint32_t TRANSACTION_RepeatNullableParcelableArray = FIRST_CALL_TRANSACTION + 45;
+  static constexpr uint32_t TRANSACTION_RepeatNullableParcelableList = FIRST_CALL_TRANSACTION + 46;
+  static constexpr uint32_t TRANSACTION_TakesAnIBinder = FIRST_CALL_TRANSACTION + 47;
+  static constexpr uint32_t TRANSACTION_TakesANullableIBinder = FIRST_CALL_TRANSACTION + 48;
+  static constexpr uint32_t TRANSACTION_TakesAnIBinderList = FIRST_CALL_TRANSACTION + 49;
+  static constexpr uint32_t TRANSACTION_TakesANullableIBinderList = FIRST_CALL_TRANSACTION + 50;
+  static constexpr uint32_t TRANSACTION_RepeatUtf8CppString = FIRST_CALL_TRANSACTION + 51;
+  static constexpr uint32_t TRANSACTION_RepeatNullableUtf8CppString = FIRST_CALL_TRANSACTION + 52;
+  static constexpr uint32_t TRANSACTION_ReverseUtf8CppString = FIRST_CALL_TRANSACTION + 53;
+  static constexpr uint32_t TRANSACTION_ReverseNullableUtf8CppString = FIRST_CALL_TRANSACTION + 54;
+  static constexpr uint32_t TRANSACTION_ReverseUtf8CppStringList = FIRST_CALL_TRANSACTION + 55;
+  static constexpr uint32_t TRANSACTION_GetCallback = FIRST_CALL_TRANSACTION + 56;
+  static constexpr uint32_t TRANSACTION_FillOutStructuredParcelable = FIRST_CALL_TRANSACTION + 57;
+  static constexpr uint32_t TRANSACTION_RepeatExtendableParcelable = FIRST_CALL_TRANSACTION + 58;
+  static constexpr uint32_t TRANSACTION_ReverseList = FIRST_CALL_TRANSACTION + 59;
+  static constexpr uint32_t TRANSACTION_ReverseIBinderArray = FIRST_CALL_TRANSACTION + 60;
+  static constexpr uint32_t TRANSACTION_ReverseNullableIBinderArray = FIRST_CALL_TRANSACTION + 61;
+  static constexpr uint32_t TRANSACTION_GetOldNameInterface = FIRST_CALL_TRANSACTION + 62;
+  static constexpr uint32_t TRANSACTION_GetNewNameInterface = FIRST_CALL_TRANSACTION + 63;
+  static constexpr uint32_t TRANSACTION_GetUnionTags = FIRST_CALL_TRANSACTION + 64;
+  static constexpr uint32_t TRANSACTION_GetCppJavaTests = FIRST_CALL_TRANSACTION + 65;
+  static constexpr uint32_t TRANSACTION_getBackendType = FIRST_CALL_TRANSACTION + 66;
+  static constexpr uint32_t TRANSACTION_GetCircular = FIRST_CALL_TRANSACTION + 67;
+
+  static std::shared_ptr<ITestService> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<ITestService>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<ITestService>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<ITestService>& impl);
+  static const std::shared_ptr<ITestService>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus UnimplementedMethod(int32_t in_arg, int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus Deprecated() __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"))) = 0;
+  virtual ::ndk::ScopedAStatus TestOneway() = 0;
+  virtual ::ndk::ScopedAStatus RepeatBoolean(bool in_token, bool* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatByte(int8_t in_token, int8_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatChar(char16_t in_token, char16_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatInt(int32_t in_token, int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatLong(int64_t in_token, int64_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatFloat(float in_token, float* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatDouble(double in_token, double* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatString(const std::string& in_token, std::string* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatByteEnum(::aidl::android::aidl::tests::ByteEnum in_token, ::aidl::android::aidl::tests::ByteEnum* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatIntEnum(::aidl::android::aidl::tests::IntEnum in_token, ::aidl::android::aidl::tests::IntEnum* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatLongEnum(::aidl::android::aidl::tests::LongEnum in_token, ::aidl::android::aidl::tests::LongEnum* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseBoolean(const std::vector<bool>& in_input, std::vector<bool>* out_repeated, std::vector<bool>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseByte(const std::vector<uint8_t>& in_input, std::vector<uint8_t>* out_repeated, std::vector<uint8_t>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseChar(const std::vector<char16_t>& in_input, std::vector<char16_t>* out_repeated, std::vector<char16_t>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseInt(const std::vector<int32_t>& in_input, std::vector<int32_t>* out_repeated, std::vector<int32_t>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseLong(const std::vector<int64_t>& in_input, std::vector<int64_t>* out_repeated, std::vector<int64_t>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseFloat(const std::vector<float>& in_input, std::vector<float>* out_repeated, std::vector<float>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseDouble(const std::vector<double>& in_input, std::vector<double>* out_repeated, std::vector<double>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseByteEnum(const std::vector<::aidl::android::aidl::tests::ByteEnum>& in_input, std::vector<::aidl::android::aidl::tests::ByteEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::ByteEnum>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseIntEnum(const std::vector<::aidl::android::aidl::tests::IntEnum>& in_input, std::vector<::aidl::android::aidl::tests::IntEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::IntEnum>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseLongEnum(const std::vector<::aidl::android::aidl::tests::LongEnum>& in_input, std::vector<::aidl::android::aidl::tests::LongEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::LongEnum>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetOtherTestService(const std::string& in_name, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus SetOtherTestService(const std::string& in_name, const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, bool* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus VerifyName(const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, const std::string& in_name, bool* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetInterfaceArray(const std::vector<std::string>& in_names, std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus VerifyNamesWithInterfaceArray(const std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>& in_services, const std::vector<std::string>& in_names, bool* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetNullableInterfaceArray(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus VerifyNamesWithNullableInterfaceArray(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetInterfaceList(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus VerifyNamesWithInterfaceList(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseStringList(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatParcelFileDescriptor(const ::ndk::ScopedFileDescriptor& in_read, ::ndk::ScopedFileDescriptor* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseParcelFileDescriptorArray(const std::vector<::ndk::ScopedFileDescriptor>& in_input, std::vector<::ndk::ScopedFileDescriptor>* out_repeated, std::vector<::ndk::ScopedFileDescriptor>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ThrowServiceException(int32_t in_code) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableIntArray(const std::optional<std::vector<int32_t>>& in_input, std::optional<std::vector<int32_t>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableByteEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableIntEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableLongEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableString(const std::optional<std::string>& in_input, std::optional<std::string>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableParcelable(const std::optional<::aidl::android::aidl::tests::ITestService::Empty>& in_input, std::optional<::aidl::android::aidl::tests::ITestService::Empty>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableParcelableArray(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableParcelableList(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus TakesAnIBinder(const ::ndk::SpAIBinder& in_input) = 0;
+  virtual ::ndk::ScopedAStatus TakesANullableIBinder(const ::ndk::SpAIBinder& in_input) = 0;
+  virtual ::ndk::ScopedAStatus TakesAnIBinderList(const std::vector<::ndk::SpAIBinder>& in_input) = 0;
+  virtual ::ndk::ScopedAStatus TakesANullableIBinderList(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input) = 0;
+  virtual ::ndk::ScopedAStatus RepeatUtf8CppString(const std::string& in_token, std::string* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus RepeatNullableUtf8CppString(const std::optional<std::string>& in_token, std::optional<std::string>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseUtf8CppString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseNullableUtf8CppString(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseUtf8CppStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetCallback(bool in_return_null, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus FillOutStructuredParcelable(::aidl::android::aidl::tests::StructuredParcelable* in_parcel) = 0;
+  virtual ::ndk::ScopedAStatus RepeatExtendableParcelable(const ::aidl::android::aidl::tests::extension::ExtendableParcelable& in_ep, ::aidl::android::aidl::tests::extension::ExtendableParcelable* out_ep2) = 0;
+  virtual ::ndk::ScopedAStatus ReverseList(const ::aidl::android::aidl::tests::RecursiveList& in_list, ::aidl::android::aidl::tests::RecursiveList* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseIBinderArray(const std::vector<::ndk::SpAIBinder>& in_input, std::vector<::ndk::SpAIBinder>* out_repeated, std::vector<::ndk::SpAIBinder>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ReverseNullableIBinderArray(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input, std::optional<std::vector<::ndk::SpAIBinder>>* out_repeated, std::optional<std::vector<::ndk::SpAIBinder>>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetOldNameInterface(std::shared_ptr<::aidl::android::aidl::tests::IOldName>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetNewNameInterface(std::shared_ptr<::aidl::android::aidl::tests::INewName>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetUnionTags(const std::vector<::aidl::android::aidl::tests::Union>& in_input, std::vector<::aidl::android::aidl::tests::Union::Tag>* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetCppJavaTests(::ndk::SpAIBinder* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus getBackendType(::aidl::android::aidl::tests::BackendType* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus GetCircular(::aidl::android::aidl::tests::CircularParcelable* out_cp, std::shared_ptr<::aidl::android::aidl::tests::ICircular>* _aidl_return) = 0;
+private:
+  static std::shared_ptr<ITestService> default_impl;
+};
+class ITestServiceDefault : public ITestService {
+public:
+  ::ndk::ScopedAStatus UnimplementedMethod(int32_t in_arg, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus Deprecated() override __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens")));
+  ::ndk::ScopedAStatus TestOneway() override;
+  ::ndk::ScopedAStatus RepeatBoolean(bool in_token, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatByte(int8_t in_token, int8_t* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatChar(char16_t in_token, char16_t* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatInt(int32_t in_token, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatLong(int64_t in_token, int64_t* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatFloat(float in_token, float* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatDouble(double in_token, double* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatString(const std::string& in_token, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatByteEnum(::aidl::android::aidl::tests::ByteEnum in_token, ::aidl::android::aidl::tests::ByteEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatIntEnum(::aidl::android::aidl::tests::IntEnum in_token, ::aidl::android::aidl::tests::IntEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatLongEnum(::aidl::android::aidl::tests::LongEnum in_token, ::aidl::android::aidl::tests::LongEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseBoolean(const std::vector<bool>& in_input, std::vector<bool>* out_repeated, std::vector<bool>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseByte(const std::vector<uint8_t>& in_input, std::vector<uint8_t>* out_repeated, std::vector<uint8_t>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseChar(const std::vector<char16_t>& in_input, std::vector<char16_t>* out_repeated, std::vector<char16_t>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseInt(const std::vector<int32_t>& in_input, std::vector<int32_t>* out_repeated, std::vector<int32_t>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseLong(const std::vector<int64_t>& in_input, std::vector<int64_t>* out_repeated, std::vector<int64_t>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseFloat(const std::vector<float>& in_input, std::vector<float>* out_repeated, std::vector<float>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseDouble(const std::vector<double>& in_input, std::vector<double>* out_repeated, std::vector<double>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseByteEnum(const std::vector<::aidl::android::aidl::tests::ByteEnum>& in_input, std::vector<::aidl::android::aidl::tests::ByteEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::ByteEnum>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseIntEnum(const std::vector<::aidl::android::aidl::tests::IntEnum>& in_input, std::vector<::aidl::android::aidl::tests::IntEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::IntEnum>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseLongEnum(const std::vector<::aidl::android::aidl::tests::LongEnum>& in_input, std::vector<::aidl::android::aidl::tests::LongEnum>* out_repeated, std::vector<::aidl::android::aidl::tests::LongEnum>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetOtherTestService(const std::string& in_name, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) override;
+  ::ndk::ScopedAStatus SetOtherTestService(const std::string& in_name, const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus VerifyName(const std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>& in_service, const std::string& in_name, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus GetInterfaceArray(const std::vector<std::string>& in_names, std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>* _aidl_return) override;
+  ::ndk::ScopedAStatus VerifyNamesWithInterfaceArray(const std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>& in_services, const std::vector<std::string>& in_names, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus GetNullableInterfaceArray(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus VerifyNamesWithNullableInterfaceArray(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus GetInterfaceList(const std::optional<std::vector<std::optional<std::string>>>& in_names, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus VerifyNamesWithInterfaceList(const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>>>& in_services, const std::optional<std::vector<std::optional<std::string>>>& in_names, bool* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseStringList(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatParcelFileDescriptor(const ::ndk::ScopedFileDescriptor& in_read, ::ndk::ScopedFileDescriptor* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseParcelFileDescriptorArray(const std::vector<::ndk::ScopedFileDescriptor>& in_input, std::vector<::ndk::ScopedFileDescriptor>* out_repeated, std::vector<::ndk::ScopedFileDescriptor>* _aidl_return) override;
+  ::ndk::ScopedAStatus ThrowServiceException(int32_t in_code) override;
+  ::ndk::ScopedAStatus RepeatNullableIntArray(const std::optional<std::vector<int32_t>>& in_input, std::optional<std::vector<int32_t>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableByteEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableIntEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableLongEnumArray(const std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>& in_input, std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableString(const std::optional<std::string>& in_input, std::optional<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableParcelable(const std::optional<::aidl::android::aidl::tests::ITestService::Empty>& in_input, std::optional<::aidl::android::aidl::tests::ITestService::Empty>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableParcelableArray(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableParcelableList(const std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>& in_input, std::optional<std::vector<std::optional<::aidl::android::aidl::tests::ITestService::Empty>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus TakesAnIBinder(const ::ndk::SpAIBinder& in_input) override;
+  ::ndk::ScopedAStatus TakesANullableIBinder(const ::ndk::SpAIBinder& in_input) override;
+  ::ndk::ScopedAStatus TakesAnIBinderList(const std::vector<::ndk::SpAIBinder>& in_input) override;
+  ::ndk::ScopedAStatus TakesANullableIBinderList(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input) override;
+  ::ndk::ScopedAStatus RepeatUtf8CppString(const std::string& in_token, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus RepeatNullableUtf8CppString(const std::optional<std::string>& in_token, std::optional<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseUtf8CppString(const std::vector<std::string>& in_input, std::vector<std::string>* out_repeated, std::vector<std::string>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseNullableUtf8CppString(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseUtf8CppStringList(const std::optional<std::vector<std::optional<std::string>>>& in_input, std::optional<std::vector<std::optional<std::string>>>* out_repeated, std::optional<std::vector<std::optional<std::string>>>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetCallback(bool in_return_null, std::shared_ptr<::aidl::android::aidl::tests::INamedCallback>* _aidl_return) override;
+  ::ndk::ScopedAStatus FillOutStructuredParcelable(::aidl::android::aidl::tests::StructuredParcelable* in_parcel) override;
+  ::ndk::ScopedAStatus RepeatExtendableParcelable(const ::aidl::android::aidl::tests::extension::ExtendableParcelable& in_ep, ::aidl::android::aidl::tests::extension::ExtendableParcelable* out_ep2) override;
+  ::ndk::ScopedAStatus ReverseList(const ::aidl::android::aidl::tests::RecursiveList& in_list, ::aidl::android::aidl::tests::RecursiveList* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseIBinderArray(const std::vector<::ndk::SpAIBinder>& in_input, std::vector<::ndk::SpAIBinder>* out_repeated, std::vector<::ndk::SpAIBinder>* _aidl_return) override;
+  ::ndk::ScopedAStatus ReverseNullableIBinderArray(const std::optional<std::vector<::ndk::SpAIBinder>>& in_input, std::optional<std::vector<::ndk::SpAIBinder>>* out_repeated, std::optional<std::vector<::ndk::SpAIBinder>>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetOldNameInterface(std::shared_ptr<::aidl::android::aidl::tests::IOldName>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetNewNameInterface(std::shared_ptr<::aidl::android::aidl::tests::INewName>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetUnionTags(const std::vector<::aidl::android::aidl::tests::Union>& in_input, std::vector<::aidl::android::aidl::tests::Union::Tag>* _aidl_return) override;
+  ::ndk::ScopedAStatus GetCppJavaTests(::ndk::SpAIBinder* _aidl_return) override;
+  ::ndk::ScopedAStatus getBackendType(::aidl::android::aidl::tests::BackendType* _aidl_return) override;
+  ::ndk::ScopedAStatus GetCircular(::aidl::android::aidl::tests::CircularParcelable* out_cp, std::shared_ptr<::aidl::android::aidl::tests::ICircular>* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ITestService::CompilerChecks::UsingHasDeprecated::Tag val) {
+  switch(val) {
+  case ITestService::CompilerChecks::UsingHasDeprecated::Tag::n:
+    return "n";
+  case ITestService::CompilerChecks::UsingHasDeprecated::Tag::m:
+    return "m";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::ITestService::CompilerChecks::UsingHasDeprecated::Tag, 2> enum_values<aidl::android::aidl::tests::ITestService::CompilerChecks::UsingHasDeprecated::Tag> = {
+  aidl::android::aidl::tests::ITestService::CompilerChecks::UsingHasDeprecated::Tag::n,
+  aidl::android::aidl::tests::ITestService::CompilerChecks::UsingHasDeprecated::Tag::m,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IntEnum.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IntEnum.h
new file mode 100644
index 0000000..d7c5fb0
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/IntEnum.h
@@ -0,0 +1,72 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/IntEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+enum class IntEnum : int32_t {
+  FOO = 1000,
+  BAR = 2000,
+  BAZ = 2001,
+  QUX __attribute__((deprecated("do not use this"))) = 2002,
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+[[nodiscard]] static inline std::string toString(IntEnum val) {
+  switch(val) {
+  case IntEnum::FOO:
+    return "FOO";
+  case IntEnum::BAR:
+    return "BAR";
+  case IntEnum::BAZ:
+    return "BAZ";
+  case IntEnum::QUX:
+    return "QUX";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+#pragma clang diagnostic pop
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::IntEnum, 4> enum_values<aidl::android::aidl::tests::IntEnum> = {
+  aidl::android::aidl::tests::IntEnum::FOO,
+  aidl::android::aidl::tests::IntEnum::BAR,
+  aidl::android::aidl::tests::IntEnum::BAZ,
+  aidl::android::aidl::tests::IntEnum::QUX,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ListOfInterfaces.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ListOfInterfaces.h
new file mode 100644
index 0000000..d48979b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ListOfInterfaces.h
@@ -0,0 +1,333 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ListOfInterfaces.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_ibinder.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/ListOfInterfaces.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class ListOfInterfaces {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  class IEmptyInterfaceDelegator;
+
+  class IEmptyInterface : public ::ndk::ICInterface {
+  public:
+    typedef IEmptyInterfaceDelegator DefaultDelegator;
+    static const char* descriptor;
+    IEmptyInterface();
+    virtual ~IEmptyInterface();
+
+
+    static std::shared_ptr<IEmptyInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IEmptyInterface>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IEmptyInterface>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<IEmptyInterface>& impl);
+    static const std::shared_ptr<IEmptyInterface>& getDefaultImpl();
+  private:
+    static std::shared_ptr<IEmptyInterface> default_impl;
+  };
+  class IEmptyInterfaceDefault : public IEmptyInterface {
+  public:
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpEmptyInterface : public ::ndk::BpCInterface<IEmptyInterface> {
+  public:
+    explicit BpEmptyInterface(const ::ndk::SpAIBinder& binder);
+    virtual ~BpEmptyInterface();
+
+  };
+  class BnEmptyInterface : public ::ndk::BnCInterface<IEmptyInterface> {
+  public:
+    BnEmptyInterface();
+    virtual ~BnEmptyInterface();
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  class IMyInterfaceDelegator;
+
+  class IMyInterface : public ::ndk::ICInterface {
+  public:
+    typedef IMyInterfaceDelegator DefaultDelegator;
+    static const char* descriptor;
+    IMyInterface();
+    virtual ~IMyInterface();
+
+    static constexpr uint32_t TRANSACTION_methodWithInterfaces = FIRST_CALL_TRANSACTION + 0;
+
+    static std::shared_ptr<IMyInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IMyInterface>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IMyInterface>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<IMyInterface>& impl);
+    static const std::shared_ptr<IMyInterface>& getDefaultImpl();
+    virtual ::ndk::ScopedAStatus methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& in_iface, const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& in_nullable_iface, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& in_iface_list_in, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* out_iface_list_out, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* in_iface_list_inout, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& in_nullable_iface_list_in, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* out_nullable_iface_list_out, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* in_nullable_iface_list_inout, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* _aidl_return) = 0;
+  private:
+    static std::shared_ptr<IMyInterface> default_impl;
+  };
+  class IMyInterfaceDefault : public IMyInterface {
+  public:
+    ::ndk::ScopedAStatus methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& in_iface, const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& in_nullable_iface, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& in_iface_list_in, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* out_iface_list_out, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* in_iface_list_inout, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& in_nullable_iface_list_in, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* out_nullable_iface_list_out, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* in_nullable_iface_list_inout, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* _aidl_return) override;
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpMyInterface : public ::ndk::BpCInterface<IMyInterface> {
+  public:
+    explicit BpMyInterface(const ::ndk::SpAIBinder& binder);
+    virtual ~BpMyInterface();
+
+    ::ndk::ScopedAStatus methodWithInterfaces(const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& in_iface, const std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>& in_nullable_iface, const std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>& in_iface_list_in, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* out_iface_list_out, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>* in_iface_list_inout, const std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>& in_nullable_iface_list_in, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* out_nullable_iface_list_out, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* in_nullable_iface_list_inout, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>* _aidl_return) override;
+  };
+  class BnMyInterface : public ::ndk::BnCInterface<IMyInterface> {
+  public:
+    BnMyInterface();
+    virtual ~BnMyInterface();
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  class MyParcelable {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface> iface;
+    std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface> nullable_iface;
+    std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>> iface_list;
+    std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>> nullable_iface_list;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) != std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator<(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) < std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator<=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) <= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator==(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) == std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator>(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) > std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+    inline bool operator>=(const MyParcelable& rhs) const {
+      return std::tie(iface, nullable_iface, iface_list, nullable_iface_list) >= std::tie(rhs.iface, rhs.nullable_iface, rhs.iface_list, rhs.nullable_iface_list);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyParcelable{";
+      os << "iface: " << ::android::internal::ToString(iface);
+      os << ", nullable_iface: " << ::android::internal::ToString(nullable_iface);
+      os << ", iface_list: " << ::android::internal::ToString(iface_list);
+      os << ", nullable_iface_list: " << ::android::internal::ToString(nullable_iface_list);
+      os << "}";
+      return os.str();
+    }
+  };
+  class MyUnion {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    enum class Tag : int32_t {
+      iface = 0,
+      nullable_iface = 1,
+      iface_list = 2,
+      nullable_iface_list = 3,
+    };
+
+    // Expose tag symbols for legacy code
+    static const inline Tag iface = Tag::iface;
+    static const inline Tag nullable_iface = Tag::nullable_iface;
+    static const inline Tag iface_list = Tag::iface_list;
+    static const inline Tag nullable_iface_list = Tag::nullable_iface_list;
+
+    template<typename _Tp>
+    static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, MyUnion>;
+
+    MyUnion() : _value(std::in_place_index<static_cast<size_t>(iface)>, std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>()) { }
+
+    template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+    // NOLINTNEXTLINE(google-explicit-constructor)
+    constexpr MyUnion(_Tp&& _arg)
+        : _value(std::forward<_Tp>(_arg)) {}
+
+    template <size_t _Np, typename... _Tp>
+    constexpr explicit MyUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+        : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+    template <Tag _tag, typename... _Tp>
+    static MyUnion make(_Tp&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+    }
+
+    template <Tag _tag, typename _Tp, typename... _Up>
+    static MyUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+    }
+
+    Tag getTag() const {
+      return static_cast<Tag>(_value.index());
+    }
+
+    template <Tag _tag>
+    const auto& get() const {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag>
+    auto& get() {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag, typename... _Tp>
+    void set(_Tp&&... _args) {
+      _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+    }
+
+    binder_status_t readFromParcel(const AParcel* _parcel);
+    binder_status_t writeToParcel(AParcel* _parcel) const;
+
+    inline bool operator!=(const MyUnion& rhs) const {
+      return _value != rhs._value;
+    }
+    inline bool operator<(const MyUnion& rhs) const {
+      return _value < rhs._value;
+    }
+    inline bool operator<=(const MyUnion& rhs) const {
+      return _value <= rhs._value;
+    }
+    inline bool operator==(const MyUnion& rhs) const {
+      return _value == rhs._value;
+    }
+    inline bool operator>(const MyUnion& rhs) const {
+      return _value > rhs._value;
+    }
+    inline bool operator>=(const MyUnion& rhs) const {
+      return _value >= rhs._value;
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyUnion{";
+      switch (getTag()) {
+      case iface: os << "iface: " << ::android::internal::ToString(get<iface>()); break;
+      case nullable_iface: os << "nullable_iface: " << ::android::internal::ToString(get<nullable_iface>()); break;
+      case iface_list: os << "iface_list: " << ::android::internal::ToString(get<iface_list>()); break;
+      case nullable_iface_list: os << "nullable_iface_list: " << ::android::internal::ToString(get<nullable_iface_list>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    std::variant<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>, std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>, std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>, std::optional<std::vector<std::shared_ptr<::aidl::android::aidl::tests::ListOfInterfaces::IEmptyInterface>>>> _value;
+  };
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const ListOfInterfaces&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const ListOfInterfaces&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const ListOfInterfaces&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const ListOfInterfaces&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const ListOfInterfaces&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const ListOfInterfaces&) const {
+    return std::tie() >= std::tie();
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ListOfInterfaces{";
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(ListOfInterfaces::MyUnion::Tag val) {
+  switch(val) {
+  case ListOfInterfaces::MyUnion::Tag::iface:
+    return "iface";
+  case ListOfInterfaces::MyUnion::Tag::nullable_iface:
+    return "nullable_iface";
+  case ListOfInterfaces::MyUnion::Tag::iface_list:
+    return "iface_list";
+  case ListOfInterfaces::MyUnion::Tag::nullable_iface_list:
+    return "nullable_iface_list";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::ListOfInterfaces::MyUnion::Tag, 4> enum_values<aidl::android::aidl::tests::ListOfInterfaces::MyUnion::Tag> = {
+  aidl::android::aidl::tests::ListOfInterfaces::MyUnion::Tag::iface,
+  aidl::android::aidl::tests::ListOfInterfaces::MyUnion::Tag::nullable_iface,
+  aidl::android::aidl::tests::ListOfInterfaces::MyUnion::Tag::iface_list,
+  aidl::android::aidl::tests::ListOfInterfaces::MyUnion::Tag::nullable_iface_list,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/LongEnum.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/LongEnum.h
new file mode 100644
index 0000000..fd31daf
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/LongEnum.h
@@ -0,0 +1,64 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/LongEnum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+enum class LongEnum : int64_t {
+  FOO = 100000000000L,
+  BAR = 200000000000L,
+  BAZ = 200000000001L,
+};
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(LongEnum val) {
+  switch(val) {
+  case LongEnum::FOO:
+    return "FOO";
+  case LongEnum::BAR:
+    return "BAR";
+  case LongEnum::BAZ:
+    return "BAZ";
+  default:
+    return std::to_string(static_cast<int64_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::LongEnum, 3> enum_values<aidl::android::aidl::tests::LongEnum> = {
+  aidl::android::aidl::tests::LongEnum::FOO,
+  aidl::android::aidl::tests::LongEnum::BAR,
+  aidl::android::aidl::tests::LongEnum::BAZ,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/OtherParcelableForToString.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/OtherParcelableForToString.h
new file mode 100644
index 0000000..7dd14ce
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/OtherParcelableForToString.h
@@ -0,0 +1,64 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/OtherParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class OtherParcelableForToString {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  std::string field;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) != std::tie(rhs.field);
+  }
+  inline bool operator<(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) < std::tie(rhs.field);
+  }
+  inline bool operator<=(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) <= std::tie(rhs.field);
+  }
+  inline bool operator==(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) == std::tie(rhs.field);
+  }
+  inline bool operator>(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) > std::tie(rhs.field);
+  }
+  inline bool operator>=(const OtherParcelableForToString& rhs) const {
+    return std::tie(field) >= std::tie(rhs.field);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "OtherParcelableForToString{";
+    os << "field: " << ::android::internal::ToString(field);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ParcelableForToString.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ParcelableForToString.h
new file mode 100644
index 0000000..06baa9c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/ParcelableForToString.h
@@ -0,0 +1,119 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/ParcelableForToString.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/GenericStructuredParcelable.h>
+#include <aidl/android/aidl/tests/IntEnum.h>
+#include <aidl/android/aidl/tests/OtherParcelableForToString.h>
+#include <aidl/android/aidl/tests/StructuredParcelable.h>
+#include <aidl/android/aidl/tests/Union.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::tests {
+template <typename T, typename U, typename B>
+class GenericStructuredParcelable;
+class OtherParcelableForToString;
+class StructuredParcelable;
+}  // namespace aidl::android::aidl::tests
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class ParcelableForToString {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t intValue = 0;
+  std::vector<int32_t> intArray;
+  int64_t longValue = 0L;
+  std::vector<int64_t> longArray;
+  double doubleValue = 0.000000;
+  std::vector<double> doubleArray;
+  float floatValue = 0.000000f;
+  std::vector<float> floatArray;
+  int8_t byteValue = 0;
+  std::vector<uint8_t> byteArray;
+  bool booleanValue = false;
+  std::vector<bool> booleanArray;
+  std::string stringValue;
+  std::vector<std::string> stringArray;
+  std::vector<std::string> stringList;
+  ::aidl::android::aidl::tests::OtherParcelableForToString parcelableValue;
+  std::vector<::aidl::android::aidl::tests::OtherParcelableForToString> parcelableArray;
+  ::aidl::android::aidl::tests::IntEnum enumValue = ::aidl::android::aidl::tests::IntEnum::FOO;
+  std::vector<::aidl::android::aidl::tests::IntEnum> enumArray;
+  std::vector<std::string> nullArray;
+  std::vector<std::string> nullList;
+  ::aidl::android::aidl::tests::GenericStructuredParcelable<int32_t, ::aidl::android::aidl::tests::StructuredParcelable, ::aidl::android::aidl::tests::IntEnum> parcelableGeneric;
+  ::aidl::android::aidl::tests::Union unionValue;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) != std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator<(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) < std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator<=(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) <= std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator==(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) == std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator>(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) > std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+  inline bool operator>=(const ParcelableForToString& rhs) const {
+    return std::tie(intValue, intArray, longValue, longArray, doubleValue, doubleArray, floatValue, floatArray, byteValue, byteArray, booleanValue, booleanArray, stringValue, stringArray, stringList, parcelableValue, parcelableArray, enumValue, enumArray, nullArray, nullList, parcelableGeneric, unionValue) >= std::tie(rhs.intValue, rhs.intArray, rhs.longValue, rhs.longArray, rhs.doubleValue, rhs.doubleArray, rhs.floatValue, rhs.floatArray, rhs.byteValue, rhs.byteArray, rhs.booleanValue, rhs.booleanArray, rhs.stringValue, rhs.stringArray, rhs.stringList, rhs.parcelableValue, rhs.parcelableArray, rhs.enumValue, rhs.enumArray, rhs.nullArray, rhs.nullList, rhs.parcelableGeneric, rhs.unionValue);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ParcelableForToString{";
+    os << "intValue: " << ::android::internal::ToString(intValue);
+    os << ", intArray: " << ::android::internal::ToString(intArray);
+    os << ", longValue: " << ::android::internal::ToString(longValue);
+    os << ", longArray: " << ::android::internal::ToString(longArray);
+    os << ", doubleValue: " << ::android::internal::ToString(doubleValue);
+    os << ", doubleArray: " << ::android::internal::ToString(doubleArray);
+    os << ", floatValue: " << ::android::internal::ToString(floatValue);
+    os << ", floatArray: " << ::android::internal::ToString(floatArray);
+    os << ", byteValue: " << ::android::internal::ToString(byteValue);
+    os << ", byteArray: " << ::android::internal::ToString(byteArray);
+    os << ", booleanValue: " << ::android::internal::ToString(booleanValue);
+    os << ", booleanArray: " << ::android::internal::ToString(booleanArray);
+    os << ", stringValue: " << ::android::internal::ToString(stringValue);
+    os << ", stringArray: " << ::android::internal::ToString(stringArray);
+    os << ", stringList: " << ::android::internal::ToString(stringList);
+    os << ", parcelableValue: " << ::android::internal::ToString(parcelableValue);
+    os << ", parcelableArray: " << ::android::internal::ToString(parcelableArray);
+    os << ", enumValue: " << ::android::internal::ToString(enumValue);
+    os << ", enumArray: " << ::android::internal::ToString(enumArray);
+    os << ", nullArray: " << ::android::internal::ToString(nullArray);
+    os << ", nullList: " << ::android::internal::ToString(nullList);
+    os << ", parcelableGeneric: " << ::android::internal::ToString(parcelableGeneric);
+    os << ", unionValue: " << ::android::internal::ToString(unionValue);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/RecursiveList.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/RecursiveList.h
new file mode 100644
index 0000000..4fb1263
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/RecursiveList.h
@@ -0,0 +1,70 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/RecursiveList.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/RecursiveList.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::tests {
+class RecursiveList;
+}  // namespace aidl::android::aidl::tests
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class RecursiveList {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t value = 0;
+  std::unique_ptr<::aidl::android::aidl::tests::RecursiveList> next;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const RecursiveList& rhs) const {
+    return std::tie(value, next) != std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator<(const RecursiveList& rhs) const {
+    return std::tie(value, next) < std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator<=(const RecursiveList& rhs) const {
+    return std::tie(value, next) <= std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator==(const RecursiveList& rhs) const {
+    return std::tie(value, next) == std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator>(const RecursiveList& rhs) const {
+    return std::tie(value, next) > std::tie(rhs.value, rhs.next);
+  }
+  inline bool operator>=(const RecursiveList& rhs) const {
+    return std::tie(value, next) >= std::tie(rhs.value, rhs.next);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "RecursiveList{";
+    os << "value: " << ::android::internal::ToString(value);
+    os << ", next: " << ::android::internal::ToString(next);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/StructuredParcelable.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/StructuredParcelable.h
new file mode 100644
index 0000000..79454da
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/StructuredParcelable.h
@@ -0,0 +1,217 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/StructuredParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/ByteEnum.h>
+#include <aidl/android/aidl/tests/ConstantExpressionEnum.h>
+#include <aidl/android/aidl/tests/IntEnum.h>
+#include <aidl/android/aidl/tests/LongEnum.h>
+#include <aidl/android/aidl/tests/StructuredParcelable.h>
+#include <aidl/android/aidl/tests/Union.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class StructuredParcelable {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  class Empty {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const Empty&) const {
+      return std::tie() != std::tie();
+    }
+    inline bool operator<(const Empty&) const {
+      return std::tie() < std::tie();
+    }
+    inline bool operator<=(const Empty&) const {
+      return std::tie() <= std::tie();
+    }
+    inline bool operator==(const Empty&) const {
+      return std::tie() == std::tie();
+    }
+    inline bool operator>(const Empty&) const {
+      return std::tie() > std::tie();
+    }
+    inline bool operator>=(const Empty&) const {
+      return std::tie() >= std::tie();
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "Empty{";
+      os << "}";
+      return os.str();
+    }
+  };
+  std::vector<int32_t> shouldContainThreeFs;
+  int32_t f = 0;
+  std::string shouldBeJerry;
+  ::aidl::android::aidl::tests::ByteEnum shouldBeByteBar = ::aidl::android::aidl::tests::ByteEnum(0);
+  ::aidl::android::aidl::tests::IntEnum shouldBeIntBar = ::aidl::android::aidl::tests::IntEnum(0);
+  ::aidl::android::aidl::tests::LongEnum shouldBeLongBar = ::aidl::android::aidl::tests::LongEnum(0);
+  std::vector<::aidl::android::aidl::tests::ByteEnum> shouldContainTwoByteFoos;
+  std::vector<::aidl::android::aidl::tests::IntEnum> shouldContainTwoIntFoos;
+  std::vector<::aidl::android::aidl::tests::LongEnum> shouldContainTwoLongFoos;
+  std::string stringDefaultsToFoo = "foo";
+  int8_t byteDefaultsToFour = 4;
+  int32_t intDefaultsToFive = 5;
+  int64_t longDefaultsToNegativeSeven = -7L;
+  bool booleanDefaultsToTrue = true;
+  char16_t charDefaultsToC = 'C';
+  float floatDefaultsToPi = 3.140000f;
+  double doubleWithDefault = -314000000000000000.000000;
+  std::vector<int32_t> arrayDefaultsTo123 = {1, 2, 3};
+  std::vector<int32_t> arrayDefaultsToEmpty = {};
+  bool boolDefault = false;
+  int8_t byteDefault = 0;
+  int32_t intDefault = 0;
+  int64_t longDefault = 0L;
+  float floatDefault = 0.000000f;
+  double doubleDefault = 0.000000;
+  double checkDoubleFromFloat = 3.140000;
+  std::vector<std::string> checkStringArray1 = {"a", "b"};
+  std::vector<std::string> checkStringArray2 = {"a", "b"};
+  int32_t int32_min = -2147483648;
+  int32_t int32_max = 2147483647;
+  int64_t int64_max = 9223372036854775807L;
+  int32_t hexInt32_neg_1 = -1;
+  ::ndk::SpAIBinder ibinder;
+  ::aidl::android::aidl::tests::StructuredParcelable::Empty empty;
+  std::vector<uint8_t> int8_1 = {1, 1, 1, 1, 1};
+  std::vector<int32_t> int32_1 = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
+  std::vector<int64_t> int64_1 = {1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L};
+  int32_t hexInt32_pos_1 = 1;
+  int32_t hexInt64_pos_1 = 1;
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_1 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_2 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_3 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_4 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_5 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_6 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_7 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_8 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_9 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  ::aidl::android::aidl::tests::ConstantExpressionEnum const_exprs_10 = ::aidl::android::aidl::tests::ConstantExpressionEnum(0);
+  std::string addString1 = "hello world!";
+  std::string addString2 = "The quick brown fox jumps over the lazy dog.";
+  int32_t shouldSetBit0AndBit2 = 0;
+  std::optional<::aidl::android::aidl::tests::Union> u;
+  std::optional<::aidl::android::aidl::tests::Union> shouldBeConstS1;
+  ::aidl::android::aidl::tests::IntEnum defaultWithFoo = ::aidl::android::aidl::tests::IntEnum::FOO;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) != std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator<(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) < std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator<=(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) <= std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator==(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) == std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator>(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) > std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+  inline bool operator>=(const StructuredParcelable& rhs) const {
+    return std::tie(shouldContainThreeFs, f, shouldBeJerry, shouldBeByteBar, shouldBeIntBar, shouldBeLongBar, shouldContainTwoByteFoos, shouldContainTwoIntFoos, shouldContainTwoLongFoos, stringDefaultsToFoo, byteDefaultsToFour, intDefaultsToFive, longDefaultsToNegativeSeven, booleanDefaultsToTrue, charDefaultsToC, floatDefaultsToPi, doubleWithDefault, arrayDefaultsTo123, arrayDefaultsToEmpty, boolDefault, byteDefault, intDefault, longDefault, floatDefault, doubleDefault, checkDoubleFromFloat, checkStringArray1, checkStringArray2, int32_min, int32_max, int64_max, hexInt32_neg_1, ibinder, empty, int8_1, int32_1, int64_1, hexInt32_pos_1, hexInt64_pos_1, const_exprs_1, const_exprs_2, const_exprs_3, const_exprs_4, const_exprs_5, const_exprs_6, const_exprs_7, const_exprs_8, const_exprs_9, const_exprs_10, addString1, addString2, shouldSetBit0AndBit2, u, shouldBeConstS1, defaultWithFoo) >= std::tie(rhs.shouldContainThreeFs, rhs.f, rhs.shouldBeJerry, rhs.shouldBeByteBar, rhs.shouldBeIntBar, rhs.shouldBeLongBar, rhs.shouldContainTwoByteFoos, rhs.shouldContainTwoIntFoos, rhs.shouldContainTwoLongFoos, rhs.stringDefaultsToFoo, rhs.byteDefaultsToFour, rhs.intDefaultsToFive, rhs.longDefaultsToNegativeSeven, rhs.booleanDefaultsToTrue, rhs.charDefaultsToC, rhs.floatDefaultsToPi, rhs.doubleWithDefault, rhs.arrayDefaultsTo123, rhs.arrayDefaultsToEmpty, rhs.boolDefault, rhs.byteDefault, rhs.intDefault, rhs.longDefault, rhs.floatDefault, rhs.doubleDefault, rhs.checkDoubleFromFloat, rhs.checkStringArray1, rhs.checkStringArray2, rhs.int32_min, rhs.int32_max, rhs.int64_max, rhs.hexInt32_neg_1, rhs.ibinder, rhs.empty, rhs.int8_1, rhs.int32_1, rhs.int64_1, rhs.hexInt32_pos_1, rhs.hexInt64_pos_1, rhs.const_exprs_1, rhs.const_exprs_2, rhs.const_exprs_3, rhs.const_exprs_4, rhs.const_exprs_5, rhs.const_exprs_6, rhs.const_exprs_7, rhs.const_exprs_8, rhs.const_exprs_9, rhs.const_exprs_10, rhs.addString1, rhs.addString2, rhs.shouldSetBit0AndBit2, rhs.u, rhs.shouldBeConstS1, rhs.defaultWithFoo);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  enum : int32_t { BIT0 = 1 };
+  enum : int32_t { BIT1 = 2 };
+  enum : int32_t { BIT2 = 4 };
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "StructuredParcelable{";
+    os << "shouldContainThreeFs: " << ::android::internal::ToString(shouldContainThreeFs);
+    os << ", f: " << ::android::internal::ToString(f);
+    os << ", shouldBeJerry: " << ::android::internal::ToString(shouldBeJerry);
+    os << ", shouldBeByteBar: " << ::android::internal::ToString(shouldBeByteBar);
+    os << ", shouldBeIntBar: " << ::android::internal::ToString(shouldBeIntBar);
+    os << ", shouldBeLongBar: " << ::android::internal::ToString(shouldBeLongBar);
+    os << ", shouldContainTwoByteFoos: " << ::android::internal::ToString(shouldContainTwoByteFoos);
+    os << ", shouldContainTwoIntFoos: " << ::android::internal::ToString(shouldContainTwoIntFoos);
+    os << ", shouldContainTwoLongFoos: " << ::android::internal::ToString(shouldContainTwoLongFoos);
+    os << ", stringDefaultsToFoo: " << ::android::internal::ToString(stringDefaultsToFoo);
+    os << ", byteDefaultsToFour: " << ::android::internal::ToString(byteDefaultsToFour);
+    os << ", intDefaultsToFive: " << ::android::internal::ToString(intDefaultsToFive);
+    os << ", longDefaultsToNegativeSeven: " << ::android::internal::ToString(longDefaultsToNegativeSeven);
+    os << ", booleanDefaultsToTrue: " << ::android::internal::ToString(booleanDefaultsToTrue);
+    os << ", charDefaultsToC: " << ::android::internal::ToString(charDefaultsToC);
+    os << ", floatDefaultsToPi: " << ::android::internal::ToString(floatDefaultsToPi);
+    os << ", doubleWithDefault: " << ::android::internal::ToString(doubleWithDefault);
+    os << ", arrayDefaultsTo123: " << ::android::internal::ToString(arrayDefaultsTo123);
+    os << ", arrayDefaultsToEmpty: " << ::android::internal::ToString(arrayDefaultsToEmpty);
+    os << ", boolDefault: " << ::android::internal::ToString(boolDefault);
+    os << ", byteDefault: " << ::android::internal::ToString(byteDefault);
+    os << ", intDefault: " << ::android::internal::ToString(intDefault);
+    os << ", longDefault: " << ::android::internal::ToString(longDefault);
+    os << ", floatDefault: " << ::android::internal::ToString(floatDefault);
+    os << ", doubleDefault: " << ::android::internal::ToString(doubleDefault);
+    os << ", checkDoubleFromFloat: " << ::android::internal::ToString(checkDoubleFromFloat);
+    os << ", checkStringArray1: " << ::android::internal::ToString(checkStringArray1);
+    os << ", checkStringArray2: " << ::android::internal::ToString(checkStringArray2);
+    os << ", int32_min: " << ::android::internal::ToString(int32_min);
+    os << ", int32_max: " << ::android::internal::ToString(int32_max);
+    os << ", int64_max: " << ::android::internal::ToString(int64_max);
+    os << ", hexInt32_neg_1: " << ::android::internal::ToString(hexInt32_neg_1);
+    os << ", ibinder: " << ::android::internal::ToString(ibinder);
+    os << ", empty: " << ::android::internal::ToString(empty);
+    os << ", int8_1: " << ::android::internal::ToString(int8_1);
+    os << ", int32_1: " << ::android::internal::ToString(int32_1);
+    os << ", int64_1: " << ::android::internal::ToString(int64_1);
+    os << ", hexInt32_pos_1: " << ::android::internal::ToString(hexInt32_pos_1);
+    os << ", hexInt64_pos_1: " << ::android::internal::ToString(hexInt64_pos_1);
+    os << ", const_exprs_1: " << ::android::internal::ToString(const_exprs_1);
+    os << ", const_exprs_2: " << ::android::internal::ToString(const_exprs_2);
+    os << ", const_exprs_3: " << ::android::internal::ToString(const_exprs_3);
+    os << ", const_exprs_4: " << ::android::internal::ToString(const_exprs_4);
+    os << ", const_exprs_5: " << ::android::internal::ToString(const_exprs_5);
+    os << ", const_exprs_6: " << ::android::internal::ToString(const_exprs_6);
+    os << ", const_exprs_7: " << ::android::internal::ToString(const_exprs_7);
+    os << ", const_exprs_8: " << ::android::internal::ToString(const_exprs_8);
+    os << ", const_exprs_9: " << ::android::internal::ToString(const_exprs_9);
+    os << ", const_exprs_10: " << ::android::internal::ToString(const_exprs_10);
+    os << ", addString1: " << ::android::internal::ToString(addString1);
+    os << ", addString2: " << ::android::internal::ToString(addString2);
+    os << ", shouldSetBit0AndBit2: " << ::android::internal::ToString(shouldSetBit0AndBit2);
+    os << ", u: " << ::android::internal::ToString(u);
+    os << ", shouldBeConstS1: " << ::android::internal::ToString(shouldBeConstS1);
+    os << ", defaultWithFoo: " << ::android::internal::ToString(defaultWithFoo);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/Union.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/Union.h
new file mode 100644
index 0000000..1300fb1
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/Union.h
@@ -0,0 +1,193 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/ByteEnum.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class Union {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Tag : int32_t {
+    ns = 0,
+    n = 1,
+    m = 2,
+    s = 3,
+    ibinder = 4,
+    ss = 5,
+    be = 6,
+  };
+
+  // Expose tag symbols for legacy code
+  static const inline Tag ns = Tag::ns;
+  static const inline Tag n = Tag::n;
+  static const inline Tag m = Tag::m;
+  static const inline Tag s = Tag::s;
+  static const inline Tag ibinder = Tag::ibinder;
+  static const inline Tag ss = Tag::ss;
+  static const inline Tag be = Tag::be;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, Union>;
+
+  Union() : _value(std::in_place_index<static_cast<size_t>(ns)>, std::vector<int32_t>({})) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr Union(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit Union(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static Union make(_Tp&&... _args) {
+    return Union(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static Union make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return Union(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  binder_status_t readFromParcel(const AParcel* _parcel);
+  binder_status_t writeToParcel(AParcel* _parcel) const;
+
+  inline bool operator!=(const Union& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const Union& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const Union& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const Union& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const Union& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const Union& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  static const char* S1;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Union{";
+    switch (getTag()) {
+    case ns: os << "ns: " << ::android::internal::ToString(get<ns>()); break;
+    case n: os << "n: " << ::android::internal::ToString(get<n>()); break;
+    case m: os << "m: " << ::android::internal::ToString(get<m>()); break;
+    case s: os << "s: " << ::android::internal::ToString(get<s>()); break;
+    case ibinder: os << "ibinder: " << ::android::internal::ToString(get<ibinder>()); break;
+    case ss: os << "ss: " << ::android::internal::ToString(get<ss>()); break;
+    case be: os << "be: " << ::android::internal::ToString(get<be>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<std::vector<int32_t>, int32_t, int32_t, std::string, ::ndk::SpAIBinder, std::vector<std::string>, ::aidl::android::aidl::tests::ByteEnum> _value;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(Union::Tag val) {
+  switch(val) {
+  case Union::Tag::ns:
+    return "ns";
+  case Union::Tag::n:
+    return "n";
+  case Union::Tag::m:
+    return "m";
+  case Union::Tag::s:
+    return "s";
+  case Union::Tag::ibinder:
+    return "ibinder";
+  case Union::Tag::ss:
+    return "ss";
+  case Union::Tag::be:
+    return "be";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::Union::Tag, 7> enum_values<aidl::android::aidl::tests::Union::Tag> = {
+  aidl::android::aidl::tests::Union::Tag::ns,
+  aidl::android::aidl::tests::Union::Tag::n,
+  aidl::android::aidl::tests::Union::Tag::m,
+  aidl::android::aidl::tests::Union::Tag::s,
+  aidl::android::aidl::tests::Union::Tag::ibinder,
+  aidl::android::aidl::tests::Union::Tag::ss,
+  aidl::android::aidl::tests::Union::Tag::be,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/UnionWithFd.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/UnionWithFd.h
new file mode 100644
index 0000000..381e9c7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/UnionWithFd.h
@@ -0,0 +1,161 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/UnionWithFd.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class UnionWithFd {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Tag : int32_t {
+    num = 0,
+    pfd = 1,
+  };
+
+  // Expose tag symbols for legacy code
+  static const inline Tag num = Tag::num;
+  static const inline Tag pfd = Tag::pfd;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, UnionWithFd>;
+
+  UnionWithFd() : _value(std::in_place_index<static_cast<size_t>(num)>, int32_t(0)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr UnionWithFd(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit UnionWithFd(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static UnionWithFd make(_Tp&&... _args) {
+    return UnionWithFd(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static UnionWithFd make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return UnionWithFd(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  binder_status_t readFromParcel(const AParcel* _parcel);
+  binder_status_t writeToParcel(AParcel* _parcel) const;
+
+  inline bool operator!=(const UnionWithFd& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const UnionWithFd& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const UnionWithFd& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const UnionWithFd& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const UnionWithFd& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const UnionWithFd& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "UnionWithFd{";
+    switch (getTag()) {
+    case num: os << "num: " << ::android::internal::ToString(get<num>()); break;
+    case pfd: os << "pfd: " << ::android::internal::ToString(get<pfd>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t, ::ndk::ScopedFileDescriptor> _value;
+};
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+[[nodiscard]] static inline std::string toString(UnionWithFd::Tag val) {
+  switch(val) {
+  case UnionWithFd::Tag::num:
+    return "num";
+  case UnionWithFd::Tag::pfd:
+    return "pfd";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::UnionWithFd::Tag, 2> enum_values<aidl::android::aidl::tests::UnionWithFd::Tag> = {
+  aidl::android::aidl::tests::UnionWithFd::Tag::num,
+  aidl::android::aidl::tests::UnionWithFd::Tag::pfd,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnExtendableParcelable.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnExtendableParcelable.h
new file mode 100644
index 0000000..c25f696
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnExtendableParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExt.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExt.h
new file mode 100644
index 0000000..edc7ac2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExt.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExt2.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExt2.h
new file mode 100644
index 0000000..fedcd72
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExt2.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExtLike.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExtLike.h
new file mode 100644
index 0000000..3805f56
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BnMyExtLike.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpExtendableParcelable.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpExtendableParcelable.h
new file mode 100644
index 0000000..253e8c5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpExtendableParcelable.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExt.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExt.h
new file mode 100644
index 0000000..3504c71
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExt.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExt2.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExt2.h
new file mode 100644
index 0000000..9de8160
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExt2.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExtLike.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExtLike.h
new file mode 100644
index 0000000..4e692b4
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/BpMyExtLike.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/ExtendableParcelable.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/ExtendableParcelable.h
new file mode 100644
index 0000000..64f0d32
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/ExtendableParcelable.h
@@ -0,0 +1,74 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/ExtendableParcelable.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+class ExtendableParcelable {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t a = 0;
+  std::string b;
+  ::ndk::AParcelableHolder ext{::ndk::STABILITY_LOCAL};
+  int64_t c = 0L;
+  ::ndk::AParcelableHolder ext2{::ndk::STABILITY_LOCAL};
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) != std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator<(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) < std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator<=(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) <= std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator==(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) == std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator>(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) > std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+  inline bool operator>=(const ExtendableParcelable& rhs) const {
+    return std::tie(a, b, ext, c, ext2) >= std::tie(rhs.a, rhs.b, rhs.ext, rhs.c, rhs.ext2);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ExtendableParcelable{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << ", ext: " << ::android::internal::ToString(ext);
+    os << ", c: " << ::android::internal::ToString(c);
+    os << ", ext2: " << ::android::internal::ToString(ext2);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExt.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExt.h
new file mode 100644
index 0000000..65d77dd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExt.h
@@ -0,0 +1,68 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExt.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+class MyExt {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t a = 0;
+  std::string b;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const MyExt& rhs) const {
+    return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<(const MyExt& rhs) const {
+    return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<=(const MyExt& rhs) const {
+    return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator==(const MyExt& rhs) const {
+    return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>(const MyExt& rhs) const {
+    return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>=(const MyExt& rhs) const {
+    return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "MyExt{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExt2.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExt2.h
new file mode 100644
index 0000000..e305910
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExt2.h
@@ -0,0 +1,74 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExt2.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/extension/MyExt.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::tests::extension {
+class MyExt;
+}  // namespace aidl::android::aidl::tests::extension
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+class MyExt2 {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t a = 0;
+  ::aidl::android::aidl::tests::extension::MyExt b;
+  std::string c;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const MyExt2& rhs) const {
+    return std::tie(a, b, c) != std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator<(const MyExt2& rhs) const {
+    return std::tie(a, b, c) < std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator<=(const MyExt2& rhs) const {
+    return std::tie(a, b, c) <= std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator==(const MyExt2& rhs) const {
+    return std::tie(a, b, c) == std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator>(const MyExt2& rhs) const {
+    return std::tie(a, b, c) > std::tie(rhs.a, rhs.b, rhs.c);
+  }
+  inline bool operator>=(const MyExt2& rhs) const {
+    return std::tie(a, b, c) >= std::tie(rhs.a, rhs.b, rhs.c);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "MyExt2{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << ", c: " << ::android::internal::ToString(c);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExtLike.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExtLike.h
new file mode 100644
index 0000000..0ae5336
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/extension/MyExtLike.h
@@ -0,0 +1,68 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/extension/MyExtLike.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace extension {
+class MyExtLike {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t a = 0;
+  std::string b;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const MyExtLike& rhs) const {
+    return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<(const MyExtLike& rhs) const {
+    return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator<=(const MyExtLike& rhs) const {
+    return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator==(const MyExtLike& rhs) const {
+    return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>(const MyExtLike& rhs) const {
+    return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+  }
+  inline bool operator>=(const MyExtLike& rhs) const {
+    return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "MyExtLike{";
+    os << "a: " << ::android::internal::ToString(a);
+    os << ", b: " << ::android::internal::ToString(b);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace extension
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnDeeplyNested.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnDeeplyNested.h
new file mode 100644
index 0000000..d5c2ba5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnDeeplyNested.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnNestedService.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnNestedService.h
new file mode 100644
index 0000000..fa05f80
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnNestedService.h
@@ -0,0 +1,51 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/nested/INestedService.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class BnNestedService : public ::ndk::BnCInterface<INestedService> {
+public:
+  BnNestedService();
+  virtual ~BnNestedService();
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class INestedServiceDelegator : public BnNestedService {
+public:
+  explicit INestedServiceDelegator(const std::shared_ptr<INestedService> &impl) : _impl(impl) {
+  }
+
+  ::ndk::ScopedAStatus flipStatus(const ::aidl::android::aidl::tests::nested::ParcelableWithNested& in_p, ::aidl::android::aidl::tests::nested::INestedService::Result* _aidl_return) override {
+    return _impl->flipStatus(in_p, _aidl_return);
+  }
+  ::ndk::ScopedAStatus flipStatusWithCallback(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status, const std::shared_ptr<::aidl::android::aidl::tests::nested::INestedService::ICallback>& in_cb) override {
+    return _impl->flipStatusWithCallback(in_status, in_cb);
+  }
+protected:
+private:
+  std::shared_ptr<INestedService> _impl;
+};
+
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnParcelableWithNested.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnParcelableWithNested.h
new file mode 100644
index 0000000..bee1348
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BnParcelableWithNested.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpDeeplyNested.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpDeeplyNested.h
new file mode 100644
index 0000000..f390693
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpDeeplyNested.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpNestedService.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpNestedService.h
new file mode 100644
index 0000000..4a41c20
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpNestedService.h
@@ -0,0 +1,28 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/tests/nested/INestedService.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class BpNestedService : public ::ndk::BpCInterface<INestedService> {
+public:
+  explicit BpNestedService(const ::ndk::SpAIBinder& binder);
+  virtual ~BpNestedService();
+
+  ::ndk::ScopedAStatus flipStatus(const ::aidl::android::aidl::tests::nested::ParcelableWithNested& in_p, ::aidl::android::aidl::tests::nested::INestedService::Result* _aidl_return) override;
+  ::ndk::ScopedAStatus flipStatusWithCallback(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status, const std::shared_ptr<::aidl::android::aidl::tests::nested::INestedService::ICallback>& in_cb) override;
+};
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpParcelableWithNested.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpParcelableWithNested.h
new file mode 100644
index 0000000..2a9ae60
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/BpParcelableWithNested.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/DeeplyNested.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/DeeplyNested.h
new file mode 100644
index 0000000..58a2217
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/DeeplyNested.h
@@ -0,0 +1,246 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/DeeplyNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/nested/DeeplyNested.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class DeeplyNested {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  class B {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    class C {
+    public:
+      typedef std::false_type fixed_size;
+      static const char* descriptor;
+
+      class D {
+      public:
+        typedef std::false_type fixed_size;
+        static const char* descriptor;
+
+        enum class E : int8_t {
+          OK = 0,
+        };
+
+
+        binder_status_t readFromParcel(const AParcel* parcel);
+        binder_status_t writeToParcel(AParcel* parcel) const;
+
+        inline bool operator!=(const D&) const {
+          return std::tie() != std::tie();
+        }
+        inline bool operator<(const D&) const {
+          return std::tie() < std::tie();
+        }
+        inline bool operator<=(const D&) const {
+          return std::tie() <= std::tie();
+        }
+        inline bool operator==(const D&) const {
+          return std::tie() == std::tie();
+        }
+        inline bool operator>(const D&) const {
+          return std::tie() > std::tie();
+        }
+        inline bool operator>=(const D&) const {
+          return std::tie() >= std::tie();
+        }
+
+        static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+        inline std::string toString() const {
+          std::ostringstream os;
+          os << "D{";
+          os << "}";
+          return os.str();
+        }
+      };
+
+      binder_status_t readFromParcel(const AParcel* parcel);
+      binder_status_t writeToParcel(AParcel* parcel) const;
+
+      inline bool operator!=(const C&) const {
+        return std::tie() != std::tie();
+      }
+      inline bool operator<(const C&) const {
+        return std::tie() < std::tie();
+      }
+      inline bool operator<=(const C&) const {
+        return std::tie() <= std::tie();
+      }
+      inline bool operator==(const C&) const {
+        return std::tie() == std::tie();
+      }
+      inline bool operator>(const C&) const {
+        return std::tie() > std::tie();
+      }
+      inline bool operator>=(const C&) const {
+        return std::tie() >= std::tie();
+      }
+
+      static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+      inline std::string toString() const {
+        std::ostringstream os;
+        os << "C{";
+        os << "}";
+        return os.str();
+      }
+    };
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const B&) const {
+      return std::tie() != std::tie();
+    }
+    inline bool operator<(const B&) const {
+      return std::tie() < std::tie();
+    }
+    inline bool operator<=(const B&) const {
+      return std::tie() <= std::tie();
+    }
+    inline bool operator==(const B&) const {
+      return std::tie() == std::tie();
+    }
+    inline bool operator>(const B&) const {
+      return std::tie() > std::tie();
+    }
+    inline bool operator>=(const B&) const {
+      return std::tie() >= std::tie();
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "B{";
+      os << "}";
+      return os.str();
+    }
+  };
+  class A {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    ::aidl::android::aidl::tests::nested::DeeplyNested::B::C::D::E e = ::aidl::android::aidl::tests::nested::DeeplyNested::B::C::D::E::OK;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const A& rhs) const {
+      return std::tie(e) != std::tie(rhs.e);
+    }
+    inline bool operator<(const A& rhs) const {
+      return std::tie(e) < std::tie(rhs.e);
+    }
+    inline bool operator<=(const A& rhs) const {
+      return std::tie(e) <= std::tie(rhs.e);
+    }
+    inline bool operator==(const A& rhs) const {
+      return std::tie(e) == std::tie(rhs.e);
+    }
+    inline bool operator>(const A& rhs) const {
+      return std::tie(e) > std::tie(rhs.e);
+    }
+    inline bool operator>=(const A& rhs) const {
+      return std::tie(e) >= std::tie(rhs.e);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "A{";
+      os << "e: " << ::android::internal::ToString(e);
+      os << "}";
+      return os.str();
+    }
+  };
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const DeeplyNested&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const DeeplyNested&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const DeeplyNested&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const DeeplyNested&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const DeeplyNested&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const DeeplyNested&) const {
+    return std::tie() >= std::tie();
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "DeeplyNested{";
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+[[nodiscard]] static inline std::string toString(DeeplyNested::B::C::D::E val) {
+  switch(val) {
+  case DeeplyNested::B::C::D::E::OK:
+    return "OK";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::nested::DeeplyNested::B::C::D::E, 1> enum_values<aidl::android::aidl::tests::nested::DeeplyNested::B::C::D::E> = {
+  aidl::android::aidl::tests::nested::DeeplyNested::B::C::D::E::OK,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/INestedService.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/INestedService.h
new file mode 100644
index 0000000..5ec478f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/INestedService.h
@@ -0,0 +1,142 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/INestedService.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_ibinder.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/nested/INestedService.h>
+#include <aidl/android/aidl/tests/nested/ParcelableWithNested.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::tests::nested {
+class ParcelableWithNested;
+}  // namespace aidl::android::aidl::tests::nested
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class INestedServiceDelegator;
+
+class INestedService : public ::ndk::ICInterface {
+public:
+  typedef INestedServiceDelegator DefaultDelegator;
+  static const char* descriptor;
+  INestedService();
+  virtual ~INestedService();
+
+  class Result {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    ::aidl::android::aidl::tests::nested::ParcelableWithNested::Status status = ::aidl::android::aidl::tests::nested::ParcelableWithNested::Status::OK;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const Result& rhs) const {
+      return std::tie(status) != std::tie(rhs.status);
+    }
+    inline bool operator<(const Result& rhs) const {
+      return std::tie(status) < std::tie(rhs.status);
+    }
+    inline bool operator<=(const Result& rhs) const {
+      return std::tie(status) <= std::tie(rhs.status);
+    }
+    inline bool operator==(const Result& rhs) const {
+      return std::tie(status) == std::tie(rhs.status);
+    }
+    inline bool operator>(const Result& rhs) const {
+      return std::tie(status) > std::tie(rhs.status);
+    }
+    inline bool operator>=(const Result& rhs) const {
+      return std::tie(status) >= std::tie(rhs.status);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "Result{";
+      os << "status: " << ::android::internal::ToString(status);
+      os << "}";
+      return os.str();
+    }
+  };
+  class ICallbackDelegator;
+
+  class ICallback : public ::ndk::ICInterface {
+  public:
+    typedef ICallbackDelegator DefaultDelegator;
+    static const char* descriptor;
+    ICallback();
+    virtual ~ICallback();
+
+    static constexpr uint32_t TRANSACTION_done = FIRST_CALL_TRANSACTION + 0;
+
+    static std::shared_ptr<ICallback> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<ICallback>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<ICallback>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<ICallback>& impl);
+    static const std::shared_ptr<ICallback>& getDefaultImpl();
+    virtual ::ndk::ScopedAStatus done(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status) = 0;
+  private:
+    static std::shared_ptr<ICallback> default_impl;
+  };
+  class ICallbackDefault : public ICallback {
+  public:
+    ::ndk::ScopedAStatus done(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status) override;
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpCallback : public ::ndk::BpCInterface<ICallback> {
+  public:
+    explicit BpCallback(const ::ndk::SpAIBinder& binder);
+    virtual ~BpCallback();
+
+    ::ndk::ScopedAStatus done(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status) override;
+  };
+  class BnCallback : public ::ndk::BnCInterface<ICallback> {
+  public:
+    BnCallback();
+    virtual ~BnCallback();
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  static constexpr uint32_t TRANSACTION_flipStatus = FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_flipStatusWithCallback = FIRST_CALL_TRANSACTION + 1;
+
+  static std::shared_ptr<INestedService> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<INestedService>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<INestedService>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<INestedService>& impl);
+  static const std::shared_ptr<INestedService>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus flipStatus(const ::aidl::android::aidl::tests::nested::ParcelableWithNested& in_p, ::aidl::android::aidl::tests::nested::INestedService::Result* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus flipStatusWithCallback(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status, const std::shared_ptr<::aidl::android::aidl::tests::nested::INestedService::ICallback>& in_cb) = 0;
+private:
+  static std::shared_ptr<INestedService> default_impl;
+};
+class INestedServiceDefault : public INestedService {
+public:
+  ::ndk::ScopedAStatus flipStatus(const ::aidl::android::aidl::tests::nested::ParcelableWithNested& in_p, ::aidl::android::aidl::tests::nested::INestedService::Result* _aidl_return) override;
+  ::ndk::ScopedAStatus flipStatusWithCallback(::aidl::android::aidl::tests::nested::ParcelableWithNested::Status in_status, const std::shared_ptr<::aidl::android::aidl::tests::nested::INestedService::ICallback>& in_cb) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/ParcelableWithNested.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/ParcelableWithNested.h
new file mode 100644
index 0000000..eb7404a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/nested/ParcelableWithNested.h
@@ -0,0 +1,106 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/nested/ParcelableWithNested.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/nested/ParcelableWithNested.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+class ParcelableWithNested {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Status : int8_t {
+    OK = 0,
+    NOT_OK = 1,
+  };
+
+  ::aidl::android::aidl::tests::nested::ParcelableWithNested::Status status = ::aidl::android::aidl::tests::nested::ParcelableWithNested::Status::OK;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const ParcelableWithNested& rhs) const {
+    return std::tie(status) != std::tie(rhs.status);
+  }
+  inline bool operator<(const ParcelableWithNested& rhs) const {
+    return std::tie(status) < std::tie(rhs.status);
+  }
+  inline bool operator<=(const ParcelableWithNested& rhs) const {
+    return std::tie(status) <= std::tie(rhs.status);
+  }
+  inline bool operator==(const ParcelableWithNested& rhs) const {
+    return std::tie(status) == std::tie(rhs.status);
+  }
+  inline bool operator>(const ParcelableWithNested& rhs) const {
+    return std::tie(status) > std::tie(rhs.status);
+  }
+  inline bool operator>=(const ParcelableWithNested& rhs) const {
+    return std::tie(status) >= std::tie(rhs.status);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "ParcelableWithNested{";
+    os << "status: " << ::android::internal::ToString(status);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace nested {
+[[nodiscard]] static inline std::string toString(ParcelableWithNested::Status val) {
+  switch(val) {
+  case ParcelableWithNested::Status::OK:
+    return "OK";
+  case ParcelableWithNested::Status::NOT_OK:
+    return "NOT_OK";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace nested
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::nested::ParcelableWithNested::Status, 2> enum_values<aidl::android::aidl::tests::nested::ParcelableWithNested::Status> = {
+  aidl::android::aidl::tests::nested::ParcelableWithNested::Status::OK,
+  aidl::android::aidl::tests::nested::ParcelableWithNested::Status::NOT_OK,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BnEnumUnion.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BnEnumUnion.h
new file mode 100644
index 0000000..1b9fb99
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BnEnumUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BnUnionInUnion.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BnUnionInUnion.h
new file mode 100644
index 0000000..0617da7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BnUnionInUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BpEnumUnion.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BpEnumUnion.h
new file mode 100644
index 0000000..997e6fc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BpEnumUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BpUnionInUnion.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BpUnionInUnion.h
new file mode 100644
index 0000000..77d0764
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/BpUnionInUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/EnumUnion.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/EnumUnion.h
new file mode 100644
index 0000000..9dd7376
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/EnumUnion.h
@@ -0,0 +1,180 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/unions/EnumUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/IntEnum.h>
+#include <aidl/android/aidl/tests/LongEnum.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+class EnumUnion {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Tag : int32_t {
+    intEnum = 0,
+    longEnum = 1,
+    deprecatedField __attribute__((deprecated("do not use this"))) = 2,
+  };
+
+  // Expose tag symbols for legacy code
+  static const inline Tag intEnum = Tag::intEnum;
+  static const inline Tag longEnum = Tag::longEnum;
+  static const inline Tag __attribute__((deprecated("do not use this"))) deprecatedField = Tag::deprecatedField;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, EnumUnion>;
+
+  EnumUnion() : _value(std::in_place_index<static_cast<size_t>(intEnum)>, ::aidl::android::aidl::tests::IntEnum(::aidl::android::aidl::tests::IntEnum::FOO)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr EnumUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit EnumUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static EnumUnion make(_Tp&&... _args) {
+    return EnumUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static EnumUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return EnumUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  binder_status_t readFromParcel(const AParcel* _parcel);
+  binder_status_t writeToParcel(AParcel* _parcel) const;
+
+  inline bool operator!=(const EnumUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const EnumUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const EnumUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const EnumUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const EnumUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const EnumUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "EnumUnion{";
+    switch (getTag()) {
+    case intEnum: os << "intEnum: " << ::android::internal::ToString(get<intEnum>()); break;
+    case longEnum: os << "longEnum: " << ::android::internal::ToString(get<longEnum>()); break;
+    case deprecatedField: os << "deprecatedField: " << ::android::internal::ToString(get<deprecatedField>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<::aidl::android::aidl::tests::IntEnum, ::aidl::android::aidl::tests::LongEnum, int32_t> _value;
+};
+#pragma clang diagnostic pop
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+[[nodiscard]] static inline std::string toString(EnumUnion::Tag val) {
+  switch(val) {
+  case EnumUnion::Tag::intEnum:
+    return "intEnum";
+  case EnumUnion::Tag::longEnum:
+    return "longEnum";
+  case EnumUnion::Tag::deprecatedField:
+    return "deprecatedField";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+#pragma clang diagnostic pop
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::unions::EnumUnion::Tag, 3> enum_values<aidl::android::aidl::tests::unions::EnumUnion::Tag> = {
+  aidl::android::aidl::tests::unions::EnumUnion::Tag::intEnum,
+  aidl::android::aidl::tests::unions::EnumUnion::Tag::longEnum,
+  aidl::android::aidl::tests::unions::EnumUnion::Tag::deprecatedField,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/UnionInUnion.h b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/UnionInUnion.h
new file mode 100644
index 0000000..d84452a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/include/aidl/android/aidl/tests/unions/UnionInUnion.h
@@ -0,0 +1,166 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging/android/aidl/tests/unions/UnionInUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/tests/unions/EnumUnion.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+class UnionInUnion {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Tag : int32_t {
+    first = 0,
+    second = 1,
+  };
+
+  // Expose tag symbols for legacy code
+  static const inline Tag first = Tag::first;
+  static const inline Tag second = Tag::second;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, UnionInUnion>;
+
+  UnionInUnion() : _value(std::in_place_index<static_cast<size_t>(first)>, ::aidl::android::aidl::tests::unions::EnumUnion()) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr UnionInUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit UnionInUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static UnionInUnion make(_Tp&&... _args) {
+    return UnionInUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static UnionInUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return UnionInUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  binder_status_t readFromParcel(const AParcel* _parcel);
+  binder_status_t writeToParcel(AParcel* _parcel) const;
+
+  inline bool operator!=(const UnionInUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const UnionInUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const UnionInUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const UnionInUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const UnionInUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const UnionInUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "UnionInUnion{";
+    switch (getTag()) {
+    case first: os << "first: " << ::android::internal::ToString(get<first>()); break;
+    case second: os << "second: " << ::android::internal::ToString(get<second>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<::aidl::android::aidl::tests::unions::EnumUnion, int32_t> _value;
+};
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+namespace unions {
+[[nodiscard]] static inline std::string toString(UnionInUnion::Tag val) {
+  switch(val) {
+  case UnionInUnion::Tag::first:
+    return "first";
+  case UnionInUnion::Tag::second:
+    return "second";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace unions
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::unions::UnionInUnion::Tag, 2> enum_values<aidl::android::aidl::tests::unions::UnionInUnion::Tag> = {
+  aidl::android::aidl::tests::unions::UnionInUnion::Tag::first,
+  aidl::android::aidl::tests::unions::UnionInUnion::Tag::second,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-ndk-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/INoPermission.java b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/INoPermission.java
new file mode 100644
index 0000000..1013bed
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/INoPermission.java
@@ -0,0 +1,131 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/INoPermission.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen -Iframeworks/base/core/java -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/permission/INoPermission.aidl
+ */
+package android.aidl.tests.permission;
+public interface INoPermission extends android.os.IInterface
+{
+  /** Default implementation for INoPermission. */
+  public static class Default implements android.aidl.tests.permission.INoPermission
+  {
+    @Override public void foo() throws android.os.RemoteException
+    {
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.permission.INoPermission
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.permission.INoPermission interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.permission.INoPermission asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.permission.INoPermission))) {
+        return ((android.aidl.tests.permission.INoPermission)iin);
+      }
+      return new android.aidl.tests.permission.INoPermission.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_foo:
+        {
+          return "foo";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_foo:
+        {
+          this.foo();
+          reply.writeNoException();
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.permission.INoPermission
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public void foo() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_foo, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+    }
+    static final int TRANSACTION_foo = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 0;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.permission.INoPermission";
+  @android.annotation.RequiresNoPermission
+  public void foo() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/INoPermission.java.d b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/INoPermission.java.d
new file mode 100644
index 0000000..c213fdc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/INoPermission.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/INoPermission.java : \
+  system/tools/aidl/tests/android/aidl/tests/permission/INoPermission.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtected.java b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtected.java
new file mode 100644
index 0000000..96a2468
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtected.java
@@ -0,0 +1,351 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtected.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen -Iframeworks/base/core/java -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/permission/IProtected.aidl
+ */
+package android.aidl.tests.permission;
+public interface IProtected extends android.os.IInterface
+{
+  /** Default implementation for IProtected. */
+  public static class Default implements android.aidl.tests.permission.IProtected
+  {
+    @Override public void PermissionProtected() throws android.os.RemoteException
+    {
+    }
+    @Override public void MultiplePermissionsAll() throws android.os.RemoteException
+    {
+    }
+    @Override public void MultiplePermissionsAny() throws android.os.RemoteException
+    {
+    }
+    @Override public void NonManifestPermission() throws android.os.RemoteException
+    {
+    }
+    // Used by the integration tests to dynamically set permissions that are considered granted.
+    @Override public void Grant(java.lang.String permission) throws android.os.RemoteException
+    {
+    }
+    @Override public void Revoke(java.lang.String permission) throws android.os.RemoteException
+    {
+    }
+    @Override public void RevokeAll() throws android.os.RemoteException
+    {
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.permission.IProtected
+  {
+    private final android.os.PermissionEnforcer mEnforcer;
+    /** Construct the stub using the Enforcer provided. */
+    public Stub(android.os.PermissionEnforcer enforcer)
+    {
+      this.attachInterface(this, DESCRIPTOR);
+      if (enforcer == null) {
+        throw new IllegalArgumentException("enforcer cannot be null");
+      }
+      mEnforcer = enforcer;
+    }
+    @Deprecated
+    /** Default constructor. */
+    public Stub() {
+      this(android.os.PermissionEnforcer.fromContext(
+         android.app.ActivityThread.currentActivityThread().getSystemContext()));
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.permission.IProtected interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.permission.IProtected asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.permission.IProtected))) {
+        return ((android.aidl.tests.permission.IProtected)iin);
+      }
+      return new android.aidl.tests.permission.IProtected.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_PermissionProtected:
+        {
+          return "PermissionProtected";
+        }
+        case TRANSACTION_MultiplePermissionsAll:
+        {
+          return "MultiplePermissionsAll";
+        }
+        case TRANSACTION_MultiplePermissionsAny:
+        {
+          return "MultiplePermissionsAny";
+        }
+        case TRANSACTION_NonManifestPermission:
+        {
+          return "NonManifestPermission";
+        }
+        case TRANSACTION_Grant:
+        {
+          return "Grant";
+        }
+        case TRANSACTION_Revoke:
+        {
+          return "Revoke";
+        }
+        case TRANSACTION_RevokeAll:
+        {
+          return "RevokeAll";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_PermissionProtected:
+        {
+          this.PermissionProtected();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_MultiplePermissionsAll:
+        {
+          this.MultiplePermissionsAll();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_MultiplePermissionsAny:
+        {
+          this.MultiplePermissionsAny();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_NonManifestPermission:
+        {
+          this.NonManifestPermission();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_Grant:
+        {
+          java.lang.String _arg0;
+          _arg0 = data.readString();
+          data.enforceNoDataAvail();
+          this.Grant(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_Revoke:
+        {
+          java.lang.String _arg0;
+          _arg0 = data.readString();
+          data.enforceNoDataAvail();
+          this.Revoke(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_RevokeAll:
+        {
+          this.RevokeAll();
+          reply.writeNoException();
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.permission.IProtected
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public void PermissionProtected() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_PermissionProtected, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void MultiplePermissionsAll() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_MultiplePermissionsAll, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void MultiplePermissionsAny() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_MultiplePermissionsAny, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void NonManifestPermission() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_NonManifestPermission, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      // Used by the integration tests to dynamically set permissions that are considered granted.
+      @Override public void Grant(java.lang.String permission) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeString(permission);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_Grant, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void Revoke(java.lang.String permission) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeString(permission);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_Revoke, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void RevokeAll() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_RevokeAll, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+    }
+    static final int TRANSACTION_PermissionProtected = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    /** Helper method to enforce permissions for PermissionProtected */
+    protected void PermissionProtected_enforcePermission() throws SecurityException {
+      mEnforcer.enforcePermission(android.Manifest.permission.READ_PHONE_STATE, getCallingPid(), getCallingUid());
+    }
+    static final int TRANSACTION_MultiplePermissionsAll = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    static final String[] PERMISSIONS_MultiplePermissionsAll = {android.Manifest.permission.INTERNET, android.Manifest.permission.VIBRATE};
+    /** Helper method to enforce permissions for MultiplePermissionsAll */
+    protected void MultiplePermissionsAll_enforcePermission() throws SecurityException {
+      mEnforcer.enforcePermissionAllOf(PERMISSIONS_MultiplePermissionsAll, getCallingPid(), getCallingUid());
+    }
+    static final int TRANSACTION_MultiplePermissionsAny = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+    static final String[] PERMISSIONS_MultiplePermissionsAny = {android.Manifest.permission.INTERNET, android.Manifest.permission.VIBRATE};
+    /** Helper method to enforce permissions for MultiplePermissionsAny */
+    protected void MultiplePermissionsAny_enforcePermission() throws SecurityException {
+      mEnforcer.enforcePermissionAnyOf(PERMISSIONS_MultiplePermissionsAny, getCallingPid(), getCallingUid());
+    }
+    static final int TRANSACTION_NonManifestPermission = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+    /** Helper method to enforce permissions for NonManifestPermission */
+    protected void NonManifestPermission_enforcePermission() throws SecurityException {
+      mEnforcer.enforcePermission(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, getCallingPid(), getCallingUid());
+    }
+    static final int TRANSACTION_Grant = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
+    static final int TRANSACTION_Revoke = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5);
+    static final int TRANSACTION_RevokeAll = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 6;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.permission.IProtected";
+  @android.annotation.EnforcePermission(android.Manifest.permission.READ_PHONE_STATE)
+  public void PermissionProtected() throws android.os.RemoteException;
+  @android.annotation.EnforcePermission(allOf = {android.Manifest.permission.INTERNET, android.Manifest.permission.VIBRATE})
+  public void MultiplePermissionsAll() throws android.os.RemoteException;
+  @android.annotation.EnforcePermission(anyOf = {android.Manifest.permission.INTERNET, android.Manifest.permission.VIBRATE})
+  public void MultiplePermissionsAny() throws android.os.RemoteException;
+  @android.annotation.EnforcePermission(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK)
+  public void NonManifestPermission() throws android.os.RemoteException;
+  // Used by the integration tests to dynamically set permissions that are considered granted.
+  @android.annotation.RequiresNoPermission
+  public void Grant(java.lang.String permission) throws android.os.RemoteException;
+  @android.annotation.RequiresNoPermission
+  public void Revoke(java.lang.String permission) throws android.os.RemoteException;
+  @android.annotation.RequiresNoPermission
+  public void RevokeAll() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtected.java.d b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtected.java.d
new file mode 100644
index 0000000..752e4bf
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtected.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtected.java : \
+  system/tools/aidl/tests/android/aidl/tests/permission/IProtected.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtectedInterface.java b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtectedInterface.java
new file mode 100644
index 0000000..e79abe3
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtectedInterface.java
@@ -0,0 +1,180 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtectedInterface.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen -Iframeworks/base/core/java -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/permission/IProtectedInterface.aidl
+ */
+package android.aidl.tests.permission;
+public interface IProtectedInterface extends android.os.IInterface
+{
+  /** Default implementation for IProtectedInterface. */
+  public static class Default implements android.aidl.tests.permission.IProtectedInterface
+  {
+    @Override public void Method1() throws android.os.RemoteException
+    {
+    }
+    @Override public void Method2() throws android.os.RemoteException
+    {
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.permission.IProtectedInterface
+  {
+    private final android.os.PermissionEnforcer mEnforcer;
+    /** Construct the stub using the Enforcer provided. */
+    public Stub(android.os.PermissionEnforcer enforcer)
+    {
+      this.attachInterface(this, DESCRIPTOR);
+      if (enforcer == null) {
+        throw new IllegalArgumentException("enforcer cannot be null");
+      }
+      mEnforcer = enforcer;
+    }
+    @Deprecated
+    /** Default constructor. */
+    public Stub() {
+      this(android.os.PermissionEnforcer.fromContext(
+         android.app.ActivityThread.currentActivityThread().getSystemContext()));
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.permission.IProtectedInterface interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.permission.IProtectedInterface asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.permission.IProtectedInterface))) {
+        return ((android.aidl.tests.permission.IProtectedInterface)iin);
+      }
+      return new android.aidl.tests.permission.IProtectedInterface.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_Method1:
+        {
+          return "Method1";
+        }
+        case TRANSACTION_Method2:
+        {
+          return "Method2";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_Method1:
+        {
+          this.Method1();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_Method2:
+        {
+          this.Method2();
+          reply.writeNoException();
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.permission.IProtectedInterface
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public void Method1() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_Method1, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public void Method2() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_Method2, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+    }
+    static final int TRANSACTION_Method1 = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    /** Helper method to enforce permissions for Method1 */
+    protected void Method1_enforcePermission() throws SecurityException {
+      mEnforcer.enforcePermission(android.Manifest.permission.ACCESS_FINE_LOCATION, getCallingPid(), getCallingUid());
+    }
+    static final int TRANSACTION_Method2 = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    /** Helper method to enforce permissions for Method2 */
+    protected void Method2_enforcePermission() throws SecurityException {
+      mEnforcer.enforcePermission(android.Manifest.permission.ACCESS_FINE_LOCATION, getCallingPid(), getCallingUid());
+    }
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 1;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.permission.IProtectedInterface";
+  @android.annotation.EnforcePermission(android.Manifest.permission.ACCESS_FINE_LOCATION)
+  public void Method1() throws android.os.RemoteException;
+  @android.annotation.EnforcePermission(android.Manifest.permission.ACCESS_FINE_LOCATION)
+  public void Method2() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtectedInterface.java.d b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtectedInterface.java.d
new file mode 100644
index 0000000..1a36e38
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtectedInterface.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/IProtectedInterface.java : \
+  system/tools/aidl/tests/android/aidl/tests/permission/IProtectedInterface.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/platform/IProtected.java b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/platform/IProtected.java
new file mode 100644
index 0000000..ca05d0d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/platform/IProtected.java
@@ -0,0 +1,151 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/platform/IProtected.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen -Iframeworks/base/core/java -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/permission/platform/IProtected.aidl
+ */
+package android.aidl.tests.permission.platform;
+public interface IProtected extends android.os.IInterface
+{
+  /** Default implementation for IProtected. */
+  public static class Default implements android.aidl.tests.permission.platform.IProtected
+  {
+    @Override public void ProtectedWithSourceAttribution(android.content.AttributionSource source) throws android.os.RemoteException
+    {
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.tests.permission.platform.IProtected
+  {
+    private final android.os.PermissionEnforcer mEnforcer;
+    /** Construct the stub using the Enforcer provided. */
+    public Stub(android.os.PermissionEnforcer enforcer)
+    {
+      this.attachInterface(this, DESCRIPTOR);
+      if (enforcer == null) {
+        throw new IllegalArgumentException("enforcer cannot be null");
+      }
+      mEnforcer = enforcer;
+    }
+    @Deprecated
+    /** Default constructor. */
+    public Stub() {
+      this(android.os.PermissionEnforcer.fromContext(
+         android.app.ActivityThread.currentActivityThread().getSystemContext()));
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.tests.permission.platform.IProtected interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.tests.permission.platform.IProtected asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.tests.permission.platform.IProtected))) {
+        return ((android.aidl.tests.permission.platform.IProtected)iin);
+      }
+      return new android.aidl.tests.permission.platform.IProtected.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_ProtectedWithSourceAttribution:
+        {
+          return "ProtectedWithSourceAttribution";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_ProtectedWithSourceAttribution:
+        {
+          android.content.AttributionSource _arg0;
+          _arg0 = data.readTypedObject(android.content.AttributionSource.CREATOR);
+          data.enforceNoDataAvail();
+          this.ProtectedWithSourceAttribution(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.tests.permission.platform.IProtected
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public void ProtectedWithSourceAttribution(android.content.AttributionSource source) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(source, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ProtectedWithSourceAttribution, _data, _reply, 0);
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+    }
+    static final int TRANSACTION_ProtectedWithSourceAttribution = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    static final String[] PERMISSIONS_ProtectedWithSourceAttribution = {android.Manifest.permission.INTERNET, android.Manifest.permission.VIBRATE};
+    /** Helper method to enforce permissions for ProtectedWithSourceAttribution */
+    protected void ProtectedWithSourceAttribution_enforcePermission() throws SecurityException {
+      mEnforcer.enforcePermissionAllOf(PERMISSIONS_ProtectedWithSourceAttribution, getCallingPid(), getCallingUid());
+    }
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 0;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.tests.permission.platform.IProtected";
+  @android.annotation.EnforcePermission(allOf = {android.Manifest.permission.INTERNET, android.Manifest.permission.VIBRATE})
+  public void ProtectedWithSourceAttribution(android.content.AttributionSource source) throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/platform/IProtected.java.d b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/platform/IProtected.java.d
new file mode 100644
index 0000000..86866a2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/platform/IProtected.java.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-permission-java-source/gen/android/aidl/tests/permission/platform/IProtected.java : \
+  system/tools/aidl/tests/android/aidl/tests/permission/platform/IProtected.aidl \
+  frameworks/base/core/java/android/content/AttributionSource.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-permission-java-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs
new file mode 100644
index 0000000..f8ff563
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs
@@ -0,0 +1,411 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#ArrayOfInterfaces {
+}
+impl Default for r#ArrayOfInterfaces {
+  fn default() -> Self {
+    Self {
+    }
+  }
+}
+impl binder::Parcelable for r#ArrayOfInterfaces {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#ArrayOfInterfaces);
+binder::impl_deserialize_for_parcelable!(r#ArrayOfInterfaces);
+impl binder::binder_impl::ParcelableMetadata for r#ArrayOfInterfaces {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.ArrayOfInterfaces" }
+}
+pub mod r#IEmptyInterface {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    IEmptyInterface["android.aidl.tests.ArrayOfInterfaces.IEmptyInterface"] {
+      native: BnEmptyInterface(on_transact),
+      proxy: BpEmptyInterface {
+      },
+      async: IEmptyInterfaceAsync,
+    }
+  }
+  pub trait IEmptyInterface: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ArrayOfInterfaces.IEmptyInterface" }
+    fn getDefaultImpl() -> IEmptyInterfaceDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: IEmptyInterfaceDefaultRef) -> IEmptyInterfaceDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait IEmptyInterfaceAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ArrayOfInterfaces.IEmptyInterface" }
+  }
+  #[::async_trait::async_trait]
+  pub trait IEmptyInterfaceAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ArrayOfInterfaces.IEmptyInterface" }
+  }
+  impl BnEmptyInterface {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IEmptyInterface>
+    where
+      T: IEmptyInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> IEmptyInterface for Wrapper<T, R>
+      where
+        T: IEmptyInterfaceAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait IEmptyInterfaceDefault: Send + Sync {
+  }
+  pub mod transactions {
+  }
+  pub type IEmptyInterfaceDefaultRef = Option<std::sync::Arc<dyn IEmptyInterfaceDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None);
+  }
+  impl BpEmptyInterface {
+  }
+  impl IEmptyInterface for BpEmptyInterface {
+  }
+  impl<P: binder::BinderAsyncPool> IEmptyInterfaceAsync<P> for BpEmptyInterface {
+  }
+  impl IEmptyInterface for binder::binder_impl::Binder<BnEmptyInterface> {
+  }
+  fn on_transact(_aidl_service: &dyn IEmptyInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub mod r#IMyInterface {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    IMyInterface["android.aidl.tests.ArrayOfInterfaces.IMyInterface"] {
+      native: BnMyInterface(on_transact),
+      proxy: BpMyInterface {
+      },
+      async: IMyInterfaceAsync,
+    }
+  }
+  pub trait IMyInterface: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ArrayOfInterfaces.IMyInterface" }
+    fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>>;
+    fn getDefaultImpl() -> IMyInterfaceDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: IMyInterfaceDefaultRef) -> IMyInterfaceDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait IMyInterfaceAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ArrayOfInterfaces.IMyInterface" }
+    fn r#methodWithInterfaces<'a>(&'a self, _arg_iface: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &'a [binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &'a mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &'a mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&'a [Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &'a mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &'a mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>>>;
+  }
+  #[::async_trait::async_trait]
+  pub trait IMyInterfaceAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ArrayOfInterfaces.IMyInterface" }
+    async fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>>;
+  }
+  impl BnMyInterface {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IMyInterface>
+    where
+      T: IMyInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> IMyInterface for Wrapper<T, R>
+      where
+        T: IMyInterfaceAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+        fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>> {
+          self._rt.block_on(self._inner.r#methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_array_in, _arg_iface_array_out, _arg_iface_array_inout, _arg_nullable_iface_array_in, _arg_nullable_iface_array_out, _arg_nullable_iface_array_inout))
+        }
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait IMyInterfaceDefault: Send + Sync {
+    fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+  }
+  pub mod transactions {
+    pub const r#methodWithInterfaces: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  }
+  pub type IMyInterfaceDefaultRef = Option<std::sync::Arc<dyn IMyInterfaceDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<IMyInterfaceDefaultRef> = std::sync::Mutex::new(None);
+  }
+  impl BpMyInterface {
+    fn build_parcel_methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_iface)?;
+      aidl_data.write(&_arg_nullable_iface)?;
+      aidl_data.write(_arg_iface_array_in)?;
+      aidl_data.write_slice_size(Some(_arg_iface_array_out))?;
+      aidl_data.write(_arg_iface_array_inout)?;
+      aidl_data.write(&_arg_nullable_iface_array_in)?;
+      aidl_data.write_slice_size(_arg_nullable_iface_array_out.as_deref())?;
+      aidl_data.write(_arg_nullable_iface_array_inout)?;
+      Ok(aidl_data)
+    }
+    fn read_response_methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyInterface>::getDefaultImpl() {
+          return _aidl_default_impl.r#methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_array_in, _arg_iface_array_out, _arg_iface_array_inout, _arg_nullable_iface_array_in, _arg_nullable_iface_array_out, _arg_nullable_iface_array_inout);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>> = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_iface_array_out)?;
+      _aidl_reply.read_onto(_arg_iface_array_inout)?;
+      _aidl_reply.read_onto(_arg_nullable_iface_array_out)?;
+      _aidl_reply.read_onto(_arg_nullable_iface_array_inout)?;
+      Ok(_aidl_return)
+    }
+  }
+  impl IMyInterface for BpMyInterface {
+    fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>> {
+      let _aidl_data = self.build_parcel_methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_array_in, _arg_iface_array_out, _arg_iface_array_inout, _arg_nullable_iface_array_in, _arg_nullable_iface_array_out, _arg_nullable_iface_array_inout)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#methodWithInterfaces, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_array_in, _arg_iface_array_out, _arg_iface_array_inout, _arg_nullable_iface_array_in, _arg_nullable_iface_array_out, _arg_nullable_iface_array_inout, _aidl_reply)
+    }
+  }
+  impl<P: binder::BinderAsyncPool> IMyInterfaceAsync<P> for BpMyInterface {
+    fn r#methodWithInterfaces<'a>(&'a self, _arg_iface: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &'a [binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &'a mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &'a mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&'a [Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &'a mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &'a mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>>> {
+      let _aidl_data = match self.build_parcel_methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_array_in, _arg_iface_array_out, _arg_iface_array_inout, _arg_nullable_iface_array_in, _arg_nullable_iface_array_out, _arg_nullable_iface_array_inout) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#methodWithInterfaces, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_array_in, _arg_iface_array_out, _arg_iface_array_inout, _arg_nullable_iface_array_in, _arg_nullable_iface_array_out, _arg_nullable_iface_array_inout, _aidl_reply)
+        }
+      )
+    }
+  }
+  impl IMyInterface for binder::binder_impl::Binder<BnMyInterface> {
+    fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>> { self.0.r#methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_array_in, _arg_iface_array_out, _arg_iface_array_inout, _arg_nullable_iface_array_in, _arg_nullable_iface_array_out, _arg_nullable_iface_array_inout) }
+  }
+  fn on_transact(_aidl_service: &dyn IMyInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      transactions::r#methodWithInterfaces => {
+        let _arg_iface: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface> = _aidl_data.read()?;
+        let _arg_nullable_iface: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>> = _aidl_data.read()?;
+        let _arg_iface_array_in: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>> = _aidl_data.read()?;
+        let mut _arg_iface_array_out: Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>> = Default::default();
+        _aidl_data.resize_out_vec(&mut _arg_iface_array_out)?;
+        let mut _arg_iface_array_inout: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>> = _aidl_data.read()?;
+        let _arg_nullable_iface_array_in: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>> = _aidl_data.read()?;
+        let mut _arg_nullable_iface_array_out: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>> = Default::default();
+        _aidl_data.resize_nullable_out_vec(&mut _arg_nullable_iface_array_out)?;
+        let mut _arg_nullable_iface_array_inout: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>> = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#methodWithInterfaces(&_arg_iface, _arg_nullable_iface.as_ref(), &_arg_iface_array_in, &mut _arg_iface_array_out, &mut _arg_iface_array_inout, _arg_nullable_iface_array_in.as_deref(), &mut _arg_nullable_iface_array_out, &mut _arg_nullable_iface_array_inout);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_iface_array_out)?;
+            _aidl_reply.write(&_arg_iface_array_inout)?;
+            _aidl_reply.write(&_arg_nullable_iface_array_out)?;
+            _aidl_reply.write(&_arg_nullable_iface_array_inout)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub mod r#MyParcelable {
+  #[derive(Debug)]
+  pub struct r#MyParcelable {
+    pub r#iface: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>,
+    pub r#nullable_iface: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>,
+    pub r#iface_array: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>,
+    pub r#nullable_iface_array: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>,
+  }
+  impl Default for r#MyParcelable {
+    fn default() -> Self {
+      Self {
+        r#iface: Default::default(),
+        r#nullable_iface: Default::default(),
+        r#iface_array: Default::default(),
+        r#nullable_iface_array: Default::default(),
+      }
+    }
+  }
+  impl binder::Parcelable for r#MyParcelable {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        let __field_ref = self.r#iface.as_ref().ok_or(binder::StatusCode::UNEXPECTED_NULL)?;
+        subparcel.write(__field_ref)?;
+        subparcel.write(&self.r#nullable_iface)?;
+        subparcel.write(&self.r#iface_array)?;
+        subparcel.write(&self.r#nullable_iface_array)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#iface = Some(subparcel.read()?);
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_iface = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#iface_array = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_iface_array = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyParcelable);
+  binder::impl_deserialize_for_parcelable!(r#MyParcelable);
+  impl binder::binder_impl::ParcelableMetadata for r#MyParcelable {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.ArrayOfInterfaces.MyParcelable" }
+  }
+}
+pub mod r#MyUnion {
+  #[derive(Debug)]
+  pub enum r#MyUnion {
+    Iface(Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>),
+    Nullable_iface(Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>),
+    Iface_array(Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>),
+    Nullable_iface_array(Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>),
+  }
+  impl Default for r#MyUnion {
+    fn default() -> Self {
+      Self::Iface(Default::default())
+    }
+  }
+  impl binder::Parcelable for r#MyUnion {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      match self {
+        Self::Iface(v) => {
+          parcel.write(&0i32)?;
+          let __field_ref = v.as_ref().ok_or(binder::StatusCode::UNEXPECTED_NULL)?;
+          parcel.write(__field_ref)
+        }
+        Self::Nullable_iface(v) => {
+          parcel.write(&1i32)?;
+          parcel.write(v)
+        }
+        Self::Iface_array(v) => {
+          parcel.write(&2i32)?;
+          parcel.write(v)
+        }
+        Self::Nullable_iface_array(v) => {
+          parcel.write(&3i32)?;
+          parcel.write(v)
+        }
+      }
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      let tag: i32 = parcel.read()?;
+      match tag {
+        0 => {
+          let value: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>> = Some(parcel.read()?);
+          *self = Self::Iface(value);
+          Ok(())
+        }
+        1 => {
+          let value: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>> = parcel.read()?;
+          *self = Self::Nullable_iface(value);
+          Ok(())
+        }
+        2 => {
+          let value: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>> = parcel.read()?;
+          *self = Self::Iface_array(value);
+          Ok(())
+        }
+        3 => {
+          let value: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>> = parcel.read()?;
+          *self = Self::Nullable_iface_array(value);
+          Ok(())
+        }
+        _ => {
+          Err(binder::StatusCode::BAD_VALUE)
+        }
+      }
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyUnion);
+  binder::impl_deserialize_for_parcelable!(r#MyUnion);
+  impl binder::binder_impl::ParcelableMetadata for r#MyUnion {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.ArrayOfInterfaces.MyUnion" }
+  }
+  pub mod r#Tag {
+    #![allow(non_upper_case_globals)]
+    use binder::declare_binder_enum;
+    declare_binder_enum! {
+      r#Tag : [i32; 4] {
+        r#iface = 0,
+        r#nullable_iface = 1,
+        r#iface_array = 2,
+        r#nullable_iface_array = 3,
+      }
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ArrayOfInterfaces as _7_android_4_aidl_5_tests_17_ArrayOfInterfaces;
+ pub use super::r#IEmptyInterface::r#IEmptyInterface as _7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface;
+ pub use super::r#IMyInterface::r#IMyInterface as _7_android_4_aidl_5_tests_17_ArrayOfInterfaces_12_IMyInterface;
+ pub use super::r#MyParcelable::r#MyParcelable as _7_android_4_aidl_5_tests_17_ArrayOfInterfaces_12_MyParcelable;
+ pub use super::r#MyUnion::r#MyUnion as _7_android_4_aidl_5_tests_17_ArrayOfInterfaces_7_MyUnion;
+ pub use super::r#MyUnion::r#Tag::r#Tag as _7_android_4_aidl_5_tests_17_ArrayOfInterfaces_7_MyUnion_3_Tag;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs.d
new file mode 100644
index 0000000..23e7dc5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs : \
+  system/tools/aidl/tests/android/aidl/tests/ArrayOfInterfaces.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/BackendType.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/BackendType.rs
new file mode 100644
index 0000000..3433438
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/BackendType.rs
@@ -0,0 +1,19 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/BackendType.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+use binder::declare_binder_enum;
+declare_binder_enum! {
+  r#BackendType : [i8; 4] {
+    r#CPP = 0,
+    r#JAVA = 1,
+    r#NDK = 2,
+    r#RUST = 3,
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#BackendType as _7_android_4_aidl_5_tests_11_BackendType;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/BackendType.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/BackendType.rs.d
new file mode 100644
index 0000000..065463e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/BackendType.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/BackendType.rs : \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ByteEnum.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ByteEnum.rs
new file mode 100644
index 0000000..ac8d1a6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ByteEnum.rs
@@ -0,0 +1,18 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ByteEnum.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+use binder::declare_binder_enum;
+declare_binder_enum! {
+  r#ByteEnum : [i8; 3] {
+    r#FOO = 1,
+    r#BAR = 2,
+    r#BAZ = 3,
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ByteEnum as _7_android_4_aidl_5_tests_8_ByteEnum;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ByteEnum.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ByteEnum.rs.d
new file mode 100644
index 0000000..f91b6e9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ByteEnum.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ByteEnum.rs : \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/CircularParcelable.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/CircularParcelable.rs
new file mode 100644
index 0000000..d5d9097
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/CircularParcelable.rs
@@ -0,0 +1,41 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/CircularParcelable.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#CircularParcelable {
+  pub r#testService: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>,
+}
+impl Default for r#CircularParcelable {
+  fn default() -> Self {
+    Self {
+      r#testService: Default::default(),
+    }
+  }
+}
+impl binder::Parcelable for r#CircularParcelable {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#testService)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#testService = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#CircularParcelable);
+binder::impl_deserialize_for_parcelable!(r#CircularParcelable);
+impl binder::binder_impl::ParcelableMetadata for r#CircularParcelable {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.CircularParcelable" }
+}
+pub(crate) mod mangled {
+ pub use super::r#CircularParcelable as _7_android_4_aidl_5_tests_18_CircularParcelable;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/CircularParcelable.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/CircularParcelable.rs.d
new file mode 100644
index 0000000..f031808
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/CircularParcelable.rs.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/CircularParcelable.rs : \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ConstantExpressionEnum.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ConstantExpressionEnum.rs
new file mode 100644
index 0000000..16e136c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ConstantExpressionEnum.rs
@@ -0,0 +1,25 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ConstantExpressionEnum.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+use binder::declare_binder_enum;
+declare_binder_enum! {
+  r#ConstantExpressionEnum : [i32; 10] {
+    r#decInt32_1 = 1,
+    r#decInt32_2 = 1,
+    r#decInt64_1 = 1,
+    r#decInt64_2 = 1,
+    r#decInt64_3 = 1,
+    r#decInt64_4 = 1,
+    r#hexInt32_1 = 1,
+    r#hexInt32_2 = 1,
+    r#hexInt32_3 = 1,
+    r#hexInt64_1 = 1,
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ConstantExpressionEnum as _7_android_4_aidl_5_tests_22_ConstantExpressionEnum;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ConstantExpressionEnum.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ConstantExpressionEnum.rs.d
new file mode 100644
index 0000000..bd22319
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ConstantExpressionEnum.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ConstantExpressionEnum.rs : \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs
new file mode 100644
index 0000000..e8ac957
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs
@@ -0,0 +1,19 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+use binder::declare_binder_enum;
+declare_binder_enum! {
+  #[deprecated = "test"]
+  r#DeprecatedEnum : [i32; 3] {
+    r#A = 0,
+    r#B = 1,
+    r#C = 2,
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#DeprecatedEnum as _7_android_4_aidl_5_tests_14_DeprecatedEnum;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs.d
new file mode 100644
index 0000000..388f093
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs
new file mode 100644
index 0000000..41cc591
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs
@@ -0,0 +1,36 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+#[deprecated = "test"]
+pub struct r#DeprecatedParcelable {
+}
+impl Default for r#DeprecatedParcelable {
+  fn default() -> Self {
+    Self {
+    }
+  }
+}
+impl binder::Parcelable for r#DeprecatedParcelable {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#DeprecatedParcelable);
+binder::impl_deserialize_for_parcelable!(r#DeprecatedParcelable);
+impl binder::binder_impl::ParcelableMetadata for r#DeprecatedParcelable {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.DeprecatedParcelable" }
+}
+pub(crate) mod mangled {
+ pub use super::r#DeprecatedParcelable as _7_android_4_aidl_5_tests_20_DeprecatedParcelable;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs.d
new file mode 100644
index 0000000..a257852
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs : \
+  system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/FixedSize.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/FixedSize.rs
new file mode 100644
index 0000000..5fbba28
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/FixedSize.rs
@@ -0,0 +1,245 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/FixedSize.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#FixedSize {
+}
+impl Default for r#FixedSize {
+  fn default() -> Self {
+    Self {
+    }
+  }
+}
+impl binder::Parcelable for r#FixedSize {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#FixedSize);
+binder::impl_deserialize_for_parcelable!(r#FixedSize);
+impl binder::binder_impl::ParcelableMetadata for r#FixedSize {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.FixedSize" }
+}
+pub mod r#FixedParcelable {
+  #[derive(Debug)]
+  pub struct r#FixedParcelable {
+    pub r#booleanValue: bool,
+    pub r#byteValue: i8,
+    pub r#charValue: u16,
+    pub r#intValue: i32,
+    pub r#longValue: i64,
+    pub r#floatValue: f32,
+    pub r#doubleValue: f64,
+    pub r#enumValue: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum,
+    pub r#parcelableValue: crate::mangled::_7_android_4_aidl_5_tests_9_FixedSize_10_FixedUnion,
+  }
+  impl Default for r#FixedParcelable {
+    fn default() -> Self {
+      Self {
+        r#booleanValue: false,
+        r#byteValue: 0,
+        r#charValue: '\0' as u16,
+        r#intValue: 0,
+        r#longValue: 0,
+        r#floatValue: 0.000000f32,
+        r#doubleValue: 0.000000f64,
+        r#enumValue: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum::FOO,
+        r#parcelableValue: Default::default(),
+      }
+    }
+  }
+  impl binder::Parcelable for r#FixedParcelable {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        subparcel.write(&self.r#booleanValue)?;
+        subparcel.write(&self.r#byteValue)?;
+        subparcel.write(&self.r#charValue)?;
+        subparcel.write(&self.r#intValue)?;
+        subparcel.write(&self.r#longValue)?;
+        subparcel.write(&self.r#floatValue)?;
+        subparcel.write(&self.r#doubleValue)?;
+        subparcel.write(&self.r#enumValue)?;
+        subparcel.write(&self.r#parcelableValue)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#booleanValue = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#byteValue = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#charValue = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#intValue = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#longValue = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#floatValue = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#doubleValue = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#enumValue = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#parcelableValue = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#FixedParcelable);
+  binder::impl_deserialize_for_parcelable!(r#FixedParcelable);
+  impl binder::binder_impl::ParcelableMetadata for r#FixedParcelable {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.FixedSize.FixedParcelable" }
+  }
+}
+pub mod r#FixedUnion {
+  #[derive(Debug)]
+  pub enum r#FixedUnion {
+    BooleanValue(bool),
+    ByteValue(i8),
+    CharValue(u16),
+    IntValue(i32),
+    LongValue(i64),
+    FloatValue(f32),
+    DoubleValue(f64),
+    EnumValue(crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum),
+  }
+  impl Default for r#FixedUnion {
+    fn default() -> Self {
+      Self::BooleanValue(false)
+    }
+  }
+  impl binder::Parcelable for r#FixedUnion {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      match self {
+        Self::BooleanValue(v) => {
+          parcel.write(&0i32)?;
+          parcel.write(v)
+        }
+        Self::ByteValue(v) => {
+          parcel.write(&1i32)?;
+          parcel.write(v)
+        }
+        Self::CharValue(v) => {
+          parcel.write(&2i32)?;
+          parcel.write(v)
+        }
+        Self::IntValue(v) => {
+          parcel.write(&3i32)?;
+          parcel.write(v)
+        }
+        Self::LongValue(v) => {
+          parcel.write(&4i32)?;
+          parcel.write(v)
+        }
+        Self::FloatValue(v) => {
+          parcel.write(&5i32)?;
+          parcel.write(v)
+        }
+        Self::DoubleValue(v) => {
+          parcel.write(&6i32)?;
+          parcel.write(v)
+        }
+        Self::EnumValue(v) => {
+          parcel.write(&7i32)?;
+          parcel.write(v)
+        }
+      }
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      let tag: i32 = parcel.read()?;
+      match tag {
+        0 => {
+          let value: bool = parcel.read()?;
+          *self = Self::BooleanValue(value);
+          Ok(())
+        }
+        1 => {
+          let value: i8 = parcel.read()?;
+          *self = Self::ByteValue(value);
+          Ok(())
+        }
+        2 => {
+          let value: u16 = parcel.read()?;
+          *self = Self::CharValue(value);
+          Ok(())
+        }
+        3 => {
+          let value: i32 = parcel.read()?;
+          *self = Self::IntValue(value);
+          Ok(())
+        }
+        4 => {
+          let value: i64 = parcel.read()?;
+          *self = Self::LongValue(value);
+          Ok(())
+        }
+        5 => {
+          let value: f32 = parcel.read()?;
+          *self = Self::FloatValue(value);
+          Ok(())
+        }
+        6 => {
+          let value: f64 = parcel.read()?;
+          *self = Self::DoubleValue(value);
+          Ok(())
+        }
+        7 => {
+          let value: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum = parcel.read()?;
+          *self = Self::EnumValue(value);
+          Ok(())
+        }
+        _ => {
+          Err(binder::StatusCode::BAD_VALUE)
+        }
+      }
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#FixedUnion);
+  binder::impl_deserialize_for_parcelable!(r#FixedUnion);
+  impl binder::binder_impl::ParcelableMetadata for r#FixedUnion {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.FixedSize.FixedUnion" }
+  }
+  pub mod r#Tag {
+    #![allow(non_upper_case_globals)]
+    use binder::declare_binder_enum;
+    declare_binder_enum! {
+      r#Tag : [i8; 8] {
+        r#booleanValue = 0,
+        r#byteValue = 1,
+        r#charValue = 2,
+        r#intValue = 3,
+        r#longValue = 4,
+        r#floatValue = 5,
+        r#doubleValue = 6,
+        r#enumValue = 7,
+      }
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#FixedSize as _7_android_4_aidl_5_tests_9_FixedSize;
+ pub use super::r#FixedParcelable::r#FixedParcelable as _7_android_4_aidl_5_tests_9_FixedSize_15_FixedParcelable;
+ pub use super::r#FixedUnion::r#FixedUnion as _7_android_4_aidl_5_tests_9_FixedSize_10_FixedUnion;
+ pub use super::r#FixedUnion::r#Tag::r#Tag as _7_android_4_aidl_5_tests_9_FixedSize_10_FixedUnion_3_Tag;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/FixedSize.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/FixedSize.rs.d
new file mode 100644
index 0000000..0635f5e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/FixedSize.rs.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/FixedSize.rs : \
+  system/tools/aidl/tests/android/aidl/tests/FixedSize.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/GenericStructuredParcelable.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/GenericStructuredParcelable.rs
new file mode 100644
index 0000000..17aa9d5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/GenericStructuredParcelable.rs
@@ -0,0 +1,53 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/GenericStructuredParcelable.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug, Clone, Copy, Eq, PartialEq)]
+pub struct r#GenericStructuredParcelable<T,U,B,> {
+  pub r#a: i32,
+  pub r#b: i32,
+  _phantom_B: std::marker::PhantomData<B>,
+  _phantom_T: std::marker::PhantomData<T>,
+  _phantom_U: std::marker::PhantomData<U>,
+}
+impl<T: Default,U: Default,B: Default,> Default for r#GenericStructuredParcelable<T,U,B,> {
+  fn default() -> Self {
+    Self {
+      r#a: 0,
+      r#b: 0,
+      r#_phantom_B: Default::default(),
+      r#_phantom_T: Default::default(),
+      r#_phantom_U: Default::default(),
+    }
+  }
+}
+impl<T,U,B,> binder::Parcelable for r#GenericStructuredParcelable<T,U,B,> {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#a)?;
+      subparcel.write(&self.r#b)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#a = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#b = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#GenericStructuredParcelable<T,U,B,>);
+binder::impl_deserialize_for_parcelable!(r#GenericStructuredParcelable<T,U,B,>);
+impl<T,U,B,> binder::binder_impl::ParcelableMetadata for r#GenericStructuredParcelable<T,U,B,> {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.GenericStructuredParcelable" }
+}
+pub(crate) mod mangled {
+ pub use super::r#GenericStructuredParcelable as _7_android_4_aidl_5_tests_27_GenericStructuredParcelable;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/GenericStructuredParcelable.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/GenericStructuredParcelable.rs.d
new file mode 100644
index 0000000..01507cd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/GenericStructuredParcelable.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/GenericStructuredParcelable.rs : \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs
new file mode 100644
index 0000000..22bdb92
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs
@@ -0,0 +1,140 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ICircular.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  ICircular["android.aidl.tests.ICircular"] {
+    native: BnCircular(on_transact),
+    proxy: BpCircular {
+    },
+    async: ICircularAsync,
+  }
+}
+pub trait ICircular: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ICircular" }
+  fn r#GetTestService(&self) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>>;
+  fn getDefaultImpl() -> ICircularDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: ICircularDefaultRef) -> ICircularDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait ICircularAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ICircular" }
+  fn r#GetTestService<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>>>;
+}
+#[::async_trait::async_trait]
+pub trait ICircularAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ICircular" }
+  async fn r#GetTestService(&self) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>>;
+}
+impl BnCircular {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn ICircular>
+  where
+    T: ICircularAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> ICircular for Wrapper<T, R>
+    where
+      T: ICircularAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#GetTestService(&self) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>> {
+        self._rt.block_on(self._inner.r#GetTestService())
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait ICircularDefault: Send + Sync {
+  fn r#GetTestService(&self) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#GetTestService: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+}
+pub type ICircularDefaultRef = Option<std::sync::Arc<dyn ICircularDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<ICircularDefaultRef> = std::sync::Mutex::new(None);
+}
+impl BpCircular {
+  fn build_parcel_GetTestService(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_GetTestService(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ICircular>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetTestService();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+}
+impl ICircular for BpCircular {
+  fn r#GetTestService(&self) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>> {
+    let _aidl_data = self.build_parcel_GetTestService()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetTestService, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetTestService(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> ICircularAsync<P> for BpCircular {
+  fn r#GetTestService<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>>> {
+    let _aidl_data = match self.build_parcel_GetTestService() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetTestService, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetTestService(_aidl_reply)
+      }
+    )
+  }
+}
+impl ICircular for binder::binder_impl::Binder<BnCircular> {
+  fn r#GetTestService(&self) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_12_ITestService>>> { self.0.r#GetTestService() }
+}
+fn on_transact(_aidl_service: &dyn ICircular, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#GetTestService => {
+      let _aidl_return = _aidl_service.r#GetTestService();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ICircular as _7_android_4_aidl_5_tests_9_ICircular;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs.d
new file mode 100644
index 0000000..2237337
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs : \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs
new file mode 100644
index 0000000..cd9528a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs
@@ -0,0 +1,87 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  IDeprecated["android.aidl.tests.IDeprecated"] {
+    native: BnDeprecated(on_transact),
+    proxy: BpDeprecated {
+    },
+    async: IDeprecatedAsync,
+  }
+}
+#[deprecated = "test"]
+pub trait IDeprecated: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IDeprecated" }
+  fn getDefaultImpl() -> IDeprecatedDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: IDeprecatedDefaultRef) -> IDeprecatedDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+#[deprecated = "test"]
+pub trait IDeprecatedAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IDeprecated" }
+}
+#[deprecated = "test"]
+#[::async_trait::async_trait]
+pub trait IDeprecatedAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IDeprecated" }
+}
+impl BnDeprecated {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IDeprecated>
+  where
+    T: IDeprecatedAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> IDeprecated for Wrapper<T, R>
+    where
+      T: IDeprecatedAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait IDeprecatedDefault: Send + Sync {
+}
+pub mod transactions {
+}
+pub type IDeprecatedDefaultRef = Option<std::sync::Arc<dyn IDeprecatedDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<IDeprecatedDefaultRef> = std::sync::Mutex::new(None);
+}
+impl BpDeprecated {
+}
+impl IDeprecated for BpDeprecated {
+}
+impl<P: binder::BinderAsyncPool> IDeprecatedAsync<P> for BpDeprecated {
+}
+impl IDeprecated for binder::binder_impl::Binder<BnDeprecated> {
+}
+fn on_transact(_aidl_service: &dyn IDeprecated, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#IDeprecated as _7_android_4_aidl_5_tests_11_IDeprecated;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs.d
new file mode 100644
index 0000000..dc96618
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs : \
+  system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs
new file mode 100644
index 0000000..026d893
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs
@@ -0,0 +1,140 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  INamedCallback["android.aidl.tests.INamedCallback"] {
+    native: BnNamedCallback(on_transact),
+    proxy: BpNamedCallback {
+    },
+    async: INamedCallbackAsync,
+  }
+}
+pub trait INamedCallback: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.INamedCallback" }
+  fn r#GetName(&self) -> binder::Result<String>;
+  fn getDefaultImpl() -> INamedCallbackDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: INamedCallbackDefaultRef) -> INamedCallbackDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait INamedCallbackAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.INamedCallback" }
+  fn r#GetName<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>>;
+}
+#[::async_trait::async_trait]
+pub trait INamedCallbackAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.INamedCallback" }
+  async fn r#GetName(&self) -> binder::Result<String>;
+}
+impl BnNamedCallback {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn INamedCallback>
+  where
+    T: INamedCallbackAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> INamedCallback for Wrapper<T, R>
+    where
+      T: INamedCallbackAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#GetName(&self) -> binder::Result<String> {
+        self._rt.block_on(self._inner.r#GetName())
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait INamedCallbackDefault: Send + Sync {
+  fn r#GetName(&self) -> binder::Result<String> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#GetName: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+}
+pub type INamedCallbackDefaultRef = Option<std::sync::Arc<dyn INamedCallbackDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<INamedCallbackDefaultRef> = std::sync::Mutex::new(None);
+}
+impl BpNamedCallback {
+  fn build_parcel_GetName(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_GetName(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as INamedCallback>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetName();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+}
+impl INamedCallback for BpNamedCallback {
+  fn r#GetName(&self) -> binder::Result<String> {
+    let _aidl_data = self.build_parcel_GetName()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetName, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetName(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> INamedCallbackAsync<P> for BpNamedCallback {
+  fn r#GetName<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    let _aidl_data = match self.build_parcel_GetName() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetName, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetName(_aidl_reply)
+      }
+    )
+  }
+}
+impl INamedCallback for binder::binder_impl::Binder<BnNamedCallback> {
+  fn r#GetName(&self) -> binder::Result<String> { self.0.r#GetName() }
+}
+fn on_transact(_aidl_service: &dyn INamedCallback, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#GetName => {
+      let _aidl_return = _aidl_service.r#GetName();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#INamedCallback as _7_android_4_aidl_5_tests_14_INamedCallback;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs.d
new file mode 100644
index 0000000..eea0b4d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs : \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs
new file mode 100644
index 0000000..64d6a35
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs
@@ -0,0 +1,140 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/INewName.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  INewName["android.aidl.tests.IOldName"] {
+    native: BnNewName(on_transact),
+    proxy: BpNewName {
+    },
+    async: INewNameAsync,
+  }
+}
+pub trait INewName: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IOldName" }
+  fn r#RealName(&self) -> binder::Result<String>;
+  fn getDefaultImpl() -> INewNameDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: INewNameDefaultRef) -> INewNameDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait INewNameAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IOldName" }
+  fn r#RealName<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>>;
+}
+#[::async_trait::async_trait]
+pub trait INewNameAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IOldName" }
+  async fn r#RealName(&self) -> binder::Result<String>;
+}
+impl BnNewName {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn INewName>
+  where
+    T: INewNameAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> INewName for Wrapper<T, R>
+    where
+      T: INewNameAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#RealName(&self) -> binder::Result<String> {
+        self._rt.block_on(self._inner.r#RealName())
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait INewNameDefault: Send + Sync {
+  fn r#RealName(&self) -> binder::Result<String> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#RealName: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+}
+pub type INewNameDefaultRef = Option<std::sync::Arc<dyn INewNameDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<INewNameDefaultRef> = std::sync::Mutex::new(None);
+}
+impl BpNewName {
+  fn build_parcel_RealName(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_RealName(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as INewName>::getDefaultImpl() {
+        return _aidl_default_impl.r#RealName();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+}
+impl INewName for BpNewName {
+  fn r#RealName(&self) -> binder::Result<String> {
+    let _aidl_data = self.build_parcel_RealName()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RealName, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RealName(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> INewNameAsync<P> for BpNewName {
+  fn r#RealName<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    let _aidl_data = match self.build_parcel_RealName() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RealName, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RealName(_aidl_reply)
+      }
+    )
+  }
+}
+impl INewName for binder::binder_impl::Binder<BnNewName> {
+  fn r#RealName(&self) -> binder::Result<String> { self.0.r#RealName() }
+}
+fn on_transact(_aidl_service: &dyn INewName, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#RealName => {
+      let _aidl_return = _aidl_service.r#RealName();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#INewName as _7_android_4_aidl_5_tests_8_INewName;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs.d
new file mode 100644
index 0000000..978238f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs : \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs
new file mode 100644
index 0000000..7fac9c3
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs
@@ -0,0 +1,140 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  IOldName["android.aidl.tests.IOldName"] {
+    native: BnOldName(on_transact),
+    proxy: BpOldName {
+    },
+    async: IOldNameAsync,
+  }
+}
+pub trait IOldName: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IOldName" }
+  fn r#RealName(&self) -> binder::Result<String>;
+  fn getDefaultImpl() -> IOldNameDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: IOldNameDefaultRef) -> IOldNameDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait IOldNameAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IOldName" }
+  fn r#RealName<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>>;
+}
+#[::async_trait::async_trait]
+pub trait IOldNameAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IOldName" }
+  async fn r#RealName(&self) -> binder::Result<String>;
+}
+impl BnOldName {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IOldName>
+  where
+    T: IOldNameAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> IOldName for Wrapper<T, R>
+    where
+      T: IOldNameAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#RealName(&self) -> binder::Result<String> {
+        self._rt.block_on(self._inner.r#RealName())
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait IOldNameDefault: Send + Sync {
+  fn r#RealName(&self) -> binder::Result<String> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#RealName: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+}
+pub type IOldNameDefaultRef = Option<std::sync::Arc<dyn IOldNameDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<IOldNameDefaultRef> = std::sync::Mutex::new(None);
+}
+impl BpOldName {
+  fn build_parcel_RealName(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_RealName(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IOldName>::getDefaultImpl() {
+        return _aidl_default_impl.r#RealName();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+}
+impl IOldName for BpOldName {
+  fn r#RealName(&self) -> binder::Result<String> {
+    let _aidl_data = self.build_parcel_RealName()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RealName, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RealName(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> IOldNameAsync<P> for BpOldName {
+  fn r#RealName<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    let _aidl_data = match self.build_parcel_RealName() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RealName, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RealName(_aidl_reply)
+      }
+    )
+  }
+}
+impl IOldName for binder::binder_impl::Binder<BnOldName> {
+  fn r#RealName(&self) -> binder::Result<String> { self.0.r#RealName() }
+}
+fn on_transact(_aidl_service: &dyn IOldName, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#RealName => {
+      let _aidl_return = _aidl_service.r#RealName();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#IOldName as _7_android_4_aidl_5_tests_8_IOldName;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs.d
new file mode 100644
index 0000000..77773e8
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs : \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs
new file mode 100644
index 0000000..1f5d18d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs
@@ -0,0 +1,4885 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ITestService.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  ITestService["android.aidl.tests.ITestService"] {
+    native: BnTestService(on_transact),
+    proxy: BpTestService {
+    },
+    async: ITestServiceAsync,
+  }
+}
+pub trait ITestService: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService" }
+  fn r#UnimplementedMethod(&self, _arg_arg: i32) -> binder::Result<i32>;
+  #[deprecated = "to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"]
+  fn r#Deprecated(&self) -> binder::Result<()>;
+  fn r#TestOneway(&self) -> binder::Result<()>;
+  fn r#RepeatBoolean(&self, _arg_token: bool) -> binder::Result<bool>;
+  fn r#RepeatByte(&self, _arg_token: i8) -> binder::Result<i8>;
+  fn r#RepeatChar(&self, _arg_token: u16) -> binder::Result<u16>;
+  fn r#RepeatInt(&self, _arg_token: i32) -> binder::Result<i32>;
+  fn r#RepeatLong(&self, _arg_token: i64) -> binder::Result<i64>;
+  fn r#RepeatFloat(&self, _arg_token: f32) -> binder::Result<f32>;
+  fn r#RepeatDouble(&self, _arg_token: f64) -> binder::Result<f64>;
+  fn r#RepeatString(&self, _arg_token: &str) -> binder::Result<String>;
+  fn r#RepeatByteEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>;
+  fn r#RepeatIntEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>;
+  fn r#RepeatLongEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>;
+  fn r#ReverseBoolean(&self, _arg_input: &[bool], _arg_repeated: &mut Vec<bool>) -> binder::Result<Vec<bool>>;
+  fn r#ReverseByte(&self, _arg_input: &[u8], _arg_repeated: &mut Vec<u8>) -> binder::Result<Vec<u8>>;
+  fn r#ReverseChar(&self, _arg_input: &[u16], _arg_repeated: &mut Vec<u16>) -> binder::Result<Vec<u16>>;
+  fn r#ReverseInt(&self, _arg_input: &[i32], _arg_repeated: &mut Vec<i32>) -> binder::Result<Vec<i32>>;
+  fn r#ReverseLong(&self, _arg_input: &[i64], _arg_repeated: &mut Vec<i64>) -> binder::Result<Vec<i64>>;
+  fn r#ReverseFloat(&self, _arg_input: &[f32], _arg_repeated: &mut Vec<f32>) -> binder::Result<Vec<f32>>;
+  fn r#ReverseDouble(&self, _arg_input: &[f64], _arg_repeated: &mut Vec<f64>) -> binder::Result<Vec<f64>>;
+  fn r#ReverseString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>>;
+  fn r#ReverseByteEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>;
+  fn r#ReverseIntEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>;
+  fn r#ReverseLongEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>;
+  fn r#GetOtherTestService(&self, _arg_name: &str) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>;
+  fn r#SetOtherTestService(&self, _arg_name: &str, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::Result<bool>;
+  fn r#VerifyName(&self, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &str) -> binder::Result<bool>;
+  fn r#GetInterfaceArray(&self, _arg_names: &[String]) -> binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>;
+  fn r#VerifyNamesWithInterfaceArray(&self, _arg_services: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &[String]) -> binder::Result<bool>;
+  fn r#GetNullableInterfaceArray(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>>;
+  fn r#VerifyNamesWithNullableInterfaceArray(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool>;
+  fn r#GetInterfaceList(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>>;
+  fn r#VerifyNamesWithInterfaceList(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool>;
+  fn r#ReverseStringList(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>>;
+  fn r#RepeatParcelFileDescriptor(&self, _arg_read: &binder::ParcelFileDescriptor) -> binder::Result<binder::ParcelFileDescriptor>;
+  fn r#ReverseParcelFileDescriptorArray(&self, _arg_input: &[binder::ParcelFileDescriptor], _arg_repeated: &mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::Result<Vec<binder::ParcelFileDescriptor>>;
+  fn r#ThrowServiceException(&self, _arg_code: i32) -> binder::Result<()>;
+  fn r#RepeatNullableIntArray(&self, _arg_input: Option<&[i32]>) -> binder::Result<Option<Vec<i32>>>;
+  fn r#RepeatNullableByteEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>>;
+  fn r#RepeatNullableIntEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>>;
+  fn r#RepeatNullableLongEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>>;
+  fn r#RepeatNullableString(&self, _arg_input: Option<&str>) -> binder::Result<Option<String>>;
+  fn r#RepeatNullableStringList(&self, _arg_input: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<String>>>>;
+  fn r#RepeatNullableParcelable(&self, _arg_input: Option<&crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>;
+  fn r#RepeatNullableParcelableArray(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>>;
+  fn r#RepeatNullableParcelableList(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>>;
+  fn r#TakesAnIBinder(&self, _arg_input: &binder::SpIBinder) -> binder::Result<()>;
+  fn r#TakesANullableIBinder(&self, _arg_input: Option<&binder::SpIBinder>) -> binder::Result<()>;
+  fn r#TakesAnIBinderList(&self, _arg_input: &[binder::SpIBinder]) -> binder::Result<()>;
+  fn r#TakesANullableIBinderList(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>) -> binder::Result<()>;
+  fn r#RepeatUtf8CppString(&self, _arg_token: &str) -> binder::Result<String>;
+  fn r#RepeatNullableUtf8CppString(&self, _arg_token: Option<&str>) -> binder::Result<Option<String>>;
+  fn r#ReverseUtf8CppString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>>;
+  fn r#ReverseNullableUtf8CppString(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>>;
+  fn r#ReverseUtf8CppStringList(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>>;
+  fn r#GetCallback(&self, _arg_return_null: bool) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>;
+  fn r#FillOutStructuredParcelable(&self, _arg_parcel: &mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::Result<()>;
+  fn r#RepeatExtendableParcelable(&self, _arg_ep: &crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::Result<()>;
+  fn r#ReverseList(&self, _arg_list: &crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList>;
+  fn r#ReverseIBinderArray(&self, _arg_input: &[binder::SpIBinder], _arg_repeated: &mut Vec<Option<binder::SpIBinder>>) -> binder::Result<Vec<binder::SpIBinder>>;
+  fn r#ReverseNullableIBinderArray(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _arg_repeated: &mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::Result<Option<Vec<Option<binder::SpIBinder>>>>;
+  fn r#GetOldNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>>;
+  fn r#GetNewNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>>;
+  fn r#GetUnionTags(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>>;
+  fn r#GetCppJavaTests(&self) -> binder::Result<Option<binder::SpIBinder>>;
+  fn r#getBackendType(&self) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType>;
+  fn r#GetCircular(&self, _arg_cp: &mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>>;
+  fn getDefaultImpl() -> ITestServiceDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: ITestServiceDefaultRef) -> ITestServiceDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait ITestServiceAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService" }
+  fn r#UnimplementedMethod<'a>(&'a self, _arg_arg: i32) -> binder::BoxFuture<'a, binder::Result<i32>>;
+  #[deprecated = "to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"]
+  fn r#Deprecated<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#TestOneway(&self) -> std::future::Ready<binder::Result<()>>;
+  fn r#RepeatBoolean<'a>(&'a self, _arg_token: bool) -> binder::BoxFuture<'a, binder::Result<bool>>;
+  fn r#RepeatByte<'a>(&'a self, _arg_token: i8) -> binder::BoxFuture<'a, binder::Result<i8>>;
+  fn r#RepeatChar<'a>(&'a self, _arg_token: u16) -> binder::BoxFuture<'a, binder::Result<u16>>;
+  fn r#RepeatInt<'a>(&'a self, _arg_token: i32) -> binder::BoxFuture<'a, binder::Result<i32>>;
+  fn r#RepeatLong<'a>(&'a self, _arg_token: i64) -> binder::BoxFuture<'a, binder::Result<i64>>;
+  fn r#RepeatFloat<'a>(&'a self, _arg_token: f32) -> binder::BoxFuture<'a, binder::Result<f32>>;
+  fn r#RepeatDouble<'a>(&'a self, _arg_token: f64) -> binder::BoxFuture<'a, binder::Result<f64>>;
+  fn r#RepeatString<'a>(&'a self, _arg_token: &'a str) -> binder::BoxFuture<'a, binder::Result<String>>;
+  fn r#RepeatByteEnum<'a>(&'a self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>;
+  fn r#RepeatIntEnum<'a>(&'a self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>;
+  fn r#RepeatLongEnum<'a>(&'a self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>;
+  fn r#ReverseBoolean<'a>(&'a self, _arg_input: &'a [bool], _arg_repeated: &'a mut Vec<bool>) -> binder::BoxFuture<'a, binder::Result<Vec<bool>>>;
+  fn r#ReverseByte<'a>(&'a self, _arg_input: &'a [u8], _arg_repeated: &'a mut Vec<u8>) -> binder::BoxFuture<'a, binder::Result<Vec<u8>>>;
+  fn r#ReverseChar<'a>(&'a self, _arg_input: &'a [u16], _arg_repeated: &'a mut Vec<u16>) -> binder::BoxFuture<'a, binder::Result<Vec<u16>>>;
+  fn r#ReverseInt<'a>(&'a self, _arg_input: &'a [i32], _arg_repeated: &'a mut Vec<i32>) -> binder::BoxFuture<'a, binder::Result<Vec<i32>>>;
+  fn r#ReverseLong<'a>(&'a self, _arg_input: &'a [i64], _arg_repeated: &'a mut Vec<i64>) -> binder::BoxFuture<'a, binder::Result<Vec<i64>>>;
+  fn r#ReverseFloat<'a>(&'a self, _arg_input: &'a [f32], _arg_repeated: &'a mut Vec<f32>) -> binder::BoxFuture<'a, binder::Result<Vec<f32>>>;
+  fn r#ReverseDouble<'a>(&'a self, _arg_input: &'a [f64], _arg_repeated: &'a mut Vec<f64>) -> binder::BoxFuture<'a, binder::Result<Vec<f64>>>;
+  fn r#ReverseString<'a>(&'a self, _arg_input: &'a [String], _arg_repeated: &'a mut Vec<String>) -> binder::BoxFuture<'a, binder::Result<Vec<String>>>;
+  fn r#ReverseByteEnum<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &'a mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::BoxFuture<'a, binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>>;
+  fn r#ReverseIntEnum<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &'a mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::BoxFuture<'a, binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>>;
+  fn r#ReverseLongEnum<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &'a mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::BoxFuture<'a, binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>>;
+  fn r#GetOtherTestService<'a>(&'a self, _arg_name: &'a str) -> binder::BoxFuture<'a, binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>;
+  fn r#SetOtherTestService<'a>(&'a self, _arg_name: &'a str, _arg_service: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::BoxFuture<'a, binder::Result<bool>>;
+  fn r#VerifyName<'a>(&'a self, _arg_service: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &'a str) -> binder::BoxFuture<'a, binder::Result<bool>>;
+  fn r#GetInterfaceArray<'a>(&'a self, _arg_names: &'a [String]) -> binder::BoxFuture<'a, binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>;
+  fn r#VerifyNamesWithInterfaceArray<'a>(&'a self, _arg_services: &'a [binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &'a [String]) -> binder::BoxFuture<'a, binder::Result<bool>>;
+  fn r#GetNullableInterfaceArray<'a>(&'a self, _arg_names: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>>>;
+  fn r#VerifyNamesWithNullableInterfaceArray<'a>(&'a self, _arg_services: Option<&'a [Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<bool>>;
+  fn r#GetInterfaceList<'a>(&'a self, _arg_names: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>>>;
+  fn r#VerifyNamesWithInterfaceList<'a>(&'a self, _arg_services: Option<&'a [Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<bool>>;
+  fn r#ReverseStringList<'a>(&'a self, _arg_input: &'a [String], _arg_repeated: &'a mut Vec<String>) -> binder::BoxFuture<'a, binder::Result<Vec<String>>>;
+  fn r#RepeatParcelFileDescriptor<'a>(&'a self, _arg_read: &'a binder::ParcelFileDescriptor) -> binder::BoxFuture<'a, binder::Result<binder::ParcelFileDescriptor>>;
+  fn r#ReverseParcelFileDescriptorArray<'a>(&'a self, _arg_input: &'a [binder::ParcelFileDescriptor], _arg_repeated: &'a mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::BoxFuture<'a, binder::Result<Vec<binder::ParcelFileDescriptor>>>;
+  fn r#ThrowServiceException<'a>(&'a self, _arg_code: i32) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#RepeatNullableIntArray<'a>(&'a self, _arg_input: Option<&'a [i32]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<i32>>>>;
+  fn r#RepeatNullableByteEnumArray<'a>(&'a self, _arg_input: Option<&'a [crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>>>;
+  fn r#RepeatNullableIntEnumArray<'a>(&'a self, _arg_input: Option<&'a [crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>>>;
+  fn r#RepeatNullableLongEnumArray<'a>(&'a self, _arg_input: Option<&'a [crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>>>;
+  fn r#RepeatNullableString<'a>(&'a self, _arg_input: Option<&'a str>) -> binder::BoxFuture<'a, binder::Result<Option<String>>>;
+  fn r#RepeatNullableStringList<'a>(&'a self, _arg_input: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<String>>>>>;
+  fn r#RepeatNullableParcelable<'a>(&'a self, _arg_input: Option<&'a crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::BoxFuture<'a, binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>;
+  fn r#RepeatNullableParcelableArray<'a>(&'a self, _arg_input: Option<&'a [Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>>>;
+  fn r#RepeatNullableParcelableList<'a>(&'a self, _arg_input: Option<&'a [Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>>>;
+  fn r#TakesAnIBinder<'a>(&'a self, _arg_input: &'a binder::SpIBinder) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#TakesANullableIBinder<'a>(&'a self, _arg_input: Option<&'a binder::SpIBinder>) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#TakesAnIBinderList<'a>(&'a self, _arg_input: &'a [binder::SpIBinder]) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#TakesANullableIBinderList<'a>(&'a self, _arg_input: Option<&'a [Option<binder::SpIBinder>]>) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#RepeatUtf8CppString<'a>(&'a self, _arg_token: &'a str) -> binder::BoxFuture<'a, binder::Result<String>>;
+  fn r#RepeatNullableUtf8CppString<'a>(&'a self, _arg_token: Option<&'a str>) -> binder::BoxFuture<'a, binder::Result<Option<String>>>;
+  fn r#ReverseUtf8CppString<'a>(&'a self, _arg_input: &'a [String], _arg_repeated: &'a mut Vec<String>) -> binder::BoxFuture<'a, binder::Result<Vec<String>>>;
+  fn r#ReverseNullableUtf8CppString<'a>(&'a self, _arg_input: Option<&'a [Option<String>]>, _arg_repeated: &'a mut Option<Vec<Option<String>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<String>>>>>;
+  fn r#ReverseUtf8CppStringList<'a>(&'a self, _arg_input: Option<&'a [Option<String>]>, _arg_repeated: &'a mut Option<Vec<Option<String>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<String>>>>>;
+  fn r#GetCallback<'a>(&'a self, _arg_return_null: bool) -> binder::BoxFuture<'a, binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>;
+  fn r#FillOutStructuredParcelable<'a>(&'a self, _arg_parcel: &'a mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#RepeatExtendableParcelable<'a>(&'a self, _arg_ep: &'a crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &'a mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#ReverseList<'a>(&'a self, _arg_list: &'a crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList>>;
+  fn r#ReverseIBinderArray<'a>(&'a self, _arg_input: &'a [binder::SpIBinder], _arg_repeated: &'a mut Vec<Option<binder::SpIBinder>>) -> binder::BoxFuture<'a, binder::Result<Vec<binder::SpIBinder>>>;
+  fn r#ReverseNullableIBinderArray<'a>(&'a self, _arg_input: Option<&'a [Option<binder::SpIBinder>]>, _arg_repeated: &'a mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::SpIBinder>>>>>;
+  fn r#GetOldNameInterface<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>>>;
+  fn r#GetNewNameInterface<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>>>;
+  fn r#GetUnionTags<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::BoxFuture<'a, binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>>>;
+  fn r#GetCppJavaTests<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<Option<binder::SpIBinder>>>;
+  fn r#getBackendType<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType>>;
+  fn r#GetCircular<'a>(&'a self, _arg_cp: &'a mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::BoxFuture<'a, binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>>>;
+}
+#[::async_trait::async_trait]
+pub trait ITestServiceAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService" }
+  async fn r#UnimplementedMethod(&self, _arg_arg: i32) -> binder::Result<i32>;
+  #[deprecated = "to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"]
+  async fn r#Deprecated(&self) -> binder::Result<()>;
+  async fn r#TestOneway(&self) -> binder::Result<()>;
+  async fn r#RepeatBoolean(&self, _arg_token: bool) -> binder::Result<bool>;
+  async fn r#RepeatByte(&self, _arg_token: i8) -> binder::Result<i8>;
+  async fn r#RepeatChar(&self, _arg_token: u16) -> binder::Result<u16>;
+  async fn r#RepeatInt(&self, _arg_token: i32) -> binder::Result<i32>;
+  async fn r#RepeatLong(&self, _arg_token: i64) -> binder::Result<i64>;
+  async fn r#RepeatFloat(&self, _arg_token: f32) -> binder::Result<f32>;
+  async fn r#RepeatDouble(&self, _arg_token: f64) -> binder::Result<f64>;
+  async fn r#RepeatString(&self, _arg_token: &str) -> binder::Result<String>;
+  async fn r#RepeatByteEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>;
+  async fn r#RepeatIntEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>;
+  async fn r#RepeatLongEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>;
+  async fn r#ReverseBoolean(&self, _arg_input: &[bool], _arg_repeated: &mut Vec<bool>) -> binder::Result<Vec<bool>>;
+  async fn r#ReverseByte(&self, _arg_input: &[u8], _arg_repeated: &mut Vec<u8>) -> binder::Result<Vec<u8>>;
+  async fn r#ReverseChar(&self, _arg_input: &[u16], _arg_repeated: &mut Vec<u16>) -> binder::Result<Vec<u16>>;
+  async fn r#ReverseInt(&self, _arg_input: &[i32], _arg_repeated: &mut Vec<i32>) -> binder::Result<Vec<i32>>;
+  async fn r#ReverseLong(&self, _arg_input: &[i64], _arg_repeated: &mut Vec<i64>) -> binder::Result<Vec<i64>>;
+  async fn r#ReverseFloat(&self, _arg_input: &[f32], _arg_repeated: &mut Vec<f32>) -> binder::Result<Vec<f32>>;
+  async fn r#ReverseDouble(&self, _arg_input: &[f64], _arg_repeated: &mut Vec<f64>) -> binder::Result<Vec<f64>>;
+  async fn r#ReverseString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>>;
+  async fn r#ReverseByteEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>;
+  async fn r#ReverseIntEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>;
+  async fn r#ReverseLongEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>;
+  async fn r#GetOtherTestService(&self, _arg_name: &str) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>;
+  async fn r#SetOtherTestService(&self, _arg_name: &str, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::Result<bool>;
+  async fn r#VerifyName(&self, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &str) -> binder::Result<bool>;
+  async fn r#GetInterfaceArray(&self, _arg_names: &[String]) -> binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>;
+  async fn r#VerifyNamesWithInterfaceArray(&self, _arg_services: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &[String]) -> binder::Result<bool>;
+  async fn r#GetNullableInterfaceArray(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>>;
+  async fn r#VerifyNamesWithNullableInterfaceArray(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool>;
+  async fn r#GetInterfaceList(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>>;
+  async fn r#VerifyNamesWithInterfaceList(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool>;
+  async fn r#ReverseStringList(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>>;
+  async fn r#RepeatParcelFileDescriptor(&self, _arg_read: &binder::ParcelFileDescriptor) -> binder::Result<binder::ParcelFileDescriptor>;
+  async fn r#ReverseParcelFileDescriptorArray(&self, _arg_input: &[binder::ParcelFileDescriptor], _arg_repeated: &mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::Result<Vec<binder::ParcelFileDescriptor>>;
+  async fn r#ThrowServiceException(&self, _arg_code: i32) -> binder::Result<()>;
+  async fn r#RepeatNullableIntArray(&self, _arg_input: Option<&[i32]>) -> binder::Result<Option<Vec<i32>>>;
+  async fn r#RepeatNullableByteEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>>;
+  async fn r#RepeatNullableIntEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>>;
+  async fn r#RepeatNullableLongEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>>;
+  async fn r#RepeatNullableString(&self, _arg_input: Option<&str>) -> binder::Result<Option<String>>;
+  async fn r#RepeatNullableStringList(&self, _arg_input: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<String>>>>;
+  async fn r#RepeatNullableParcelable(&self, _arg_input: Option<&crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>;
+  async fn r#RepeatNullableParcelableArray(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>>;
+  async fn r#RepeatNullableParcelableList(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>>;
+  async fn r#TakesAnIBinder(&self, _arg_input: &binder::SpIBinder) -> binder::Result<()>;
+  async fn r#TakesANullableIBinder(&self, _arg_input: Option<&binder::SpIBinder>) -> binder::Result<()>;
+  async fn r#TakesAnIBinderList(&self, _arg_input: &[binder::SpIBinder]) -> binder::Result<()>;
+  async fn r#TakesANullableIBinderList(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>) -> binder::Result<()>;
+  async fn r#RepeatUtf8CppString(&self, _arg_token: &str) -> binder::Result<String>;
+  async fn r#RepeatNullableUtf8CppString(&self, _arg_token: Option<&str>) -> binder::Result<Option<String>>;
+  async fn r#ReverseUtf8CppString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>>;
+  async fn r#ReverseNullableUtf8CppString(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>>;
+  async fn r#ReverseUtf8CppStringList(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>>;
+  async fn r#GetCallback(&self, _arg_return_null: bool) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>;
+  async fn r#FillOutStructuredParcelable(&self, _arg_parcel: &mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::Result<()>;
+  async fn r#RepeatExtendableParcelable(&self, _arg_ep: &crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::Result<()>;
+  async fn r#ReverseList(&self, _arg_list: &crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList>;
+  async fn r#ReverseIBinderArray(&self, _arg_input: &[binder::SpIBinder], _arg_repeated: &mut Vec<Option<binder::SpIBinder>>) -> binder::Result<Vec<binder::SpIBinder>>;
+  async fn r#ReverseNullableIBinderArray(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _arg_repeated: &mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::Result<Option<Vec<Option<binder::SpIBinder>>>>;
+  async fn r#GetOldNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>>;
+  async fn r#GetNewNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>>;
+  async fn r#GetUnionTags(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>>;
+  async fn r#GetCppJavaTests(&self) -> binder::Result<Option<binder::SpIBinder>>;
+  async fn r#getBackendType(&self) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType>;
+  async fn r#GetCircular(&self, _arg_cp: &mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>>;
+}
+impl BnTestService {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn ITestService>
+  where
+    T: ITestServiceAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> ITestService for Wrapper<T, R>
+    where
+      T: ITestServiceAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#UnimplementedMethod(&self, _arg_arg: i32) -> binder::Result<i32> {
+        self._rt.block_on(self._inner.r#UnimplementedMethod(_arg_arg))
+      }
+      fn r#Deprecated(&self) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#Deprecated())
+      }
+      fn r#TestOneway(&self) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#TestOneway())
+      }
+      fn r#RepeatBoolean(&self, _arg_token: bool) -> binder::Result<bool> {
+        self._rt.block_on(self._inner.r#RepeatBoolean(_arg_token))
+      }
+      fn r#RepeatByte(&self, _arg_token: i8) -> binder::Result<i8> {
+        self._rt.block_on(self._inner.r#RepeatByte(_arg_token))
+      }
+      fn r#RepeatChar(&self, _arg_token: u16) -> binder::Result<u16> {
+        self._rt.block_on(self._inner.r#RepeatChar(_arg_token))
+      }
+      fn r#RepeatInt(&self, _arg_token: i32) -> binder::Result<i32> {
+        self._rt.block_on(self._inner.r#RepeatInt(_arg_token))
+      }
+      fn r#RepeatLong(&self, _arg_token: i64) -> binder::Result<i64> {
+        self._rt.block_on(self._inner.r#RepeatLong(_arg_token))
+      }
+      fn r#RepeatFloat(&self, _arg_token: f32) -> binder::Result<f32> {
+        self._rt.block_on(self._inner.r#RepeatFloat(_arg_token))
+      }
+      fn r#RepeatDouble(&self, _arg_token: f64) -> binder::Result<f64> {
+        self._rt.block_on(self._inner.r#RepeatDouble(_arg_token))
+      }
+      fn r#RepeatString(&self, _arg_token: &str) -> binder::Result<String> {
+        self._rt.block_on(self._inner.r#RepeatString(_arg_token))
+      }
+      fn r#RepeatByteEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum> {
+        self._rt.block_on(self._inner.r#RepeatByteEnum(_arg_token))
+      }
+      fn r#RepeatIntEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum> {
+        self._rt.block_on(self._inner.r#RepeatIntEnum(_arg_token))
+      }
+      fn r#RepeatLongEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum> {
+        self._rt.block_on(self._inner.r#RepeatLongEnum(_arg_token))
+      }
+      fn r#ReverseBoolean(&self, _arg_input: &[bool], _arg_repeated: &mut Vec<bool>) -> binder::Result<Vec<bool>> {
+        self._rt.block_on(self._inner.r#ReverseBoolean(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseByte(&self, _arg_input: &[u8], _arg_repeated: &mut Vec<u8>) -> binder::Result<Vec<u8>> {
+        self._rt.block_on(self._inner.r#ReverseByte(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseChar(&self, _arg_input: &[u16], _arg_repeated: &mut Vec<u16>) -> binder::Result<Vec<u16>> {
+        self._rt.block_on(self._inner.r#ReverseChar(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseInt(&self, _arg_input: &[i32], _arg_repeated: &mut Vec<i32>) -> binder::Result<Vec<i32>> {
+        self._rt.block_on(self._inner.r#ReverseInt(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseLong(&self, _arg_input: &[i64], _arg_repeated: &mut Vec<i64>) -> binder::Result<Vec<i64>> {
+        self._rt.block_on(self._inner.r#ReverseLong(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseFloat(&self, _arg_input: &[f32], _arg_repeated: &mut Vec<f32>) -> binder::Result<Vec<f32>> {
+        self._rt.block_on(self._inner.r#ReverseFloat(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseDouble(&self, _arg_input: &[f64], _arg_repeated: &mut Vec<f64>) -> binder::Result<Vec<f64>> {
+        self._rt.block_on(self._inner.r#ReverseDouble(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+        self._rt.block_on(self._inner.r#ReverseString(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseByteEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>> {
+        self._rt.block_on(self._inner.r#ReverseByteEnum(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseIntEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>> {
+        self._rt.block_on(self._inner.r#ReverseIntEnum(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseLongEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>> {
+        self._rt.block_on(self._inner.r#ReverseLongEnum(_arg_input, _arg_repeated))
+      }
+      fn r#GetOtherTestService(&self, _arg_name: &str) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>> {
+        self._rt.block_on(self._inner.r#GetOtherTestService(_arg_name))
+      }
+      fn r#SetOtherTestService(&self, _arg_name: &str, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::Result<bool> {
+        self._rt.block_on(self._inner.r#SetOtherTestService(_arg_name, _arg_service))
+      }
+      fn r#VerifyName(&self, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &str) -> binder::Result<bool> {
+        self._rt.block_on(self._inner.r#VerifyName(_arg_service, _arg_name))
+      }
+      fn r#GetInterfaceArray(&self, _arg_names: &[String]) -> binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+        self._rt.block_on(self._inner.r#GetInterfaceArray(_arg_names))
+      }
+      fn r#VerifyNamesWithInterfaceArray(&self, _arg_services: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &[String]) -> binder::Result<bool> {
+        self._rt.block_on(self._inner.r#VerifyNamesWithInterfaceArray(_arg_services, _arg_names))
+      }
+      fn r#GetNullableInterfaceArray(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> {
+        self._rt.block_on(self._inner.r#GetNullableInterfaceArray(_arg_names))
+      }
+      fn r#VerifyNamesWithNullableInterfaceArray(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool> {
+        self._rt.block_on(self._inner.r#VerifyNamesWithNullableInterfaceArray(_arg_services, _arg_names))
+      }
+      fn r#GetInterfaceList(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> {
+        self._rt.block_on(self._inner.r#GetInterfaceList(_arg_names))
+      }
+      fn r#VerifyNamesWithInterfaceList(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool> {
+        self._rt.block_on(self._inner.r#VerifyNamesWithInterfaceList(_arg_services, _arg_names))
+      }
+      fn r#ReverseStringList(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+        self._rt.block_on(self._inner.r#ReverseStringList(_arg_input, _arg_repeated))
+      }
+      fn r#RepeatParcelFileDescriptor(&self, _arg_read: &binder::ParcelFileDescriptor) -> binder::Result<binder::ParcelFileDescriptor> {
+        self._rt.block_on(self._inner.r#RepeatParcelFileDescriptor(_arg_read))
+      }
+      fn r#ReverseParcelFileDescriptorArray(&self, _arg_input: &[binder::ParcelFileDescriptor], _arg_repeated: &mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::Result<Vec<binder::ParcelFileDescriptor>> {
+        self._rt.block_on(self._inner.r#ReverseParcelFileDescriptorArray(_arg_input, _arg_repeated))
+      }
+      fn r#ThrowServiceException(&self, _arg_code: i32) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#ThrowServiceException(_arg_code))
+      }
+      fn r#RepeatNullableIntArray(&self, _arg_input: Option<&[i32]>) -> binder::Result<Option<Vec<i32>>> {
+        self._rt.block_on(self._inner.r#RepeatNullableIntArray(_arg_input))
+      }
+      fn r#RepeatNullableByteEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>> {
+        self._rt.block_on(self._inner.r#RepeatNullableByteEnumArray(_arg_input))
+      }
+      fn r#RepeatNullableIntEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>> {
+        self._rt.block_on(self._inner.r#RepeatNullableIntEnumArray(_arg_input))
+      }
+      fn r#RepeatNullableLongEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>> {
+        self._rt.block_on(self._inner.r#RepeatNullableLongEnumArray(_arg_input))
+      }
+      fn r#RepeatNullableString(&self, _arg_input: Option<&str>) -> binder::Result<Option<String>> {
+        self._rt.block_on(self._inner.r#RepeatNullableString(_arg_input))
+      }
+      fn r#RepeatNullableStringList(&self, _arg_input: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<String>>>> {
+        self._rt.block_on(self._inner.r#RepeatNullableStringList(_arg_input))
+      }
+      fn r#RepeatNullableParcelable(&self, _arg_input: Option<&crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>> {
+        self._rt.block_on(self._inner.r#RepeatNullableParcelable(_arg_input))
+      }
+      fn r#RepeatNullableParcelableArray(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> {
+        self._rt.block_on(self._inner.r#RepeatNullableParcelableArray(_arg_input))
+      }
+      fn r#RepeatNullableParcelableList(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> {
+        self._rt.block_on(self._inner.r#RepeatNullableParcelableList(_arg_input))
+      }
+      fn r#TakesAnIBinder(&self, _arg_input: &binder::SpIBinder) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#TakesAnIBinder(_arg_input))
+      }
+      fn r#TakesANullableIBinder(&self, _arg_input: Option<&binder::SpIBinder>) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#TakesANullableIBinder(_arg_input))
+      }
+      fn r#TakesAnIBinderList(&self, _arg_input: &[binder::SpIBinder]) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#TakesAnIBinderList(_arg_input))
+      }
+      fn r#TakesANullableIBinderList(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#TakesANullableIBinderList(_arg_input))
+      }
+      fn r#RepeatUtf8CppString(&self, _arg_token: &str) -> binder::Result<String> {
+        self._rt.block_on(self._inner.r#RepeatUtf8CppString(_arg_token))
+      }
+      fn r#RepeatNullableUtf8CppString(&self, _arg_token: Option<&str>) -> binder::Result<Option<String>> {
+        self._rt.block_on(self._inner.r#RepeatNullableUtf8CppString(_arg_token))
+      }
+      fn r#ReverseUtf8CppString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+        self._rt.block_on(self._inner.r#ReverseUtf8CppString(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseNullableUtf8CppString(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>> {
+        self._rt.block_on(self._inner.r#ReverseNullableUtf8CppString(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseUtf8CppStringList(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>> {
+        self._rt.block_on(self._inner.r#ReverseUtf8CppStringList(_arg_input, _arg_repeated))
+      }
+      fn r#GetCallback(&self, _arg_return_null: bool) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+        self._rt.block_on(self._inner.r#GetCallback(_arg_return_null))
+      }
+      fn r#FillOutStructuredParcelable(&self, _arg_parcel: &mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#FillOutStructuredParcelable(_arg_parcel))
+      }
+      fn r#RepeatExtendableParcelable(&self, _arg_ep: &crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#RepeatExtendableParcelable(_arg_ep, _arg_ep2))
+      }
+      fn r#ReverseList(&self, _arg_list: &crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList> {
+        self._rt.block_on(self._inner.r#ReverseList(_arg_list))
+      }
+      fn r#ReverseIBinderArray(&self, _arg_input: &[binder::SpIBinder], _arg_repeated: &mut Vec<Option<binder::SpIBinder>>) -> binder::Result<Vec<binder::SpIBinder>> {
+        self._rt.block_on(self._inner.r#ReverseIBinderArray(_arg_input, _arg_repeated))
+      }
+      fn r#ReverseNullableIBinderArray(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _arg_repeated: &mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::Result<Option<Vec<Option<binder::SpIBinder>>>> {
+        self._rt.block_on(self._inner.r#ReverseNullableIBinderArray(_arg_input, _arg_repeated))
+      }
+      fn r#GetOldNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>> {
+        self._rt.block_on(self._inner.r#GetOldNameInterface())
+      }
+      fn r#GetNewNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>> {
+        self._rt.block_on(self._inner.r#GetNewNameInterface())
+      }
+      fn r#GetUnionTags(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>> {
+        self._rt.block_on(self._inner.r#GetUnionTags(_arg_input))
+      }
+      fn r#GetCppJavaTests(&self) -> binder::Result<Option<binder::SpIBinder>> {
+        self._rt.block_on(self._inner.r#GetCppJavaTests())
+      }
+      fn r#getBackendType(&self) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType> {
+        self._rt.block_on(self._inner.r#getBackendType())
+      }
+      fn r#GetCircular(&self, _arg_cp: &mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>> {
+        self._rt.block_on(self._inner.r#GetCircular(_arg_cp))
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait ITestServiceDefault: Send + Sync {
+  fn r#UnimplementedMethod(&self, _arg_arg: i32) -> binder::Result<i32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#Deprecated(&self) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#TestOneway(&self) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatBoolean(&self, _arg_token: bool) -> binder::Result<bool> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatByte(&self, _arg_token: i8) -> binder::Result<i8> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatChar(&self, _arg_token: u16) -> binder::Result<u16> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatInt(&self, _arg_token: i32) -> binder::Result<i32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatLong(&self, _arg_token: i64) -> binder::Result<i64> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatFloat(&self, _arg_token: f32) -> binder::Result<f32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatDouble(&self, _arg_token: f64) -> binder::Result<f64> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatString(&self, _arg_token: &str) -> binder::Result<String> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatByteEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatIntEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatLongEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseBoolean(&self, _arg_input: &[bool], _arg_repeated: &mut Vec<bool>) -> binder::Result<Vec<bool>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseByte(&self, _arg_input: &[u8], _arg_repeated: &mut Vec<u8>) -> binder::Result<Vec<u8>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseChar(&self, _arg_input: &[u16], _arg_repeated: &mut Vec<u16>) -> binder::Result<Vec<u16>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseInt(&self, _arg_input: &[i32], _arg_repeated: &mut Vec<i32>) -> binder::Result<Vec<i32>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseLong(&self, _arg_input: &[i64], _arg_repeated: &mut Vec<i64>) -> binder::Result<Vec<i64>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseFloat(&self, _arg_input: &[f32], _arg_repeated: &mut Vec<f32>) -> binder::Result<Vec<f32>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseDouble(&self, _arg_input: &[f64], _arg_repeated: &mut Vec<f64>) -> binder::Result<Vec<f64>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseByteEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseIntEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseLongEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetOtherTestService(&self, _arg_name: &str) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#SetOtherTestService(&self, _arg_name: &str, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::Result<bool> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#VerifyName(&self, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &str) -> binder::Result<bool> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetInterfaceArray(&self, _arg_names: &[String]) -> binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#VerifyNamesWithInterfaceArray(&self, _arg_services: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &[String]) -> binder::Result<bool> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetNullableInterfaceArray(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#VerifyNamesWithNullableInterfaceArray(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetInterfaceList(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#VerifyNamesWithInterfaceList(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseStringList(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatParcelFileDescriptor(&self, _arg_read: &binder::ParcelFileDescriptor) -> binder::Result<binder::ParcelFileDescriptor> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseParcelFileDescriptorArray(&self, _arg_input: &[binder::ParcelFileDescriptor], _arg_repeated: &mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::Result<Vec<binder::ParcelFileDescriptor>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ThrowServiceException(&self, _arg_code: i32) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableIntArray(&self, _arg_input: Option<&[i32]>) -> binder::Result<Option<Vec<i32>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableByteEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableIntEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableLongEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableString(&self, _arg_input: Option<&str>) -> binder::Result<Option<String>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableStringList(&self, _arg_input: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<String>>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableParcelable(&self, _arg_input: Option<&crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableParcelableArray(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableParcelableList(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#TakesAnIBinder(&self, _arg_input: &binder::SpIBinder) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#TakesANullableIBinder(&self, _arg_input: Option<&binder::SpIBinder>) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#TakesAnIBinderList(&self, _arg_input: &[binder::SpIBinder]) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#TakesANullableIBinderList(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatUtf8CppString(&self, _arg_token: &str) -> binder::Result<String> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatNullableUtf8CppString(&self, _arg_token: Option<&str>) -> binder::Result<Option<String>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseUtf8CppString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseNullableUtf8CppString(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseUtf8CppStringList(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetCallback(&self, _arg_return_null: bool) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#FillOutStructuredParcelable(&self, _arg_parcel: &mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#RepeatExtendableParcelable(&self, _arg_ep: &crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseList(&self, _arg_list: &crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseIBinderArray(&self, _arg_input: &[binder::SpIBinder], _arg_repeated: &mut Vec<Option<binder::SpIBinder>>) -> binder::Result<Vec<binder::SpIBinder>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ReverseNullableIBinderArray(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _arg_repeated: &mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::Result<Option<Vec<Option<binder::SpIBinder>>>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetOldNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetNewNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetUnionTags(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetCppJavaTests(&self) -> binder::Result<Option<binder::SpIBinder>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#getBackendType(&self) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#GetCircular(&self, _arg_cp: &mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#UnimplementedMethod: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  pub const r#Deprecated: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+  pub const r#TestOneway: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+  pub const r#RepeatBoolean: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 3;
+  pub const r#RepeatByte: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 4;
+  pub const r#RepeatChar: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 5;
+  pub const r#RepeatInt: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 6;
+  pub const r#RepeatLong: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 7;
+  pub const r#RepeatFloat: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 8;
+  pub const r#RepeatDouble: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 9;
+  pub const r#RepeatString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 10;
+  pub const r#RepeatByteEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 11;
+  pub const r#RepeatIntEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 12;
+  pub const r#RepeatLongEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 13;
+  pub const r#ReverseBoolean: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 14;
+  pub const r#ReverseByte: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 15;
+  pub const r#ReverseChar: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16;
+  pub const r#ReverseInt: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 17;
+  pub const r#ReverseLong: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 18;
+  pub const r#ReverseFloat: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 19;
+  pub const r#ReverseDouble: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 20;
+  pub const r#ReverseString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 21;
+  pub const r#ReverseByteEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 22;
+  pub const r#ReverseIntEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 23;
+  pub const r#ReverseLongEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 24;
+  pub const r#GetOtherTestService: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 25;
+  pub const r#SetOtherTestService: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 26;
+  pub const r#VerifyName: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 27;
+  pub const r#GetInterfaceArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 28;
+  pub const r#VerifyNamesWithInterfaceArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 29;
+  pub const r#GetNullableInterfaceArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 30;
+  pub const r#VerifyNamesWithNullableInterfaceArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 31;
+  pub const r#GetInterfaceList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 32;
+  pub const r#VerifyNamesWithInterfaceList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 33;
+  pub const r#ReverseStringList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 34;
+  pub const r#RepeatParcelFileDescriptor: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 35;
+  pub const r#ReverseParcelFileDescriptorArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 36;
+  pub const r#ThrowServiceException: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 37;
+  pub const r#RepeatNullableIntArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 38;
+  pub const r#RepeatNullableByteEnumArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 39;
+  pub const r#RepeatNullableIntEnumArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 40;
+  pub const r#RepeatNullableLongEnumArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 41;
+  pub const r#RepeatNullableString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 42;
+  pub const r#RepeatNullableStringList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 43;
+  pub const r#RepeatNullableParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 44;
+  pub const r#RepeatNullableParcelableArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 45;
+  pub const r#RepeatNullableParcelableList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 46;
+  pub const r#TakesAnIBinder: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 47;
+  pub const r#TakesANullableIBinder: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 48;
+  pub const r#TakesAnIBinderList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 49;
+  pub const r#TakesANullableIBinderList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 50;
+  pub const r#RepeatUtf8CppString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 51;
+  pub const r#RepeatNullableUtf8CppString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 52;
+  pub const r#ReverseUtf8CppString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 53;
+  pub const r#ReverseNullableUtf8CppString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 54;
+  pub const r#ReverseUtf8CppStringList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 55;
+  pub const r#GetCallback: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 56;
+  pub const r#FillOutStructuredParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 57;
+  pub const r#RepeatExtendableParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 58;
+  pub const r#ReverseList: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 59;
+  pub const r#ReverseIBinderArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 60;
+  pub const r#ReverseNullableIBinderArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 61;
+  pub const r#GetOldNameInterface: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 62;
+  pub const r#GetNewNameInterface: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 63;
+  pub const r#GetUnionTags: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 64;
+  pub const r#GetCppJavaTests: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 65;
+  pub const r#getBackendType: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 66;
+  pub const r#GetCircular: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 67;
+}
+pub type ITestServiceDefaultRef = Option<std::sync::Arc<dyn ITestServiceDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<ITestServiceDefaultRef> = std::sync::Mutex::new(None);
+}
+pub const r#CONSTANT: i32 = 42;
+pub const r#CONSTANT2: i32 = -42;
+pub const r#CONSTANT3: i32 = 42;
+pub const r#CONSTANT4: i32 = 4;
+pub const r#CONSTANT5: i32 = -4;
+pub const r#CONSTANT6: i32 = 0;
+pub const r#CONSTANT7: i32 = 0;
+pub const r#CONSTANT8: i32 = 0;
+pub const r#CONSTANT9: i32 = 86;
+pub const r#CONSTANT10: i32 = 165;
+pub const r#CONSTANT11: i32 = 250;
+pub const r#CONSTANT12: i32 = -1;
+pub const r#BYTE_CONSTANT: i8 = 17;
+pub const r#LONG_CONSTANT: i64 = 1099511627776;
+pub const r#STRING_CONSTANT: &str = "foo";
+pub const r#STRING_CONSTANT2: &str = "bar";
+pub const r#FLOAT_CONSTANT: f32 = 1.000000f32;
+pub const r#FLOAT_CONSTANT2: f32 = -1.000000f32;
+pub const r#FLOAT_CONSTANT3: f32 = 1.000000f32;
+pub const r#FLOAT_CONSTANT4: f32 = 2.200000f32;
+pub const r#FLOAT_CONSTANT5: f32 = -2.200000f32;
+pub const r#FLOAT_CONSTANT6: f32 = -0.000000f32;
+pub const r#FLOAT_CONSTANT7: f32 = 0.000000f32;
+pub const r#DOUBLE_CONSTANT: f64 = 1.000000f64;
+pub const r#DOUBLE_CONSTANT2: f64 = -1.000000f64;
+pub const r#DOUBLE_CONSTANT3: f64 = 1.000000f64;
+pub const r#DOUBLE_CONSTANT4: f64 = 2.200000f64;
+pub const r#DOUBLE_CONSTANT5: f64 = -2.200000f64;
+pub const r#DOUBLE_CONSTANT6: f64 = -0.000000f64;
+pub const r#DOUBLE_CONSTANT7: f64 = 0.000000f64;
+pub const r#DOUBLE_CONSTANT8: f64 = 1.100000f64;
+pub const r#DOUBLE_CONSTANT9: f64 = -1.100000f64;
+pub const r#STRING_CONSTANT_UTF8: &str = "baz";
+pub const r#A1: i32 = 1;
+pub const r#A2: i32 = 1;
+pub const r#A3: i32 = 1;
+pub const r#A4: i32 = 1;
+pub const r#A5: i32 = 1;
+pub const r#A6: i32 = 1;
+pub const r#A7: i32 = 1;
+pub const r#A8: i32 = 1;
+pub const r#A9: i32 = 1;
+pub const r#A10: i32 = 1;
+pub const r#A11: i32 = 1;
+pub const r#A12: i32 = 1;
+pub const r#A13: i32 = 1;
+pub const r#A14: i32 = 1;
+pub const r#A15: i32 = 1;
+pub const r#A16: i32 = 1;
+pub const r#A17: i32 = 1;
+pub const r#A18: i32 = 1;
+pub const r#A19: i32 = 1;
+pub const r#A20: i32 = 1;
+pub const r#A21: i32 = 1;
+pub const r#A22: i32 = 1;
+pub const r#A23: i32 = 1;
+pub const r#A24: i32 = 1;
+pub const r#A25: i32 = 1;
+pub const r#A26: i32 = 1;
+pub const r#A27: i32 = 1;
+pub const r#A28: i32 = 1;
+pub const r#A29: i32 = 1;
+pub const r#A30: i32 = 1;
+pub const r#A31: i32 = 1;
+pub const r#A32: i32 = 1;
+pub const r#A33: i32 = 1;
+pub const r#A34: i32 = 1;
+pub const r#A35: i32 = 1;
+pub const r#A36: i32 = 1;
+pub const r#A37: i32 = 1;
+pub const r#A38: i32 = 1;
+pub const r#A39: i32 = 1;
+pub const r#A40: i32 = 1;
+pub const r#A41: i32 = 1;
+pub const r#A42: i32 = 1;
+pub const r#A43: i32 = 1;
+pub const r#A44: i32 = 1;
+pub const r#A45: i32 = 1;
+pub const r#A46: i32 = 1;
+pub const r#A47: i32 = 1;
+pub const r#A48: i32 = 1;
+pub const r#A49: i32 = 1;
+pub const r#A50: i32 = 1;
+pub const r#A51: i32 = 1;
+pub const r#A52: i32 = 1;
+pub const r#A53: i32 = 1;
+pub const r#A54: i32 = 1;
+pub const r#A55: i32 = 1;
+pub const r#A56: i32 = 1;
+pub const r#A57: i32 = 1;
+impl BpTestService {
+  fn build_parcel_UnimplementedMethod(&self, _arg_arg: i32) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_arg)?;
+    Ok(aidl_data)
+  }
+  fn read_response_UnimplementedMethod(&self, _arg_arg: i32, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#UnimplementedMethod(_arg_arg);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_Deprecated(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    Ok(aidl_data)
+  }
+  fn read_response_Deprecated(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#Deprecated();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_TestOneway(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    Ok(aidl_data)
+  }
+  fn read_response_TestOneway(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#TestOneway();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    Ok(())
+  }
+  fn build_parcel_RepeatBoolean(&self, _arg_token: bool) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatBoolean(&self, _arg_token: bool, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<bool> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatBoolean(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: bool = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatByte(&self, _arg_token: i8) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatByte(&self, _arg_token: i8, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i8> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatByte(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i8 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatChar(&self, _arg_token: u16) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatChar(&self, _arg_token: u16, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<u16> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatChar(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: u16 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatInt(&self, _arg_token: i32) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatInt(&self, _arg_token: i32, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatInt(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatLong(&self, _arg_token: i64) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatLong(&self, _arg_token: i64, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i64> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatLong(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i64 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatFloat(&self, _arg_token: f32) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatFloat(&self, _arg_token: f32, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<f32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatFloat(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: f32 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatDouble(&self, _arg_token: f64) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatDouble(&self, _arg_token: f64, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<f64> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatDouble(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: f64 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatString(&self, _arg_token: &str) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatString(&self, _arg_token: &str, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatString(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatByteEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatByteEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatByteEnum(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatIntEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatIntEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatIntEnum(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatLongEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatLongEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatLongEnum(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseBoolean(&self, _arg_input: &[bool], _arg_repeated: &mut Vec<bool>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseBoolean(&self, _arg_input: &[bool], _arg_repeated: &mut Vec<bool>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<bool>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseBoolean(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<bool> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseByte(&self, _arg_input: &[u8], _arg_repeated: &mut Vec<u8>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseByte(&self, _arg_input: &[u8], _arg_repeated: &mut Vec<u8>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<u8>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseByte(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<u8> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseChar(&self, _arg_input: &[u16], _arg_repeated: &mut Vec<u16>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseChar(&self, _arg_input: &[u16], _arg_repeated: &mut Vec<u16>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<u16>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseChar(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<u16> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseInt(&self, _arg_input: &[i32], _arg_repeated: &mut Vec<i32>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseInt(&self, _arg_input: &[i32], _arg_repeated: &mut Vec<i32>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<i32>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseInt(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<i32> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseLong(&self, _arg_input: &[i64], _arg_repeated: &mut Vec<i64>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseLong(&self, _arg_input: &[i64], _arg_repeated: &mut Vec<i64>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<i64>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseLong(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<i64> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseFloat(&self, _arg_input: &[f32], _arg_repeated: &mut Vec<f32>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseFloat(&self, _arg_input: &[f32], _arg_repeated: &mut Vec<f32>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<f32>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseFloat(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<f32> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseDouble(&self, _arg_input: &[f64], _arg_repeated: &mut Vec<f64>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseDouble(&self, _arg_input: &[f64], _arg_repeated: &mut Vec<f64>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<f64>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseDouble(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<f64> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<String>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseString(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<String> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseByteEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseByteEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseByteEnum(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseIntEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseIntEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseIntEnum(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseLongEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseLongEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseLongEnum(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetOtherTestService(&self, _arg_name: &str) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_name)?;
+    Ok(aidl_data)
+  }
+  fn read_response_GetOtherTestService(&self, _arg_name: &str, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetOtherTestService(_arg_name);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_SetOtherTestService(&self, _arg_name: &str, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_name)?;
+    aidl_data.write(_arg_service)?;
+    Ok(aidl_data)
+  }
+  fn read_response_SetOtherTestService(&self, _arg_name: &str, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<bool> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#SetOtherTestService(_arg_name, _arg_service);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: bool = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_VerifyName(&self, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &str) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_service)?;
+    aidl_data.write(_arg_name)?;
+    Ok(aidl_data)
+  }
+  fn read_response_VerifyName(&self, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &str, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<bool> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#VerifyName(_arg_service, _arg_name);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: bool = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetInterfaceArray(&self, _arg_names: &[String]) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_names)?;
+    Ok(aidl_data)
+  }
+  fn read_response_GetInterfaceArray(&self, _arg_names: &[String], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetInterfaceArray(_arg_names);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_VerifyNamesWithInterfaceArray(&self, _arg_services: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &[String]) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_services)?;
+    aidl_data.write(_arg_names)?;
+    Ok(aidl_data)
+  }
+  fn read_response_VerifyNamesWithInterfaceArray(&self, _arg_services: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &[String], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<bool> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#VerifyNamesWithInterfaceArray(_arg_services, _arg_names);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: bool = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetNullableInterfaceArray(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_names)?;
+    Ok(aidl_data)
+  }
+  fn read_response_GetNullableInterfaceArray(&self, _arg_names: Option<&[Option<String>]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetNullableInterfaceArray(_arg_names);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_VerifyNamesWithNullableInterfaceArray(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_services)?;
+    aidl_data.write(&_arg_names)?;
+    Ok(aidl_data)
+  }
+  fn read_response_VerifyNamesWithNullableInterfaceArray(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<bool> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#VerifyNamesWithNullableInterfaceArray(_arg_services, _arg_names);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: bool = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetInterfaceList(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_names)?;
+    Ok(aidl_data)
+  }
+  fn read_response_GetInterfaceList(&self, _arg_names: Option<&[Option<String>]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetInterfaceList(_arg_names);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_VerifyNamesWithInterfaceList(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_services)?;
+    aidl_data.write(&_arg_names)?;
+    Ok(aidl_data)
+  }
+  fn read_response_VerifyNamesWithInterfaceList(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<bool> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#VerifyNamesWithInterfaceList(_arg_services, _arg_names);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: bool = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseStringList(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseStringList(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<String>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseStringList(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<String> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatParcelFileDescriptor(&self, _arg_read: &binder::ParcelFileDescriptor) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_read)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatParcelFileDescriptor(&self, _arg_read: &binder::ParcelFileDescriptor, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<binder::ParcelFileDescriptor> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatParcelFileDescriptor(_arg_read);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: binder::ParcelFileDescriptor = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseParcelFileDescriptorArray(&self, _arg_input: &[binder::ParcelFileDescriptor], _arg_repeated: &mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseParcelFileDescriptorArray(&self, _arg_input: &[binder::ParcelFileDescriptor], _arg_repeated: &mut Vec<Option<binder::ParcelFileDescriptor>>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<binder::ParcelFileDescriptor>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseParcelFileDescriptorArray(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<binder::ParcelFileDescriptor> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ThrowServiceException(&self, _arg_code: i32) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_code)?;
+    Ok(aidl_data)
+  }
+  fn read_response_ThrowServiceException(&self, _arg_code: i32, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ThrowServiceException(_arg_code);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_RepeatNullableIntArray(&self, _arg_input: Option<&[i32]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableIntArray(&self, _arg_input: Option<&[i32]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<i32>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableIntArray(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<i32>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableByteEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableByteEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableByteEnumArray(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableIntEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableIntEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableIntEnumArray(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableLongEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableLongEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableLongEnumArray(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableString(&self, _arg_input: Option<&str>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableString(&self, _arg_input: Option<&str>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<String>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableString(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<String> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableStringList(&self, _arg_input: Option<&[Option<String>]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableStringList(&self, _arg_input: Option<&[Option<String>]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<String>>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableStringList(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<Option<String>>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableParcelable(&self, _arg_input: Option<&crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableParcelable(&self, _arg_input: Option<&crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableParcelable(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableParcelableArray(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableParcelableArray(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableParcelableArray(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableParcelableList(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableParcelableList(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableParcelableList(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_TakesAnIBinder(&self, _arg_input: &binder::SpIBinder) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_TakesAnIBinder(&self, _arg_input: &binder::SpIBinder, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#TakesAnIBinder(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_TakesANullableIBinder(&self, _arg_input: Option<&binder::SpIBinder>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_TakesANullableIBinder(&self, _arg_input: Option<&binder::SpIBinder>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#TakesANullableIBinder(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_TakesAnIBinderList(&self, _arg_input: &[binder::SpIBinder]) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_TakesAnIBinderList(&self, _arg_input: &[binder::SpIBinder], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#TakesAnIBinderList(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_TakesANullableIBinderList(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_TakesANullableIBinderList(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#TakesANullableIBinderList(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_RepeatUtf8CppString(&self, _arg_token: &str) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatUtf8CppString(&self, _arg_token: &str, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatUtf8CppString(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_RepeatNullableUtf8CppString(&self, _arg_token: Option<&str>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_token)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatNullableUtf8CppString(&self, _arg_token: Option<&str>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<String>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatNullableUtf8CppString(_arg_token);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<String> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseUtf8CppString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseUtf8CppString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<String>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseUtf8CppString(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<String> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseNullableUtf8CppString(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    aidl_data.write_slice_size(_arg_repeated.as_deref())?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseNullableUtf8CppString(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<String>>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseNullableUtf8CppString(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<Option<String>>> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseUtf8CppStringList(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseUtf8CppStringList(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<String>>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseUtf8CppStringList(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<Option<String>>> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetCallback(&self, _arg_return_null: bool) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_return_null)?;
+    Ok(aidl_data)
+  }
+  fn read_response_GetCallback(&self, _arg_return_null: bool, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetCallback(_arg_return_null);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_FillOutStructuredParcelable(&self, _arg_parcel: &mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_parcel)?;
+    Ok(aidl_data)
+  }
+  fn read_response_FillOutStructuredParcelable(&self, _arg_parcel: &mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#FillOutStructuredParcelable(_arg_parcel);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    _aidl_reply.read_onto(_arg_parcel)?;
+    Ok(())
+  }
+  fn build_parcel_RepeatExtendableParcelable(&self, _arg_ep: &crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_ep)?;
+    Ok(aidl_data)
+  }
+  fn read_response_RepeatExtendableParcelable(&self, _arg_ep: &crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#RepeatExtendableParcelable(_arg_ep, _arg_ep2);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    _aidl_reply.read_onto(_arg_ep2)?;
+    Ok(())
+  }
+  fn build_parcel_ReverseList(&self, _arg_list: &crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_list)?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseList(&self, _arg_list: &crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseList(_arg_list);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseIBinderArray(&self, _arg_input: &[binder::SpIBinder], _arg_repeated: &mut Vec<Option<binder::SpIBinder>>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    aidl_data.write_slice_size(Some(_arg_repeated))?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseIBinderArray(&self, _arg_input: &[binder::SpIBinder], _arg_repeated: &mut Vec<Option<binder::SpIBinder>>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<binder::SpIBinder>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseIBinderArray(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<binder::SpIBinder> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ReverseNullableIBinderArray(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _arg_repeated: &mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(&_arg_input)?;
+    aidl_data.write_slice_size(_arg_repeated.as_deref())?;
+    Ok(aidl_data)
+  }
+  fn read_response_ReverseNullableIBinderArray(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _arg_repeated: &mut Option<Vec<Option<binder::SpIBinder>>>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<binder::SpIBinder>>>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#ReverseNullableIBinderArray(_arg_input, _arg_repeated);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<Vec<Option<binder::SpIBinder>>> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_repeated)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetOldNameInterface(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    Ok(aidl_data)
+  }
+  fn read_response_GetOldNameInterface(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetOldNameInterface();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetNewNameInterface(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    Ok(aidl_data)
+  }
+  fn read_response_GetNewNameInterface(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetNewNameInterface();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetUnionTags(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_GetUnionTags(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_5_Union], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetUnionTags(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetCppJavaTests(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    Ok(aidl_data)
+  }
+  fn read_response_GetCppJavaTests(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<binder::SpIBinder>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetCppJavaTests();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: Option<binder::SpIBinder> = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_getBackendType(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    Ok(aidl_data)
+  }
+  fn read_response_getBackendType(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#getBackendType();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_5_tests_11_BackendType = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_GetCircular(&self, _arg_cp: &mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.mark_sensitive();
+    Ok(aidl_data)
+  }
+  fn read_response_GetCircular(&self, _arg_cp: &mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+        return _aidl_default_impl.r#GetCircular(_arg_cp);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular> = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_cp)?;
+    Ok(_aidl_return)
+  }
+}
+impl ITestService for BpTestService {
+  fn r#UnimplementedMethod(&self, _arg_arg: i32) -> binder::Result<i32> {
+    let _aidl_data = self.build_parcel_UnimplementedMethod(_arg_arg)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#UnimplementedMethod, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_UnimplementedMethod(_arg_arg, _aidl_reply)
+  }
+  fn r#Deprecated(&self) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_Deprecated()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#Deprecated, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_Deprecated(_aidl_reply)
+  }
+  fn r#TestOneway(&self) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_TestOneway()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#TestOneway, _aidl_data, binder::binder_impl::FLAG_ONEWAY | binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_TestOneway(_aidl_reply)
+  }
+  fn r#RepeatBoolean(&self, _arg_token: bool) -> binder::Result<bool> {
+    let _aidl_data = self.build_parcel_RepeatBoolean(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatBoolean, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatBoolean(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatByte(&self, _arg_token: i8) -> binder::Result<i8> {
+    let _aidl_data = self.build_parcel_RepeatByte(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatByte, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatByte(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatChar(&self, _arg_token: u16) -> binder::Result<u16> {
+    let _aidl_data = self.build_parcel_RepeatChar(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatChar, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatChar(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatInt(&self, _arg_token: i32) -> binder::Result<i32> {
+    let _aidl_data = self.build_parcel_RepeatInt(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatInt, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatInt(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatLong(&self, _arg_token: i64) -> binder::Result<i64> {
+    let _aidl_data = self.build_parcel_RepeatLong(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatLong, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatLong(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatFloat(&self, _arg_token: f32) -> binder::Result<f32> {
+    let _aidl_data = self.build_parcel_RepeatFloat(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatFloat, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatFloat(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatDouble(&self, _arg_token: f64) -> binder::Result<f64> {
+    let _aidl_data = self.build_parcel_RepeatDouble(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatDouble, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatDouble(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatString(&self, _arg_token: &str) -> binder::Result<String> {
+    let _aidl_data = self.build_parcel_RepeatString(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatString(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatByteEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum> {
+    let _aidl_data = self.build_parcel_RepeatByteEnum(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatByteEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatByteEnum(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatIntEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum> {
+    let _aidl_data = self.build_parcel_RepeatIntEnum(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatIntEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatIntEnum(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatLongEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum> {
+    let _aidl_data = self.build_parcel_RepeatLongEnum(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatLongEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatLongEnum(_arg_token, _aidl_reply)
+  }
+  fn r#ReverseBoolean(&self, _arg_input: &[bool], _arg_repeated: &mut Vec<bool>) -> binder::Result<Vec<bool>> {
+    let _aidl_data = self.build_parcel_ReverseBoolean(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseBoolean, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseBoolean(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseByte(&self, _arg_input: &[u8], _arg_repeated: &mut Vec<u8>) -> binder::Result<Vec<u8>> {
+    let _aidl_data = self.build_parcel_ReverseByte(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseByte, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseByte(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseChar(&self, _arg_input: &[u16], _arg_repeated: &mut Vec<u16>) -> binder::Result<Vec<u16>> {
+    let _aidl_data = self.build_parcel_ReverseChar(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseChar, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseChar(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseInt(&self, _arg_input: &[i32], _arg_repeated: &mut Vec<i32>) -> binder::Result<Vec<i32>> {
+    let _aidl_data = self.build_parcel_ReverseInt(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseInt, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseInt(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseLong(&self, _arg_input: &[i64], _arg_repeated: &mut Vec<i64>) -> binder::Result<Vec<i64>> {
+    let _aidl_data = self.build_parcel_ReverseLong(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseLong, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseLong(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseFloat(&self, _arg_input: &[f32], _arg_repeated: &mut Vec<f32>) -> binder::Result<Vec<f32>> {
+    let _aidl_data = self.build_parcel_ReverseFloat(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseFloat, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseFloat(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseDouble(&self, _arg_input: &[f64], _arg_repeated: &mut Vec<f64>) -> binder::Result<Vec<f64>> {
+    let _aidl_data = self.build_parcel_ReverseDouble(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseDouble, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseDouble(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+    let _aidl_data = self.build_parcel_ReverseString(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseString(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseByteEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>> {
+    let _aidl_data = self.build_parcel_ReverseByteEnum(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseByteEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseByteEnum(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseIntEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>> {
+    let _aidl_data = self.build_parcel_ReverseIntEnum(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseIntEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseIntEnum(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseLongEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>> {
+    let _aidl_data = self.build_parcel_ReverseLongEnum(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseLongEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseLongEnum(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#GetOtherTestService(&self, _arg_name: &str) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>> {
+    let _aidl_data = self.build_parcel_GetOtherTestService(_arg_name)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetOtherTestService, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetOtherTestService(_arg_name, _aidl_reply)
+  }
+  fn r#SetOtherTestService(&self, _arg_name: &str, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::Result<bool> {
+    let _aidl_data = self.build_parcel_SetOtherTestService(_arg_name, _arg_service)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#SetOtherTestService, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_SetOtherTestService(_arg_name, _arg_service, _aidl_reply)
+  }
+  fn r#VerifyName(&self, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &str) -> binder::Result<bool> {
+    let _aidl_data = self.build_parcel_VerifyName(_arg_service, _arg_name)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#VerifyName, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_VerifyName(_arg_service, _arg_name, _aidl_reply)
+  }
+  fn r#GetInterfaceArray(&self, _arg_names: &[String]) -> binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+    let _aidl_data = self.build_parcel_GetInterfaceArray(_arg_names)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetInterfaceArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetInterfaceArray(_arg_names, _aidl_reply)
+  }
+  fn r#VerifyNamesWithInterfaceArray(&self, _arg_services: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &[String]) -> binder::Result<bool> {
+    let _aidl_data = self.build_parcel_VerifyNamesWithInterfaceArray(_arg_services, _arg_names)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#VerifyNamesWithInterfaceArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_VerifyNamesWithInterfaceArray(_arg_services, _arg_names, _aidl_reply)
+  }
+  fn r#GetNullableInterfaceArray(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> {
+    let _aidl_data = self.build_parcel_GetNullableInterfaceArray(_arg_names)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetNullableInterfaceArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetNullableInterfaceArray(_arg_names, _aidl_reply)
+  }
+  fn r#VerifyNamesWithNullableInterfaceArray(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool> {
+    let _aidl_data = self.build_parcel_VerifyNamesWithNullableInterfaceArray(_arg_services, _arg_names)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#VerifyNamesWithNullableInterfaceArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_VerifyNamesWithNullableInterfaceArray(_arg_services, _arg_names, _aidl_reply)
+  }
+  fn r#GetInterfaceList(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> {
+    let _aidl_data = self.build_parcel_GetInterfaceList(_arg_names)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetInterfaceList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetInterfaceList(_arg_names, _aidl_reply)
+  }
+  fn r#VerifyNamesWithInterfaceList(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool> {
+    let _aidl_data = self.build_parcel_VerifyNamesWithInterfaceList(_arg_services, _arg_names)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#VerifyNamesWithInterfaceList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_VerifyNamesWithInterfaceList(_arg_services, _arg_names, _aidl_reply)
+  }
+  fn r#ReverseStringList(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+    let _aidl_data = self.build_parcel_ReverseStringList(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseStringList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseStringList(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#RepeatParcelFileDescriptor(&self, _arg_read: &binder::ParcelFileDescriptor) -> binder::Result<binder::ParcelFileDescriptor> {
+    let _aidl_data = self.build_parcel_RepeatParcelFileDescriptor(_arg_read)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatParcelFileDescriptor, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatParcelFileDescriptor(_arg_read, _aidl_reply)
+  }
+  fn r#ReverseParcelFileDescriptorArray(&self, _arg_input: &[binder::ParcelFileDescriptor], _arg_repeated: &mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::Result<Vec<binder::ParcelFileDescriptor>> {
+    let _aidl_data = self.build_parcel_ReverseParcelFileDescriptorArray(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseParcelFileDescriptorArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseParcelFileDescriptorArray(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ThrowServiceException(&self, _arg_code: i32) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_ThrowServiceException(_arg_code)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ThrowServiceException, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ThrowServiceException(_arg_code, _aidl_reply)
+  }
+  fn r#RepeatNullableIntArray(&self, _arg_input: Option<&[i32]>) -> binder::Result<Option<Vec<i32>>> {
+    let _aidl_data = self.build_parcel_RepeatNullableIntArray(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableIntArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableIntArray(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatNullableByteEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>> {
+    let _aidl_data = self.build_parcel_RepeatNullableByteEnumArray(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableByteEnumArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableByteEnumArray(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatNullableIntEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>> {
+    let _aidl_data = self.build_parcel_RepeatNullableIntEnumArray(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableIntEnumArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableIntEnumArray(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatNullableLongEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>> {
+    let _aidl_data = self.build_parcel_RepeatNullableLongEnumArray(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableLongEnumArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableLongEnumArray(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatNullableString(&self, _arg_input: Option<&str>) -> binder::Result<Option<String>> {
+    let _aidl_data = self.build_parcel_RepeatNullableString(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableString(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatNullableStringList(&self, _arg_input: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<String>>>> {
+    let _aidl_data = self.build_parcel_RepeatNullableStringList(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableStringList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableStringList(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatNullableParcelable(&self, _arg_input: Option<&crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>> {
+    let _aidl_data = self.build_parcel_RepeatNullableParcelable(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableParcelable, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableParcelable(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatNullableParcelableArray(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> {
+    let _aidl_data = self.build_parcel_RepeatNullableParcelableArray(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableParcelableArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableParcelableArray(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatNullableParcelableList(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> {
+    let _aidl_data = self.build_parcel_RepeatNullableParcelableList(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableParcelableList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableParcelableList(_arg_input, _aidl_reply)
+  }
+  fn r#TakesAnIBinder(&self, _arg_input: &binder::SpIBinder) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_TakesAnIBinder(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#TakesAnIBinder, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_TakesAnIBinder(_arg_input, _aidl_reply)
+  }
+  fn r#TakesANullableIBinder(&self, _arg_input: Option<&binder::SpIBinder>) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_TakesANullableIBinder(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#TakesANullableIBinder, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_TakesANullableIBinder(_arg_input, _aidl_reply)
+  }
+  fn r#TakesAnIBinderList(&self, _arg_input: &[binder::SpIBinder]) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_TakesAnIBinderList(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#TakesAnIBinderList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_TakesAnIBinderList(_arg_input, _aidl_reply)
+  }
+  fn r#TakesANullableIBinderList(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_TakesANullableIBinderList(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#TakesANullableIBinderList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_TakesANullableIBinderList(_arg_input, _aidl_reply)
+  }
+  fn r#RepeatUtf8CppString(&self, _arg_token: &str) -> binder::Result<String> {
+    let _aidl_data = self.build_parcel_RepeatUtf8CppString(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatUtf8CppString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatUtf8CppString(_arg_token, _aidl_reply)
+  }
+  fn r#RepeatNullableUtf8CppString(&self, _arg_token: Option<&str>) -> binder::Result<Option<String>> {
+    let _aidl_data = self.build_parcel_RepeatNullableUtf8CppString(_arg_token)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatNullableUtf8CppString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatNullableUtf8CppString(_arg_token, _aidl_reply)
+  }
+  fn r#ReverseUtf8CppString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> {
+    let _aidl_data = self.build_parcel_ReverseUtf8CppString(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseUtf8CppString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseUtf8CppString(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseNullableUtf8CppString(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>> {
+    let _aidl_data = self.build_parcel_ReverseNullableUtf8CppString(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseNullableUtf8CppString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseNullableUtf8CppString(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseUtf8CppStringList(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>> {
+    let _aidl_data = self.build_parcel_ReverseUtf8CppStringList(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseUtf8CppStringList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseUtf8CppStringList(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#GetCallback(&self, _arg_return_null: bool) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+    let _aidl_data = self.build_parcel_GetCallback(_arg_return_null)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetCallback, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetCallback(_arg_return_null, _aidl_reply)
+  }
+  fn r#FillOutStructuredParcelable(&self, _arg_parcel: &mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_FillOutStructuredParcelable(_arg_parcel)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#FillOutStructuredParcelable, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_FillOutStructuredParcelable(_arg_parcel, _aidl_reply)
+  }
+  fn r#RepeatExtendableParcelable(&self, _arg_ep: &crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_RepeatExtendableParcelable(_arg_ep, _arg_ep2)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#RepeatExtendableParcelable, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_RepeatExtendableParcelable(_arg_ep, _arg_ep2, _aidl_reply)
+  }
+  fn r#ReverseList(&self, _arg_list: &crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList> {
+    let _aidl_data = self.build_parcel_ReverseList(_arg_list)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseList(_arg_list, _aidl_reply)
+  }
+  fn r#ReverseIBinderArray(&self, _arg_input: &[binder::SpIBinder], _arg_repeated: &mut Vec<Option<binder::SpIBinder>>) -> binder::Result<Vec<binder::SpIBinder>> {
+    let _aidl_data = self.build_parcel_ReverseIBinderArray(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseIBinderArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseIBinderArray(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#ReverseNullableIBinderArray(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _arg_repeated: &mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::Result<Option<Vec<Option<binder::SpIBinder>>>> {
+    let _aidl_data = self.build_parcel_ReverseNullableIBinderArray(_arg_input, _arg_repeated)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ReverseNullableIBinderArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ReverseNullableIBinderArray(_arg_input, _arg_repeated, _aidl_reply)
+  }
+  fn r#GetOldNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>> {
+    let _aidl_data = self.build_parcel_GetOldNameInterface()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetOldNameInterface, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetOldNameInterface(_aidl_reply)
+  }
+  fn r#GetNewNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>> {
+    let _aidl_data = self.build_parcel_GetNewNameInterface()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetNewNameInterface, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetNewNameInterface(_aidl_reply)
+  }
+  fn r#GetUnionTags(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>> {
+    let _aidl_data = self.build_parcel_GetUnionTags(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetUnionTags, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetUnionTags(_arg_input, _aidl_reply)
+  }
+  fn r#GetCppJavaTests(&self) -> binder::Result<Option<binder::SpIBinder>> {
+    let _aidl_data = self.build_parcel_GetCppJavaTests()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetCppJavaTests, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetCppJavaTests(_aidl_reply)
+  }
+  fn r#getBackendType(&self) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType> {
+    let _aidl_data = self.build_parcel_getBackendType()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getBackendType, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getBackendType(_aidl_reply)
+  }
+  fn r#GetCircular(&self, _arg_cp: &mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>> {
+    let _aidl_data = self.build_parcel_GetCircular(_arg_cp)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#GetCircular, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_GetCircular(_arg_cp, _aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> ITestServiceAsync<P> for BpTestService {
+  fn r#UnimplementedMethod<'a>(&'a self, _arg_arg: i32) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_data = match self.build_parcel_UnimplementedMethod(_arg_arg) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#UnimplementedMethod, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_UnimplementedMethod(_arg_arg, _aidl_reply)
+      }
+    )
+  }
+  fn r#Deprecated<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_Deprecated() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#Deprecated, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_Deprecated(_aidl_reply)
+      }
+    )
+  }
+  fn r#TestOneway(&self) -> std::future::Ready<binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_TestOneway() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return std::future::ready(Err(err)),
+    };
+    let _aidl_reply = self.binder.submit_transact(transactions::r#TestOneway, _aidl_data, binder::binder_impl::FLAG_ONEWAY | binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    std::future::ready(self.read_response_TestOneway(_aidl_reply))
+  }
+  fn r#RepeatBoolean<'a>(&'a self, _arg_token: bool) -> binder::BoxFuture<'a, binder::Result<bool>> {
+    let _aidl_data = match self.build_parcel_RepeatBoolean(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatBoolean, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatBoolean(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatByte<'a>(&'a self, _arg_token: i8) -> binder::BoxFuture<'a, binder::Result<i8>> {
+    let _aidl_data = match self.build_parcel_RepeatByte(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatByte, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatByte(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatChar<'a>(&'a self, _arg_token: u16) -> binder::BoxFuture<'a, binder::Result<u16>> {
+    let _aidl_data = match self.build_parcel_RepeatChar(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatChar, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatChar(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatInt<'a>(&'a self, _arg_token: i32) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_data = match self.build_parcel_RepeatInt(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatInt, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatInt(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatLong<'a>(&'a self, _arg_token: i64) -> binder::BoxFuture<'a, binder::Result<i64>> {
+    let _aidl_data = match self.build_parcel_RepeatLong(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatLong, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatLong(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatFloat<'a>(&'a self, _arg_token: f32) -> binder::BoxFuture<'a, binder::Result<f32>> {
+    let _aidl_data = match self.build_parcel_RepeatFloat(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatFloat, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatFloat(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatDouble<'a>(&'a self, _arg_token: f64) -> binder::BoxFuture<'a, binder::Result<f64>> {
+    let _aidl_data = match self.build_parcel_RepeatDouble(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatDouble, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatDouble(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatString<'a>(&'a self, _arg_token: &'a str) -> binder::BoxFuture<'a, binder::Result<String>> {
+    let _aidl_data = match self.build_parcel_RepeatString(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatString(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatByteEnum<'a>(&'a self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>> {
+    let _aidl_data = match self.build_parcel_RepeatByteEnum(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatByteEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatByteEnum(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatIntEnum<'a>(&'a self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>> {
+    let _aidl_data = match self.build_parcel_RepeatIntEnum(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatIntEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatIntEnum(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatLongEnum<'a>(&'a self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>> {
+    let _aidl_data = match self.build_parcel_RepeatLongEnum(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatLongEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatLongEnum(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseBoolean<'a>(&'a self, _arg_input: &'a [bool], _arg_repeated: &'a mut Vec<bool>) -> binder::BoxFuture<'a, binder::Result<Vec<bool>>> {
+    let _aidl_data = match self.build_parcel_ReverseBoolean(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseBoolean, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseBoolean(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseByte<'a>(&'a self, _arg_input: &'a [u8], _arg_repeated: &'a mut Vec<u8>) -> binder::BoxFuture<'a, binder::Result<Vec<u8>>> {
+    let _aidl_data = match self.build_parcel_ReverseByte(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseByte, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseByte(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseChar<'a>(&'a self, _arg_input: &'a [u16], _arg_repeated: &'a mut Vec<u16>) -> binder::BoxFuture<'a, binder::Result<Vec<u16>>> {
+    let _aidl_data = match self.build_parcel_ReverseChar(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseChar, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseChar(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseInt<'a>(&'a self, _arg_input: &'a [i32], _arg_repeated: &'a mut Vec<i32>) -> binder::BoxFuture<'a, binder::Result<Vec<i32>>> {
+    let _aidl_data = match self.build_parcel_ReverseInt(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseInt, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseInt(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseLong<'a>(&'a self, _arg_input: &'a [i64], _arg_repeated: &'a mut Vec<i64>) -> binder::BoxFuture<'a, binder::Result<Vec<i64>>> {
+    let _aidl_data = match self.build_parcel_ReverseLong(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseLong, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseLong(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseFloat<'a>(&'a self, _arg_input: &'a [f32], _arg_repeated: &'a mut Vec<f32>) -> binder::BoxFuture<'a, binder::Result<Vec<f32>>> {
+    let _aidl_data = match self.build_parcel_ReverseFloat(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseFloat, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseFloat(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseDouble<'a>(&'a self, _arg_input: &'a [f64], _arg_repeated: &'a mut Vec<f64>) -> binder::BoxFuture<'a, binder::Result<Vec<f64>>> {
+    let _aidl_data = match self.build_parcel_ReverseDouble(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseDouble, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseDouble(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseString<'a>(&'a self, _arg_input: &'a [String], _arg_repeated: &'a mut Vec<String>) -> binder::BoxFuture<'a, binder::Result<Vec<String>>> {
+    let _aidl_data = match self.build_parcel_ReverseString(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseString(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseByteEnum<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &'a mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::BoxFuture<'a, binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>> {
+    let _aidl_data = match self.build_parcel_ReverseByteEnum(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseByteEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseByteEnum(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseIntEnum<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &'a mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::BoxFuture<'a, binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>> {
+    let _aidl_data = match self.build_parcel_ReverseIntEnum(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseIntEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseIntEnum(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseLongEnum<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &'a mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::BoxFuture<'a, binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>> {
+    let _aidl_data = match self.build_parcel_ReverseLongEnum(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseLongEnum, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseLongEnum(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#GetOtherTestService<'a>(&'a self, _arg_name: &'a str) -> binder::BoxFuture<'a, binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> {
+    let _aidl_data = match self.build_parcel_GetOtherTestService(_arg_name) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetOtherTestService, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetOtherTestService(_arg_name, _aidl_reply)
+      }
+    )
+  }
+  fn r#SetOtherTestService<'a>(&'a self, _arg_name: &'a str, _arg_service: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::BoxFuture<'a, binder::Result<bool>> {
+    let _aidl_data = match self.build_parcel_SetOtherTestService(_arg_name, _arg_service) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#SetOtherTestService, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_SetOtherTestService(_arg_name, _arg_service, _aidl_reply)
+      }
+    )
+  }
+  fn r#VerifyName<'a>(&'a self, _arg_service: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &'a str) -> binder::BoxFuture<'a, binder::Result<bool>> {
+    let _aidl_data = match self.build_parcel_VerifyName(_arg_service, _arg_name) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#VerifyName, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_VerifyName(_arg_service, _arg_name, _aidl_reply)
+      }
+    )
+  }
+  fn r#GetInterfaceArray<'a>(&'a self, _arg_names: &'a [String]) -> binder::BoxFuture<'a, binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>> {
+    let _aidl_data = match self.build_parcel_GetInterfaceArray(_arg_names) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetInterfaceArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetInterfaceArray(_arg_names, _aidl_reply)
+      }
+    )
+  }
+  fn r#VerifyNamesWithInterfaceArray<'a>(&'a self, _arg_services: &'a [binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &'a [String]) -> binder::BoxFuture<'a, binder::Result<bool>> {
+    let _aidl_data = match self.build_parcel_VerifyNamesWithInterfaceArray(_arg_services, _arg_names) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#VerifyNamesWithInterfaceArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_VerifyNamesWithInterfaceArray(_arg_services, _arg_names, _aidl_reply)
+      }
+    )
+  }
+  fn r#GetNullableInterfaceArray<'a>(&'a self, _arg_names: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>>> {
+    let _aidl_data = match self.build_parcel_GetNullableInterfaceArray(_arg_names) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetNullableInterfaceArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetNullableInterfaceArray(_arg_names, _aidl_reply)
+      }
+    )
+  }
+  fn r#VerifyNamesWithNullableInterfaceArray<'a>(&'a self, _arg_services: Option<&'a [Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<bool>> {
+    let _aidl_data = match self.build_parcel_VerifyNamesWithNullableInterfaceArray(_arg_services, _arg_names) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#VerifyNamesWithNullableInterfaceArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_VerifyNamesWithNullableInterfaceArray(_arg_services, _arg_names, _aidl_reply)
+      }
+    )
+  }
+  fn r#GetInterfaceList<'a>(&'a self, _arg_names: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>>> {
+    let _aidl_data = match self.build_parcel_GetInterfaceList(_arg_names) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetInterfaceList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetInterfaceList(_arg_names, _aidl_reply)
+      }
+    )
+  }
+  fn r#VerifyNamesWithInterfaceList<'a>(&'a self, _arg_services: Option<&'a [Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<bool>> {
+    let _aidl_data = match self.build_parcel_VerifyNamesWithInterfaceList(_arg_services, _arg_names) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#VerifyNamesWithInterfaceList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_VerifyNamesWithInterfaceList(_arg_services, _arg_names, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseStringList<'a>(&'a self, _arg_input: &'a [String], _arg_repeated: &'a mut Vec<String>) -> binder::BoxFuture<'a, binder::Result<Vec<String>>> {
+    let _aidl_data = match self.build_parcel_ReverseStringList(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseStringList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseStringList(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatParcelFileDescriptor<'a>(&'a self, _arg_read: &'a binder::ParcelFileDescriptor) -> binder::BoxFuture<'a, binder::Result<binder::ParcelFileDescriptor>> {
+    let _aidl_data = match self.build_parcel_RepeatParcelFileDescriptor(_arg_read) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatParcelFileDescriptor, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatParcelFileDescriptor(_arg_read, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseParcelFileDescriptorArray<'a>(&'a self, _arg_input: &'a [binder::ParcelFileDescriptor], _arg_repeated: &'a mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::BoxFuture<'a, binder::Result<Vec<binder::ParcelFileDescriptor>>> {
+    let _aidl_data = match self.build_parcel_ReverseParcelFileDescriptorArray(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseParcelFileDescriptorArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseParcelFileDescriptorArray(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ThrowServiceException<'a>(&'a self, _arg_code: i32) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_ThrowServiceException(_arg_code) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ThrowServiceException, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ThrowServiceException(_arg_code, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableIntArray<'a>(&'a self, _arg_input: Option<&'a [i32]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<i32>>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableIntArray(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableIntArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableIntArray(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableByteEnumArray<'a>(&'a self, _arg_input: Option<&'a [crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableByteEnumArray(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableByteEnumArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableByteEnumArray(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableIntEnumArray<'a>(&'a self, _arg_input: Option<&'a [crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableIntEnumArray(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableIntEnumArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableIntEnumArray(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableLongEnumArray<'a>(&'a self, _arg_input: Option<&'a [crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableLongEnumArray(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableLongEnumArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableLongEnumArray(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableString<'a>(&'a self, _arg_input: Option<&'a str>) -> binder::BoxFuture<'a, binder::Result<Option<String>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableString(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableString(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableStringList<'a>(&'a self, _arg_input: Option<&'a [Option<String>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<String>>>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableStringList(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableStringList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableStringList(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableParcelable<'a>(&'a self, _arg_input: Option<&'a crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::BoxFuture<'a, binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableParcelable(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableParcelable, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableParcelable(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableParcelableArray<'a>(&'a self, _arg_input: Option<&'a [Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableParcelableArray(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableParcelableArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableParcelableArray(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableParcelableList<'a>(&'a self, _arg_input: Option<&'a [Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableParcelableList(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableParcelableList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableParcelableList(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#TakesAnIBinder<'a>(&'a self, _arg_input: &'a binder::SpIBinder) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_TakesAnIBinder(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#TakesAnIBinder, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_TakesAnIBinder(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#TakesANullableIBinder<'a>(&'a self, _arg_input: Option<&'a binder::SpIBinder>) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_TakesANullableIBinder(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#TakesANullableIBinder, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_TakesANullableIBinder(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#TakesAnIBinderList<'a>(&'a self, _arg_input: &'a [binder::SpIBinder]) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_TakesAnIBinderList(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#TakesAnIBinderList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_TakesAnIBinderList(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#TakesANullableIBinderList<'a>(&'a self, _arg_input: Option<&'a [Option<binder::SpIBinder>]>) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_TakesANullableIBinderList(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#TakesANullableIBinderList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_TakesANullableIBinderList(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatUtf8CppString<'a>(&'a self, _arg_token: &'a str) -> binder::BoxFuture<'a, binder::Result<String>> {
+    let _aidl_data = match self.build_parcel_RepeatUtf8CppString(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatUtf8CppString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatUtf8CppString(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatNullableUtf8CppString<'a>(&'a self, _arg_token: Option<&'a str>) -> binder::BoxFuture<'a, binder::Result<Option<String>>> {
+    let _aidl_data = match self.build_parcel_RepeatNullableUtf8CppString(_arg_token) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatNullableUtf8CppString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatNullableUtf8CppString(_arg_token, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseUtf8CppString<'a>(&'a self, _arg_input: &'a [String], _arg_repeated: &'a mut Vec<String>) -> binder::BoxFuture<'a, binder::Result<Vec<String>>> {
+    let _aidl_data = match self.build_parcel_ReverseUtf8CppString(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseUtf8CppString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseUtf8CppString(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseNullableUtf8CppString<'a>(&'a self, _arg_input: Option<&'a [Option<String>]>, _arg_repeated: &'a mut Option<Vec<Option<String>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<String>>>>> {
+    let _aidl_data = match self.build_parcel_ReverseNullableUtf8CppString(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseNullableUtf8CppString, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseNullableUtf8CppString(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseUtf8CppStringList<'a>(&'a self, _arg_input: Option<&'a [Option<String>]>, _arg_repeated: &'a mut Option<Vec<Option<String>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<String>>>>> {
+    let _aidl_data = match self.build_parcel_ReverseUtf8CppStringList(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseUtf8CppStringList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseUtf8CppStringList(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#GetCallback<'a>(&'a self, _arg_return_null: bool) -> binder::BoxFuture<'a, binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>> {
+    let _aidl_data = match self.build_parcel_GetCallback(_arg_return_null) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetCallback, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetCallback(_arg_return_null, _aidl_reply)
+      }
+    )
+  }
+  fn r#FillOutStructuredParcelable<'a>(&'a self, _arg_parcel: &'a mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_FillOutStructuredParcelable(_arg_parcel) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#FillOutStructuredParcelable, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_FillOutStructuredParcelable(_arg_parcel, _aidl_reply)
+      }
+    )
+  }
+  fn r#RepeatExtendableParcelable<'a>(&'a self, _arg_ep: &'a crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &'a mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_RepeatExtendableParcelable(_arg_ep, _arg_ep2) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#RepeatExtendableParcelable, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_RepeatExtendableParcelable(_arg_ep, _arg_ep2, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseList<'a>(&'a self, _arg_list: &'a crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList>> {
+    let _aidl_data = match self.build_parcel_ReverseList(_arg_list) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseList, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseList(_arg_list, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseIBinderArray<'a>(&'a self, _arg_input: &'a [binder::SpIBinder], _arg_repeated: &'a mut Vec<Option<binder::SpIBinder>>) -> binder::BoxFuture<'a, binder::Result<Vec<binder::SpIBinder>>> {
+    let _aidl_data = match self.build_parcel_ReverseIBinderArray(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseIBinderArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseIBinderArray(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#ReverseNullableIBinderArray<'a>(&'a self, _arg_input: Option<&'a [Option<binder::SpIBinder>]>, _arg_repeated: &'a mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::SpIBinder>>>>> {
+    let _aidl_data = match self.build_parcel_ReverseNullableIBinderArray(_arg_input, _arg_repeated) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ReverseNullableIBinderArray, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ReverseNullableIBinderArray(_arg_input, _arg_repeated, _aidl_reply)
+      }
+    )
+  }
+  fn r#GetOldNameInterface<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>>> {
+    let _aidl_data = match self.build_parcel_GetOldNameInterface() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetOldNameInterface, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetOldNameInterface(_aidl_reply)
+      }
+    )
+  }
+  fn r#GetNewNameInterface<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>>> {
+    let _aidl_data = match self.build_parcel_GetNewNameInterface() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetNewNameInterface, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetNewNameInterface(_aidl_reply)
+      }
+    )
+  }
+  fn r#GetUnionTags<'a>(&'a self, _arg_input: &'a [crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::BoxFuture<'a, binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>>> {
+    let _aidl_data = match self.build_parcel_GetUnionTags(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetUnionTags, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetUnionTags(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#GetCppJavaTests<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<Option<binder::SpIBinder>>> {
+    let _aidl_data = match self.build_parcel_GetCppJavaTests() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetCppJavaTests, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetCppJavaTests(_aidl_reply)
+      }
+    )
+  }
+  fn r#getBackendType<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType>> {
+    let _aidl_data = match self.build_parcel_getBackendType() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getBackendType, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getBackendType(_aidl_reply)
+      }
+    )
+  }
+  fn r#GetCircular<'a>(&'a self, _arg_cp: &'a mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::BoxFuture<'a, binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>>> {
+    let _aidl_data = match self.build_parcel_GetCircular(_arg_cp) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#GetCircular, _aidl_data, binder::binder_impl::FLAG_CLEAR_BUF | binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_GetCircular(_arg_cp, _aidl_reply)
+      }
+    )
+  }
+}
+impl ITestService for binder::binder_impl::Binder<BnTestService> {
+  fn r#UnimplementedMethod(&self, _arg_arg: i32) -> binder::Result<i32> { self.0.r#UnimplementedMethod(_arg_arg) }
+  fn r#Deprecated(&self) -> binder::Result<()> { self.0.r#Deprecated() }
+  fn r#TestOneway(&self) -> binder::Result<()> { self.0.r#TestOneway() }
+  fn r#RepeatBoolean(&self, _arg_token: bool) -> binder::Result<bool> { self.0.r#RepeatBoolean(_arg_token) }
+  fn r#RepeatByte(&self, _arg_token: i8) -> binder::Result<i8> { self.0.r#RepeatByte(_arg_token) }
+  fn r#RepeatChar(&self, _arg_token: u16) -> binder::Result<u16> { self.0.r#RepeatChar(_arg_token) }
+  fn r#RepeatInt(&self, _arg_token: i32) -> binder::Result<i32> { self.0.r#RepeatInt(_arg_token) }
+  fn r#RepeatLong(&self, _arg_token: i64) -> binder::Result<i64> { self.0.r#RepeatLong(_arg_token) }
+  fn r#RepeatFloat(&self, _arg_token: f32) -> binder::Result<f32> { self.0.r#RepeatFloat(_arg_token) }
+  fn r#RepeatDouble(&self, _arg_token: f64) -> binder::Result<f64> { self.0.r#RepeatDouble(_arg_token) }
+  fn r#RepeatString(&self, _arg_token: &str) -> binder::Result<String> { self.0.r#RepeatString(_arg_token) }
+  fn r#RepeatByteEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum> { self.0.r#RepeatByteEnum(_arg_token) }
+  fn r#RepeatIntEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum> { self.0.r#RepeatIntEnum(_arg_token) }
+  fn r#RepeatLongEnum(&self, _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum> { self.0.r#RepeatLongEnum(_arg_token) }
+  fn r#ReverseBoolean(&self, _arg_input: &[bool], _arg_repeated: &mut Vec<bool>) -> binder::Result<Vec<bool>> { self.0.r#ReverseBoolean(_arg_input, _arg_repeated) }
+  fn r#ReverseByte(&self, _arg_input: &[u8], _arg_repeated: &mut Vec<u8>) -> binder::Result<Vec<u8>> { self.0.r#ReverseByte(_arg_input, _arg_repeated) }
+  fn r#ReverseChar(&self, _arg_input: &[u16], _arg_repeated: &mut Vec<u16>) -> binder::Result<Vec<u16>> { self.0.r#ReverseChar(_arg_input, _arg_repeated) }
+  fn r#ReverseInt(&self, _arg_input: &[i32], _arg_repeated: &mut Vec<i32>) -> binder::Result<Vec<i32>> { self.0.r#ReverseInt(_arg_input, _arg_repeated) }
+  fn r#ReverseLong(&self, _arg_input: &[i64], _arg_repeated: &mut Vec<i64>) -> binder::Result<Vec<i64>> { self.0.r#ReverseLong(_arg_input, _arg_repeated) }
+  fn r#ReverseFloat(&self, _arg_input: &[f32], _arg_repeated: &mut Vec<f32>) -> binder::Result<Vec<f32>> { self.0.r#ReverseFloat(_arg_input, _arg_repeated) }
+  fn r#ReverseDouble(&self, _arg_input: &[f64], _arg_repeated: &mut Vec<f64>) -> binder::Result<Vec<f64>> { self.0.r#ReverseDouble(_arg_input, _arg_repeated) }
+  fn r#ReverseString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> { self.0.r#ReverseString(_arg_input, _arg_repeated) }
+  fn r#ReverseByteEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>> { self.0.r#ReverseByteEnum(_arg_input, _arg_repeated) }
+  fn r#ReverseIntEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>> { self.0.r#ReverseIntEnum(_arg_input, _arg_repeated) }
+  fn r#ReverseLongEnum(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum], _arg_repeated: &mut Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>> { self.0.r#ReverseLongEnum(_arg_input, _arg_repeated) }
+  fn r#GetOtherTestService(&self, _arg_name: &str) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>> { self.0.r#GetOtherTestService(_arg_name) }
+  fn r#SetOtherTestService(&self, _arg_name: &str, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>) -> binder::Result<bool> { self.0.r#SetOtherTestService(_arg_name, _arg_service) }
+  fn r#VerifyName(&self, _arg_service: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>, _arg_name: &str) -> binder::Result<bool> { self.0.r#VerifyName(_arg_service, _arg_name) }
+  fn r#GetInterfaceArray(&self, _arg_names: &[String]) -> binder::Result<Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> { self.0.r#GetInterfaceArray(_arg_names) }
+  fn r#VerifyNamesWithInterfaceArray(&self, _arg_services: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>], _arg_names: &[String]) -> binder::Result<bool> { self.0.r#VerifyNamesWithInterfaceArray(_arg_services, _arg_names) }
+  fn r#GetNullableInterfaceArray(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> { self.0.r#GetNullableInterfaceArray(_arg_names) }
+  fn r#VerifyNamesWithNullableInterfaceArray(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool> { self.0.r#VerifyNamesWithNullableInterfaceArray(_arg_services, _arg_names) }
+  fn r#GetInterfaceList(&self, _arg_names: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>>> { self.0.r#GetInterfaceList(_arg_names) }
+  fn r#VerifyNamesWithInterfaceList(&self, _arg_services: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>]>, _arg_names: Option<&[Option<String>]>) -> binder::Result<bool> { self.0.r#VerifyNamesWithInterfaceList(_arg_services, _arg_names) }
+  fn r#ReverseStringList(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> { self.0.r#ReverseStringList(_arg_input, _arg_repeated) }
+  fn r#RepeatParcelFileDescriptor(&self, _arg_read: &binder::ParcelFileDescriptor) -> binder::Result<binder::ParcelFileDescriptor> { self.0.r#RepeatParcelFileDescriptor(_arg_read) }
+  fn r#ReverseParcelFileDescriptorArray(&self, _arg_input: &[binder::ParcelFileDescriptor], _arg_repeated: &mut Vec<Option<binder::ParcelFileDescriptor>>) -> binder::Result<Vec<binder::ParcelFileDescriptor>> { self.0.r#ReverseParcelFileDescriptorArray(_arg_input, _arg_repeated) }
+  fn r#ThrowServiceException(&self, _arg_code: i32) -> binder::Result<()> { self.0.r#ThrowServiceException(_arg_code) }
+  fn r#RepeatNullableIntArray(&self, _arg_input: Option<&[i32]>) -> binder::Result<Option<Vec<i32>>> { self.0.r#RepeatNullableIntArray(_arg_input) }
+  fn r#RepeatNullableByteEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>>> { self.0.r#RepeatNullableByteEnumArray(_arg_input) }
+  fn r#RepeatNullableIntEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>>> { self.0.r#RepeatNullableIntEnumArray(_arg_input) }
+  fn r#RepeatNullableLongEnumArray(&self, _arg_input: Option<&[crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum]>) -> binder::Result<Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>>> { self.0.r#RepeatNullableLongEnumArray(_arg_input) }
+  fn r#RepeatNullableString(&self, _arg_input: Option<&str>) -> binder::Result<Option<String>> { self.0.r#RepeatNullableString(_arg_input) }
+  fn r#RepeatNullableStringList(&self, _arg_input: Option<&[Option<String>]>) -> binder::Result<Option<Vec<Option<String>>>> { self.0.r#RepeatNullableStringList(_arg_input) }
+  fn r#RepeatNullableParcelable(&self, _arg_input: Option<&crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>) -> binder::Result<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>> { self.0.r#RepeatNullableParcelable(_arg_input) }
+  fn r#RepeatNullableParcelableArray(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> { self.0.r#RepeatNullableParcelableArray(_arg_input) }
+  fn r#RepeatNullableParcelableList(&self, _arg_input: Option<&[Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>]>) -> binder::Result<Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>> { self.0.r#RepeatNullableParcelableList(_arg_input) }
+  fn r#TakesAnIBinder(&self, _arg_input: &binder::SpIBinder) -> binder::Result<()> { self.0.r#TakesAnIBinder(_arg_input) }
+  fn r#TakesANullableIBinder(&self, _arg_input: Option<&binder::SpIBinder>) -> binder::Result<()> { self.0.r#TakesANullableIBinder(_arg_input) }
+  fn r#TakesAnIBinderList(&self, _arg_input: &[binder::SpIBinder]) -> binder::Result<()> { self.0.r#TakesAnIBinderList(_arg_input) }
+  fn r#TakesANullableIBinderList(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>) -> binder::Result<()> { self.0.r#TakesANullableIBinderList(_arg_input) }
+  fn r#RepeatUtf8CppString(&self, _arg_token: &str) -> binder::Result<String> { self.0.r#RepeatUtf8CppString(_arg_token) }
+  fn r#RepeatNullableUtf8CppString(&self, _arg_token: Option<&str>) -> binder::Result<Option<String>> { self.0.r#RepeatNullableUtf8CppString(_arg_token) }
+  fn r#ReverseUtf8CppString(&self, _arg_input: &[String], _arg_repeated: &mut Vec<String>) -> binder::Result<Vec<String>> { self.0.r#ReverseUtf8CppString(_arg_input, _arg_repeated) }
+  fn r#ReverseNullableUtf8CppString(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>> { self.0.r#ReverseNullableUtf8CppString(_arg_input, _arg_repeated) }
+  fn r#ReverseUtf8CppStringList(&self, _arg_input: Option<&[Option<String>]>, _arg_repeated: &mut Option<Vec<Option<String>>>) -> binder::Result<Option<Vec<Option<String>>>> { self.0.r#ReverseUtf8CppStringList(_arg_input, _arg_repeated) }
+  fn r#GetCallback(&self, _arg_return_null: bool) -> binder::Result<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>> { self.0.r#GetCallback(_arg_return_null) }
+  fn r#FillOutStructuredParcelable(&self, _arg_parcel: &mut crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable) -> binder::Result<()> { self.0.r#FillOutStructuredParcelable(_arg_parcel) }
+  fn r#RepeatExtendableParcelable(&self, _arg_ep: &crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable, _arg_ep2: &mut crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable) -> binder::Result<()> { self.0.r#RepeatExtendableParcelable(_arg_ep, _arg_ep2) }
+  fn r#ReverseList(&self, _arg_list: &crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList> { self.0.r#ReverseList(_arg_list) }
+  fn r#ReverseIBinderArray(&self, _arg_input: &[binder::SpIBinder], _arg_repeated: &mut Vec<Option<binder::SpIBinder>>) -> binder::Result<Vec<binder::SpIBinder>> { self.0.r#ReverseIBinderArray(_arg_input, _arg_repeated) }
+  fn r#ReverseNullableIBinderArray(&self, _arg_input: Option<&[Option<binder::SpIBinder>]>, _arg_repeated: &mut Option<Vec<Option<binder::SpIBinder>>>) -> binder::Result<Option<Vec<Option<binder::SpIBinder>>>> { self.0.r#ReverseNullableIBinderArray(_arg_input, _arg_repeated) }
+  fn r#GetOldNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_IOldName>> { self.0.r#GetOldNameInterface() }
+  fn r#GetNewNameInterface(&self) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_8_INewName>> { self.0.r#GetNewNameInterface() }
+  fn r#GetUnionTags(&self, _arg_input: &[crate::mangled::_7_android_4_aidl_5_tests_5_Union]) -> binder::Result<Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union_3_Tag>> { self.0.r#GetUnionTags(_arg_input) }
+  fn r#GetCppJavaTests(&self) -> binder::Result<Option<binder::SpIBinder>> { self.0.r#GetCppJavaTests() }
+  fn r#getBackendType(&self) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_11_BackendType> { self.0.r#getBackendType() }
+  fn r#GetCircular(&self, _arg_cp: &mut crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable) -> binder::Result<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_9_ICircular>> { self.0.r#GetCircular(_arg_cp) }
+}
+fn on_transact(_aidl_service: &dyn ITestService, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#UnimplementedMethod => {
+      let _arg_arg: i32 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#UnimplementedMethod(_arg_arg);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#Deprecated => {
+      let _aidl_return = _aidl_service.r#Deprecated();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#TestOneway => {
+      let _aidl_return = _aidl_service.r#TestOneway();
+      Ok(())
+    }
+    transactions::r#RepeatBoolean => {
+      let _arg_token: bool = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatBoolean(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatByte => {
+      let _arg_token: i8 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatByte(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatChar => {
+      let _arg_token: u16 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatChar(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatInt => {
+      let _arg_token: i32 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatInt(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatLong => {
+      let _arg_token: i64 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatLong(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatFloat => {
+      let _arg_token: f32 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatFloat(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatDouble => {
+      let _arg_token: f64 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatDouble(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatString => {
+      let _arg_token: String = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatString(&_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatByteEnum => {
+      let _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatByteEnum(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatIntEnum => {
+      let _arg_token: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatIntEnum(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatLongEnum => {
+      let _arg_token: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatLongEnum(_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseBoolean => {
+      let _arg_input: Vec<bool> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<bool> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseBoolean(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseByte => {
+      let _arg_input: Vec<u8> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<u8> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseByte(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseChar => {
+      let _arg_input: Vec<u16> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<u16> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseChar(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseInt => {
+      let _arg_input: Vec<i32> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<i32> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseInt(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseLong => {
+      let _arg_input: Vec<i64> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<i64> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseLong(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseFloat => {
+      let _arg_input: Vec<f32> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<f32> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseFloat(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseDouble => {
+      let _arg_input: Vec<f64> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<f64> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseDouble(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseString => {
+      let _arg_input: Vec<String> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<String> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseString(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseByteEnum => {
+      let _arg_input: Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseByteEnum(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseIntEnum => {
+      let _arg_input: Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseIntEnum(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseLongEnum => {
+      let _arg_input: Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseLongEnum(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetOtherTestService => {
+      let _arg_name: String = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#GetOtherTestService(&_arg_name);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#SetOtherTestService => {
+      let _arg_name: String = _aidl_data.read()?;
+      let _arg_service: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#SetOtherTestService(&_arg_name, &_arg_service);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#VerifyName => {
+      let _arg_service: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback> = _aidl_data.read()?;
+      let _arg_name: String = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#VerifyName(&_arg_service, &_arg_name);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetInterfaceArray => {
+      let _arg_names: Vec<String> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#GetInterfaceArray(&_arg_names);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#VerifyNamesWithInterfaceArray => {
+      let _arg_services: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>> = _aidl_data.read()?;
+      let _arg_names: Vec<String> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#VerifyNamesWithInterfaceArray(&_arg_services, &_arg_names);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetNullableInterfaceArray => {
+      let _arg_names: Option<Vec<Option<String>>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#GetNullableInterfaceArray(_arg_names.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#VerifyNamesWithNullableInterfaceArray => {
+      let _arg_services: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>> = _aidl_data.read()?;
+      let _arg_names: Option<Vec<Option<String>>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#VerifyNamesWithNullableInterfaceArray(_arg_services.as_deref(), _arg_names.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetInterfaceList => {
+      let _arg_names: Option<Vec<Option<String>>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#GetInterfaceList(_arg_names.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#VerifyNamesWithInterfaceList => {
+      let _arg_services: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_14_INamedCallback>>>> = _aidl_data.read()?;
+      let _arg_names: Option<Vec<Option<String>>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#VerifyNamesWithInterfaceList(_arg_services.as_deref(), _arg_names.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseStringList => {
+      let _arg_input: Vec<String> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<String> = Default::default();
+      let _aidl_return = _aidl_service.r#ReverseStringList(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatParcelFileDescriptor => {
+      let _arg_read: binder::ParcelFileDescriptor = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatParcelFileDescriptor(&_arg_read);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseParcelFileDescriptorArray => {
+      let _arg_input: Vec<binder::ParcelFileDescriptor> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<Option<binder::ParcelFileDescriptor>> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseParcelFileDescriptorArray(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          if _arg_repeated.iter().any(Option::is_none) { return Err(binder::StatusCode::UNEXPECTED_NULL); }
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ThrowServiceException => {
+      let _arg_code: i32 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#ThrowServiceException(_arg_code);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableIntArray => {
+      let _arg_input: Option<Vec<i32>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableIntArray(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableByteEnumArray => {
+      let _arg_input: Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableByteEnumArray(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableIntEnumArray => {
+      let _arg_input: Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableIntEnumArray(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableLongEnumArray => {
+      let _arg_input: Option<Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableLongEnumArray(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableString => {
+      let _arg_input: Option<String> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableString(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableStringList => {
+      let _arg_input: Option<Vec<Option<String>>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableStringList(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableParcelable => {
+      let _arg_input: Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableParcelable(_arg_input.as_ref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableParcelableArray => {
+      let _arg_input: Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableParcelableArray(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableParcelableList => {
+      let _arg_input: Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableParcelableList(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#TakesAnIBinder => {
+      let _arg_input: binder::SpIBinder = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#TakesAnIBinder(&_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#TakesANullableIBinder => {
+      let _arg_input: Option<binder::SpIBinder> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#TakesANullableIBinder(_arg_input.as_ref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#TakesAnIBinderList => {
+      let _arg_input: Vec<binder::SpIBinder> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#TakesAnIBinderList(&_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#TakesANullableIBinderList => {
+      let _arg_input: Option<Vec<Option<binder::SpIBinder>>> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#TakesANullableIBinderList(_arg_input.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatUtf8CppString => {
+      let _arg_token: String = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatUtf8CppString(&_arg_token);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatNullableUtf8CppString => {
+      let _arg_token: Option<String> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#RepeatNullableUtf8CppString(_arg_token.as_deref());
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseUtf8CppString => {
+      let _arg_input: Vec<String> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<String> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseUtf8CppString(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseNullableUtf8CppString => {
+      let _arg_input: Option<Vec<Option<String>>> = _aidl_data.read()?;
+      let mut _arg_repeated: Option<Vec<Option<String>>> = Default::default();
+      _aidl_data.resize_nullable_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseNullableUtf8CppString(_arg_input.as_deref(), &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseUtf8CppStringList => {
+      let _arg_input: Option<Vec<Option<String>>> = _aidl_data.read()?;
+      let mut _arg_repeated: Option<Vec<Option<String>>> = Default::default();
+      let _aidl_return = _aidl_service.r#ReverseUtf8CppStringList(_arg_input.as_deref(), &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetCallback => {
+      let _arg_return_null: bool = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#GetCallback(_arg_return_null);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#FillOutStructuredParcelable => {
+      let mut _arg_parcel: crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#FillOutStructuredParcelable(&mut _arg_parcel);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(&_arg_parcel)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#RepeatExtendableParcelable => {
+      let _arg_ep: crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable = _aidl_data.read()?;
+      let mut _arg_ep2: crate::mangled::_7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable = Default::default();
+      let _aidl_return = _aidl_service.r#RepeatExtendableParcelable(&_arg_ep, &mut _arg_ep2);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(&_arg_ep2)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseList => {
+      let _arg_list: crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#ReverseList(&_arg_list);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseIBinderArray => {
+      let _arg_input: Vec<binder::SpIBinder> = _aidl_data.read()?;
+      let mut _arg_repeated: Vec<Option<binder::SpIBinder>> = Default::default();
+      _aidl_data.resize_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseIBinderArray(&_arg_input, &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ReverseNullableIBinderArray => {
+      let _arg_input: Option<Vec<Option<binder::SpIBinder>>> = _aidl_data.read()?;
+      let mut _arg_repeated: Option<Vec<Option<binder::SpIBinder>>> = Default::default();
+      _aidl_data.resize_nullable_out_vec(&mut _arg_repeated)?;
+      let _aidl_return = _aidl_service.r#ReverseNullableIBinderArray(_arg_input.as_deref(), &mut _arg_repeated);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_repeated)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetOldNameInterface => {
+      let _aidl_return = _aidl_service.r#GetOldNameInterface();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetNewNameInterface => {
+      let _aidl_return = _aidl_service.r#GetNewNameInterface();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetUnionTags => {
+      let _arg_input: Vec<crate::mangled::_7_android_4_aidl_5_tests_5_Union> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#GetUnionTags(&_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetCppJavaTests => {
+      let _aidl_return = _aidl_service.r#GetCppJavaTests();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getBackendType => {
+      let _aidl_return = _aidl_service.r#getBackendType();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#GetCircular => {
+      let mut _arg_cp: crate::mangled::_7_android_4_aidl_5_tests_18_CircularParcelable = Default::default();
+      let _aidl_return = _aidl_service.r#GetCircular(&mut _arg_cp);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_cp)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub mod r#Empty {
+  #[derive(Debug, Clone, PartialEq)]
+  pub struct r#Empty {
+  }
+  impl Default for r#Empty {
+    fn default() -> Self {
+      Self {
+      }
+    }
+  }
+  impl binder::Parcelable for r#Empty {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#Empty);
+  binder::impl_deserialize_for_parcelable!(r#Empty);
+  impl binder::binder_impl::ParcelableMetadata for r#Empty {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.ITestService.Empty" }
+  }
+}
+pub mod r#CompilerChecks {
+  #[derive(Debug)]
+  pub struct r#CompilerChecks {
+    pub r#binder: Option<binder::SpIBinder>,
+    pub r#nullable_binder: Option<binder::SpIBinder>,
+    pub r#binder_array: Vec<binder::SpIBinder>,
+    pub r#nullable_binder_array: Option<Vec<Option<binder::SpIBinder>>>,
+    pub r#binder_list: Vec<binder::SpIBinder>,
+    pub r#nullable_binder_list: Option<Vec<Option<binder::SpIBinder>>>,
+    pub r#pfd: Option<binder::ParcelFileDescriptor>,
+    pub r#nullable_pfd: Option<binder::ParcelFileDescriptor>,
+    pub r#pfd_array: Vec<binder::ParcelFileDescriptor>,
+    pub r#nullable_pfd_array: Option<Vec<Option<binder::ParcelFileDescriptor>>>,
+    pub r#pfd_list: Vec<binder::ParcelFileDescriptor>,
+    pub r#nullable_pfd_list: Option<Vec<Option<binder::ParcelFileDescriptor>>>,
+    pub r#parcel: crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty,
+    pub r#nullable_parcel: Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>,
+    pub r#parcel_array: Vec<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>,
+    pub r#nullable_parcel_array: Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>,
+    pub r#parcel_list: Vec<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>,
+    pub r#nullable_parcel_list: Option<Vec<Option<crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_5_Empty>>>,
+  }
+  impl Default for r#CompilerChecks {
+    fn default() -> Self {
+      Self {
+        r#binder: Default::default(),
+        r#nullable_binder: Default::default(),
+        r#binder_array: Default::default(),
+        r#nullable_binder_array: Default::default(),
+        r#binder_list: Default::default(),
+        r#nullable_binder_list: Default::default(),
+        r#pfd: Default::default(),
+        r#nullable_pfd: Default::default(),
+        r#pfd_array: Default::default(),
+        r#nullable_pfd_array: Default::default(),
+        r#pfd_list: Default::default(),
+        r#nullable_pfd_list: Default::default(),
+        r#parcel: Default::default(),
+        r#nullable_parcel: Default::default(),
+        r#parcel_array: Default::default(),
+        r#nullable_parcel_array: Default::default(),
+        r#parcel_list: Default::default(),
+        r#nullable_parcel_list: Default::default(),
+      }
+    }
+  }
+  impl binder::Parcelable for r#CompilerChecks {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        let __field_ref = self.r#binder.as_ref().ok_or(binder::StatusCode::UNEXPECTED_NULL)?;
+        subparcel.write(__field_ref)?;
+        subparcel.write(&self.r#nullable_binder)?;
+        subparcel.write(&self.r#binder_array)?;
+        subparcel.write(&self.r#nullable_binder_array)?;
+        subparcel.write(&self.r#binder_list)?;
+        subparcel.write(&self.r#nullable_binder_list)?;
+        let __field_ref = self.r#pfd.as_ref().ok_or(binder::StatusCode::UNEXPECTED_NULL)?;
+        subparcel.write(__field_ref)?;
+        subparcel.write(&self.r#nullable_pfd)?;
+        subparcel.write(&self.r#pfd_array)?;
+        subparcel.write(&self.r#nullable_pfd_array)?;
+        subparcel.write(&self.r#pfd_list)?;
+        subparcel.write(&self.r#nullable_pfd_list)?;
+        subparcel.write(&self.r#parcel)?;
+        subparcel.write(&self.r#nullable_parcel)?;
+        subparcel.write(&self.r#parcel_array)?;
+        subparcel.write(&self.r#nullable_parcel_array)?;
+        subparcel.write(&self.r#parcel_list)?;
+        subparcel.write(&self.r#nullable_parcel_list)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#binder = Some(subparcel.read()?);
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_binder = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#binder_array = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_binder_array = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#binder_list = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_binder_list = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#pfd = Some(subparcel.read()?);
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_pfd = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#pfd_array = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_pfd_array = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#pfd_list = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_pfd_list = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#parcel = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_parcel = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#parcel_array = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_parcel_array = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#parcel_list = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_parcel_list = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#CompilerChecks);
+  binder::impl_deserialize_for_parcelable!(r#CompilerChecks);
+  impl binder::binder_impl::ParcelableMetadata for r#CompilerChecks {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.ITestService.CompilerChecks" }
+  }
+  pub mod r#Foo {
+    #![allow(non_upper_case_globals)]
+    #![allow(non_snake_case)]
+    #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+    use binder::declare_binder_interface;
+    declare_binder_interface! {
+      IFoo["android.aidl.tests.ITestService.CompilerChecks.Foo"] {
+        native: BnFoo(on_transact),
+        proxy: BpFoo {
+        },
+        async: IFooAsync,
+      }
+    }
+    pub trait IFoo: binder::Interface + Send {
+      fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.Foo" }
+      fn getDefaultImpl() -> IFooDefaultRef where Self: Sized {
+        DEFAULT_IMPL.lock().unwrap().clone()
+      }
+      fn setDefaultImpl(d: IFooDefaultRef) -> IFooDefaultRef where Self: Sized {
+        std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+      }
+    }
+    pub trait IFooAsync<P>: binder::Interface + Send {
+      fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.Foo" }
+    }
+    #[::async_trait::async_trait]
+    pub trait IFooAsyncServer: binder::Interface + Send {
+      fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.Foo" }
+    }
+    impl BnFoo {
+      /// Create a new async binder service.
+      pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IFoo>
+      where
+        T: IFooAsyncServer + binder::Interface + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+        struct Wrapper<T, R> {
+          _inner: T,
+          _rt: R,
+        }
+        impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+          fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+          fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+        }
+        impl<T, R> IFoo for Wrapper<T, R>
+        where
+          T: IFooAsyncServer + Send + Sync + 'static,
+          R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+        {
+        }
+        let wrapped = Wrapper { _inner: inner, _rt: rt };
+        Self::new_binder(wrapped, features)
+      }
+    }
+    pub trait IFooDefault: Send + Sync {
+    }
+    pub mod transactions {
+    }
+    pub type IFooDefaultRef = Option<std::sync::Arc<dyn IFooDefault>>;
+    use lazy_static::lazy_static;
+    lazy_static! {
+      static ref DEFAULT_IMPL: std::sync::Mutex<IFooDefaultRef> = std::sync::Mutex::new(None);
+    }
+    impl BpFoo {
+    }
+    impl IFoo for BpFoo {
+    }
+    impl<P: binder::BinderAsyncPool> IFooAsync<P> for BpFoo {
+    }
+    impl IFoo for binder::binder_impl::Binder<BnFoo> {
+    }
+    fn on_transact(_aidl_service: &dyn IFoo, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+      match _aidl_code {
+        _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+      }
+    }
+  }
+  pub mod r#HasDeprecated {
+    #[derive(Debug)]
+    pub struct r#HasDeprecated {
+      #[deprecated = "field"]
+      pub r#deprecated: i32,
+    }
+    impl Default for r#HasDeprecated {
+      fn default() -> Self {
+        Self {
+          r#deprecated: 0,
+        }
+      }
+    }
+    impl binder::Parcelable for r#HasDeprecated {
+      fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+        parcel.sized_write(|subparcel| {
+          subparcel.write(&self.r#deprecated)?;
+          Ok(())
+        })
+      }
+      fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+        parcel.sized_read(|subparcel| {
+          if subparcel.has_more_data() {
+            self.r#deprecated = subparcel.read()?;
+          }
+          Ok(())
+        })
+      }
+    }
+    binder::impl_serialize_for_parcelable!(r#HasDeprecated);
+    binder::impl_deserialize_for_parcelable!(r#HasDeprecated);
+    impl binder::binder_impl::ParcelableMetadata for r#HasDeprecated {
+      fn get_descriptor() -> &'static str { "android.aidl.tests.ITestService.CompilerChecks.HasDeprecated" }
+    }
+  }
+  pub mod r#UsingHasDeprecated {
+    #[derive(Debug)]
+    pub enum r#UsingHasDeprecated {
+      N(i32),
+      M(crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_13_HasDeprecated),
+    }
+    impl Default for r#UsingHasDeprecated {
+      fn default() -> Self {
+        Self::N(0)
+      }
+    }
+    impl binder::Parcelable for r#UsingHasDeprecated {
+      fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+        match self {
+          Self::N(v) => {
+            parcel.write(&0i32)?;
+            parcel.write(v)
+          }
+          Self::M(v) => {
+            parcel.write(&1i32)?;
+            parcel.write(v)
+          }
+        }
+      }
+      fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+        let tag: i32 = parcel.read()?;
+        match tag {
+          0 => {
+            let value: i32 = parcel.read()?;
+            *self = Self::N(value);
+            Ok(())
+          }
+          1 => {
+            let value: crate::mangled::_7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_13_HasDeprecated = parcel.read()?;
+            *self = Self::M(value);
+            Ok(())
+          }
+          _ => {
+            Err(binder::StatusCode::BAD_VALUE)
+          }
+        }
+      }
+    }
+    binder::impl_serialize_for_parcelable!(r#UsingHasDeprecated);
+    binder::impl_deserialize_for_parcelable!(r#UsingHasDeprecated);
+    impl binder::binder_impl::ParcelableMetadata for r#UsingHasDeprecated {
+      fn get_descriptor() -> &'static str { "android.aidl.tests.ITestService.CompilerChecks.UsingHasDeprecated" }
+    }
+    pub mod r#Tag {
+      #![allow(non_upper_case_globals)]
+      use binder::declare_binder_enum;
+      declare_binder_enum! {
+        r#Tag : [i32; 2] {
+          r#n = 0,
+          r#m = 1,
+        }
+      }
+    }
+  }
+  pub mod r#NoPrefixInterface {
+    #![allow(non_upper_case_globals)]
+    #![allow(non_snake_case)]
+    #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+    use binder::declare_binder_interface;
+    declare_binder_interface! {
+      INoPrefixInterface["android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface"] {
+        native: BnNoPrefixInterface(on_transact),
+        proxy: BpNoPrefixInterface {
+        },
+        async: INoPrefixInterfaceAsync,
+      }
+    }
+    pub trait INoPrefixInterface: binder::Interface + Send {
+      fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface" }
+      fn r#foo(&self) -> binder::Result<()>;
+      fn getDefaultImpl() -> INoPrefixInterfaceDefaultRef where Self: Sized {
+        DEFAULT_IMPL.lock().unwrap().clone()
+      }
+      fn setDefaultImpl(d: INoPrefixInterfaceDefaultRef) -> INoPrefixInterfaceDefaultRef where Self: Sized {
+        std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+      }
+    }
+    pub trait INoPrefixInterfaceAsync<P>: binder::Interface + Send {
+      fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface" }
+      fn r#foo<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>>;
+    }
+    #[::async_trait::async_trait]
+    pub trait INoPrefixInterfaceAsyncServer: binder::Interface + Send {
+      fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface" }
+      async fn r#foo(&self) -> binder::Result<()>;
+    }
+    impl BnNoPrefixInterface {
+      /// Create a new async binder service.
+      pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn INoPrefixInterface>
+      where
+        T: INoPrefixInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+        struct Wrapper<T, R> {
+          _inner: T,
+          _rt: R,
+        }
+        impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+          fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+          fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+        }
+        impl<T, R> INoPrefixInterface for Wrapper<T, R>
+        where
+          T: INoPrefixInterfaceAsyncServer + Send + Sync + 'static,
+          R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+        {
+          fn r#foo(&self) -> binder::Result<()> {
+            self._rt.block_on(self._inner.r#foo())
+          }
+        }
+        let wrapped = Wrapper { _inner: inner, _rt: rt };
+        Self::new_binder(wrapped, features)
+      }
+    }
+    pub trait INoPrefixInterfaceDefault: Send + Sync {
+      fn r#foo(&self) -> binder::Result<()> {
+        Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+      }
+    }
+    pub mod transactions {
+      pub const r#foo: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+    }
+    pub type INoPrefixInterfaceDefaultRef = Option<std::sync::Arc<dyn INoPrefixInterfaceDefault>>;
+    use lazy_static::lazy_static;
+    lazy_static! {
+      static ref DEFAULT_IMPL: std::sync::Mutex<INoPrefixInterfaceDefaultRef> = std::sync::Mutex::new(None);
+    }
+    impl BpNoPrefixInterface {
+      fn build_parcel_foo(&self) -> binder::Result<binder::binder_impl::Parcel> {
+        let mut aidl_data = self.binder.prepare_transact()?;
+        Ok(aidl_data)
+      }
+      fn read_response_foo(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+        if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+          if let Some(_aidl_default_impl) = <Self as INoPrefixInterface>::getDefaultImpl() {
+            return _aidl_default_impl.r#foo();
+          }
+        }
+        let _aidl_reply = _aidl_reply?;
+        let _aidl_status: binder::Status = _aidl_reply.read()?;
+        if !_aidl_status.is_ok() { return Err(_aidl_status); }
+        Ok(())
+      }
+    }
+    impl INoPrefixInterface for BpNoPrefixInterface {
+      fn r#foo(&self) -> binder::Result<()> {
+        let _aidl_data = self.build_parcel_foo()?;
+        let _aidl_reply = self.binder.submit_transact(transactions::r#foo, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+        self.read_response_foo(_aidl_reply)
+      }
+    }
+    impl<P: binder::BinderAsyncPool> INoPrefixInterfaceAsync<P> for BpNoPrefixInterface {
+      fn r#foo<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>> {
+        let _aidl_data = match self.build_parcel_foo() {
+          Ok(_aidl_data) => _aidl_data,
+          Err(err) => return Box::pin(std::future::ready(Err(err))),
+        };
+        let binder = self.binder.clone();
+        P::spawn(
+          move || binder.submit_transact(transactions::r#foo, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+          move |_aidl_reply| async move {
+            self.read_response_foo(_aidl_reply)
+          }
+        )
+      }
+    }
+    impl INoPrefixInterface for binder::binder_impl::Binder<BnNoPrefixInterface> {
+      fn r#foo(&self) -> binder::Result<()> { self.0.r#foo() }
+    }
+    fn on_transact(_aidl_service: &dyn INoPrefixInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+      match _aidl_code {
+        transactions::r#foo => {
+          let _aidl_return = _aidl_service.r#foo();
+          match &_aidl_return {
+            Ok(_aidl_return) => {
+              _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            }
+            Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+          }
+          Ok(())
+        }
+        _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+      }
+    }
+    pub mod r#Nested {
+      #[derive(Debug)]
+      pub struct r#Nested {
+      }
+      impl Default for r#Nested {
+        fn default() -> Self {
+          Self {
+          }
+        }
+      }
+      impl binder::Parcelable for r#Nested {
+        fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+          parcel.sized_write(|subparcel| {
+            Ok(())
+          })
+        }
+        fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+          parcel.sized_read(|subparcel| {
+            Ok(())
+          })
+        }
+      }
+      binder::impl_serialize_for_parcelable!(r#Nested);
+      binder::impl_deserialize_for_parcelable!(r#Nested);
+      impl binder::binder_impl::ParcelableMetadata for r#Nested {
+        fn get_descriptor() -> &'static str { "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.Nested" }
+      }
+    }
+    pub mod r#NestedNoPrefixInterface {
+      #![allow(non_upper_case_globals)]
+      #![allow(non_snake_case)]
+      #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+      use binder::declare_binder_interface;
+      declare_binder_interface! {
+        INestedNoPrefixInterface["android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface"] {
+          native: BnNestedNoPrefixInterface(on_transact),
+          proxy: BpNestedNoPrefixInterface {
+          },
+          async: INestedNoPrefixInterfaceAsync,
+        }
+      }
+      pub trait INestedNoPrefixInterface: binder::Interface + Send {
+        fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface" }
+        fn r#foo(&self) -> binder::Result<()>;
+        fn getDefaultImpl() -> INestedNoPrefixInterfaceDefaultRef where Self: Sized {
+          DEFAULT_IMPL.lock().unwrap().clone()
+        }
+        fn setDefaultImpl(d: INestedNoPrefixInterfaceDefaultRef) -> INestedNoPrefixInterfaceDefaultRef where Self: Sized {
+          std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+        }
+      }
+      pub trait INestedNoPrefixInterfaceAsync<P>: binder::Interface + Send {
+        fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface" }
+        fn r#foo<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>>;
+      }
+      #[::async_trait::async_trait]
+      pub trait INestedNoPrefixInterfaceAsyncServer: binder::Interface + Send {
+        fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService.CompilerChecks.NoPrefixInterface.NestedNoPrefixInterface" }
+        async fn r#foo(&self) -> binder::Result<()>;
+      }
+      impl BnNestedNoPrefixInterface {
+        /// Create a new async binder service.
+        pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn INestedNoPrefixInterface>
+        where
+          T: INestedNoPrefixInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+          R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+        {
+          struct Wrapper<T, R> {
+            _inner: T,
+            _rt: R,
+          }
+          impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+            fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+            fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+          }
+          impl<T, R> INestedNoPrefixInterface for Wrapper<T, R>
+          where
+            T: INestedNoPrefixInterfaceAsyncServer + Send + Sync + 'static,
+            R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+          {
+            fn r#foo(&self) -> binder::Result<()> {
+              self._rt.block_on(self._inner.r#foo())
+            }
+          }
+          let wrapped = Wrapper { _inner: inner, _rt: rt };
+          Self::new_binder(wrapped, features)
+        }
+      }
+      pub trait INestedNoPrefixInterfaceDefault: Send + Sync {
+        fn r#foo(&self) -> binder::Result<()> {
+          Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+        }
+      }
+      pub mod transactions {
+        pub const r#foo: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+      }
+      pub type INestedNoPrefixInterfaceDefaultRef = Option<std::sync::Arc<dyn INestedNoPrefixInterfaceDefault>>;
+      use lazy_static::lazy_static;
+      lazy_static! {
+        static ref DEFAULT_IMPL: std::sync::Mutex<INestedNoPrefixInterfaceDefaultRef> = std::sync::Mutex::new(None);
+      }
+      impl BpNestedNoPrefixInterface {
+        fn build_parcel_foo(&self) -> binder::Result<binder::binder_impl::Parcel> {
+          let mut aidl_data = self.binder.prepare_transact()?;
+          Ok(aidl_data)
+        }
+        fn read_response_foo(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+          if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+            if let Some(_aidl_default_impl) = <Self as INestedNoPrefixInterface>::getDefaultImpl() {
+              return _aidl_default_impl.r#foo();
+            }
+          }
+          let _aidl_reply = _aidl_reply?;
+          let _aidl_status: binder::Status = _aidl_reply.read()?;
+          if !_aidl_status.is_ok() { return Err(_aidl_status); }
+          Ok(())
+        }
+      }
+      impl INestedNoPrefixInterface for BpNestedNoPrefixInterface {
+        fn r#foo(&self) -> binder::Result<()> {
+          let _aidl_data = self.build_parcel_foo()?;
+          let _aidl_reply = self.binder.submit_transact(transactions::r#foo, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+          self.read_response_foo(_aidl_reply)
+        }
+      }
+      impl<P: binder::BinderAsyncPool> INestedNoPrefixInterfaceAsync<P> for BpNestedNoPrefixInterface {
+        fn r#foo<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>> {
+          let _aidl_data = match self.build_parcel_foo() {
+            Ok(_aidl_data) => _aidl_data,
+            Err(err) => return Box::pin(std::future::ready(Err(err))),
+          };
+          let binder = self.binder.clone();
+          P::spawn(
+            move || binder.submit_transact(transactions::r#foo, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+            move |_aidl_reply| async move {
+              self.read_response_foo(_aidl_reply)
+            }
+          )
+        }
+      }
+      impl INestedNoPrefixInterface for binder::binder_impl::Binder<BnNestedNoPrefixInterface> {
+        fn r#foo(&self) -> binder::Result<()> { self.0.r#foo() }
+      }
+      fn on_transact(_aidl_service: &dyn INestedNoPrefixInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+        match _aidl_code {
+          transactions::r#foo => {
+            let _aidl_return = _aidl_service.r#foo();
+            match &_aidl_return {
+              Ok(_aidl_return) => {
+                _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+              }
+              Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+            }
+            Ok(())
+          }
+          _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+        }
+      }
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ITestService as _7_android_4_aidl_5_tests_12_ITestService;
+ pub use super::r#Empty::r#Empty as _7_android_4_aidl_5_tests_12_ITestService_5_Empty;
+ pub use super::r#CompilerChecks::r#CompilerChecks as _7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks;
+ pub use super::r#CompilerChecks::r#Foo::r#IFoo as _7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_3_Foo;
+ pub use super::r#CompilerChecks::r#HasDeprecated::r#HasDeprecated as _7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_13_HasDeprecated;
+ pub use super::r#CompilerChecks::r#UsingHasDeprecated::r#UsingHasDeprecated as _7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_18_UsingHasDeprecated;
+ pub use super::r#CompilerChecks::r#UsingHasDeprecated::r#Tag::r#Tag as _7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_18_UsingHasDeprecated_3_Tag;
+ pub use super::r#CompilerChecks::r#NoPrefixInterface::r#INoPrefixInterface as _7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_17_NoPrefixInterface;
+ pub use super::r#CompilerChecks::r#NoPrefixInterface::r#Nested::r#Nested as _7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_17_NoPrefixInterface_6_Nested;
+ pub use super::r#CompilerChecks::r#NoPrefixInterface::r#NestedNoPrefixInterface::r#INestedNoPrefixInterface as _7_android_4_aidl_5_tests_12_ITestService_14_CompilerChecks_17_NoPrefixInterface_23_NestedNoPrefixInterface;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs.d
new file mode 100644
index 0000000..80d694b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs.d
@@ -0,0 +1,16 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs : \
+  system/tools/aidl/tests/android/aidl/tests/ITestService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/BackendType.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/CircularParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ICircular.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INamedCallback.aidl \
+  system/tools/aidl/tests/android/aidl/tests/INewName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IOldName.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IntEnum.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IntEnum.rs
new file mode 100644
index 0000000..245465a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IntEnum.rs
@@ -0,0 +1,20 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/IntEnum.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+use binder::declare_binder_enum;
+declare_binder_enum! {
+  r#IntEnum : [i32; 4] {
+    r#FOO = 1000,
+    r#BAR = 2000,
+    r#BAZ = 2001,
+    #[deprecated = "do not use this"]
+    r#QUX = 2002,
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#IntEnum as _7_android_4_aidl_5_tests_7_IntEnum;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IntEnum.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IntEnum.rs.d
new file mode 100644
index 0000000..f90d6ac
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IntEnum.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/IntEnum.rs : \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs
new file mode 100644
index 0000000..b0b9b6c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs
@@ -0,0 +1,407 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#ListOfInterfaces {
+}
+impl Default for r#ListOfInterfaces {
+  fn default() -> Self {
+    Self {
+    }
+  }
+}
+impl binder::Parcelable for r#ListOfInterfaces {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#ListOfInterfaces);
+binder::impl_deserialize_for_parcelable!(r#ListOfInterfaces);
+impl binder::binder_impl::ParcelableMetadata for r#ListOfInterfaces {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.ListOfInterfaces" }
+}
+pub mod r#IEmptyInterface {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    IEmptyInterface["android.aidl.tests.ListOfInterfaces.IEmptyInterface"] {
+      native: BnEmptyInterface(on_transact),
+      proxy: BpEmptyInterface {
+      },
+      async: IEmptyInterfaceAsync,
+    }
+  }
+  pub trait IEmptyInterface: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ListOfInterfaces.IEmptyInterface" }
+    fn getDefaultImpl() -> IEmptyInterfaceDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: IEmptyInterfaceDefaultRef) -> IEmptyInterfaceDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait IEmptyInterfaceAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ListOfInterfaces.IEmptyInterface" }
+  }
+  #[::async_trait::async_trait]
+  pub trait IEmptyInterfaceAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ListOfInterfaces.IEmptyInterface" }
+  }
+  impl BnEmptyInterface {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IEmptyInterface>
+    where
+      T: IEmptyInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> IEmptyInterface for Wrapper<T, R>
+      where
+        T: IEmptyInterfaceAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait IEmptyInterfaceDefault: Send + Sync {
+  }
+  pub mod transactions {
+  }
+  pub type IEmptyInterfaceDefaultRef = Option<std::sync::Arc<dyn IEmptyInterfaceDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None);
+  }
+  impl BpEmptyInterface {
+  }
+  impl IEmptyInterface for BpEmptyInterface {
+  }
+  impl<P: binder::BinderAsyncPool> IEmptyInterfaceAsync<P> for BpEmptyInterface {
+  }
+  impl IEmptyInterface for binder::binder_impl::Binder<BnEmptyInterface> {
+  }
+  fn on_transact(_aidl_service: &dyn IEmptyInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub mod r#IMyInterface {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    IMyInterface["android.aidl.tests.ListOfInterfaces.IMyInterface"] {
+      native: BnMyInterface(on_transact),
+      proxy: BpMyInterface {
+      },
+      async: IMyInterfaceAsync,
+    }
+  }
+  pub trait IMyInterface: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ListOfInterfaces.IMyInterface" }
+    fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>>;
+    fn getDefaultImpl() -> IMyInterfaceDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: IMyInterfaceDefaultRef) -> IMyInterfaceDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait IMyInterfaceAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ListOfInterfaces.IMyInterface" }
+    fn r#methodWithInterfaces<'a>(&'a self, _arg_iface: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &'a [binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &'a mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &'a mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&'a [Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &'a mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &'a mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>>>;
+  }
+  #[::async_trait::async_trait]
+  pub trait IMyInterfaceAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ListOfInterfaces.IMyInterface" }
+    async fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>>;
+  }
+  impl BnMyInterface {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IMyInterface>
+    where
+      T: IMyInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> IMyInterface for Wrapper<T, R>
+      where
+        T: IMyInterfaceAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+        fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>> {
+          self._rt.block_on(self._inner.r#methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_list_in, _arg_iface_list_out, _arg_iface_list_inout, _arg_nullable_iface_list_in, _arg_nullable_iface_list_out, _arg_nullable_iface_list_inout))
+        }
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait IMyInterfaceDefault: Send + Sync {
+    fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+  }
+  pub mod transactions {
+    pub const r#methodWithInterfaces: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  }
+  pub type IMyInterfaceDefaultRef = Option<std::sync::Arc<dyn IMyInterfaceDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<IMyInterfaceDefaultRef> = std::sync::Mutex::new(None);
+  }
+  impl BpMyInterface {
+    fn build_parcel_methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_iface)?;
+      aidl_data.write(&_arg_nullable_iface)?;
+      aidl_data.write(_arg_iface_list_in)?;
+      aidl_data.write(_arg_iface_list_inout)?;
+      aidl_data.write(&_arg_nullable_iface_list_in)?;
+      aidl_data.write(_arg_nullable_iface_list_inout)?;
+      Ok(aidl_data)
+    }
+    fn read_response_methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyInterface>::getDefaultImpl() {
+          return _aidl_default_impl.r#methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_list_in, _arg_iface_list_out, _arg_iface_list_inout, _arg_nullable_iface_list_in, _arg_nullable_iface_list_out, _arg_nullable_iface_list_inout);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>> = _aidl_reply.read()?;
+      _aidl_reply.read_onto(_arg_iface_list_out)?;
+      _aidl_reply.read_onto(_arg_iface_list_inout)?;
+      _aidl_reply.read_onto(_arg_nullable_iface_list_out)?;
+      _aidl_reply.read_onto(_arg_nullable_iface_list_inout)?;
+      Ok(_aidl_return)
+    }
+  }
+  impl IMyInterface for BpMyInterface {
+    fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>> {
+      let _aidl_data = self.build_parcel_methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_list_in, _arg_iface_list_out, _arg_iface_list_inout, _arg_nullable_iface_list_in, _arg_nullable_iface_list_out, _arg_nullable_iface_list_inout)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#methodWithInterfaces, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_list_in, _arg_iface_list_out, _arg_iface_list_inout, _arg_nullable_iface_list_in, _arg_nullable_iface_list_out, _arg_nullable_iface_list_inout, _aidl_reply)
+    }
+  }
+  impl<P: binder::BinderAsyncPool> IMyInterfaceAsync<P> for BpMyInterface {
+    fn r#methodWithInterfaces<'a>(&'a self, _arg_iface: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &'a [binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &'a mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &'a mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&'a [Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &'a mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &'a mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::BoxFuture<'a, binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>>> {
+      let _aidl_data = match self.build_parcel_methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_list_in, _arg_iface_list_out, _arg_iface_list_inout, _arg_nullable_iface_list_in, _arg_nullable_iface_list_out, _arg_nullable_iface_list_inout) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#methodWithInterfaces, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_list_in, _arg_iface_list_out, _arg_iface_list_inout, _arg_nullable_iface_list_in, _arg_nullable_iface_list_out, _arg_nullable_iface_list_inout, _aidl_reply)
+        }
+      )
+    }
+  }
+  impl IMyInterface for binder::binder_impl::Binder<BnMyInterface> {
+    fn r#methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>> { self.0.r#methodWithInterfaces(_arg_iface, _arg_nullable_iface, _arg_iface_list_in, _arg_iface_list_out, _arg_iface_list_inout, _arg_nullable_iface_list_in, _arg_nullable_iface_list_out, _arg_nullable_iface_list_inout) }
+  }
+  fn on_transact(_aidl_service: &dyn IMyInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      transactions::r#methodWithInterfaces => {
+        let _arg_iface: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface> = _aidl_data.read()?;
+        let _arg_nullable_iface: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>> = _aidl_data.read()?;
+        let _arg_iface_list_in: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>> = _aidl_data.read()?;
+        let mut _arg_iface_list_out: Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>> = Default::default();
+        let mut _arg_iface_list_inout: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>> = _aidl_data.read()?;
+        let _arg_nullable_iface_list_in: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>> = _aidl_data.read()?;
+        let mut _arg_nullable_iface_list_out: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>> = Default::default();
+        let mut _arg_nullable_iface_list_inout: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>> = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#methodWithInterfaces(&_arg_iface, _arg_nullable_iface.as_ref(), &_arg_iface_list_in, &mut _arg_iface_list_out, &mut _arg_iface_list_inout, _arg_nullable_iface_list_in.as_deref(), &mut _arg_nullable_iface_list_out, &mut _arg_nullable_iface_list_inout);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+            _aidl_reply.write(&_arg_iface_list_out)?;
+            _aidl_reply.write(&_arg_iface_list_inout)?;
+            _aidl_reply.write(&_arg_nullable_iface_list_out)?;
+            _aidl_reply.write(&_arg_nullable_iface_list_inout)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub mod r#MyParcelable {
+  #[derive(Debug)]
+  pub struct r#MyParcelable {
+    pub r#iface: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>,
+    pub r#nullable_iface: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>,
+    pub r#iface_list: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>,
+    pub r#nullable_iface_list: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>,
+  }
+  impl Default for r#MyParcelable {
+    fn default() -> Self {
+      Self {
+        r#iface: Default::default(),
+        r#nullable_iface: Default::default(),
+        r#iface_list: Default::default(),
+        r#nullable_iface_list: Default::default(),
+      }
+    }
+  }
+  impl binder::Parcelable for r#MyParcelable {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        let __field_ref = self.r#iface.as_ref().ok_or(binder::StatusCode::UNEXPECTED_NULL)?;
+        subparcel.write(__field_ref)?;
+        subparcel.write(&self.r#nullable_iface)?;
+        subparcel.write(&self.r#iface_list)?;
+        subparcel.write(&self.r#nullable_iface_list)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#iface = Some(subparcel.read()?);
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_iface = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#iface_list = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#nullable_iface_list = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyParcelable);
+  binder::impl_deserialize_for_parcelable!(r#MyParcelable);
+  impl binder::binder_impl::ParcelableMetadata for r#MyParcelable {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.ListOfInterfaces.MyParcelable" }
+  }
+}
+pub mod r#MyUnion {
+  #[derive(Debug)]
+  pub enum r#MyUnion {
+    Iface(Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>),
+    Nullable_iface(Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>),
+    Iface_list(Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>),
+    Nullable_iface_list(Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>),
+  }
+  impl Default for r#MyUnion {
+    fn default() -> Self {
+      Self::Iface(Default::default())
+    }
+  }
+  impl binder::Parcelable for r#MyUnion {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      match self {
+        Self::Iface(v) => {
+          parcel.write(&0i32)?;
+          let __field_ref = v.as_ref().ok_or(binder::StatusCode::UNEXPECTED_NULL)?;
+          parcel.write(__field_ref)
+        }
+        Self::Nullable_iface(v) => {
+          parcel.write(&1i32)?;
+          parcel.write(v)
+        }
+        Self::Iface_list(v) => {
+          parcel.write(&2i32)?;
+          parcel.write(v)
+        }
+        Self::Nullable_iface_list(v) => {
+          parcel.write(&3i32)?;
+          parcel.write(v)
+        }
+      }
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      let tag: i32 = parcel.read()?;
+      match tag {
+        0 => {
+          let value: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>> = Some(parcel.read()?);
+          *self = Self::Iface(value);
+          Ok(())
+        }
+        1 => {
+          let value: Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>> = parcel.read()?;
+          *self = Self::Nullable_iface(value);
+          Ok(())
+        }
+        2 => {
+          let value: Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>> = parcel.read()?;
+          *self = Self::Iface_list(value);
+          Ok(())
+        }
+        3 => {
+          let value: Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>> = parcel.read()?;
+          *self = Self::Nullable_iface_list(value);
+          Ok(())
+        }
+        _ => {
+          Err(binder::StatusCode::BAD_VALUE)
+        }
+      }
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyUnion);
+  binder::impl_deserialize_for_parcelable!(r#MyUnion);
+  impl binder::binder_impl::ParcelableMetadata for r#MyUnion {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.ListOfInterfaces.MyUnion" }
+  }
+  pub mod r#Tag {
+    #![allow(non_upper_case_globals)]
+    use binder::declare_binder_enum;
+    declare_binder_enum! {
+      r#Tag : [i32; 4] {
+        r#iface = 0,
+        r#nullable_iface = 1,
+        r#iface_list = 2,
+        r#nullable_iface_list = 3,
+      }
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ListOfInterfaces as _7_android_4_aidl_5_tests_16_ListOfInterfaces;
+ pub use super::r#IEmptyInterface::r#IEmptyInterface as _7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface;
+ pub use super::r#IMyInterface::r#IMyInterface as _7_android_4_aidl_5_tests_16_ListOfInterfaces_12_IMyInterface;
+ pub use super::r#MyParcelable::r#MyParcelable as _7_android_4_aidl_5_tests_16_ListOfInterfaces_12_MyParcelable;
+ pub use super::r#MyUnion::r#MyUnion as _7_android_4_aidl_5_tests_16_ListOfInterfaces_7_MyUnion;
+ pub use super::r#MyUnion::r#Tag::r#Tag as _7_android_4_aidl_5_tests_16_ListOfInterfaces_7_MyUnion_3_Tag;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs.d
new file mode 100644
index 0000000..b965c9a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs : \
+  system/tools/aidl/tests/android/aidl/tests/ListOfInterfaces.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/LongEnum.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/LongEnum.rs
new file mode 100644
index 0000000..38ebfdd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/LongEnum.rs
@@ -0,0 +1,18 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/LongEnum.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+use binder::declare_binder_enum;
+declare_binder_enum! {
+  r#LongEnum : [i64; 3] {
+    r#FOO = 100000000000,
+    r#BAR = 200000000000,
+    r#BAZ = 200000000001,
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#LongEnum as _7_android_4_aidl_5_tests_8_LongEnum;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/LongEnum.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/LongEnum.rs.d
new file mode 100644
index 0000000..41f9bc3
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/LongEnum.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/LongEnum.rs : \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/OtherParcelableForToString.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/OtherParcelableForToString.rs
new file mode 100644
index 0000000..473a5b7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/OtherParcelableForToString.rs
@@ -0,0 +1,41 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/OtherParcelableForToString.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#OtherParcelableForToString {
+  pub r#field: String,
+}
+impl Default for r#OtherParcelableForToString {
+  fn default() -> Self {
+    Self {
+      r#field: Default::default(),
+    }
+  }
+}
+impl binder::Parcelable for r#OtherParcelableForToString {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#field)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#field = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#OtherParcelableForToString);
+binder::impl_deserialize_for_parcelable!(r#OtherParcelableForToString);
+impl binder::binder_impl::ParcelableMetadata for r#OtherParcelableForToString {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.OtherParcelableForToString" }
+}
+pub(crate) mod mangled {
+ pub use super::r#OtherParcelableForToString as _7_android_4_aidl_5_tests_26_OtherParcelableForToString;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/OtherParcelableForToString.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/OtherParcelableForToString.rs.d
new file mode 100644
index 0000000..cc95ae1
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/OtherParcelableForToString.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/OtherParcelableForToString.rs : \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ParcelableForToString.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ParcelableForToString.rs
new file mode 100644
index 0000000..744fadb
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ParcelableForToString.rs
@@ -0,0 +1,173 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ParcelableForToString.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#ParcelableForToString {
+  pub r#intValue: i32,
+  pub r#intArray: Vec<i32>,
+  pub r#longValue: i64,
+  pub r#longArray: Vec<i64>,
+  pub r#doubleValue: f64,
+  pub r#doubleArray: Vec<f64>,
+  pub r#floatValue: f32,
+  pub r#floatArray: Vec<f32>,
+  pub r#byteValue: i8,
+  pub r#byteArray: Vec<u8>,
+  pub r#booleanValue: bool,
+  pub r#booleanArray: Vec<bool>,
+  pub r#stringValue: String,
+  pub r#stringArray: Vec<String>,
+  pub r#stringList: Vec<String>,
+  pub r#parcelableValue: crate::mangled::_7_android_4_aidl_5_tests_26_OtherParcelableForToString,
+  pub r#parcelableArray: Vec<crate::mangled::_7_android_4_aidl_5_tests_26_OtherParcelableForToString>,
+  pub r#enumValue: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum,
+  pub r#enumArray: Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>,
+  pub r#nullArray: Vec<String>,
+  pub r#nullList: Vec<String>,
+  pub r#parcelableGeneric: crate::mangled::_7_android_4_aidl_5_tests_27_GenericStructuredParcelable<i32,crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable,crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum,>,
+  pub r#unionValue: crate::mangled::_7_android_4_aidl_5_tests_5_Union,
+}
+impl Default for r#ParcelableForToString {
+  fn default() -> Self {
+    Self {
+      r#intValue: 0,
+      r#intArray: Default::default(),
+      r#longValue: 0,
+      r#longArray: Default::default(),
+      r#doubleValue: 0.000000f64,
+      r#doubleArray: Default::default(),
+      r#floatValue: 0.000000f32,
+      r#floatArray: Default::default(),
+      r#byteValue: 0,
+      r#byteArray: Default::default(),
+      r#booleanValue: false,
+      r#booleanArray: Default::default(),
+      r#stringValue: Default::default(),
+      r#stringArray: Default::default(),
+      r#stringList: Default::default(),
+      r#parcelableValue: Default::default(),
+      r#parcelableArray: Default::default(),
+      r#enumValue: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum::FOO,
+      r#enumArray: Default::default(),
+      r#nullArray: Default::default(),
+      r#nullList: Default::default(),
+      r#parcelableGeneric: Default::default(),
+      r#unionValue: Default::default(),
+    }
+  }
+}
+impl binder::Parcelable for r#ParcelableForToString {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#intValue)?;
+      subparcel.write(&self.r#intArray)?;
+      subparcel.write(&self.r#longValue)?;
+      subparcel.write(&self.r#longArray)?;
+      subparcel.write(&self.r#doubleValue)?;
+      subparcel.write(&self.r#doubleArray)?;
+      subparcel.write(&self.r#floatValue)?;
+      subparcel.write(&self.r#floatArray)?;
+      subparcel.write(&self.r#byteValue)?;
+      subparcel.write(&self.r#byteArray)?;
+      subparcel.write(&self.r#booleanValue)?;
+      subparcel.write(&self.r#booleanArray)?;
+      subparcel.write(&self.r#stringValue)?;
+      subparcel.write(&self.r#stringArray)?;
+      subparcel.write(&self.r#stringList)?;
+      subparcel.write(&self.r#parcelableValue)?;
+      subparcel.write(&self.r#parcelableArray)?;
+      subparcel.write(&self.r#enumValue)?;
+      subparcel.write(&self.r#enumArray)?;
+      subparcel.write(&self.r#nullArray)?;
+      subparcel.write(&self.r#nullList)?;
+      subparcel.write(&self.r#parcelableGeneric)?;
+      subparcel.write(&self.r#unionValue)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#intValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#doubleValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#doubleArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#floatValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#floatArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#booleanValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#booleanArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#stringValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#stringArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#stringList = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#parcelableValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#parcelableArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#enumValue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#enumArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#nullArray = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#nullList = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#parcelableGeneric = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#unionValue = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#ParcelableForToString);
+binder::impl_deserialize_for_parcelable!(r#ParcelableForToString);
+impl binder::binder_impl::ParcelableMetadata for r#ParcelableForToString {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.ParcelableForToString" }
+}
+pub(crate) mod mangled {
+ pub use super::r#ParcelableForToString as _7_android_4_aidl_5_tests_21_ParcelableForToString;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ParcelableForToString.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ParcelableForToString.rs.d
new file mode 100644
index 0000000..5471bd0
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ParcelableForToString.rs.d
@@ -0,0 +1,10 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/ParcelableForToString.rs : \
+  system/tools/aidl/tests/android/aidl/tests/ParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/GenericStructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/OtherParcelableForToString.aidl \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/RecursiveList.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/RecursiveList.rs
new file mode 100644
index 0000000..a68a3e7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/RecursiveList.rs
@@ -0,0 +1,47 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/RecursiveList.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#RecursiveList {
+  pub r#value: i32,
+  pub r#next: Option<Box<crate::mangled::_7_android_4_aidl_5_tests_13_RecursiveList>>,
+}
+impl Default for r#RecursiveList {
+  fn default() -> Self {
+    Self {
+      r#value: 0,
+      r#next: Default::default(),
+    }
+  }
+}
+impl binder::Parcelable for r#RecursiveList {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#value)?;
+      subparcel.write(&self.r#next)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#value = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#next = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#RecursiveList);
+binder::impl_deserialize_for_parcelable!(r#RecursiveList);
+impl binder::binder_impl::ParcelableMetadata for r#RecursiveList {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.RecursiveList" }
+}
+pub(crate) mod mangled {
+ pub use super::r#RecursiveList as _7_android_4_aidl_5_tests_13_RecursiveList;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/RecursiveList.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/RecursiveList.rs.d
new file mode 100644
index 0000000..f0dd6cf
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/RecursiveList.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/RecursiveList.rs : \
+  system/tools/aidl/tests/android/aidl/tests/RecursiveList.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/StructuredParcelable.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/StructuredParcelable.rs
new file mode 100644
index 0000000..079431d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/StructuredParcelable.rs
@@ -0,0 +1,397 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/StructuredParcelable.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug, Clone, PartialEq)]
+pub struct r#StructuredParcelable {
+  pub r#shouldContainThreeFs: Vec<i32>,
+  pub r#f: i32,
+  pub r#shouldBeJerry: String,
+  pub r#shouldBeByteBar: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum,
+  pub r#shouldBeIntBar: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum,
+  pub r#shouldBeLongBar: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum,
+  pub r#shouldContainTwoByteFoos: Vec<crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum>,
+  pub r#shouldContainTwoIntFoos: Vec<crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum>,
+  pub r#shouldContainTwoLongFoos: Vec<crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum>,
+  pub r#stringDefaultsToFoo: String,
+  pub r#byteDefaultsToFour: i8,
+  pub r#intDefaultsToFive: i32,
+  pub r#longDefaultsToNegativeSeven: i64,
+  pub r#booleanDefaultsToTrue: bool,
+  pub r#charDefaultsToC: u16,
+  pub r#floatDefaultsToPi: f32,
+  pub r#doubleWithDefault: f64,
+  pub r#arrayDefaultsTo123: Vec<i32>,
+  pub r#arrayDefaultsToEmpty: Vec<i32>,
+  pub r#boolDefault: bool,
+  pub r#byteDefault: i8,
+  pub r#intDefault: i32,
+  pub r#longDefault: i64,
+  pub r#floatDefault: f32,
+  pub r#doubleDefault: f64,
+  pub r#checkDoubleFromFloat: f64,
+  pub r#checkStringArray1: Vec<String>,
+  pub r#checkStringArray2: Vec<String>,
+  pub r#int32_min: i32,
+  pub r#int32_max: i32,
+  pub r#int64_max: i64,
+  pub r#hexInt32_neg_1: i32,
+  pub r#ibinder: Option<binder::SpIBinder>,
+  pub r#empty: crate::mangled::_7_android_4_aidl_5_tests_20_StructuredParcelable_5_Empty,
+  pub r#int8_1: Vec<u8>,
+  pub r#int32_1: Vec<i32>,
+  pub r#int64_1: Vec<i64>,
+  pub r#hexInt32_pos_1: i32,
+  pub r#hexInt64_pos_1: i32,
+  pub r#const_exprs_1: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_2: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_3: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_4: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_5: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_6: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_7: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_8: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_9: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#const_exprs_10: crate::mangled::_7_android_4_aidl_5_tests_22_ConstantExpressionEnum,
+  pub r#addString1: String,
+  pub r#addString2: String,
+  pub r#shouldSetBit0AndBit2: i32,
+  pub r#u: Option<crate::mangled::_7_android_4_aidl_5_tests_5_Union>,
+  pub r#shouldBeConstS1: Option<crate::mangled::_7_android_4_aidl_5_tests_5_Union>,
+  pub r#defaultWithFoo: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum,
+}
+pub const r#BIT0: i32 = 1;
+pub const r#BIT1: i32 = 2;
+pub const r#BIT2: i32 = 4;
+impl Default for r#StructuredParcelable {
+  fn default() -> Self {
+    Self {
+      r#shouldContainThreeFs: Default::default(),
+      r#f: 0,
+      r#shouldBeJerry: Default::default(),
+      r#shouldBeByteBar: Default::default(),
+      r#shouldBeIntBar: Default::default(),
+      r#shouldBeLongBar: Default::default(),
+      r#shouldContainTwoByteFoos: Default::default(),
+      r#shouldContainTwoIntFoos: Default::default(),
+      r#shouldContainTwoLongFoos: Default::default(),
+      r#stringDefaultsToFoo: "foo".into(),
+      r#byteDefaultsToFour: 4,
+      r#intDefaultsToFive: 5,
+      r#longDefaultsToNegativeSeven: -7,
+      r#booleanDefaultsToTrue: true,
+      r#charDefaultsToC: 'C' as u16,
+      r#floatDefaultsToPi: 3.140000f32,
+      r#doubleWithDefault: -314000000000000000.000000f64,
+      r#arrayDefaultsTo123: vec![1, 2, 3],
+      r#arrayDefaultsToEmpty: vec![],
+      r#boolDefault: false,
+      r#byteDefault: 0,
+      r#intDefault: 0,
+      r#longDefault: 0,
+      r#floatDefault: 0.000000f32,
+      r#doubleDefault: 0.000000f64,
+      r#checkDoubleFromFloat: 3.140000f64,
+      r#checkStringArray1: vec!["a".into(), "b".into()],
+      r#checkStringArray2: vec!["a".into(), "b".into()],
+      r#int32_min: -2147483648,
+      r#int32_max: 2147483647,
+      r#int64_max: 9223372036854775807,
+      r#hexInt32_neg_1: -1,
+      r#ibinder: Default::default(),
+      r#empty: Default::default(),
+      r#int8_1: vec![1, 1, 1, 1, 1],
+      r#int32_1: vec![1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+      r#int64_1: vec![1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+      r#hexInt32_pos_1: 1,
+      r#hexInt64_pos_1: 1,
+      r#const_exprs_1: Default::default(),
+      r#const_exprs_2: Default::default(),
+      r#const_exprs_3: Default::default(),
+      r#const_exprs_4: Default::default(),
+      r#const_exprs_5: Default::default(),
+      r#const_exprs_6: Default::default(),
+      r#const_exprs_7: Default::default(),
+      r#const_exprs_8: Default::default(),
+      r#const_exprs_9: Default::default(),
+      r#const_exprs_10: Default::default(),
+      r#addString1: "hello world!".into(),
+      r#addString2: "The quick brown fox jumps over the lazy dog.".into(),
+      r#shouldSetBit0AndBit2: 0,
+      r#u: Default::default(),
+      r#shouldBeConstS1: Default::default(),
+      r#defaultWithFoo: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum::FOO,
+    }
+  }
+}
+impl binder::Parcelable for r#StructuredParcelable {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#shouldContainThreeFs)?;
+      subparcel.write(&self.r#f)?;
+      subparcel.write(&self.r#shouldBeJerry)?;
+      subparcel.write(&self.r#shouldBeByteBar)?;
+      subparcel.write(&self.r#shouldBeIntBar)?;
+      subparcel.write(&self.r#shouldBeLongBar)?;
+      subparcel.write(&self.r#shouldContainTwoByteFoos)?;
+      subparcel.write(&self.r#shouldContainTwoIntFoos)?;
+      subparcel.write(&self.r#shouldContainTwoLongFoos)?;
+      subparcel.write(&self.r#stringDefaultsToFoo)?;
+      subparcel.write(&self.r#byteDefaultsToFour)?;
+      subparcel.write(&self.r#intDefaultsToFive)?;
+      subparcel.write(&self.r#longDefaultsToNegativeSeven)?;
+      subparcel.write(&self.r#booleanDefaultsToTrue)?;
+      subparcel.write(&self.r#charDefaultsToC)?;
+      subparcel.write(&self.r#floatDefaultsToPi)?;
+      subparcel.write(&self.r#doubleWithDefault)?;
+      subparcel.write(&self.r#arrayDefaultsTo123)?;
+      subparcel.write(&self.r#arrayDefaultsToEmpty)?;
+      subparcel.write(&self.r#boolDefault)?;
+      subparcel.write(&self.r#byteDefault)?;
+      subparcel.write(&self.r#intDefault)?;
+      subparcel.write(&self.r#longDefault)?;
+      subparcel.write(&self.r#floatDefault)?;
+      subparcel.write(&self.r#doubleDefault)?;
+      subparcel.write(&self.r#checkDoubleFromFloat)?;
+      subparcel.write(&self.r#checkStringArray1)?;
+      subparcel.write(&self.r#checkStringArray2)?;
+      subparcel.write(&self.r#int32_min)?;
+      subparcel.write(&self.r#int32_max)?;
+      subparcel.write(&self.r#int64_max)?;
+      subparcel.write(&self.r#hexInt32_neg_1)?;
+      subparcel.write(&self.r#ibinder)?;
+      subparcel.write(&self.r#empty)?;
+      subparcel.write(&self.r#int8_1)?;
+      subparcel.write(&self.r#int32_1)?;
+      subparcel.write(&self.r#int64_1)?;
+      subparcel.write(&self.r#hexInt32_pos_1)?;
+      subparcel.write(&self.r#hexInt64_pos_1)?;
+      subparcel.write(&self.r#const_exprs_1)?;
+      subparcel.write(&self.r#const_exprs_2)?;
+      subparcel.write(&self.r#const_exprs_3)?;
+      subparcel.write(&self.r#const_exprs_4)?;
+      subparcel.write(&self.r#const_exprs_5)?;
+      subparcel.write(&self.r#const_exprs_6)?;
+      subparcel.write(&self.r#const_exprs_7)?;
+      subparcel.write(&self.r#const_exprs_8)?;
+      subparcel.write(&self.r#const_exprs_9)?;
+      subparcel.write(&self.r#const_exprs_10)?;
+      subparcel.write(&self.r#addString1)?;
+      subparcel.write(&self.r#addString2)?;
+      subparcel.write(&self.r#shouldSetBit0AndBit2)?;
+      subparcel.write(&self.r#u)?;
+      subparcel.write(&self.r#shouldBeConstS1)?;
+      subparcel.write(&self.r#defaultWithFoo)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#shouldContainThreeFs = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#f = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldBeJerry = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldBeByteBar = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldBeIntBar = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldBeLongBar = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldContainTwoByteFoos = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldContainTwoIntFoos = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldContainTwoLongFoos = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#stringDefaultsToFoo = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteDefaultsToFour = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intDefaultsToFive = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longDefaultsToNegativeSeven = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#booleanDefaultsToTrue = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#charDefaultsToC = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#floatDefaultsToPi = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#doubleWithDefault = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#arrayDefaultsTo123 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#arrayDefaultsToEmpty = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#boolDefault = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#byteDefault = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#intDefault = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#longDefault = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#floatDefault = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#doubleDefault = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#checkDoubleFromFloat = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#checkStringArray1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#checkStringArray2 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#int32_min = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#int32_max = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#int64_max = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#hexInt32_neg_1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#ibinder = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#empty = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#int8_1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#int32_1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#int64_1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#hexInt32_pos_1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#hexInt64_pos_1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_2 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_3 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_4 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_5 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_6 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_7 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_8 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_9 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#const_exprs_10 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#addString1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#addString2 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldSetBit0AndBit2 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#u = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#shouldBeConstS1 = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#defaultWithFoo = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#StructuredParcelable);
+binder::impl_deserialize_for_parcelable!(r#StructuredParcelable);
+impl binder::binder_impl::ParcelableMetadata for r#StructuredParcelable {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.StructuredParcelable" }
+}
+pub mod r#Empty {
+  #[derive(Debug, Clone, PartialEq)]
+  pub struct r#Empty {
+  }
+  impl Default for r#Empty {
+    fn default() -> Self {
+      Self {
+      }
+    }
+  }
+  impl binder::Parcelable for r#Empty {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#Empty);
+  binder::impl_deserialize_for_parcelable!(r#Empty);
+  impl binder::binder_impl::ParcelableMetadata for r#Empty {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.StructuredParcelable.Empty" }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#StructuredParcelable as _7_android_4_aidl_5_tests_20_StructuredParcelable;
+ pub use super::r#Empty::r#Empty as _7_android_4_aidl_5_tests_20_StructuredParcelable_5_Empty;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/StructuredParcelable.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/StructuredParcelable.rs.d
new file mode 100644
index 0000000..7b17725
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/StructuredParcelable.rs.d
@@ -0,0 +1,7 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/StructuredParcelable.rs : \
+  system/tools/aidl/tests/android/aidl/tests/StructuredParcelable.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ConstantExpressionEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/Union.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/Union.rs
new file mode 100644
index 0000000..2ae8287
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/Union.rs
@@ -0,0 +1,123 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/Union.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/Union.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug, Clone, PartialEq)]
+pub enum r#Union {
+  Ns(Vec<i32>),
+  N(i32),
+  M(i32),
+  S(String),
+  Ibinder(Option<binder::SpIBinder>),
+  Ss(Vec<String>),
+  Be(crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum),
+}
+pub const r#S1: &str = "a string constant in union";
+impl Default for r#Union {
+  fn default() -> Self {
+    Self::Ns(vec![])
+  }
+}
+impl binder::Parcelable for r#Union {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    match self {
+      Self::Ns(v) => {
+        parcel.write(&0i32)?;
+        parcel.write(v)
+      }
+      Self::N(v) => {
+        parcel.write(&1i32)?;
+        parcel.write(v)
+      }
+      Self::M(v) => {
+        parcel.write(&2i32)?;
+        parcel.write(v)
+      }
+      Self::S(v) => {
+        parcel.write(&3i32)?;
+        parcel.write(v)
+      }
+      Self::Ibinder(v) => {
+        parcel.write(&4i32)?;
+        parcel.write(v)
+      }
+      Self::Ss(v) => {
+        parcel.write(&5i32)?;
+        parcel.write(v)
+      }
+      Self::Be(v) => {
+        parcel.write(&6i32)?;
+        parcel.write(v)
+      }
+    }
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    let tag: i32 = parcel.read()?;
+    match tag {
+      0 => {
+        let value: Vec<i32> = parcel.read()?;
+        *self = Self::Ns(value);
+        Ok(())
+      }
+      1 => {
+        let value: i32 = parcel.read()?;
+        *self = Self::N(value);
+        Ok(())
+      }
+      2 => {
+        let value: i32 = parcel.read()?;
+        *self = Self::M(value);
+        Ok(())
+      }
+      3 => {
+        let value: String = parcel.read()?;
+        *self = Self::S(value);
+        Ok(())
+      }
+      4 => {
+        let value: Option<binder::SpIBinder> = parcel.read()?;
+        *self = Self::Ibinder(value);
+        Ok(())
+      }
+      5 => {
+        let value: Vec<String> = parcel.read()?;
+        *self = Self::Ss(value);
+        Ok(())
+      }
+      6 => {
+        let value: crate::mangled::_7_android_4_aidl_5_tests_8_ByteEnum = parcel.read()?;
+        *self = Self::Be(value);
+        Ok(())
+      }
+      _ => {
+        Err(binder::StatusCode::BAD_VALUE)
+      }
+    }
+  }
+}
+binder::impl_serialize_for_parcelable!(r#Union);
+binder::impl_deserialize_for_parcelable!(r#Union);
+impl binder::binder_impl::ParcelableMetadata for r#Union {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.Union" }
+}
+pub mod r#Tag {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#Tag : [i32; 7] {
+      r#ns = 0,
+      r#n = 1,
+      r#m = 2,
+      r#s = 3,
+      r#ibinder = 4,
+      r#ss = 5,
+      r#be = 6,
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#Union as _7_android_4_aidl_5_tests_5_Union;
+ pub use super::r#Tag::r#Tag as _7_android_4_aidl_5_tests_5_Union_3_Tag;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/Union.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/Union.rs.d
new file mode 100644
index 0000000..1519482
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/Union.rs.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/Union.rs : \
+  system/tools/aidl/tests/android/aidl/tests/Union.aidl \
+  system/tools/aidl/tests/android/aidl/tests/ByteEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/UnionWithFd.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/UnionWithFd.rs
new file mode 100644
index 0000000..1104da6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/UnionWithFd.rs
@@ -0,0 +1,68 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/UnionWithFd.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub enum r#UnionWithFd {
+  Num(i32),
+  Pfd(Option<binder::ParcelFileDescriptor>),
+}
+impl Default for r#UnionWithFd {
+  fn default() -> Self {
+    Self::Num(0)
+  }
+}
+impl binder::Parcelable for r#UnionWithFd {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    match self {
+      Self::Num(v) => {
+        parcel.write(&0i32)?;
+        parcel.write(v)
+      }
+      Self::Pfd(v) => {
+        parcel.write(&1i32)?;
+        let __field_ref = v.as_ref().ok_or(binder::StatusCode::UNEXPECTED_NULL)?;
+        parcel.write(__field_ref)
+      }
+    }
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    let tag: i32 = parcel.read()?;
+    match tag {
+      0 => {
+        let value: i32 = parcel.read()?;
+        *self = Self::Num(value);
+        Ok(())
+      }
+      1 => {
+        let value: Option<binder::ParcelFileDescriptor> = Some(parcel.read()?);
+        *self = Self::Pfd(value);
+        Ok(())
+      }
+      _ => {
+        Err(binder::StatusCode::BAD_VALUE)
+      }
+    }
+  }
+}
+binder::impl_serialize_for_parcelable!(r#UnionWithFd);
+binder::impl_deserialize_for_parcelable!(r#UnionWithFd);
+impl binder::binder_impl::ParcelableMetadata for r#UnionWithFd {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.UnionWithFd" }
+}
+pub mod r#Tag {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#Tag : [i32; 2] {
+      r#num = 0,
+      r#pfd = 1,
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#UnionWithFd as _7_android_4_aidl_5_tests_11_UnionWithFd;
+ pub use super::r#Tag::r#Tag as _7_android_4_aidl_5_tests_11_UnionWithFd_3_Tag;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/UnionWithFd.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/UnionWithFd.rs.d
new file mode 100644
index 0000000..f8e20d7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/UnionWithFd.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/UnionWithFd.rs : \
+  system/tools/aidl/tests/android/aidl/tests/UnionWithFd.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/ExtendableParcelable.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/ExtendableParcelable.rs
new file mode 100644
index 0000000..44c7002
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/ExtendableParcelable.rs
@@ -0,0 +1,65 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/ExtendableParcelable.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#ExtendableParcelable {
+  pub r#a: i32,
+  pub r#b: String,
+  pub r#ext: binder::ParcelableHolder,
+  pub r#c: i64,
+  pub r#ext2: binder::ParcelableHolder,
+}
+impl Default for r#ExtendableParcelable {
+  fn default() -> Self {
+    Self {
+      r#a: 0,
+      r#b: Default::default(),
+      r#ext: binder::ParcelableHolder::new(binder::binder_impl::Stability::Local),
+      r#c: 0,
+      r#ext2: binder::ParcelableHolder::new(binder::binder_impl::Stability::Local),
+    }
+  }
+}
+impl binder::Parcelable for r#ExtendableParcelable {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#a)?;
+      subparcel.write(&self.r#b)?;
+      subparcel.write(&self.r#ext)?;
+      subparcel.write(&self.r#c)?;
+      subparcel.write(&self.r#ext2)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#a = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#b = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#ext = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#c = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#ext2 = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#ExtendableParcelable);
+binder::impl_deserialize_for_parcelable!(r#ExtendableParcelable);
+impl binder::binder_impl::ParcelableMetadata for r#ExtendableParcelable {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.extension.ExtendableParcelable" }
+}
+pub(crate) mod mangled {
+ pub use super::r#ExtendableParcelable as _7_android_4_aidl_5_tests_9_extension_20_ExtendableParcelable;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/ExtendableParcelable.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/ExtendableParcelable.rs.d
new file mode 100644
index 0000000..8c891a1
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/ExtendableParcelable.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/ExtendableParcelable.rs : \
+  system/tools/aidl/tests/android/aidl/tests/extension/ExtendableParcelable.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt.rs
new file mode 100644
index 0000000..81dd0e2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt.rs
@@ -0,0 +1,47 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#MyExt {
+  pub r#a: i32,
+  pub r#b: String,
+}
+impl Default for r#MyExt {
+  fn default() -> Self {
+    Self {
+      r#a: 0,
+      r#b: Default::default(),
+    }
+  }
+}
+impl binder::Parcelable for r#MyExt {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#a)?;
+      subparcel.write(&self.r#b)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#a = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#b = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#MyExt);
+binder::impl_deserialize_for_parcelable!(r#MyExt);
+impl binder::binder_impl::ParcelableMetadata for r#MyExt {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.extension.MyExt" }
+}
+pub(crate) mod mangled {
+ pub use super::r#MyExt as _7_android_4_aidl_5_tests_9_extension_5_MyExt;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt.rs.d
new file mode 100644
index 0000000..6f83175
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt.rs : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt2.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt2.rs
new file mode 100644
index 0000000..7e872f4
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt2.rs
@@ -0,0 +1,53 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt2.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#MyExt2 {
+  pub r#a: i32,
+  pub r#b: crate::mangled::_7_android_4_aidl_5_tests_9_extension_5_MyExt,
+  pub r#c: String,
+}
+impl Default for r#MyExt2 {
+  fn default() -> Self {
+    Self {
+      r#a: 0,
+      r#b: Default::default(),
+      r#c: Default::default(),
+    }
+  }
+}
+impl binder::Parcelable for r#MyExt2 {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#a)?;
+      subparcel.write(&self.r#b)?;
+      subparcel.write(&self.r#c)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#a = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#b = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#c = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#MyExt2);
+binder::impl_deserialize_for_parcelable!(r#MyExt2);
+impl binder::binder_impl::ParcelableMetadata for r#MyExt2 {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.extension.MyExt2" }
+}
+pub(crate) mod mangled {
+ pub use super::r#MyExt2 as _7_android_4_aidl_5_tests_9_extension_6_MyExt2;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt2.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt2.rs.d
new file mode 100644
index 0000000..7e58f61
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt2.rs.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExt2.rs : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt2.aidl \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExt.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExtLike.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExtLike.rs
new file mode 100644
index 0000000..776470c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExtLike.rs
@@ -0,0 +1,47 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExtLike.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#MyExtLike {
+  pub r#a: i32,
+  pub r#b: String,
+}
+impl Default for r#MyExtLike {
+  fn default() -> Self {
+    Self {
+      r#a: 0,
+      r#b: Default::default(),
+    }
+  }
+}
+impl binder::Parcelable for r#MyExtLike {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#a)?;
+      subparcel.write(&self.r#b)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#a = subparcel.read()?;
+      }
+      if subparcel.has_more_data() {
+        self.r#b = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#MyExtLike);
+binder::impl_deserialize_for_parcelable!(r#MyExtLike);
+impl binder::binder_impl::ParcelableMetadata for r#MyExtLike {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.extension.MyExtLike" }
+}
+pub(crate) mod mangled {
+ pub use super::r#MyExtLike as _7_android_4_aidl_5_tests_9_extension_9_MyExtLike;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExtLike.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExtLike.rs.d
new file mode 100644
index 0000000..4e904d6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExtLike.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/extension/MyExtLike.rs : \
+  system/tools/aidl/tests/android/aidl/tests/extension/MyExtLike.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/DeeplyNested.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/DeeplyNested.rs
new file mode 100644
index 0000000..7b6b5f3
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/DeeplyNested.rs
@@ -0,0 +1,167 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/DeeplyNested.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#DeeplyNested {
+}
+impl Default for r#DeeplyNested {
+  fn default() -> Self {
+    Self {
+    }
+  }
+}
+impl binder::Parcelable for r#DeeplyNested {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#DeeplyNested);
+binder::impl_deserialize_for_parcelable!(r#DeeplyNested);
+impl binder::binder_impl::ParcelableMetadata for r#DeeplyNested {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.nested.DeeplyNested" }
+}
+pub mod r#A {
+  #[derive(Debug)]
+  pub struct r#A {
+    pub r#e: crate::mangled::_7_android_4_aidl_5_tests_6_nested_12_DeeplyNested_1_B_1_C_1_D_1_E,
+  }
+  impl Default for r#A {
+    fn default() -> Self {
+      Self {
+        r#e: crate::mangled::_7_android_4_aidl_5_tests_6_nested_12_DeeplyNested_1_B_1_C_1_D_1_E::OK,
+      }
+    }
+  }
+  impl binder::Parcelable for r#A {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        subparcel.write(&self.r#e)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#e = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#A);
+  binder::impl_deserialize_for_parcelable!(r#A);
+  impl binder::binder_impl::ParcelableMetadata for r#A {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.nested.DeeplyNested.A" }
+  }
+}
+pub mod r#B {
+  #[derive(Debug)]
+  pub struct r#B {
+  }
+  impl Default for r#B {
+    fn default() -> Self {
+      Self {
+      }
+    }
+  }
+  impl binder::Parcelable for r#B {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#B);
+  binder::impl_deserialize_for_parcelable!(r#B);
+  impl binder::binder_impl::ParcelableMetadata for r#B {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.nested.DeeplyNested.B" }
+  }
+  pub mod r#C {
+    #[derive(Debug)]
+    pub struct r#C {
+    }
+    impl Default for r#C {
+      fn default() -> Self {
+        Self {
+        }
+      }
+    }
+    impl binder::Parcelable for r#C {
+      fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+        parcel.sized_write(|subparcel| {
+          Ok(())
+        })
+      }
+      fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+        parcel.sized_read(|subparcel| {
+          Ok(())
+        })
+      }
+    }
+    binder::impl_serialize_for_parcelable!(r#C);
+    binder::impl_deserialize_for_parcelable!(r#C);
+    impl binder::binder_impl::ParcelableMetadata for r#C {
+      fn get_descriptor() -> &'static str { "android.aidl.tests.nested.DeeplyNested.B.C" }
+    }
+    pub mod r#D {
+      #[derive(Debug)]
+      pub struct r#D {
+      }
+      impl Default for r#D {
+        fn default() -> Self {
+          Self {
+          }
+        }
+      }
+      impl binder::Parcelable for r#D {
+        fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+          parcel.sized_write(|subparcel| {
+            Ok(())
+          })
+        }
+        fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+          parcel.sized_read(|subparcel| {
+            Ok(())
+          })
+        }
+      }
+      binder::impl_serialize_for_parcelable!(r#D);
+      binder::impl_deserialize_for_parcelable!(r#D);
+      impl binder::binder_impl::ParcelableMetadata for r#D {
+        fn get_descriptor() -> &'static str { "android.aidl.tests.nested.DeeplyNested.B.C.D" }
+      }
+      pub mod r#E {
+        #![allow(non_upper_case_globals)]
+        use binder::declare_binder_enum;
+        declare_binder_enum! {
+          r#E : [i8; 1] {
+            r#OK = 0,
+          }
+        }
+      }
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#DeeplyNested as _7_android_4_aidl_5_tests_6_nested_12_DeeplyNested;
+ pub use super::r#A::r#A as _7_android_4_aidl_5_tests_6_nested_12_DeeplyNested_1_A;
+ pub use super::r#B::r#B as _7_android_4_aidl_5_tests_6_nested_12_DeeplyNested_1_B;
+ pub use super::r#B::r#C::r#C as _7_android_4_aidl_5_tests_6_nested_12_DeeplyNested_1_B_1_C;
+ pub use super::r#B::r#C::r#D::r#D as _7_android_4_aidl_5_tests_6_nested_12_DeeplyNested_1_B_1_C_1_D;
+ pub use super::r#B::r#C::r#D::r#E::r#E as _7_android_4_aidl_5_tests_6_nested_12_DeeplyNested_1_B_1_C_1_D_1_E;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/DeeplyNested.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/DeeplyNested.rs.d
new file mode 100644
index 0000000..cfee6a4
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/DeeplyNested.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/DeeplyNested.rs : \
+  system/tools/aidl/tests/android/aidl/tests/nested/DeeplyNested.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs
new file mode 100644
index 0000000..c91df68
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs
@@ -0,0 +1,369 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  INestedService["android.aidl.tests.nested.INestedService"] {
+    native: BnNestedService(on_transact),
+    proxy: BpNestedService {
+    },
+    async: INestedServiceAsync,
+  }
+}
+pub trait INestedService: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.nested.INestedService" }
+  fn r#flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result>;
+  fn r#flipStatusWithCallback(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::Result<()>;
+  fn getDefaultImpl() -> INestedServiceDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: INestedServiceDefaultRef) -> INestedServiceDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait INestedServiceAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.nested.INestedService" }
+  fn r#flipStatus<'a>(&'a self, _arg_p: &'a crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result>>;
+  fn r#flipStatusWithCallback<'a>(&'a self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::BoxFuture<'a, binder::Result<()>>;
+}
+#[::async_trait::async_trait]
+pub trait INestedServiceAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.nested.INestedService" }
+  async fn r#flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result>;
+  async fn r#flipStatusWithCallback(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::Result<()>;
+}
+impl BnNestedService {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn INestedService>
+  where
+    T: INestedServiceAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> INestedService for Wrapper<T, R>
+    where
+      T: INestedServiceAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result> {
+        self._rt.block_on(self._inner.r#flipStatus(_arg_p))
+      }
+      fn r#flipStatusWithCallback(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#flipStatusWithCallback(_arg_status, _arg_cb))
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait INestedServiceDefault: Send + Sync {
+  fn r#flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#flipStatusWithCallback(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#flipStatus: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  pub const r#flipStatusWithCallback: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+}
+pub type INestedServiceDefaultRef = Option<std::sync::Arc<dyn INestedServiceDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<INestedServiceDefaultRef> = std::sync::Mutex::new(None);
+}
+impl BpNestedService {
+  fn build_parcel_flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_p)?;
+    Ok(aidl_data)
+  }
+  fn read_response_flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as INestedService>::getDefaultImpl() {
+        return _aidl_default_impl.r#flipStatus(_arg_p);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_flipStatusWithCallback(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(&_arg_status)?;
+    aidl_data.write(_arg_cb)?;
+    Ok(aidl_data)
+  }
+  fn read_response_flipStatusWithCallback(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as INestedService>::getDefaultImpl() {
+        return _aidl_default_impl.r#flipStatusWithCallback(_arg_status, _arg_cb);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+}
+impl INestedService for BpNestedService {
+  fn r#flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result> {
+    let _aidl_data = self.build_parcel_flipStatus(_arg_p)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#flipStatus, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_flipStatus(_arg_p, _aidl_reply)
+  }
+  fn r#flipStatusWithCallback(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_flipStatusWithCallback(_arg_status, _arg_cb)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#flipStatusWithCallback, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_flipStatusWithCallback(_arg_status, _arg_cb, _aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> INestedServiceAsync<P> for BpNestedService {
+  fn r#flipStatus<'a>(&'a self, _arg_p: &'a crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result>> {
+    let _aidl_data = match self.build_parcel_flipStatus(_arg_p) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#flipStatus, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_flipStatus(_arg_p, _aidl_reply)
+      }
+    )
+  }
+  fn r#flipStatusWithCallback<'a>(&'a self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_flipStatusWithCallback(_arg_status, _arg_cb) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#flipStatusWithCallback, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_flipStatusWithCallback(_arg_status, _arg_cb, _aidl_reply)
+      }
+    )
+  }
+}
+impl INestedService for binder::binder_impl::Binder<BnNestedService> {
+  fn r#flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::Result<crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result> { self.0.r#flipStatus(_arg_p) }
+  fn r#flipStatusWithCallback(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback>) -> binder::Result<()> { self.0.r#flipStatusWithCallback(_arg_status, _arg_cb) }
+}
+fn on_transact(_aidl_service: &dyn INestedService, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#flipStatus => {
+      let _arg_p: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#flipStatus(&_arg_p);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#flipStatusWithCallback => {
+      let _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status = _aidl_data.read()?;
+      let _arg_cb: binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#flipStatusWithCallback(_arg_status, &_arg_cb);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub mod r#Result {
+  #[derive(Debug, PartialEq)]
+  pub struct r#Result {
+    pub r#status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status,
+  }
+  impl Default for r#Result {
+    fn default() -> Self {
+      Self {
+        r#status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status::OK,
+      }
+    }
+  }
+  impl binder::Parcelable for r#Result {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        subparcel.write(&self.r#status)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#status = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#Result);
+  binder::impl_deserialize_for_parcelable!(r#Result);
+  impl binder::binder_impl::ParcelableMetadata for r#Result {
+    fn get_descriptor() -> &'static str { "android.aidl.tests.nested.INestedService.Result" }
+  }
+}
+pub mod r#ICallback {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    ICallback["android.aidl.tests.nested.INestedService.ICallback"] {
+      native: BnCallback(on_transact),
+      proxy: BpCallback {
+      },
+      async: ICallbackAsync,
+    }
+  }
+  pub trait ICallback: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.nested.INestedService.ICallback" }
+    fn r#done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::Result<()>;
+    fn getDefaultImpl() -> ICallbackDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: ICallbackDefaultRef) -> ICallbackDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait ICallbackAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.nested.INestedService.ICallback" }
+    fn r#done<'a>(&'a self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::BoxFuture<'a, binder::Result<()>>;
+  }
+  #[::async_trait::async_trait]
+  pub trait ICallbackAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.nested.INestedService.ICallback" }
+    async fn r#done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::Result<()>;
+  }
+  impl BnCallback {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn ICallback>
+    where
+      T: ICallbackAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> ICallback for Wrapper<T, R>
+      where
+        T: ICallbackAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+        fn r#done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::Result<()> {
+          self._rt.block_on(self._inner.r#done(_arg_status))
+        }
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait ICallbackDefault: Send + Sync {
+    fn r#done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::Result<()> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+  }
+  pub mod transactions {
+    pub const r#done: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  }
+  pub type ICallbackDefaultRef = Option<std::sync::Arc<dyn ICallbackDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<ICallbackDefaultRef> = std::sync::Mutex::new(None);
+  }
+  impl BpCallback {
+    fn build_parcel_done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(&_arg_status)?;
+      Ok(aidl_data)
+    }
+    fn read_response_done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as ICallback>::getDefaultImpl() {
+          return _aidl_default_impl.r#done(_arg_status);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      Ok(())
+    }
+  }
+  impl ICallback for BpCallback {
+    fn r#done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::Result<()> {
+      let _aidl_data = self.build_parcel_done(_arg_status)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#done, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_done(_arg_status, _aidl_reply)
+    }
+  }
+  impl<P: binder::BinderAsyncPool> ICallbackAsync<P> for BpCallback {
+    fn r#done<'a>(&'a self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::BoxFuture<'a, binder::Result<()>> {
+      let _aidl_data = match self.build_parcel_done(_arg_status) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#done, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_done(_arg_status, _aidl_reply)
+        }
+      )
+    }
+  }
+  impl ICallback for binder::binder_impl::Binder<BnCallback> {
+    fn r#done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::Result<()> { self.0.r#done(_arg_status) }
+  }
+  fn on_transact(_aidl_service: &dyn ICallback, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      transactions::r#done => {
+        let _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#done(_arg_status);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#INestedService as _7_android_4_aidl_5_tests_6_nested_14_INestedService;
+ pub use super::r#Result::r#Result as _7_android_4_aidl_5_tests_6_nested_14_INestedService_6_Result;
+ pub use super::r#ICallback::r#ICallback as _7_android_4_aidl_5_tests_6_nested_14_INestedService_9_ICallback;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs.d
new file mode 100644
index 0000000..d2839d2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs.d
@@ -0,0 +1,3 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs : \
+  system/tools/aidl/tests/android/aidl/tests/nested/INestedService.aidl \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/ParcelableWithNested.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/ParcelableWithNested.rs
new file mode 100644
index 0000000..e193fb2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/ParcelableWithNested.rs
@@ -0,0 +1,52 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/ParcelableWithNested.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#ParcelableWithNested {
+  pub r#status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status,
+}
+impl Default for r#ParcelableWithNested {
+  fn default() -> Self {
+    Self {
+      r#status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status::OK,
+    }
+  }
+}
+impl binder::Parcelable for r#ParcelableWithNested {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#status)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#status = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#ParcelableWithNested);
+binder::impl_deserialize_for_parcelable!(r#ParcelableWithNested);
+impl binder::binder_impl::ParcelableMetadata for r#ParcelableWithNested {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.nested.ParcelableWithNested" }
+}
+pub mod r#Status {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#Status : [i8; 2] {
+      r#OK = 0,
+      r#NOT_OK = 1,
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ParcelableWithNested as _7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested;
+ pub use super::r#Status::r#Status as _7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/ParcelableWithNested.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/ParcelableWithNested.rs.d
new file mode 100644
index 0000000..d91414e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/ParcelableWithNested.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/ParcelableWithNested.rs : \
+  system/tools/aidl/tests/android/aidl/tests/nested/ParcelableWithNested.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/EnumUnion.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/EnumUnion.rs
new file mode 100644
index 0000000..db652f9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/EnumUnion.rs
@@ -0,0 +1,80 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/EnumUnion.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug, Clone, PartialEq)]
+pub enum r#EnumUnion {
+  IntEnum(crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum),
+  LongEnum(crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum),
+  #[deprecated = "do not use this"]
+  DeprecatedField(i32),
+}
+impl Default for r#EnumUnion {
+  fn default() -> Self {
+    Self::IntEnum(crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum::FOO)
+  }
+}
+impl binder::Parcelable for r#EnumUnion {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    match self {
+      Self::IntEnum(v) => {
+        parcel.write(&0i32)?;
+        parcel.write(v)
+      }
+      Self::LongEnum(v) => {
+        parcel.write(&1i32)?;
+        parcel.write(v)
+      }
+      Self::DeprecatedField(v) => {
+        parcel.write(&2i32)?;
+        parcel.write(v)
+      }
+    }
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    let tag: i32 = parcel.read()?;
+    match tag {
+      0 => {
+        let value: crate::mangled::_7_android_4_aidl_5_tests_7_IntEnum = parcel.read()?;
+        *self = Self::IntEnum(value);
+        Ok(())
+      }
+      1 => {
+        let value: crate::mangled::_7_android_4_aidl_5_tests_8_LongEnum = parcel.read()?;
+        *self = Self::LongEnum(value);
+        Ok(())
+      }
+      2 => {
+        let value: i32 = parcel.read()?;
+        *self = Self::DeprecatedField(value);
+        Ok(())
+      }
+      _ => {
+        Err(binder::StatusCode::BAD_VALUE)
+      }
+    }
+  }
+}
+binder::impl_serialize_for_parcelable!(r#EnumUnion);
+binder::impl_deserialize_for_parcelable!(r#EnumUnion);
+impl binder::binder_impl::ParcelableMetadata for r#EnumUnion {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.unions.EnumUnion" }
+}
+pub mod r#Tag {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#Tag : [i32; 3] {
+      r#intEnum = 0,
+      r#longEnum = 1,
+      #[deprecated = "do not use this"]
+      r#deprecatedField = 2,
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#EnumUnion as _7_android_4_aidl_5_tests_6_unions_9_EnumUnion;
+ pub use super::r#Tag::r#Tag as _7_android_4_aidl_5_tests_6_unions_9_EnumUnion_3_Tag;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/EnumUnion.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/EnumUnion.rs.d
new file mode 100644
index 0000000..40e3a24
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/EnumUnion.rs.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/EnumUnion.rs : \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/UnionInUnion.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/UnionInUnion.rs
new file mode 100644
index 0000000..ac2a6e9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/UnionInUnion.rs
@@ -0,0 +1,67 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/UnionInUnion.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug, Clone, PartialEq)]
+pub enum r#UnionInUnion {
+  First(crate::mangled::_7_android_4_aidl_5_tests_6_unions_9_EnumUnion),
+  Second(i32),
+}
+impl Default for r#UnionInUnion {
+  fn default() -> Self {
+    Self::First(Default::default())
+  }
+}
+impl binder::Parcelable for r#UnionInUnion {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    match self {
+      Self::First(v) => {
+        parcel.write(&0i32)?;
+        parcel.write(v)
+      }
+      Self::Second(v) => {
+        parcel.write(&1i32)?;
+        parcel.write(v)
+      }
+    }
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    let tag: i32 = parcel.read()?;
+    match tag {
+      0 => {
+        let value: crate::mangled::_7_android_4_aidl_5_tests_6_unions_9_EnumUnion = parcel.read()?;
+        *self = Self::First(value);
+        Ok(())
+      }
+      1 => {
+        let value: i32 = parcel.read()?;
+        *self = Self::Second(value);
+        Ok(())
+      }
+      _ => {
+        Err(binder::StatusCode::BAD_VALUE)
+      }
+    }
+  }
+}
+binder::impl_serialize_for_parcelable!(r#UnionInUnion);
+binder::impl_deserialize_for_parcelable!(r#UnionInUnion);
+impl binder::binder_impl::ParcelableMetadata for r#UnionInUnion {
+  fn get_descriptor() -> &'static str { "android.aidl.tests.unions.UnionInUnion" }
+}
+pub mod r#Tag {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#Tag : [i32; 2] {
+      r#first = 0,
+      r#second = 1,
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#UnionInUnion as _7_android_4_aidl_5_tests_6_unions_12_UnionInUnion;
+ pub use super::r#Tag::r#Tag as _7_android_4_aidl_5_tests_6_unions_12_UnionInUnion_3_Tag;
+}
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/UnionInUnion.rs.d b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/UnionInUnion.rs.d
new file mode 100644
index 0000000..2376cf5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/UnionInUnion.rs.d
@@ -0,0 +1,5 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/unions/UnionInUnion.rs : \
+  system/tools/aidl/tests/android/aidl/tests/unions/UnionInUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/unions/EnumUnion.aidl \
+  system/tools/aidl/tests/android/aidl/tests/IntEnum.aidl \
+  system/tools/aidl/tests/android/aidl/tests/LongEnum.aidl
diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp
new file mode 100644
index 0000000..47e5a86
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp
@@ -0,0 +1,40 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#include <android/aidl/versioned/tests/BazUnion.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+::android::status_t BazUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case intNum: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<intNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intNum>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t BazUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case intNum: return _aidl_parcel->writeInt32(get<intNum>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
new file mode 100644
index 0000000..616884b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp
new file mode 100644
index 0000000..16a42bd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp
@@ -0,0 +1,38 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#include <android/aidl/versioned/tests/Foo.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+::android::status_t Foo::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t Foo::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d
new file mode 100644
index 0000000..637f847
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
new file mode 100644
index 0000000..ef89093
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
@@ -0,0 +1,411 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#include <android/aidl/versioned/tests/IFooInterface.h>
+#include <android/aidl/versioned/tests/BpFooInterface.h>
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(FooInterface, "android.aidl.versioned.tests.IFooInterface")
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/versioned/tests/BpFooInterface.h>
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+
+BpFooInterface::BpFooInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IFooInterface>(_aidl_impl){
+}
+
+::android::binder::Status BpFooInterface::originalApi() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::originalApi::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_originalApi, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->originalApi();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::acceptUnionAndReturnString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(u);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_acceptUnionAndReturnString, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->acceptUnionAndReturnString(u, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8FromUtf16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::ignoreParcelablesAndRepeatInt::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(inFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(*inoutFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(value);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_ignoreParcelablesAndRepeatInt, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->ignoreParcelablesAndRepeatInt(inFoo, inoutFoo, outFoo, value, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(inoutFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(outFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::returnsLengthOfFooArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelableVector(foos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_returnsLengthOfFooArray, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->returnsLengthOfFooArray(foos, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+int32_t BpFooInterface::getInterfaceVersion() {
+  if (cached_version_ == -1) {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnFooInterface::TRANSACTION_getInterfaceVersion, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        cached_version_ = reply.readInt32();
+      }
+    }
+  }
+  return cached_version_;
+}
+
+
+std::string BpFooInterface::getInterfaceHash() {
+  std::lock_guard<std::mutex> lockGuard(cached_hash_mutex_);
+  if (cached_hash_ == "-1") {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnFooInterface::TRANSACTION_getInterfaceHash, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        reply.readUtf8FromUtf16(&cached_hash_);
+      }
+    }
+  }
+  return cached_hash_;
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+
+BnFooInterface::BnFooInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnFooInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnFooInterface::TRANSACTION_originalApi:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::originalApi::cppServer");
+    ::android::binder::Status _aidl_status(originalApi());
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_acceptUnionAndReturnString:
+  {
+    ::android::aidl::versioned::tests::BazUnion in_u;
+    ::std::string _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::acceptUnionAndReturnString::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_u);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(acceptUnionAndReturnString(in_u, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8AsUtf16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_ignoreParcelablesAndRepeatInt:
+  {
+    ::android::aidl::versioned::tests::Foo in_inFoo;
+    ::android::aidl::versioned::tests::Foo in_inoutFoo;
+    ::android::aidl::versioned::tests::Foo out_outFoo;
+    int32_t in_value;
+    int32_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::ignoreParcelablesAndRepeatInt::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_inFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readParcelable(&in_inoutFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readInt32(&in_value);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ignoreParcelablesAndRepeatInt(in_inFoo, &in_inoutFoo, &out_outFoo, in_value, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(in_inoutFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(out_outFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_returnsLengthOfFooArray:
+  {
+    ::std::vector<::android::aidl::versioned::tests::Foo> in_foos;
+    int32_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::returnsLengthOfFooArray::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelableVector(&in_foos);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(returnsLengthOfFooArray(in_foos, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_getInterfaceVersion:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeInt32(IFooInterface::VERSION);
+  }
+  break;
+  case BnFooInterface::TRANSACTION_getInterfaceHash:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeUtf8AsUtf16(IFooInterface::HASH);
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+int32_t BnFooInterface::getInterfaceVersion() {
+  return IFooInterface::VERSION;
+}
+std::string BnFooInterface::getInterfaceHash() {
+  return IFooInterface::HASH;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
new file mode 100644
index 0000000..9bee1b6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h
new file mode 100644
index 0000000..941ecac
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h
@@ -0,0 +1,148 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BazUnion : public ::android::Parcelable {
+public:
+  enum class Tag : int32_t {
+    intNum = 0,
+  };
+  // Expose tag symbols for legacy code
+  static const inline Tag intNum = Tag::intNum;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, BazUnion>;
+
+  BazUnion() : _value(std::in_place_index<static_cast<size_t>(intNum)>, int32_t(0)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr BazUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit BazUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static BazUnion make(_Tp&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static BazUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  inline bool operator!=(const BazUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const BazUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const BazUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const BazUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const BazUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const BazUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.versioned.tests.BazUnion");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "BazUnion{";
+    switch (getTag()) {
+    case intNum: os << "intNum: " << ::android::internal::ToString(get<intNum>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t> _value;
+};  // class BazUnion
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+[[nodiscard]] static inline std::string toString(BazUnion::Tag val) {
+  switch(val) {
+  case BazUnion::Tag::intNum:
+    return "intNum";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::versioned::tests::BazUnion::Tag, 1> enum_values<::android::aidl::versioned::tests::BazUnion::Tag> = {
+  ::android::aidl::versioned::tests::BazUnion::Tag::intNum,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h
new file mode 100644
index 0000000..cae14cc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h
new file mode 100644
index 0000000..d3dd4b5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h
new file mode 100644
index 0000000..22baaa9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h
@@ -0,0 +1,62 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/versioned/tests/IFooInterface.h>
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BnFooInterface : public ::android::BnInterface<IFooInterface> {
+public:
+  static constexpr uint32_t TRANSACTION_originalApi = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_acceptUnionAndReturnString = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_ignoreParcelablesAndRepeatInt = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_returnsLengthOfFooArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_getInterfaceVersion = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777214;
+  static constexpr uint32_t TRANSACTION_getInterfaceHash = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777213;
+  explicit BnFooInterface();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  int32_t getInterfaceVersion();
+  std::string getInterfaceHash();
+};  // class BnFooInterface
+
+class IFooInterfaceDelegator : public BnFooInterface {
+public:
+  explicit IFooInterfaceDelegator(const ::android::sp<IFooInterface> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<IFooInterface> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status originalApi() override {
+    return _aidl_delegate->originalApi();
+  }
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) override {
+    return _aidl_delegate->acceptUnionAndReturnString(u, _aidl_return);
+  }
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) override {
+    return _aidl_delegate->ignoreParcelablesAndRepeatInt(inFoo, inoutFoo, outFoo, value, _aidl_return);
+  }
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) override {
+    return _aidl_delegate->returnsLengthOfFooArray(foos, _aidl_return);
+  }
+  int32_t getInterfaceVersion() override {
+    int32_t _delegator_ver = BnFooInterface::getInterfaceVersion();
+    int32_t _impl_ver = _aidl_delegate->getInterfaceVersion();
+    return _delegator_ver < _impl_ver ? _delegator_ver : _impl_ver;
+  }
+  std::string getInterfaceHash() override {
+    return _aidl_delegate->getInterfaceHash();
+  }
+private:
+  ::android::sp<IFooInterface> _aidl_delegate;
+};  // class IFooInterfaceDelegator
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h
new file mode 100644
index 0000000..dd8bdb4
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h
new file mode 100644
index 0000000..d81b356
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h
new file mode 100644
index 0000000..e3f84ea
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h
@@ -0,0 +1,34 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/versioned/tests/IFooInterface.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BpFooInterface : public ::android::BpInterface<IFooInterface> {
+public:
+  explicit BpFooInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpFooInterface() = default;
+  ::android::binder::Status originalApi() override;
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) override;
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) override;
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) override;
+  int32_t getInterfaceVersion() override;
+  std::string getInterfaceHash() override;
+private:
+  int32_t cached_version_ = -1;
+  std::string cached_hash_ = "-1";
+  std::mutex cached_hash_mutex_;
+};  // class BpFooInterface
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h
new file mode 100644
index 0000000..8929dbb
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h
@@ -0,0 +1,54 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class Foo : public ::android::Parcelable {
+public:
+  inline bool operator!=(const Foo&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const Foo&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const Foo&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const Foo&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const Foo&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const Foo&) const {
+    return std::tie() >= std::tie();
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.versioned.tests.Foo");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Foo{";
+    os << "}";
+    return os.str();
+  }
+};  // class Foo
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h
new file mode 100644
index 0000000..e7eb4be
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h
@@ -0,0 +1,69 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <android/aidl/versioned/tests/BazUnion.h>
+#include <android/aidl/versioned/tests/Foo.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cstdint>
+#include <string>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <vector>
+
+namespace android::aidl::versioned::tests {
+class Foo;
+}  // namespace android::aidl::versioned::tests
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class IFooInterfaceDelegator;
+
+class IFooInterface : public ::android::IInterface {
+public:
+  typedef IFooInterfaceDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(FooInterface)
+  static inline const int32_t VERSION = 1;
+  static inline const std::string HASH = "9e7be1859820c59d9d55dd133e71a3687b5d2e5b";
+  virtual ::android::binder::Status originalApi() = 0;
+  virtual ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) = 0;
+  virtual ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) = 0;
+  virtual ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) = 0;
+  virtual int32_t getInterfaceVersion() = 0;
+  virtual std::string getInterfaceHash() = 0;
+};  // class IFooInterface
+
+class IFooInterfaceDefault : public IFooInterface {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status originalApi() override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& /*u*/, ::std::string* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& /*inFoo*/, ::android::aidl::versioned::tests::Foo* /*inoutFoo*/, ::android::aidl::versioned::tests::Foo* /*outFoo*/, int32_t /*value*/, int32_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& /*foos*/, int32_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  int32_t getInterfaceVersion() override {
+    return 0;
+  }
+  std::string getInterfaceHash() override {
+    return "";
+  }
+};  // class IFooInterfaceDefault
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-cpp-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/BazUnion.java b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/BazUnion.java
new file mode 100644
index 0000000..0428d1d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/BazUnion.java
@@ -0,0 +1,109 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+package android.aidl.versioned.tests;
+public final class BazUnion implements android.os.Parcelable {
+  // tags for union fields
+  public final static int intNum = 0;  // int intNum;
+
+  private int _tag;
+  private Object _value;
+
+  public BazUnion() {
+    int _value = 0;
+    this._tag = intNum;
+    this._value = _value;
+  }
+
+  private BazUnion(android.os.Parcel _aidl_parcel) {
+    readFromParcel(_aidl_parcel);
+  }
+
+  private BazUnion(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+
+  public int getTag() {
+    return _tag;
+  }
+
+  // int intNum;
+
+  public static BazUnion intNum(int _value) {
+    return new BazUnion(intNum, _value);
+  }
+
+  public int getIntNum() {
+    _assertTag(intNum);
+    return (int) _value;
+  }
+
+  public void setIntNum(int _value) {
+    _set(intNum, _value);
+  }
+
+  public static final android.os.Parcelable.Creator<BazUnion> CREATOR = new android.os.Parcelable.Creator<BazUnion>() {
+    @Override
+    public BazUnion createFromParcel(android.os.Parcel _aidl_source) {
+      return new BazUnion(_aidl_source);
+    }
+    @Override
+    public BazUnion[] newArray(int _aidl_size) {
+      return new BazUnion[_aidl_size];
+    }
+  };
+
+  @Override
+  public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+    _aidl_parcel.writeInt(_tag);
+    switch (_tag) {
+    case intNum:
+      _aidl_parcel.writeInt(getIntNum());
+      break;
+    }
+  }
+
+  public void readFromParcel(android.os.Parcel _aidl_parcel) {
+    int _aidl_tag;
+    _aidl_tag = _aidl_parcel.readInt();
+    switch (_aidl_tag) {
+    case intNum: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    }
+    throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+  }
+
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    switch (getTag()) {
+    }
+    return _mask;
+  }
+
+  private void _assertTag(int tag) {
+    if (getTag() != tag) {
+      throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+    }
+  }
+
+  private String _tagString(int _tag) {
+    switch (_tag) {
+    case intNum: return "intNum";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+
+  private void _set(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+  public static @interface Tag {
+    public static final int intNum = 0;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d
new file mode 100644
index 0000000..1c7895a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/BazUnion.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/Foo.java b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/Foo.java
new file mode 100644
index 0000000..aa95b5a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/Foo.java
@@ -0,0 +1,47 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/Foo.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+package android.aidl.versioned.tests;
+public class Foo implements android.os.Parcelable
+{
+  public static final android.os.Parcelable.Creator<Foo> CREATOR = new android.os.Parcelable.Creator<Foo>() {
+    @Override
+    public Foo createFromParcel(android.os.Parcel _aidl_source) {
+      Foo _aidl_out = new Foo();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public Foo[] newArray(int _aidl_size) {
+      return new Foo[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/Foo.java.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/Foo.java.d
new file mode 100644
index 0000000..23763bb
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/Foo.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/Foo.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/IFooInterface.java b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/IFooInterface.java
new file mode 100644
index 0000000..94fbb81
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/IFooInterface.java
@@ -0,0 +1,301 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+package android.aidl.versioned.tests;
+public interface IFooInterface extends android.os.IInterface
+{
+  /**
+   * The version of this interface that the caller is built against.
+   * This might be different from what {@link #getInterfaceVersion()
+   * getInterfaceVersion} returns as that is the version of the interface
+   * that the remote object is implementing.
+   */
+  public static final int VERSION = 1;
+  public static final String HASH = "9e7be1859820c59d9d55dd133e71a3687b5d2e5b";
+  /** Default implementation for IFooInterface. */
+  public static class Default implements android.aidl.versioned.tests.IFooInterface
+  {
+    @Override public void originalApi() throws android.os.RemoteException
+    {
+    }
+    @Override public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override
+    public int getInterfaceVersion() {
+      return 0;
+    }
+    @Override
+    public String getInterfaceHash() {
+      return "";
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.versioned.tests.IFooInterface
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.versioned.tests.IFooInterface interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.versioned.tests.IFooInterface asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.versioned.tests.IFooInterface))) {
+        return ((android.aidl.versioned.tests.IFooInterface)iin);
+      }
+      return new android.aidl.versioned.tests.IFooInterface.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceVersion) {
+        reply.writeNoException();
+        reply.writeInt(getInterfaceVersion());
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceHash) {
+        reply.writeNoException();
+        reply.writeString(getInterfaceHash());
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_originalApi:
+        {
+          this.originalApi();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_acceptUnionAndReturnString:
+        {
+          android.aidl.versioned.tests.BazUnion _arg0;
+          _arg0 = data.readTypedObject(android.aidl.versioned.tests.BazUnion.CREATOR);
+          data.enforceNoDataAvail();
+          java.lang.String _result = this.acceptUnionAndReturnString(_arg0);
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        case TRANSACTION_ignoreParcelablesAndRepeatInt:
+        {
+          android.aidl.versioned.tests.Foo _arg0;
+          _arg0 = data.readTypedObject(android.aidl.versioned.tests.Foo.CREATOR);
+          android.aidl.versioned.tests.Foo _arg1;
+          _arg1 = data.readTypedObject(android.aidl.versioned.tests.Foo.CREATOR);
+          android.aidl.versioned.tests.Foo _arg2;
+          _arg2 = new android.aidl.versioned.tests.Foo();
+          int _arg3;
+          _arg3 = data.readInt();
+          data.enforceNoDataAvail();
+          int _result = this.ignoreParcelablesAndRepeatInt(_arg0, _arg1, _arg2, _arg3);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          reply.writeTypedObject(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          reply.writeTypedObject(_arg2, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_returnsLengthOfFooArray:
+        {
+          android.aidl.versioned.tests.Foo[] _arg0;
+          _arg0 = data.createTypedArray(android.aidl.versioned.tests.Foo.CREATOR);
+          data.enforceNoDataAvail();
+          int _result = this.returnsLengthOfFooArray(_arg0);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.versioned.tests.IFooInterface
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      private int mCachedVersion = -1;
+      private String mCachedHash = "-1";
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public void originalApi() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_originalApi, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method originalApi is unimplemented.");
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(u, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_acceptUnionAndReturnString, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method acceptUnionAndReturnString is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(inFoo, 0);
+          _data.writeTypedObject(inoutFoo, 0);
+          _data.writeInt(value);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ignoreParcelablesAndRepeatInt, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method ignoreParcelablesAndRepeatInt is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+          if ((0!=_reply.readInt())) {
+            inoutFoo.readFromParcel(_reply);
+          }
+          if ((0!=_reply.readInt())) {
+            outFoo.readFromParcel(_reply);
+          }
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedArray(foos, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_returnsLengthOfFooArray, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method returnsLengthOfFooArray is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override
+      public int getInterfaceVersion() throws android.os.RemoteException {
+        if (mCachedVersion == -1) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceVersion, data, reply, 0);
+            reply.readException();
+            mCachedVersion = reply.readInt();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedVersion;
+      }
+      @Override
+      public synchronized String getInterfaceHash() throws android.os.RemoteException {
+        if ("-1".equals(mCachedHash)) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceHash, data, reply, 0);
+            reply.readException();
+            mCachedHash = reply.readString();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedHash;
+      }
+    }
+    static final int TRANSACTION_originalApi = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    static final int TRANSACTION_acceptUnionAndReturnString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    static final int TRANSACTION_ignoreParcelablesAndRepeatInt = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+    static final int TRANSACTION_returnsLengthOfFooArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+    static final int TRANSACTION_getInterfaceVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777214);
+    static final int TRANSACTION_getInterfaceHash = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777213);
+  }
+  public static final java.lang.String DESCRIPTOR = "android$aidl$versioned$tests$IFooInterface".replace('$', '.');
+  public void originalApi() throws android.os.RemoteException;
+  public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException;
+  public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException;
+  public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException;
+  public int getInterfaceVersion() throws android.os.RemoteException;
+  public String getInterfaceHash() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d
new file mode 100644
index 0000000..6875917
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-java-source/gen/android/aidl/versioned/tests/IFooInterface.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-java-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp
new file mode 100644
index 0000000..5750f92
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp
@@ -0,0 +1,47 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/BazUnion.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+const char* BazUnion::descriptor = "android.aidl.versioned.tests.BazUnion";
+
+binder_status_t BazUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case intNum: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<intNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intNum>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t BazUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case intNum: return ::ndk::AParcel_writeData(_parcel, get<intNum>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
new file mode 100644
index 0000000..b4581bd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp
new file mode 100644
index 0000000..07e8efe
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp
@@ -0,0 +1,45 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/Foo.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+const char* Foo::descriptor = "android.aidl.versioned.tests.Foo";
+
+binder_status_t Foo::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t Foo::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d
new file mode 100644
index 0000000..df963e3
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
new file mode 100644
index 0000000..aec8e2c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
@@ -0,0 +1,496 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/versioned/tests/BnFooInterface.h>
+#include <aidl/android/aidl/versioned/tests/BpFooInterface.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+static binder_status_t _aidl_android_aidl_versioned_tests_IFooInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnFooInterface> _aidl_impl = std::static_pointer_cast<BnFooInterface>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*originalApi*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->originalApi();
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*acceptUnionAndReturnString*/): {
+      ::aidl::android::aidl::versioned::tests::BazUnion in_u;
+      std::string _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_u);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->acceptUnionAndReturnString(in_u, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*ignoreParcelablesAndRepeatInt*/): {
+      ::aidl::android::aidl::versioned::tests::Foo in_inFoo;
+      ::aidl::android::aidl::versioned::tests::Foo in_inoutFoo;
+      ::aidl::android::aidl::versioned::tests::Foo out_outFoo;
+      int32_t in_value;
+      int32_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_inFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_inoutFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_value);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ignoreParcelablesAndRepeatInt(in_inFoo, &in_inoutFoo, &out_outFoo, in_value, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_inoutFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_outFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 3 /*returnsLengthOfFooArray*/): {
+      std::vector<::aidl::android::aidl::versioned::tests::Foo> in_foos;
+      int32_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_foos);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->returnsLengthOfFooArray(in_foos, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): {
+      int32_t _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): {
+      std::string _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_versioned_tests_IFooInterface_clazz = ::ndk::ICInterface::defineClass(IFooInterface::descriptor, _aidl_android_aidl_versioned_tests_IFooInterface_onTransact);
+
+BpFooInterface::BpFooInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpFooInterface::~BpFooInterface() {}
+
+::ndk::ScopedAStatus BpFooInterface::originalApi() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*originalApi*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->originalApi();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_u);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*acceptUnionAndReturnString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->acceptUnionAndReturnString(in_u, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_inFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_inoutFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_value);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*ignoreParcelablesAndRepeatInt*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->ignoreParcelablesAndRepeatInt(in_inFoo, in_inoutFoo, out_outFoo, in_value, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_inoutFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_outFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_foos);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 3 /*returnsLengthOfFooArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->returnsLengthOfFooArray(in_foos, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::getInterfaceVersion(int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  if (_aidl_cached_version != -1) {
+    *_aidl_return = _aidl_cached_version;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->getInterfaceVersion(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_version = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::getInterfaceHash(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex);
+  if (_aidl_cached_hash != "-1") {
+    *_aidl_return = _aidl_cached_hash;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->getInterfaceHash(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_hash = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnFooInterface
+BnFooInterface::BnFooInterface() {}
+BnFooInterface::~BnFooInterface() {}
+::ndk::SpAIBinder BnFooInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_versioned_tests_IFooInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+::ndk::ScopedAStatus BnFooInterface::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = IFooInterface::version;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus BnFooInterface::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = IFooInterface::hash;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+// Source for IFooInterface
+const char* IFooInterface::descriptor = "android.aidl.versioned.tests.IFooInterface";
+IFooInterface::IFooInterface() {}
+IFooInterface::~IFooInterface() {}
+
+
+std::shared_ptr<IFooInterface> IFooInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_versioned_tests_IFooInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpFooInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IFooInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpFooInterface>(binder);
+}
+
+binder_status_t IFooInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<IFooInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t IFooInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<IFooInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IFooInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool IFooInterface::setDefaultImpl(const std::shared_ptr<IFooInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IFooInterface::default_impl);
+  if (impl) {
+    IFooInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<IFooInterface>& IFooInterface::getDefaultImpl() {
+  return IFooInterface::default_impl;
+}
+std::shared_ptr<IFooInterface> IFooInterface::default_impl = nullptr;
+::ndk::ScopedAStatus IFooInterfaceDefault::originalApi() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& /*in_u*/, std::string* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& /*in_inFoo*/, ::aidl::android::aidl::versioned::tests::Foo* /*in_inoutFoo*/, ::aidl::android::aidl::versioned::tests::Foo* /*out_outFoo*/, int32_t /*in_value*/, int32_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& /*in_foos*/, int32_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = 0;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = "";
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::SpAIBinder IFooInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool IFooInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
new file mode 100644
index 0000000..762b47b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h
new file mode 100644
index 0000000..c3fdf63
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h
@@ -0,0 +1,159 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BazUnion {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Tag : int32_t {
+    intNum = 0,
+  };
+
+  // Expose tag symbols for legacy code
+  static const inline Tag intNum = Tag::intNum;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, BazUnion>;
+
+  BazUnion() : _value(std::in_place_index<static_cast<size_t>(intNum)>, int32_t(0)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr BazUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit BazUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static BazUnion make(_Tp&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static BazUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  binder_status_t readFromParcel(const AParcel* _parcel);
+  binder_status_t writeToParcel(AParcel* _parcel) const;
+
+  inline bool operator!=(const BazUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const BazUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const BazUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const BazUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const BazUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const BazUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "BazUnion{";
+    switch (getTag()) {
+    case intNum: os << "intNum: " << ::android::internal::ToString(get<intNum>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t> _value;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+[[nodiscard]] static inline std::string toString(BazUnion::Tag val) {
+  switch(val) {
+  case BazUnion::Tag::intNum:
+    return "intNum";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::versioned::tests::BazUnion::Tag, 1> enum_values<aidl::android::aidl::versioned::tests::BazUnion::Tag> = {
+  aidl::android::aidl::versioned::tests::BazUnion::Tag::intNum,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h
new file mode 100644
index 0000000..44bef24
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h
new file mode 100644
index 0000000..0f14b41
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h
new file mode 100644
index 0000000..13db93c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h
@@ -0,0 +1,66 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BnFooInterface : public ::ndk::BnCInterface<IFooInterface> {
+public:
+  BnFooInterface();
+  virtual ~BnFooInterface();
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) final;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) final;
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class IFooInterfaceDelegator : public BnFooInterface {
+public:
+  explicit IFooInterfaceDelegator(const std::shared_ptr<IFooInterface> &impl) : _impl(impl) {
+     int32_t _impl_ver = 0;
+     if (!impl->getInterfaceVersion(&_impl_ver).isOk()) {;
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Delegator failed to get version of the implementation.");
+     }
+     if (_impl_ver != IFooInterface::version) {
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Mismatched versions of delegator and implementation is not allowed.");
+     }
+  }
+
+  ::ndk::ScopedAStatus originalApi() override {
+    return _impl->originalApi();
+  }
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override {
+    return _impl->acceptUnionAndReturnString(in_u, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override {
+    return _impl->ignoreParcelablesAndRepeatInt(in_inFoo, in_inoutFoo, out_outFoo, in_value, _aidl_return);
+  }
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override {
+    return _impl->returnsLengthOfFooArray(in_foos, _aidl_return);
+  }
+protected:
+private:
+  std::shared_ptr<IFooInterface> _impl;
+};
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h
new file mode 100644
index 0000000..d772c0c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h
new file mode 100644
index 0000000..6fc1f80
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h
new file mode 100644
index 0000000..2cac137
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h
@@ -0,0 +1,35 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BpFooInterface : public ::ndk::BpCInterface<IFooInterface> {
+public:
+  explicit BpFooInterface(const ::ndk::SpAIBinder& binder);
+  virtual ~BpFooInterface();
+
+  ::ndk::ScopedAStatus originalApi() override;
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  int32_t _aidl_cached_version = -1;
+  std::string _aidl_cached_hash = "-1";
+  std::mutex _aidl_cached_hash_mutex;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h
new file mode 100644
index 0000000..fd7b3ab
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h
@@ -0,0 +1,64 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class Foo {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const Foo&) const {
+    return std::tie() != std::tie();
+  }
+  inline bool operator<(const Foo&) const {
+    return std::tie() < std::tie();
+  }
+  inline bool operator<=(const Foo&) const {
+    return std::tie() <= std::tie();
+  }
+  inline bool operator==(const Foo&) const {
+    return std::tie() == std::tie();
+  }
+  inline bool operator>(const Foo&) const {
+    return std::tie() > std::tie();
+  }
+  inline bool operator>=(const Foo&) const {
+    return std::tie() >= std::tie();
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Foo{";
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h
new file mode 100644
index 0000000..0d39f1d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h
@@ -0,0 +1,72 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <aidl/android/aidl/versioned/tests/BazUnion.h>
+#include <aidl/android/aidl/versioned/tests/Foo.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::versioned::tests {
+class Foo;
+}  // namespace aidl::android::aidl::versioned::tests
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class IFooInterfaceDelegator;
+
+class IFooInterface : public ::ndk::ICInterface {
+public:
+  typedef IFooInterfaceDelegator DefaultDelegator;
+  static const char* descriptor;
+  IFooInterface();
+  virtual ~IFooInterface();
+
+  static inline const int32_t version = 1;
+  static inline const std::string hash = "9e7be1859820c59d9d55dd133e71a3687b5d2e5b";
+  static constexpr uint32_t TRANSACTION_originalApi = FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_acceptUnionAndReturnString = FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_ignoreParcelablesAndRepeatInt = FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_returnsLengthOfFooArray = FIRST_CALL_TRANSACTION + 3;
+
+  static std::shared_ptr<IFooInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IFooInterface>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IFooInterface>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<IFooInterface>& impl);
+  static const std::shared_ptr<IFooInterface>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus originalApi() = 0;
+  virtual ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) = 0;
+private:
+  static std::shared_ptr<IFooInterface> default_impl;
+};
+class IFooInterfaceDefault : public IFooInterface {
+public:
+  ::ndk::ScopedAStatus originalApi() override;
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-ndk-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs
new file mode 100644
index 0000000..42879be
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs
@@ -0,0 +1,56 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub enum r#BazUnion {
+  IntNum(i32),
+}
+impl Default for r#BazUnion {
+  fn default() -> Self {
+    Self::IntNum(0)
+  }
+}
+impl binder::Parcelable for r#BazUnion {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    match self {
+      Self::IntNum(v) => {
+        parcel.write(&0i32)?;
+        parcel.write(v)
+      }
+    }
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    let tag: i32 = parcel.read()?;
+    match tag {
+      0 => {
+        let value: i32 = parcel.read()?;
+        *self = Self::IntNum(value);
+        Ok(())
+      }
+      _ => {
+        Err(binder::StatusCode::BAD_VALUE)
+      }
+    }
+  }
+}
+binder::impl_serialize_for_parcelable!(r#BazUnion);
+binder::impl_deserialize_for_parcelable!(r#BazUnion);
+impl binder::binder_impl::ParcelableMetadata for r#BazUnion {
+  fn get_descriptor() -> &'static str { "android.aidl.versioned.tests.BazUnion" }
+}
+pub mod r#Tag {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#Tag : [i32; 1] {
+      r#intNum = 0,
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#BazUnion as _7_android_4_aidl_9_versioned_5_tests_8_BazUnion;
+ pub use super::r#Tag::r#Tag as _7_android_4_aidl_9_versioned_5_tests_8_BazUnion_3_Tag;
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d
new file mode 100644
index 0000000..d46cd01
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/Foo.rs b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/Foo.rs
new file mode 100644
index 0000000..231c94d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/Foo.rs
@@ -0,0 +1,35 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#Foo {
+}
+impl Default for r#Foo {
+  fn default() -> Self {
+    Self {
+    }
+  }
+}
+impl binder::Parcelable for r#Foo {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#Foo);
+binder::impl_deserialize_for_parcelable!(r#Foo);
+impl binder::binder_impl::ParcelableMetadata for r#Foo {
+  fn get_descriptor() -> &'static str { "android.aidl.versioned.tests.Foo" }
+}
+pub(crate) mod mangled {
+ pub use super::r#Foo as _7_android_4_aidl_9_versioned_5_tests_3_Foo;
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d
new file mode 100644
index 0000000..f8b09de
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/Foo.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs
new file mode 100644
index 0000000..7a58017
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs
@@ -0,0 +1,439 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 1 --hash 9e7be1859820c59d9d55dd133e71a3687b5d2e5b --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/1 system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  IFooInterface["android.aidl.versioned.tests.IFooInterface"] {
+    native: BnFooInterface(on_transact),
+    proxy: BpFooInterface {
+      cached_version: std::sync::atomic::AtomicI32 = std::sync::atomic::AtomicI32::new(-1),
+      cached_hash: std::sync::Mutex<Option<String>> = std::sync::Mutex::new(None)
+    },
+    async: IFooInterfaceAsync,
+  }
+}
+pub trait IFooInterface: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  fn r#originalApi(&self) -> binder::Result<()>;
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String>;
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32>;
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32>;
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    Ok(VERSION)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    Ok(HASH.into())
+  }
+  fn getDefaultImpl() -> IFooInterfaceDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: IFooInterfaceDefaultRef) -> IFooInterfaceDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait IFooInterfaceAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  fn r#originalApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#acceptUnionAndReturnString<'a>(&'a self, _arg_u: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::BoxFuture<'a, binder::Result<String>>;
+  fn r#ignoreParcelablesAndRepeatInt<'a>(&'a self, _arg_inFoo: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::BoxFuture<'a, binder::Result<i32>>;
+  fn r#returnsLengthOfFooArray<'a>(&'a self, _arg_foos: &'a [crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::BoxFuture<'a, binder::Result<i32>>;
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    Box::pin(async move { Ok(VERSION) })
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    Box::pin(async move { Ok(HASH.into()) })
+  }
+}
+#[::async_trait::async_trait]
+pub trait IFooInterfaceAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  async fn r#originalApi(&self) -> binder::Result<()>;
+  async fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String>;
+  async fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32>;
+  async fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32>;
+}
+impl BnFooInterface {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IFooInterface>
+  where
+    T: IFooInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> IFooInterface for Wrapper<T, R>
+    where
+      T: IFooInterfaceAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#originalApi(&self) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#originalApi())
+      }
+      fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+        self._rt.block_on(self._inner.r#acceptUnionAndReturnString(_arg_u))
+      }
+      fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+        self._rt.block_on(self._inner.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value))
+      }
+      fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+        self._rt.block_on(self._inner.r#returnsLengthOfFooArray(_arg_foos))
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait IFooInterfaceDefault: Send + Sync {
+  fn r#originalApi(&self) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#originalApi: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  pub const r#acceptUnionAndReturnString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+  pub const r#ignoreParcelablesAndRepeatInt: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+  pub const r#returnsLengthOfFooArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 3;
+  pub const r#getInterfaceVersion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777214;
+  pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213;
+}
+pub type IFooInterfaceDefaultRef = Option<std::sync::Arc<dyn IFooInterfaceDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None);
+}
+pub const VERSION: i32 = 1;
+pub const HASH: &str = "9e7be1859820c59d9d55dd133e71a3687b5d2e5b";
+impl BpFooInterface {
+  fn build_parcel_originalApi(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_originalApi(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#originalApi();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_u)?;
+    Ok(aidl_data)
+  }
+  fn read_response_acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#acceptUnionAndReturnString(_arg_u);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_inFoo)?;
+    aidl_data.write(_arg_inoutFoo)?;
+    aidl_data.write(&_arg_value)?;
+    Ok(aidl_data)
+  }
+  fn read_response_ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_inoutFoo)?;
+    _aidl_reply.read_onto(_arg_outFoo)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_foos)?;
+    Ok(aidl_data)
+  }
+  fn read_response_returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#returnsLengthOfFooArray(_arg_foos);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_getInterfaceVersion(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceVersion(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    self.cached_version.store(_aidl_return, std::sync::atomic::Ordering::Relaxed);
+    Ok(_aidl_return)
+  }
+  fn build_parcel_getInterfaceHash(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceHash(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    *self.cached_hash.lock().unwrap() = Some(_aidl_return.clone());
+    Ok(_aidl_return)
+  }
+}
+impl IFooInterface for BpFooInterface {
+  fn r#originalApi(&self) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_originalApi()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#originalApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_originalApi(_aidl_reply)
+  }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+    let _aidl_data = self.build_parcel_acceptUnionAndReturnString(_arg_u)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#acceptUnionAndReturnString, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_acceptUnionAndReturnString(_arg_u, _aidl_reply)
+  }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+    let _aidl_data = self.build_parcel_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ignoreParcelablesAndRepeatInt, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value, _aidl_reply)
+  }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+    let _aidl_data = self.build_parcel_returnsLengthOfFooArray(_arg_foos)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#returnsLengthOfFooArray, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_returnsLengthOfFooArray(_arg_foos, _aidl_reply)
+  }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Ok(_aidl_version); }
+    let _aidl_data = self.build_parcel_getInterfaceVersion()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceVersion(_aidl_reply)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Ok(_aidl_hash.clone());
+      }
+    }
+    let _aidl_data = self.build_parcel_getInterfaceHash()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceHash(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> IFooInterfaceAsync<P> for BpFooInterface {
+  fn r#originalApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_originalApi() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#originalApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_originalApi(_aidl_reply)
+      }
+    )
+  }
+  fn r#acceptUnionAndReturnString<'a>(&'a self, _arg_u: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::BoxFuture<'a, binder::Result<String>> {
+    let _aidl_data = match self.build_parcel_acceptUnionAndReturnString(_arg_u) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#acceptUnionAndReturnString, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_acceptUnionAndReturnString(_arg_u, _aidl_reply)
+      }
+    )
+  }
+  fn r#ignoreParcelablesAndRepeatInt<'a>(&'a self, _arg_inFoo: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_data = match self.build_parcel_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ignoreParcelablesAndRepeatInt, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value, _aidl_reply)
+      }
+    )
+  }
+  fn r#returnsLengthOfFooArray<'a>(&'a self, _arg_foos: &'a [crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_data = match self.build_parcel_returnsLengthOfFooArray(_arg_foos) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#returnsLengthOfFooArray, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_returnsLengthOfFooArray(_arg_foos, _aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Box::pin(std::future::ready(Ok(_aidl_version))); }
+    let _aidl_data = match self.build_parcel_getInterfaceVersion() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceVersion(_aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Box::pin(std::future::ready(Ok(_aidl_hash.clone())));
+      }
+    }
+    let _aidl_data = match self.build_parcel_getInterfaceHash() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceHash(_aidl_reply)
+      }
+    )
+  }
+}
+impl IFooInterface for binder::binder_impl::Binder<BnFooInterface> {
+  fn r#originalApi(&self) -> binder::Result<()> { self.0.r#originalApi() }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> { self.0.r#acceptUnionAndReturnString(_arg_u) }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> { self.0.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value) }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> { self.0.r#returnsLengthOfFooArray(_arg_foos) }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> { self.0.r#getInterfaceVersion() }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> { self.0.r#getInterfaceHash() }
+}
+fn on_transact(_aidl_service: &dyn IFooInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#originalApi => {
+      let _aidl_return = _aidl_service.r#originalApi();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#acceptUnionAndReturnString => {
+      let _arg_u: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#acceptUnionAndReturnString(&_arg_u);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ignoreParcelablesAndRepeatInt => {
+      let _arg_inFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = _aidl_data.read()?;
+      let mut _arg_inoutFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = _aidl_data.read()?;
+      let mut _arg_outFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = Default::default();
+      let _arg_value: i32 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#ignoreParcelablesAndRepeatInt(&_arg_inFoo, &mut _arg_inoutFoo, &mut _arg_outFoo, _arg_value);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_inoutFoo)?;
+          _aidl_reply.write(&_arg_outFoo)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#returnsLengthOfFooArray => {
+      let _arg_foos: Vec<crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#returnsLengthOfFooArray(&_arg_foos);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceVersion => {
+      let _aidl_return = _aidl_service.r#getInterfaceVersion();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceHash => {
+      let _aidl_return = _aidl_service.r#getInterfaceHash();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#IFooInterface as _7_android_4_aidl_9_versioned_5_tests_13_IFooInterface;
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d
new file mode 100644
index 0000000..b93c4ba
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/1/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp
new file mode 100644
index 0000000..29c1cf0
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp
@@ -0,0 +1,51 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#include <android/aidl/versioned/tests/BazUnion.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+::android::status_t BazUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case intNum: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<intNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intNum>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case longNum: {
+    int64_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt64(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int64_t>) {
+      set<longNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<longNum>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t BazUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case intNum: return _aidl_parcel->writeInt32(get<intNum>());
+  case longNum: return _aidl_parcel->writeInt64(get<longNum>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
new file mode 100644
index 0000000..a78cf5d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp
new file mode 100644
index 0000000..92018e9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp
@@ -0,0 +1,50 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#include <android/aidl/versioned/tests/Foo.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+::android::status_t Foo::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&intDefault42);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t Foo::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(intDefault42);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d
new file mode 100644
index 0000000..b6961af
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
new file mode 100644
index 0000000..02a0d11
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
@@ -0,0 +1,458 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#include <android/aidl/versioned/tests/IFooInterface.h>
+#include <android/aidl/versioned/tests/BpFooInterface.h>
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(FooInterface, "android.aidl.versioned.tests.IFooInterface")
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/versioned/tests/BpFooInterface.h>
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+
+BpFooInterface::BpFooInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IFooInterface>(_aidl_impl){
+}
+
+::android::binder::Status BpFooInterface::originalApi() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::originalApi::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_originalApi, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->originalApi();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::acceptUnionAndReturnString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(u);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_acceptUnionAndReturnString, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->acceptUnionAndReturnString(u, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8FromUtf16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::ignoreParcelablesAndRepeatInt::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(inFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(*inoutFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(value);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_ignoreParcelablesAndRepeatInt, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->ignoreParcelablesAndRepeatInt(inFoo, inoutFoo, outFoo, value, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(inoutFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(outFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::returnsLengthOfFooArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelableVector(foos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_returnsLengthOfFooArray, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->returnsLengthOfFooArray(foos, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::newApi() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::newApi::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_newApi, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->newApi();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+int32_t BpFooInterface::getInterfaceVersion() {
+  if (cached_version_ == -1) {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnFooInterface::TRANSACTION_getInterfaceVersion, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        cached_version_ = reply.readInt32();
+      }
+    }
+  }
+  return cached_version_;
+}
+
+
+std::string BpFooInterface::getInterfaceHash() {
+  std::lock_guard<std::mutex> lockGuard(cached_hash_mutex_);
+  if (cached_hash_ == "-1") {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnFooInterface::TRANSACTION_getInterfaceHash, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        reply.readUtf8FromUtf16(&cached_hash_);
+      }
+    }
+  }
+  return cached_hash_;
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+
+BnFooInterface::BnFooInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnFooInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnFooInterface::TRANSACTION_originalApi:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::originalApi::cppServer");
+    ::android::binder::Status _aidl_status(originalApi());
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_acceptUnionAndReturnString:
+  {
+    ::android::aidl::versioned::tests::BazUnion in_u;
+    ::std::string _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::acceptUnionAndReturnString::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_u);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(acceptUnionAndReturnString(in_u, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8AsUtf16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_ignoreParcelablesAndRepeatInt:
+  {
+    ::android::aidl::versioned::tests::Foo in_inFoo;
+    ::android::aidl::versioned::tests::Foo in_inoutFoo;
+    ::android::aidl::versioned::tests::Foo out_outFoo;
+    int32_t in_value;
+    int32_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::ignoreParcelablesAndRepeatInt::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_inFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readParcelable(&in_inoutFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readInt32(&in_value);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ignoreParcelablesAndRepeatInt(in_inFoo, &in_inoutFoo, &out_outFoo, in_value, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(in_inoutFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(out_outFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_returnsLengthOfFooArray:
+  {
+    ::std::vector<::android::aidl::versioned::tests::Foo> in_foos;
+    int32_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::returnsLengthOfFooArray::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelableVector(&in_foos);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(returnsLengthOfFooArray(in_foos, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_newApi:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::newApi::cppServer");
+    ::android::binder::Status _aidl_status(newApi());
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_getInterfaceVersion:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeInt32(IFooInterface::VERSION);
+  }
+  break;
+  case BnFooInterface::TRANSACTION_getInterfaceHash:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeUtf8AsUtf16(IFooInterface::HASH);
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+int32_t BnFooInterface::getInterfaceVersion() {
+  return IFooInterface::VERSION;
+}
+std::string BnFooInterface::getInterfaceHash() {
+  return IFooInterface::HASH;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
new file mode 100644
index 0000000..35cdb4f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h
new file mode 100644
index 0000000..92adb13
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h
@@ -0,0 +1,154 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BazUnion : public ::android::Parcelable {
+public:
+  enum class Tag : int32_t {
+    intNum = 0,
+    longNum = 1,
+  };
+  // Expose tag symbols for legacy code
+  static const inline Tag intNum = Tag::intNum;
+  static const inline Tag longNum = Tag::longNum;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, BazUnion>;
+
+  BazUnion() : _value(std::in_place_index<static_cast<size_t>(intNum)>, int32_t(0)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr BazUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit BazUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static BazUnion make(_Tp&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static BazUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  inline bool operator!=(const BazUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const BazUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const BazUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const BazUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const BazUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const BazUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.versioned.tests.BazUnion");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "BazUnion{";
+    switch (getTag()) {
+    case intNum: os << "intNum: " << ::android::internal::ToString(get<intNum>()); break;
+    case longNum: os << "longNum: " << ::android::internal::ToString(get<longNum>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t, int64_t> _value;
+};  // class BazUnion
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+[[nodiscard]] static inline std::string toString(BazUnion::Tag val) {
+  switch(val) {
+  case BazUnion::Tag::intNum:
+    return "intNum";
+  case BazUnion::Tag::longNum:
+    return "longNum";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::versioned::tests::BazUnion::Tag, 2> enum_values<::android::aidl::versioned::tests::BazUnion::Tag> = {
+  ::android::aidl::versioned::tests::BazUnion::Tag::intNum,
+  ::android::aidl::versioned::tests::BazUnion::Tag::longNum,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h
new file mode 100644
index 0000000..ed912f9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h
new file mode 100644
index 0000000..809a4d1
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h
new file mode 100644
index 0000000..69b229e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h
@@ -0,0 +1,66 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/versioned/tests/IFooInterface.h>
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BnFooInterface : public ::android::BnInterface<IFooInterface> {
+public:
+  static constexpr uint32_t TRANSACTION_originalApi = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_acceptUnionAndReturnString = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_ignoreParcelablesAndRepeatInt = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_returnsLengthOfFooArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_newApi = ::android::IBinder::FIRST_CALL_TRANSACTION + 4;
+  static constexpr uint32_t TRANSACTION_getInterfaceVersion = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777214;
+  static constexpr uint32_t TRANSACTION_getInterfaceHash = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777213;
+  explicit BnFooInterface();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  int32_t getInterfaceVersion();
+  std::string getInterfaceHash();
+};  // class BnFooInterface
+
+class IFooInterfaceDelegator : public BnFooInterface {
+public:
+  explicit IFooInterfaceDelegator(const ::android::sp<IFooInterface> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<IFooInterface> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status originalApi() override {
+    return _aidl_delegate->originalApi();
+  }
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) override {
+    return _aidl_delegate->acceptUnionAndReturnString(u, _aidl_return);
+  }
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) override {
+    return _aidl_delegate->ignoreParcelablesAndRepeatInt(inFoo, inoutFoo, outFoo, value, _aidl_return);
+  }
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) override {
+    return _aidl_delegate->returnsLengthOfFooArray(foos, _aidl_return);
+  }
+  ::android::binder::Status newApi() override {
+    return _aidl_delegate->newApi();
+  }
+  int32_t getInterfaceVersion() override {
+    int32_t _delegator_ver = BnFooInterface::getInterfaceVersion();
+    int32_t _impl_ver = _aidl_delegate->getInterfaceVersion();
+    return _delegator_ver < _impl_ver ? _delegator_ver : _impl_ver;
+  }
+  std::string getInterfaceHash() override {
+    return _aidl_delegate->getInterfaceHash();
+  }
+private:
+  ::android::sp<IFooInterface> _aidl_delegate;
+};  // class IFooInterfaceDelegator
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h
new file mode 100644
index 0000000..b570cba
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h
new file mode 100644
index 0000000..2d9b299
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h
new file mode 100644
index 0000000..91570e5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h
@@ -0,0 +1,35 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/versioned/tests/IFooInterface.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BpFooInterface : public ::android::BpInterface<IFooInterface> {
+public:
+  explicit BpFooInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpFooInterface() = default;
+  ::android::binder::Status originalApi() override;
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) override;
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) override;
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) override;
+  ::android::binder::Status newApi() override;
+  int32_t getInterfaceVersion() override;
+  std::string getInterfaceHash() override;
+private:
+  int32_t cached_version_ = -1;
+  std::string cached_hash_ = "-1";
+  std::mutex cached_hash_mutex_;
+};  // class BpFooInterface
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h
new file mode 100644
index 0000000..a8cae5c
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class Foo : public ::android::Parcelable {
+public:
+  int32_t intDefault42 = 42;
+  inline bool operator!=(const Foo& rhs) const {
+    return std::tie(intDefault42) != std::tie(rhs.intDefault42);
+  }
+  inline bool operator<(const Foo& rhs) const {
+    return std::tie(intDefault42) < std::tie(rhs.intDefault42);
+  }
+  inline bool operator<=(const Foo& rhs) const {
+    return std::tie(intDefault42) <= std::tie(rhs.intDefault42);
+  }
+  inline bool operator==(const Foo& rhs) const {
+    return std::tie(intDefault42) == std::tie(rhs.intDefault42);
+  }
+  inline bool operator>(const Foo& rhs) const {
+    return std::tie(intDefault42) > std::tie(rhs.intDefault42);
+  }
+  inline bool operator>=(const Foo& rhs) const {
+    return std::tie(intDefault42) >= std::tie(rhs.intDefault42);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.versioned.tests.Foo");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Foo{";
+    os << "intDefault42: " << ::android::internal::ToString(intDefault42);
+    os << "}";
+    return os.str();
+  }
+};  // class Foo
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h
new file mode 100644
index 0000000..e50a31f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h
@@ -0,0 +1,73 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <android/aidl/versioned/tests/BazUnion.h>
+#include <android/aidl/versioned/tests/Foo.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cstdint>
+#include <string>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <vector>
+
+namespace android::aidl::versioned::tests {
+class Foo;
+}  // namespace android::aidl::versioned::tests
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class IFooInterfaceDelegator;
+
+class IFooInterface : public ::android::IInterface {
+public:
+  typedef IFooInterfaceDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(FooInterface)
+  static inline const int32_t VERSION = 2;
+  static inline const std::string HASH = "da8c4bc94ca7feff0e0a65563a466787698b5891";
+  virtual ::android::binder::Status originalApi() = 0;
+  virtual ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) = 0;
+  virtual ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) = 0;
+  virtual ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) = 0;
+  virtual ::android::binder::Status newApi() = 0;
+  virtual int32_t getInterfaceVersion() = 0;
+  virtual std::string getInterfaceHash() = 0;
+};  // class IFooInterface
+
+class IFooInterfaceDefault : public IFooInterface {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status originalApi() override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& /*u*/, ::std::string* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& /*inFoo*/, ::android::aidl::versioned::tests::Foo* /*inoutFoo*/, ::android::aidl::versioned::tests::Foo* /*outFoo*/, int32_t /*value*/, int32_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& /*foos*/, int32_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status newApi() override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  int32_t getInterfaceVersion() override {
+    return 0;
+  }
+  std::string getInterfaceHash() override {
+    return "";
+  }
+};  // class IFooInterfaceDefault
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-cpp-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/BazUnion.java b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/BazUnion.java
new file mode 100644
index 0000000..5342547
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/BazUnion.java
@@ -0,0 +1,135 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+package android.aidl.versioned.tests;
+public final class BazUnion implements android.os.Parcelable {
+  // tags for union fields
+  public final static int intNum = 0;  // int intNum;
+  public final static int longNum = 1;  // long longNum;
+
+  private int _tag;
+  private Object _value;
+
+  public BazUnion() {
+    int _value = 0;
+    this._tag = intNum;
+    this._value = _value;
+  }
+
+  private BazUnion(android.os.Parcel _aidl_parcel) {
+    readFromParcel(_aidl_parcel);
+  }
+
+  private BazUnion(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+
+  public int getTag() {
+    return _tag;
+  }
+
+  // int intNum;
+
+  public static BazUnion intNum(int _value) {
+    return new BazUnion(intNum, _value);
+  }
+
+  public int getIntNum() {
+    _assertTag(intNum);
+    return (int) _value;
+  }
+
+  public void setIntNum(int _value) {
+    _set(intNum, _value);
+  }
+
+  // long longNum;
+
+  public static BazUnion longNum(long _value) {
+    return new BazUnion(longNum, _value);
+  }
+
+  public long getLongNum() {
+    _assertTag(longNum);
+    return (long) _value;
+  }
+
+  public void setLongNum(long _value) {
+    _set(longNum, _value);
+  }
+
+  public static final android.os.Parcelable.Creator<BazUnion> CREATOR = new android.os.Parcelable.Creator<BazUnion>() {
+    @Override
+    public BazUnion createFromParcel(android.os.Parcel _aidl_source) {
+      return new BazUnion(_aidl_source);
+    }
+    @Override
+    public BazUnion[] newArray(int _aidl_size) {
+      return new BazUnion[_aidl_size];
+    }
+  };
+
+  @Override
+  public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+    _aidl_parcel.writeInt(_tag);
+    switch (_tag) {
+    case intNum:
+      _aidl_parcel.writeInt(getIntNum());
+      break;
+    case longNum:
+      _aidl_parcel.writeLong(getLongNum());
+      break;
+    }
+  }
+
+  public void readFromParcel(android.os.Parcel _aidl_parcel) {
+    int _aidl_tag;
+    _aidl_tag = _aidl_parcel.readInt();
+    switch (_aidl_tag) {
+    case intNum: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case longNum: {
+      long _aidl_value;
+      _aidl_value = _aidl_parcel.readLong();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    }
+    throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+  }
+
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    switch (getTag()) {
+    }
+    return _mask;
+  }
+
+  private void _assertTag(int tag) {
+    if (getTag() != tag) {
+      throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+    }
+  }
+
+  private String _tagString(int _tag) {
+    switch (_tag) {
+    case intNum: return "intNum";
+    case longNum: return "longNum";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+
+  private void _set(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+  public static @interface Tag {
+    public static final int intNum = 0;
+    public static final int longNum = 1;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d
new file mode 100644
index 0000000..68d7b75
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/BazUnion.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/Foo.java b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/Foo.java
new file mode 100644
index 0000000..1f1df27
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/Foo.java
@@ -0,0 +1,51 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/Foo.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+package android.aidl.versioned.tests;
+public class Foo implements android.os.Parcelable
+{
+  public int intDefault42 = 42;
+  public static final android.os.Parcelable.Creator<Foo> CREATOR = new android.os.Parcelable.Creator<Foo>() {
+    @Override
+    public Foo createFromParcel(android.os.Parcel _aidl_source) {
+      Foo _aidl_out = new Foo();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public Foo[] newArray(int _aidl_size) {
+      return new Foo[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(intDefault42);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intDefault42 = _aidl_parcel.readInt();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/Foo.java.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/Foo.java.d
new file mode 100644
index 0000000..b7db41a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/Foo.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/Foo.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/IFooInterface.java b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/IFooInterface.java
new file mode 100644
index 0000000..a932100
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/IFooInterface.java
@@ -0,0 +1,329 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+package android.aidl.versioned.tests;
+public interface IFooInterface extends android.os.IInterface
+{
+  /**
+   * The version of this interface that the caller is built against.
+   * This might be different from what {@link #getInterfaceVersion()
+   * getInterfaceVersion} returns as that is the version of the interface
+   * that the remote object is implementing.
+   */
+  public static final int VERSION = 2;
+  public static final String HASH = "da8c4bc94ca7feff0e0a65563a466787698b5891";
+  /** Default implementation for IFooInterface. */
+  public static class Default implements android.aidl.versioned.tests.IFooInterface
+  {
+    @Override public void originalApi() throws android.os.RemoteException
+    {
+    }
+    @Override public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public void newApi() throws android.os.RemoteException
+    {
+    }
+    @Override
+    public int getInterfaceVersion() {
+      return 0;
+    }
+    @Override
+    public String getInterfaceHash() {
+      return "";
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.versioned.tests.IFooInterface
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.versioned.tests.IFooInterface interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.versioned.tests.IFooInterface asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.versioned.tests.IFooInterface))) {
+        return ((android.aidl.versioned.tests.IFooInterface)iin);
+      }
+      return new android.aidl.versioned.tests.IFooInterface.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceVersion) {
+        reply.writeNoException();
+        reply.writeInt(getInterfaceVersion());
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceHash) {
+        reply.writeNoException();
+        reply.writeString(getInterfaceHash());
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_originalApi:
+        {
+          this.originalApi();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_acceptUnionAndReturnString:
+        {
+          android.aidl.versioned.tests.BazUnion _arg0;
+          _arg0 = data.readTypedObject(android.aidl.versioned.tests.BazUnion.CREATOR);
+          data.enforceNoDataAvail();
+          java.lang.String _result = this.acceptUnionAndReturnString(_arg0);
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        case TRANSACTION_ignoreParcelablesAndRepeatInt:
+        {
+          android.aidl.versioned.tests.Foo _arg0;
+          _arg0 = data.readTypedObject(android.aidl.versioned.tests.Foo.CREATOR);
+          android.aidl.versioned.tests.Foo _arg1;
+          _arg1 = data.readTypedObject(android.aidl.versioned.tests.Foo.CREATOR);
+          android.aidl.versioned.tests.Foo _arg2;
+          _arg2 = new android.aidl.versioned.tests.Foo();
+          int _arg3;
+          _arg3 = data.readInt();
+          data.enforceNoDataAvail();
+          int _result = this.ignoreParcelablesAndRepeatInt(_arg0, _arg1, _arg2, _arg3);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          reply.writeTypedObject(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          reply.writeTypedObject(_arg2, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_returnsLengthOfFooArray:
+        {
+          android.aidl.versioned.tests.Foo[] _arg0;
+          _arg0 = data.createTypedArray(android.aidl.versioned.tests.Foo.CREATOR);
+          data.enforceNoDataAvail();
+          int _result = this.returnsLengthOfFooArray(_arg0);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          break;
+        }
+        case TRANSACTION_newApi:
+        {
+          this.newApi();
+          reply.writeNoException();
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.versioned.tests.IFooInterface
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      private int mCachedVersion = -1;
+      private String mCachedHash = "-1";
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public void originalApi() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_originalApi, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method originalApi is unimplemented.");
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(u, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_acceptUnionAndReturnString, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method acceptUnionAndReturnString is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(inFoo, 0);
+          _data.writeTypedObject(inoutFoo, 0);
+          _data.writeInt(value);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ignoreParcelablesAndRepeatInt, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method ignoreParcelablesAndRepeatInt is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+          if ((0!=_reply.readInt())) {
+            inoutFoo.readFromParcel(_reply);
+          }
+          if ((0!=_reply.readInt())) {
+            outFoo.readFromParcel(_reply);
+          }
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedArray(foos, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_returnsLengthOfFooArray, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method returnsLengthOfFooArray is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public void newApi() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_newApi, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method newApi is unimplemented.");
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override
+      public int getInterfaceVersion() throws android.os.RemoteException {
+        if (mCachedVersion == -1) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceVersion, data, reply, 0);
+            reply.readException();
+            mCachedVersion = reply.readInt();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedVersion;
+      }
+      @Override
+      public synchronized String getInterfaceHash() throws android.os.RemoteException {
+        if ("-1".equals(mCachedHash)) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceHash, data, reply, 0);
+            reply.readException();
+            mCachedHash = reply.readString();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedHash;
+      }
+    }
+    static final int TRANSACTION_originalApi = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    static final int TRANSACTION_acceptUnionAndReturnString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    static final int TRANSACTION_ignoreParcelablesAndRepeatInt = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+    static final int TRANSACTION_returnsLengthOfFooArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+    static final int TRANSACTION_newApi = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
+    static final int TRANSACTION_getInterfaceVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777214);
+    static final int TRANSACTION_getInterfaceHash = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777213);
+  }
+  public static final java.lang.String DESCRIPTOR = "android$aidl$versioned$tests$IFooInterface".replace('$', '.');
+  public void originalApi() throws android.os.RemoteException;
+  public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException;
+  public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException;
+  public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException;
+  public void newApi() throws android.os.RemoteException;
+  public int getInterfaceVersion() throws android.os.RemoteException;
+  public String getInterfaceHash() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d
new file mode 100644
index 0000000..b6dd541
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-java-source/gen/android/aidl/versioned/tests/IFooInterface.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-java-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp
new file mode 100644
index 0000000..03207cf
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp
@@ -0,0 +1,58 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/BazUnion.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+const char* BazUnion::descriptor = "android.aidl.versioned.tests.BazUnion";
+
+binder_status_t BazUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case intNum: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<intNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intNum>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case longNum: {
+    int64_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int64_t>) {
+      set<longNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<longNum>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t BazUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case intNum: return ::ndk::AParcel_writeData(_parcel, get<intNum>());
+  case longNum: return ::ndk::AParcel_writeData(_parcel, get<longNum>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
new file mode 100644
index 0000000..827a692
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp
new file mode 100644
index 0000000..0cce783
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp
@@ -0,0 +1,55 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/Foo.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+const char* Foo::descriptor = "android.aidl.versioned.tests.Foo";
+
+binder_status_t Foo::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intDefault42);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t Foo::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intDefault42);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d
new file mode 100644
index 0000000..c4f0bfb
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
new file mode 100644
index 0000000..aafb98e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
@@ -0,0 +1,545 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/versioned/tests/BnFooInterface.h>
+#include <aidl/android/aidl/versioned/tests/BpFooInterface.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+static binder_status_t _aidl_android_aidl_versioned_tests_IFooInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnFooInterface> _aidl_impl = std::static_pointer_cast<BnFooInterface>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*originalApi*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->originalApi();
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*acceptUnionAndReturnString*/): {
+      ::aidl::android::aidl::versioned::tests::BazUnion in_u;
+      std::string _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_u);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->acceptUnionAndReturnString(in_u, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*ignoreParcelablesAndRepeatInt*/): {
+      ::aidl::android::aidl::versioned::tests::Foo in_inFoo;
+      ::aidl::android::aidl::versioned::tests::Foo in_inoutFoo;
+      ::aidl::android::aidl::versioned::tests::Foo out_outFoo;
+      int32_t in_value;
+      int32_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_inFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_inoutFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_value);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ignoreParcelablesAndRepeatInt(in_inFoo, &in_inoutFoo, &out_outFoo, in_value, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_inoutFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_outFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 3 /*returnsLengthOfFooArray*/): {
+      std::vector<::aidl::android::aidl::versioned::tests::Foo> in_foos;
+      int32_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_foos);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->returnsLengthOfFooArray(in_foos, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 4 /*newApi*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->newApi();
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): {
+      int32_t _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): {
+      std::string _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_versioned_tests_IFooInterface_clazz = ::ndk::ICInterface::defineClass(IFooInterface::descriptor, _aidl_android_aidl_versioned_tests_IFooInterface_onTransact);
+
+BpFooInterface::BpFooInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpFooInterface::~BpFooInterface() {}
+
+::ndk::ScopedAStatus BpFooInterface::originalApi() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*originalApi*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->originalApi();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_u);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*acceptUnionAndReturnString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->acceptUnionAndReturnString(in_u, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_inFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_inoutFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_value);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*ignoreParcelablesAndRepeatInt*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->ignoreParcelablesAndRepeatInt(in_inFoo, in_inoutFoo, out_outFoo, in_value, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_inoutFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_outFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_foos);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 3 /*returnsLengthOfFooArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->returnsLengthOfFooArray(in_foos, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::newApi() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 4 /*newApi*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->newApi();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::getInterfaceVersion(int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  if (_aidl_cached_version != -1) {
+    *_aidl_return = _aidl_cached_version;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->getInterfaceVersion(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_version = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::getInterfaceHash(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex);
+  if (_aidl_cached_hash != "-1") {
+    *_aidl_return = _aidl_cached_hash;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->getInterfaceHash(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_hash = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnFooInterface
+BnFooInterface::BnFooInterface() {}
+BnFooInterface::~BnFooInterface() {}
+::ndk::SpAIBinder BnFooInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_versioned_tests_IFooInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+::ndk::ScopedAStatus BnFooInterface::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = IFooInterface::version;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus BnFooInterface::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = IFooInterface::hash;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+// Source for IFooInterface
+const char* IFooInterface::descriptor = "android.aidl.versioned.tests.IFooInterface";
+IFooInterface::IFooInterface() {}
+IFooInterface::~IFooInterface() {}
+
+
+std::shared_ptr<IFooInterface> IFooInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_versioned_tests_IFooInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpFooInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IFooInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpFooInterface>(binder);
+}
+
+binder_status_t IFooInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<IFooInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t IFooInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<IFooInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IFooInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool IFooInterface::setDefaultImpl(const std::shared_ptr<IFooInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IFooInterface::default_impl);
+  if (impl) {
+    IFooInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<IFooInterface>& IFooInterface::getDefaultImpl() {
+  return IFooInterface::default_impl;
+}
+std::shared_ptr<IFooInterface> IFooInterface::default_impl = nullptr;
+::ndk::ScopedAStatus IFooInterfaceDefault::originalApi() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& /*in_u*/, std::string* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& /*in_inFoo*/, ::aidl::android::aidl::versioned::tests::Foo* /*in_inoutFoo*/, ::aidl::android::aidl::versioned::tests::Foo* /*out_outFoo*/, int32_t /*in_value*/, int32_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& /*in_foos*/, int32_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::newApi() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = 0;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = "";
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::SpAIBinder IFooInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool IFooInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
new file mode 100644
index 0000000..73bd3a8
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h
new file mode 100644
index 0000000..5d52d70
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h
@@ -0,0 +1,165 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BazUnion {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Tag : int32_t {
+    intNum = 0,
+    longNum = 1,
+  };
+
+  // Expose tag symbols for legacy code
+  static const inline Tag intNum = Tag::intNum;
+  static const inline Tag longNum = Tag::longNum;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, BazUnion>;
+
+  BazUnion() : _value(std::in_place_index<static_cast<size_t>(intNum)>, int32_t(0)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr BazUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit BazUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static BazUnion make(_Tp&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static BazUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  binder_status_t readFromParcel(const AParcel* _parcel);
+  binder_status_t writeToParcel(AParcel* _parcel) const;
+
+  inline bool operator!=(const BazUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const BazUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const BazUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const BazUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const BazUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const BazUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "BazUnion{";
+    switch (getTag()) {
+    case intNum: os << "intNum: " << ::android::internal::ToString(get<intNum>()); break;
+    case longNum: os << "longNum: " << ::android::internal::ToString(get<longNum>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t, int64_t> _value;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+[[nodiscard]] static inline std::string toString(BazUnion::Tag val) {
+  switch(val) {
+  case BazUnion::Tag::intNum:
+    return "intNum";
+  case BazUnion::Tag::longNum:
+    return "longNum";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::versioned::tests::BazUnion::Tag, 2> enum_values<aidl::android::aidl::versioned::tests::BazUnion::Tag> = {
+  aidl::android::aidl::versioned::tests::BazUnion::Tag::intNum,
+  aidl::android::aidl::versioned::tests::BazUnion::Tag::longNum,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h
new file mode 100644
index 0000000..478933b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h
new file mode 100644
index 0000000..940ba87
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h
new file mode 100644
index 0000000..fcc70c8
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h
@@ -0,0 +1,69 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BnFooInterface : public ::ndk::BnCInterface<IFooInterface> {
+public:
+  BnFooInterface();
+  virtual ~BnFooInterface();
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) final;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) final;
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class IFooInterfaceDelegator : public BnFooInterface {
+public:
+  explicit IFooInterfaceDelegator(const std::shared_ptr<IFooInterface> &impl) : _impl(impl) {
+     int32_t _impl_ver = 0;
+     if (!impl->getInterfaceVersion(&_impl_ver).isOk()) {;
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Delegator failed to get version of the implementation.");
+     }
+     if (_impl_ver != IFooInterface::version) {
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Mismatched versions of delegator and implementation is not allowed.");
+     }
+  }
+
+  ::ndk::ScopedAStatus originalApi() override {
+    return _impl->originalApi();
+  }
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override {
+    return _impl->acceptUnionAndReturnString(in_u, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override {
+    return _impl->ignoreParcelablesAndRepeatInt(in_inFoo, in_inoutFoo, out_outFoo, in_value, _aidl_return);
+  }
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override {
+    return _impl->returnsLengthOfFooArray(in_foos, _aidl_return);
+  }
+  ::ndk::ScopedAStatus newApi() override {
+    return _impl->newApi();
+  }
+protected:
+private:
+  std::shared_ptr<IFooInterface> _impl;
+};
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h
new file mode 100644
index 0000000..c0d906f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h
new file mode 100644
index 0000000..bbbfe53
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h
new file mode 100644
index 0000000..80cfee6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h
@@ -0,0 +1,36 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BpFooInterface : public ::ndk::BpCInterface<IFooInterface> {
+public:
+  explicit BpFooInterface(const ::ndk::SpAIBinder& binder);
+  virtual ~BpFooInterface();
+
+  ::ndk::ScopedAStatus originalApi() override;
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus newApi() override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  int32_t _aidl_cached_version = -1;
+  std::string _aidl_cached_hash = "-1";
+  std::mutex _aidl_cached_hash_mutex;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h
new file mode 100644
index 0000000..2fc3c6b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h
@@ -0,0 +1,66 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class Foo {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t intDefault42 = 42;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const Foo& rhs) const {
+    return std::tie(intDefault42) != std::tie(rhs.intDefault42);
+  }
+  inline bool operator<(const Foo& rhs) const {
+    return std::tie(intDefault42) < std::tie(rhs.intDefault42);
+  }
+  inline bool operator<=(const Foo& rhs) const {
+    return std::tie(intDefault42) <= std::tie(rhs.intDefault42);
+  }
+  inline bool operator==(const Foo& rhs) const {
+    return std::tie(intDefault42) == std::tie(rhs.intDefault42);
+  }
+  inline bool operator>(const Foo& rhs) const {
+    return std::tie(intDefault42) > std::tie(rhs.intDefault42);
+  }
+  inline bool operator>=(const Foo& rhs) const {
+    return std::tie(intDefault42) >= std::tie(rhs.intDefault42);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Foo{";
+    os << "intDefault42: " << ::android::internal::ToString(intDefault42);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h
new file mode 100644
index 0000000..2896675
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h
@@ -0,0 +1,75 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <aidl/android/aidl/versioned/tests/BazUnion.h>
+#include <aidl/android/aidl/versioned/tests/Foo.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::versioned::tests {
+class Foo;
+}  // namespace aidl::android::aidl::versioned::tests
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class IFooInterfaceDelegator;
+
+class IFooInterface : public ::ndk::ICInterface {
+public:
+  typedef IFooInterfaceDelegator DefaultDelegator;
+  static const char* descriptor;
+  IFooInterface();
+  virtual ~IFooInterface();
+
+  static inline const int32_t version = 2;
+  static inline const std::string hash = "da8c4bc94ca7feff0e0a65563a466787698b5891";
+  static constexpr uint32_t TRANSACTION_originalApi = FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_acceptUnionAndReturnString = FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_ignoreParcelablesAndRepeatInt = FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_returnsLengthOfFooArray = FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_newApi = FIRST_CALL_TRANSACTION + 4;
+
+  static std::shared_ptr<IFooInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IFooInterface>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IFooInterface>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<IFooInterface>& impl);
+  static const std::shared_ptr<IFooInterface>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus originalApi() = 0;
+  virtual ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus newApi() = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) = 0;
+private:
+  static std::shared_ptr<IFooInterface> default_impl;
+};
+class IFooInterfaceDefault : public IFooInterface {
+public:
+  ::ndk::ScopedAStatus originalApi() override;
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus newApi() override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-ndk-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs
new file mode 100644
index 0000000..2af9086
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs
@@ -0,0 +1,67 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub enum r#BazUnion {
+  IntNum(i32),
+  LongNum(i64),
+}
+impl Default for r#BazUnion {
+  fn default() -> Self {
+    Self::IntNum(0)
+  }
+}
+impl binder::Parcelable for r#BazUnion {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    match self {
+      Self::IntNum(v) => {
+        parcel.write(&0i32)?;
+        parcel.write(v)
+      }
+      Self::LongNum(v) => {
+        parcel.write(&1i32)?;
+        parcel.write(v)
+      }
+    }
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    let tag: i32 = parcel.read()?;
+    match tag {
+      0 => {
+        let value: i32 = parcel.read()?;
+        *self = Self::IntNum(value);
+        Ok(())
+      }
+      1 => {
+        let value: i64 = parcel.read()?;
+        *self = Self::LongNum(value);
+        Ok(())
+      }
+      _ => {
+        Err(binder::StatusCode::BAD_VALUE)
+      }
+    }
+  }
+}
+binder::impl_serialize_for_parcelable!(r#BazUnion);
+binder::impl_deserialize_for_parcelable!(r#BazUnion);
+impl binder::binder_impl::ParcelableMetadata for r#BazUnion {
+  fn get_descriptor() -> &'static str { "android.aidl.versioned.tests.BazUnion" }
+}
+pub mod r#Tag {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#Tag : [i32; 2] {
+      r#intNum = 0,
+      r#longNum = 1,
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#BazUnion as _7_android_4_aidl_9_versioned_5_tests_8_BazUnion;
+ pub use super::r#Tag::r#Tag as _7_android_4_aidl_9_versioned_5_tests_8_BazUnion_3_Tag;
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d
new file mode 100644
index 0000000..507d2af
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/Foo.rs b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/Foo.rs
new file mode 100644
index 0000000..d5fe918
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/Foo.rs
@@ -0,0 +1,41 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#Foo {
+  pub r#intDefault42: i32,
+}
+impl Default for r#Foo {
+  fn default() -> Self {
+    Self {
+      r#intDefault42: 42,
+    }
+  }
+}
+impl binder::Parcelable for r#Foo {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#intDefault42)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#intDefault42 = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#Foo);
+binder::impl_deserialize_for_parcelable!(r#Foo);
+impl binder::binder_impl::ParcelableMetadata for r#Foo {
+  fn get_descriptor() -> &'static str { "android.aidl.versioned.tests.Foo" }
+}
+pub(crate) mod mangled {
+ pub use super::r#Foo as _7_android_4_aidl_9_versioned_5_tests_3_Foo;
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d
new file mode 100644
index 0000000..96d8873
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/Foo.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs
new file mode 100644
index 0000000..6b7f8b4
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs
@@ -0,0 +1,493 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 2 --hash da8c4bc94ca7feff0e0a65563a466787698b5891 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/2 system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  IFooInterface["android.aidl.versioned.tests.IFooInterface"] {
+    native: BnFooInterface(on_transact),
+    proxy: BpFooInterface {
+      cached_version: std::sync::atomic::AtomicI32 = std::sync::atomic::AtomicI32::new(-1),
+      cached_hash: std::sync::Mutex<Option<String>> = std::sync::Mutex::new(None)
+    },
+    async: IFooInterfaceAsync,
+  }
+}
+pub trait IFooInterface: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  fn r#originalApi(&self) -> binder::Result<()>;
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String>;
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32>;
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32>;
+  fn r#newApi(&self) -> binder::Result<()>;
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    Ok(VERSION)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    Ok(HASH.into())
+  }
+  fn getDefaultImpl() -> IFooInterfaceDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: IFooInterfaceDefaultRef) -> IFooInterfaceDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait IFooInterfaceAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  fn r#originalApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#acceptUnionAndReturnString<'a>(&'a self, _arg_u: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::BoxFuture<'a, binder::Result<String>>;
+  fn r#ignoreParcelablesAndRepeatInt<'a>(&'a self, _arg_inFoo: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::BoxFuture<'a, binder::Result<i32>>;
+  fn r#returnsLengthOfFooArray<'a>(&'a self, _arg_foos: &'a [crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::BoxFuture<'a, binder::Result<i32>>;
+  fn r#newApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    Box::pin(async move { Ok(VERSION) })
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    Box::pin(async move { Ok(HASH.into()) })
+  }
+}
+#[::async_trait::async_trait]
+pub trait IFooInterfaceAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  async fn r#originalApi(&self) -> binder::Result<()>;
+  async fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String>;
+  async fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32>;
+  async fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32>;
+  async fn r#newApi(&self) -> binder::Result<()>;
+}
+impl BnFooInterface {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IFooInterface>
+  where
+    T: IFooInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> IFooInterface for Wrapper<T, R>
+    where
+      T: IFooInterfaceAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#originalApi(&self) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#originalApi())
+      }
+      fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+        self._rt.block_on(self._inner.r#acceptUnionAndReturnString(_arg_u))
+      }
+      fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+        self._rt.block_on(self._inner.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value))
+      }
+      fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+        self._rt.block_on(self._inner.r#returnsLengthOfFooArray(_arg_foos))
+      }
+      fn r#newApi(&self) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#newApi())
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait IFooInterfaceDefault: Send + Sync {
+  fn r#originalApi(&self) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#newApi(&self) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#originalApi: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  pub const r#acceptUnionAndReturnString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+  pub const r#ignoreParcelablesAndRepeatInt: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+  pub const r#returnsLengthOfFooArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 3;
+  pub const r#newApi: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 4;
+  pub const r#getInterfaceVersion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777214;
+  pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213;
+}
+pub type IFooInterfaceDefaultRef = Option<std::sync::Arc<dyn IFooInterfaceDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None);
+}
+pub const VERSION: i32 = 2;
+pub const HASH: &str = "da8c4bc94ca7feff0e0a65563a466787698b5891";
+impl BpFooInterface {
+  fn build_parcel_originalApi(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_originalApi(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#originalApi();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_u)?;
+    Ok(aidl_data)
+  }
+  fn read_response_acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#acceptUnionAndReturnString(_arg_u);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_inFoo)?;
+    aidl_data.write(_arg_inoutFoo)?;
+    aidl_data.write(&_arg_value)?;
+    Ok(aidl_data)
+  }
+  fn read_response_ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_inoutFoo)?;
+    _aidl_reply.read_onto(_arg_outFoo)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_foos)?;
+    Ok(aidl_data)
+  }
+  fn read_response_returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#returnsLengthOfFooArray(_arg_foos);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_newApi(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_newApi(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#newApi();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_getInterfaceVersion(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceVersion(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    self.cached_version.store(_aidl_return, std::sync::atomic::Ordering::Relaxed);
+    Ok(_aidl_return)
+  }
+  fn build_parcel_getInterfaceHash(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceHash(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    *self.cached_hash.lock().unwrap() = Some(_aidl_return.clone());
+    Ok(_aidl_return)
+  }
+}
+impl IFooInterface for BpFooInterface {
+  fn r#originalApi(&self) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_originalApi()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#originalApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_originalApi(_aidl_reply)
+  }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+    let _aidl_data = self.build_parcel_acceptUnionAndReturnString(_arg_u)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#acceptUnionAndReturnString, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_acceptUnionAndReturnString(_arg_u, _aidl_reply)
+  }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+    let _aidl_data = self.build_parcel_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ignoreParcelablesAndRepeatInt, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value, _aidl_reply)
+  }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+    let _aidl_data = self.build_parcel_returnsLengthOfFooArray(_arg_foos)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#returnsLengthOfFooArray, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_returnsLengthOfFooArray(_arg_foos, _aidl_reply)
+  }
+  fn r#newApi(&self) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_newApi()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#newApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_newApi(_aidl_reply)
+  }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Ok(_aidl_version); }
+    let _aidl_data = self.build_parcel_getInterfaceVersion()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceVersion(_aidl_reply)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Ok(_aidl_hash.clone());
+      }
+    }
+    let _aidl_data = self.build_parcel_getInterfaceHash()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceHash(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> IFooInterfaceAsync<P> for BpFooInterface {
+  fn r#originalApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_originalApi() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#originalApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_originalApi(_aidl_reply)
+      }
+    )
+  }
+  fn r#acceptUnionAndReturnString<'a>(&'a self, _arg_u: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::BoxFuture<'a, binder::Result<String>> {
+    let _aidl_data = match self.build_parcel_acceptUnionAndReturnString(_arg_u) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#acceptUnionAndReturnString, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_acceptUnionAndReturnString(_arg_u, _aidl_reply)
+      }
+    )
+  }
+  fn r#ignoreParcelablesAndRepeatInt<'a>(&'a self, _arg_inFoo: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_data = match self.build_parcel_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ignoreParcelablesAndRepeatInt, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value, _aidl_reply)
+      }
+    )
+  }
+  fn r#returnsLengthOfFooArray<'a>(&'a self, _arg_foos: &'a [crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_data = match self.build_parcel_returnsLengthOfFooArray(_arg_foos) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#returnsLengthOfFooArray, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_returnsLengthOfFooArray(_arg_foos, _aidl_reply)
+      }
+    )
+  }
+  fn r#newApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_newApi() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#newApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_newApi(_aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Box::pin(std::future::ready(Ok(_aidl_version))); }
+    let _aidl_data = match self.build_parcel_getInterfaceVersion() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceVersion(_aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Box::pin(std::future::ready(Ok(_aidl_hash.clone())));
+      }
+    }
+    let _aidl_data = match self.build_parcel_getInterfaceHash() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceHash(_aidl_reply)
+      }
+    )
+  }
+}
+impl IFooInterface for binder::binder_impl::Binder<BnFooInterface> {
+  fn r#originalApi(&self) -> binder::Result<()> { self.0.r#originalApi() }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> { self.0.r#acceptUnionAndReturnString(_arg_u) }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> { self.0.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value) }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> { self.0.r#returnsLengthOfFooArray(_arg_foos) }
+  fn r#newApi(&self) -> binder::Result<()> { self.0.r#newApi() }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> { self.0.r#getInterfaceVersion() }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> { self.0.r#getInterfaceHash() }
+}
+fn on_transact(_aidl_service: &dyn IFooInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#originalApi => {
+      let _aidl_return = _aidl_service.r#originalApi();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#acceptUnionAndReturnString => {
+      let _arg_u: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#acceptUnionAndReturnString(&_arg_u);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ignoreParcelablesAndRepeatInt => {
+      let _arg_inFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = _aidl_data.read()?;
+      let mut _arg_inoutFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = _aidl_data.read()?;
+      let mut _arg_outFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = Default::default();
+      let _arg_value: i32 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#ignoreParcelablesAndRepeatInt(&_arg_inFoo, &mut _arg_inoutFoo, &mut _arg_outFoo, _arg_value);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_inoutFoo)?;
+          _aidl_reply.write(&_arg_outFoo)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#returnsLengthOfFooArray => {
+      let _arg_foos: Vec<crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#returnsLengthOfFooArray(&_arg_foos);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#newApi => {
+      let _aidl_return = _aidl_service.r#newApi();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceVersion => {
+      let _aidl_return = _aidl_service.r#getInterfaceVersion();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceHash => {
+      let _aidl_return = _aidl_service.r#getInterfaceHash();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#IFooInterface as _7_android_4_aidl_9_versioned_5_tests_13_IFooInterface;
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d
new file mode 100644
index 0000000..d6407bd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/2/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp
new file mode 100644
index 0000000..be86461
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp
@@ -0,0 +1,51 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#include <android/aidl/versioned/tests/BazUnion.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+::android::status_t BazUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case intNum: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<intNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intNum>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case longNum: {
+    int64_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt64(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int64_t>) {
+      set<longNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<longNum>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t BazUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case intNum: return _aidl_parcel->writeInt32(get<intNum>());
+  case longNum: return _aidl_parcel->writeInt64(get<longNum>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
new file mode 100644
index 0000000..45d9df0
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/BazUnion.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp
new file mode 100644
index 0000000..2b99d05
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp
@@ -0,0 +1,50 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#include <android/aidl/versioned/tests/Foo.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+::android::status_t Foo::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&intDefault42);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t Foo::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(intDefault42);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d
new file mode 100644
index 0000000..ab65cfc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/Foo.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
new file mode 100644
index 0000000..27be6ea
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
@@ -0,0 +1,458 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#include <android/aidl/versioned/tests/IFooInterface.h>
+#include <android/aidl/versioned/tests/BpFooInterface.h>
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(FooInterface, "android.aidl.versioned.tests.IFooInterface")
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/versioned/tests/BpFooInterface.h>
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+
+BpFooInterface::BpFooInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IFooInterface>(_aidl_impl){
+}
+
+::android::binder::Status BpFooInterface::originalApi() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::originalApi::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_originalApi, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->originalApi();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::acceptUnionAndReturnString::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(u);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_acceptUnionAndReturnString, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->acceptUnionAndReturnString(u, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readUtf8FromUtf16(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::ignoreParcelablesAndRepeatInt::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(inFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(*inoutFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(value);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_ignoreParcelablesAndRepeatInt, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->ignoreParcelablesAndRepeatInt(inFoo, inoutFoo, outFoo, value, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(inoutFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(outFoo);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::returnsLengthOfFooArray::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelableVector(foos);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_returnsLengthOfFooArray, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->returnsLengthOfFooArray(foos, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+::android::binder::Status BpFooInterface::newApi() {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::newApi::cppClient");
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnFooInterface::TRANSACTION_newApi, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl())) {
+     return IFooInterface::getDefaultImpl()->newApi();
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  return _aidl_status;
+}
+
+int32_t BpFooInterface::getInterfaceVersion() {
+  if (cached_version_ == -1) {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnFooInterface::TRANSACTION_getInterfaceVersion, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        cached_version_ = reply.readInt32();
+      }
+    }
+  }
+  return cached_version_;
+}
+
+
+std::string BpFooInterface::getInterfaceHash() {
+  std::lock_guard<std::mutex> lockGuard(cached_hash_mutex_);
+  if (cached_hash_ == "-1") {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnFooInterface::TRANSACTION_getInterfaceHash, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        reply.readUtf8FromUtf16(&cached_hash_);
+      }
+    }
+  }
+  return cached_hash_;
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+
+BnFooInterface::BnFooInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnFooInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnFooInterface::TRANSACTION_originalApi:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::originalApi::cppServer");
+    ::android::binder::Status _aidl_status(originalApi());
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_acceptUnionAndReturnString:
+  {
+    ::android::aidl::versioned::tests::BazUnion in_u;
+    ::std::string _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::acceptUnionAndReturnString::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_u);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(acceptUnionAndReturnString(in_u, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeUtf8AsUtf16(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_ignoreParcelablesAndRepeatInt:
+  {
+    ::android::aidl::versioned::tests::Foo in_inFoo;
+    ::android::aidl::versioned::tests::Foo in_inoutFoo;
+    ::android::aidl::versioned::tests::Foo out_outFoo;
+    int32_t in_value;
+    int32_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::ignoreParcelablesAndRepeatInt::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_inFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readParcelable(&in_inoutFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readInt32(&in_value);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(ignoreParcelablesAndRepeatInt(in_inFoo, &in_inoutFoo, &out_outFoo, in_value, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(in_inoutFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(out_outFoo);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_returnsLengthOfFooArray:
+  {
+    ::std::vector<::android::aidl::versioned::tests::Foo> in_foos;
+    int32_t _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::returnsLengthOfFooArray::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelableVector(&in_foos);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(returnsLengthOfFooArray(in_foos, &_aidl_return));
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_newApi:
+  {
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IFooInterface::newApi::cppServer");
+    ::android::binder::Status _aidl_status(newApi());
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnFooInterface::TRANSACTION_getInterfaceVersion:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeInt32(IFooInterface::VERSION);
+  }
+  break;
+  case BnFooInterface::TRANSACTION_getInterfaceHash:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeUtf8AsUtf16(IFooInterface::HASH);
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+int32_t BnFooInterface::getInterfaceVersion() {
+  return IFooInterface::VERSION;
+}
+std::string BnFooInterface::getInterfaceHash() {
+  return IFooInterface::HASH;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
new file mode 100644
index 0000000..ef37bb7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/android/aidl/versioned/tests/IFooInterface.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h
new file mode 100644
index 0000000..3087e6f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BazUnion.h
@@ -0,0 +1,154 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BazUnion : public ::android::Parcelable {
+public:
+  enum class Tag : int32_t {
+    intNum = 0,
+    longNum = 1,
+  };
+  // Expose tag symbols for legacy code
+  static const inline Tag intNum = Tag::intNum;
+  static const inline Tag longNum = Tag::longNum;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, BazUnion>;
+
+  BazUnion() : _value(std::in_place_index<static_cast<size_t>(intNum)>, int32_t(0)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr BazUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit BazUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static BazUnion make(_Tp&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static BazUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  inline bool operator!=(const BazUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const BazUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const BazUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const BazUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const BazUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const BazUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.versioned.tests.BazUnion");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "BazUnion{";
+    switch (getTag()) {
+    case intNum: os << "intNum: " << ::android::internal::ToString(get<intNum>()); break;
+    case longNum: os << "longNum: " << ::android::internal::ToString(get<longNum>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t, int64_t> _value;
+};  // class BazUnion
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+[[nodiscard]] static inline std::string toString(BazUnion::Tag val) {
+  switch(val) {
+  case BazUnion::Tag::intNum:
+    return "intNum";
+  case BazUnion::Tag::longNum:
+    return "longNum";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::versioned::tests::BazUnion::Tag, 2> enum_values<::android::aidl::versioned::tests::BazUnion::Tag> = {
+  ::android::aidl::versioned::tests::BazUnion::Tag::intNum,
+  ::android::aidl::versioned::tests::BazUnion::Tag::longNum,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h
new file mode 100644
index 0000000..e2fc1f2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h
new file mode 100644
index 0000000..78934bf
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h
new file mode 100644
index 0000000..892b163
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BnFooInterface.h
@@ -0,0 +1,66 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/versioned/tests/IFooInterface.h>
+#include <android/aidl/versioned/tests/BnFooInterface.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BnFooInterface : public ::android::BnInterface<IFooInterface> {
+public:
+  static constexpr uint32_t TRANSACTION_originalApi = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_acceptUnionAndReturnString = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_ignoreParcelablesAndRepeatInt = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_returnsLengthOfFooArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_newApi = ::android::IBinder::FIRST_CALL_TRANSACTION + 4;
+  static constexpr uint32_t TRANSACTION_getInterfaceVersion = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777214;
+  static constexpr uint32_t TRANSACTION_getInterfaceHash = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777213;
+  explicit BnFooInterface();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  int32_t getInterfaceVersion();
+  std::string getInterfaceHash();
+};  // class BnFooInterface
+
+class IFooInterfaceDelegator : public BnFooInterface {
+public:
+  explicit IFooInterfaceDelegator(const ::android::sp<IFooInterface> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<IFooInterface> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status originalApi() override {
+    return _aidl_delegate->originalApi();
+  }
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) override {
+    return _aidl_delegate->acceptUnionAndReturnString(u, _aidl_return);
+  }
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) override {
+    return _aidl_delegate->ignoreParcelablesAndRepeatInt(inFoo, inoutFoo, outFoo, value, _aidl_return);
+  }
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) override {
+    return _aidl_delegate->returnsLengthOfFooArray(foos, _aidl_return);
+  }
+  ::android::binder::Status newApi() override {
+    return _aidl_delegate->newApi();
+  }
+  int32_t getInterfaceVersion() override {
+    int32_t _delegator_ver = BnFooInterface::getInterfaceVersion();
+    int32_t _impl_ver = _aidl_delegate->getInterfaceVersion();
+    return _delegator_ver < _impl_ver ? _delegator_ver : _impl_ver;
+  }
+  std::string getInterfaceHash() override {
+    return _aidl_delegate->getInterfaceHash();
+  }
+private:
+  ::android::sp<IFooInterface> _aidl_delegate;
+};  // class IFooInterfaceDelegator
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h
new file mode 100644
index 0000000..bd9c58b
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h
new file mode 100644
index 0000000..49fba3e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h
new file mode 100644
index 0000000..20b29c6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/BpFooInterface.h
@@ -0,0 +1,35 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/versioned/tests/IFooInterface.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BpFooInterface : public ::android::BpInterface<IFooInterface> {
+public:
+  explicit BpFooInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpFooInterface() = default;
+  ::android::binder::Status originalApi() override;
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) override;
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) override;
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) override;
+  ::android::binder::Status newApi() override;
+  int32_t getInterfaceVersion() override;
+  std::string getInterfaceHash() override;
+private:
+  int32_t cached_version_ = -1;
+  std::string cached_hash_ = "-1";
+  std::mutex cached_hash_mutex_;
+};  // class BpFooInterface
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h
new file mode 100644
index 0000000..ab97ca9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/Foo.h
@@ -0,0 +1,57 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class Foo : public ::android::Parcelable {
+public:
+  int32_t intDefault42 = 42;
+  inline bool operator!=(const Foo& rhs) const {
+    return std::tie(intDefault42) != std::tie(rhs.intDefault42);
+  }
+  inline bool operator<(const Foo& rhs) const {
+    return std::tie(intDefault42) < std::tie(rhs.intDefault42);
+  }
+  inline bool operator<=(const Foo& rhs) const {
+    return std::tie(intDefault42) <= std::tie(rhs.intDefault42);
+  }
+  inline bool operator==(const Foo& rhs) const {
+    return std::tie(intDefault42) == std::tie(rhs.intDefault42);
+  }
+  inline bool operator>(const Foo& rhs) const {
+    return std::tie(intDefault42) > std::tie(rhs.intDefault42);
+  }
+  inline bool operator>=(const Foo& rhs) const {
+    return std::tie(intDefault42) >= std::tie(rhs.intDefault42);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.versioned.tests.Foo");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Foo{";
+    os << "intDefault42: " << ::android::internal::ToString(intDefault42);
+    os << "}";
+    return os.str();
+  }
+};  // class Foo
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h
new file mode 100644
index 0000000..aa5add2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/include/android/aidl/versioned/tests/IFooInterface.h
@@ -0,0 +1,73 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 -t --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-cpp-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <android/aidl/versioned/tests/BazUnion.h>
+#include <android/aidl/versioned/tests/Foo.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cstdint>
+#include <string>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <vector>
+
+namespace android::aidl::versioned::tests {
+class Foo;
+}  // namespace android::aidl::versioned::tests
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class IFooInterfaceDelegator;
+
+class IFooInterface : public ::android::IInterface {
+public:
+  typedef IFooInterfaceDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(FooInterface)
+  static inline const int32_t VERSION = 3;
+  static inline const std::string HASH = "70d76c61eb0c82288e924862c10b910d1b7d8cf8";
+  virtual ::android::binder::Status originalApi() = 0;
+  virtual ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& u, ::std::string* _aidl_return) = 0;
+  virtual ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& inFoo, ::android::aidl::versioned::tests::Foo* inoutFoo, ::android::aidl::versioned::tests::Foo* outFoo, int32_t value, int32_t* _aidl_return) = 0;
+  virtual ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& foos, int32_t* _aidl_return) = 0;
+  virtual ::android::binder::Status newApi() = 0;
+  virtual int32_t getInterfaceVersion() = 0;
+  virtual std::string getInterfaceHash() = 0;
+};  // class IFooInterface
+
+class IFooInterfaceDefault : public IFooInterface {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status originalApi() override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status acceptUnionAndReturnString(const ::android::aidl::versioned::tests::BazUnion& /*u*/, ::std::string* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status ignoreParcelablesAndRepeatInt(const ::android::aidl::versioned::tests::Foo& /*inFoo*/, ::android::aidl::versioned::tests::Foo* /*inoutFoo*/, ::android::aidl::versioned::tests::Foo* /*outFoo*/, int32_t /*value*/, int32_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status returnsLengthOfFooArray(const ::std::vector<::android::aidl::versioned::tests::Foo>& /*foos*/, int32_t* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status newApi() override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  int32_t getInterfaceVersion() override {
+    return 0;
+  }
+  std::string getInterfaceHash() override {
+    return "";
+  }
+};  // class IFooInterfaceDefault
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-cpp-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/BazUnion.java b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/BazUnion.java
new file mode 100644
index 0000000..2420076
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/BazUnion.java
@@ -0,0 +1,135 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+package android.aidl.versioned.tests;
+public final class BazUnion implements android.os.Parcelable {
+  // tags for union fields
+  public final static int intNum = 0;  // int intNum;
+  public final static int longNum = 1;  // long longNum;
+
+  private int _tag;
+  private Object _value;
+
+  public BazUnion() {
+    int _value = 0;
+    this._tag = intNum;
+    this._value = _value;
+  }
+
+  private BazUnion(android.os.Parcel _aidl_parcel) {
+    readFromParcel(_aidl_parcel);
+  }
+
+  private BazUnion(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+
+  public int getTag() {
+    return _tag;
+  }
+
+  // int intNum;
+
+  public static BazUnion intNum(int _value) {
+    return new BazUnion(intNum, _value);
+  }
+
+  public int getIntNum() {
+    _assertTag(intNum);
+    return (int) _value;
+  }
+
+  public void setIntNum(int _value) {
+    _set(intNum, _value);
+  }
+
+  // long longNum;
+
+  public static BazUnion longNum(long _value) {
+    return new BazUnion(longNum, _value);
+  }
+
+  public long getLongNum() {
+    _assertTag(longNum);
+    return (long) _value;
+  }
+
+  public void setLongNum(long _value) {
+    _set(longNum, _value);
+  }
+
+  public static final android.os.Parcelable.Creator<BazUnion> CREATOR = new android.os.Parcelable.Creator<BazUnion>() {
+    @Override
+    public BazUnion createFromParcel(android.os.Parcel _aidl_source) {
+      return new BazUnion(_aidl_source);
+    }
+    @Override
+    public BazUnion[] newArray(int _aidl_size) {
+      return new BazUnion[_aidl_size];
+    }
+  };
+
+  @Override
+  public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+    _aidl_parcel.writeInt(_tag);
+    switch (_tag) {
+    case intNum:
+      _aidl_parcel.writeInt(getIntNum());
+      break;
+    case longNum:
+      _aidl_parcel.writeLong(getLongNum());
+      break;
+    }
+  }
+
+  public void readFromParcel(android.os.Parcel _aidl_parcel) {
+    int _aidl_tag;
+    _aidl_tag = _aidl_parcel.readInt();
+    switch (_aidl_tag) {
+    case intNum: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case longNum: {
+      long _aidl_value;
+      _aidl_value = _aidl_parcel.readLong();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    }
+    throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+  }
+
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    switch (getTag()) {
+    }
+    return _mask;
+  }
+
+  private void _assertTag(int tag) {
+    if (getTag() != tag) {
+      throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+    }
+  }
+
+  private String _tagString(int _tag) {
+    switch (_tag) {
+    case intNum: return "intNum";
+    case longNum: return "longNum";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+
+  private void _set(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+  public static @interface Tag {
+    public static final int intNum = 0;
+    public static final int longNum = 1;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d
new file mode 100644
index 0000000..dd0c612
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/BazUnion.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/BazUnion.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/Foo.java b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/Foo.java
new file mode 100644
index 0000000..721aa11
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/Foo.java
@@ -0,0 +1,52 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/Foo.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+package android.aidl.versioned.tests;
+@android.annotation.SuppressLint(value = {"NewApi"})
+public class Foo implements android.os.Parcelable
+{
+  public int intDefault42 = 42;
+  public static final android.os.Parcelable.Creator<Foo> CREATOR = new android.os.Parcelable.Creator<Foo>() {
+    @Override
+    public Foo createFromParcel(android.os.Parcel _aidl_source) {
+      Foo _aidl_out = new Foo();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public Foo[] newArray(int _aidl_size) {
+      return new Foo[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(intDefault42);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      intDefault42 = _aidl_parcel.readInt();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    return _mask;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/Foo.java.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/Foo.java.d
new file mode 100644
index 0000000..b24806e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/Foo.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/Foo.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/IFooInterface.java b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/IFooInterface.java
new file mode 100644
index 0000000..b4568b7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/IFooInterface.java
@@ -0,0 +1,366 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --rpc --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+package android.aidl.versioned.tests;
+public interface IFooInterface extends android.os.IInterface
+{
+  /**
+   * The version of this interface that the caller is built against.
+   * This might be different from what {@link #getInterfaceVersion()
+   * getInterfaceVersion} returns as that is the version of the interface
+   * that the remote object is implementing.
+   */
+  public static final int VERSION = 3;
+  public static final String HASH = "70d76c61eb0c82288e924862c10b910d1b7d8cf8";
+  /** Default implementation for IFooInterface. */
+  public static class Default implements android.aidl.versioned.tests.IFooInterface
+  {
+    @Override public void originalApi() throws android.os.RemoteException
+    {
+    }
+    @Override public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public void newApi() throws android.os.RemoteException
+    {
+    }
+    @Override
+    public int getInterfaceVersion() {
+      return 0;
+    }
+    @Override
+    public String getInterfaceHash() {
+      return "";
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Delegator implementation for IFooInterface. */
+  public static class Delegator extends android.aidl.versioned.tests.IFooInterface.Stub
+  {
+    public Delegator(android.aidl.versioned.tests.IFooInterface impl) {
+      this.mImpl = impl;
+    }
+    @Override
+    public String getInterfaceHash() throws android.os.RemoteException {
+      return mImpl.getInterfaceHash();
+    }
+    @Override
+    public int getInterfaceVersion() throws android.os.RemoteException {
+      int implVer = mImpl.getInterfaceVersion();
+      return VERSION < implVer ? VERSION : implVer;
+    }
+    @Override public void originalApi() throws android.os.RemoteException
+    {
+      mImpl.originalApi();
+    }
+    @Override public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException
+    {
+      return mImpl.acceptUnionAndReturnString(u);
+    }
+    @Override public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException
+    {
+      return mImpl.ignoreParcelablesAndRepeatInt(inFoo,inoutFoo,outFoo,value);
+    }
+    @Override public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException
+    {
+      return mImpl.returnsLengthOfFooArray(foos);
+    }
+    @Override public void newApi() throws android.os.RemoteException
+    {
+      mImpl.newApi();
+    }
+    android.aidl.versioned.tests.IFooInterface mImpl;
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.versioned.tests.IFooInterface
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.versioned.tests.IFooInterface interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.versioned.tests.IFooInterface asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.versioned.tests.IFooInterface))) {
+        return ((android.aidl.versioned.tests.IFooInterface)iin);
+      }
+      return new android.aidl.versioned.tests.IFooInterface.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceVersion) {
+        reply.writeNoException();
+        reply.writeInt(getInterfaceVersion());
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceHash) {
+        reply.writeNoException();
+        reply.writeString(getInterfaceHash());
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_originalApi:
+        {
+          this.originalApi();
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_acceptUnionAndReturnString:
+        {
+          android.aidl.versioned.tests.BazUnion _arg0;
+          _arg0 = data.readTypedObject(android.aidl.versioned.tests.BazUnion.CREATOR);
+          data.enforceNoDataAvail();
+          java.lang.String _result = this.acceptUnionAndReturnString(_arg0);
+          reply.writeNoException();
+          reply.writeString(_result);
+          break;
+        }
+        case TRANSACTION_ignoreParcelablesAndRepeatInt:
+        {
+          android.aidl.versioned.tests.Foo _arg0;
+          _arg0 = data.readTypedObject(android.aidl.versioned.tests.Foo.CREATOR);
+          android.aidl.versioned.tests.Foo _arg1;
+          _arg1 = data.readTypedObject(android.aidl.versioned.tests.Foo.CREATOR);
+          android.aidl.versioned.tests.Foo _arg2;
+          _arg2 = new android.aidl.versioned.tests.Foo();
+          int _arg3;
+          _arg3 = data.readInt();
+          data.enforceNoDataAvail();
+          int _result = this.ignoreParcelablesAndRepeatInt(_arg0, _arg1, _arg2, _arg3);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          reply.writeTypedObject(_arg1, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          reply.writeTypedObject(_arg2, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_returnsLengthOfFooArray:
+        {
+          android.aidl.versioned.tests.Foo[] _arg0;
+          _arg0 = data.createTypedArray(android.aidl.versioned.tests.Foo.CREATOR);
+          data.enforceNoDataAvail();
+          int _result = this.returnsLengthOfFooArray(_arg0);
+          reply.writeNoException();
+          reply.writeInt(_result);
+          break;
+        }
+        case TRANSACTION_newApi:
+        {
+          this.newApi();
+          reply.writeNoException();
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.versioned.tests.IFooInterface
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      private int mCachedVersion = -1;
+      private String mCachedHash = "-1";
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public void originalApi() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_originalApi, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method originalApi is unimplemented.");
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(u, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_acceptUnionAndReturnString, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method acceptUnionAndReturnString is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readString();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(inFoo, 0);
+          _data.writeTypedObject(inoutFoo, 0);
+          _data.writeInt(value);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_ignoreParcelablesAndRepeatInt, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method ignoreParcelablesAndRepeatInt is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+          if ((0!=_reply.readInt())) {
+            inoutFoo.readFromParcel(_reply);
+          }
+          if ((0!=_reply.readInt())) {
+            outFoo.readFromParcel(_reply);
+          }
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        int _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedArray(foos, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_returnsLengthOfFooArray, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method returnsLengthOfFooArray is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readInt();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public void newApi() throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_newApi, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method newApi is unimplemented.");
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override
+      public int getInterfaceVersion() throws android.os.RemoteException {
+        if (mCachedVersion == -1) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceVersion, data, reply, 0);
+            reply.readException();
+            mCachedVersion = reply.readInt();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedVersion;
+      }
+      @Override
+      public synchronized String getInterfaceHash() throws android.os.RemoteException {
+        if ("-1".equals(mCachedHash)) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceHash, data, reply, 0);
+            reply.readException();
+            mCachedHash = reply.readString();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedHash;
+      }
+    }
+    static final int TRANSACTION_originalApi = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    static final int TRANSACTION_acceptUnionAndReturnString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    static final int TRANSACTION_ignoreParcelablesAndRepeatInt = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+    static final int TRANSACTION_returnsLengthOfFooArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+    static final int TRANSACTION_newApi = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
+    static final int TRANSACTION_getInterfaceVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777214);
+    static final int TRANSACTION_getInterfaceHash = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777213);
+  }
+  public static final java.lang.String DESCRIPTOR = "android$aidl$versioned$tests$IFooInterface".replace('$', '.');
+  public void originalApi() throws android.os.RemoteException;
+  public java.lang.String acceptUnionAndReturnString(android.aidl.versioned.tests.BazUnion u) throws android.os.RemoteException;
+  public int ignoreParcelablesAndRepeatInt(android.aidl.versioned.tests.Foo inFoo, android.aidl.versioned.tests.Foo inoutFoo, android.aidl.versioned.tests.Foo outFoo, int value) throws android.os.RemoteException;
+  public int returnsLengthOfFooArray(android.aidl.versioned.tests.Foo[] foos) throws android.os.RemoteException;
+  public void newApi() throws android.os.RemoteException;
+  public int getInterfaceVersion() throws android.os.RemoteException;
+  public String getInterfaceHash() throws android.os.RemoteException;
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d
new file mode 100644
index 0000000..e23927f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/IFooInterface.java.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-java-source/gen/android/aidl/versioned/tests/IFooInterface.java : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-java-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp
new file mode 100644
index 0000000..36af17f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp
@@ -0,0 +1,58 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/BazUnion.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+const char* BazUnion::descriptor = "android.aidl.versioned.tests.BazUnion";
+
+binder_status_t BazUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case intNum: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<intNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<intNum>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case longNum: {
+    int64_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int64_t>) {
+      set<longNum>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<longNum>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t BazUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case intNum: return ::ndk::AParcel_writeData(_parcel, get<intNum>());
+  case longNum: return ::ndk::AParcel_writeData(_parcel, get<longNum>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
new file mode 100644
index 0000000..1f76fcd
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/BazUnion.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp
new file mode 100644
index 0000000..5dd8104
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp
@@ -0,0 +1,55 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/Foo.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+const char* Foo::descriptor = "android.aidl.versioned.tests.Foo";
+
+binder_status_t Foo::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &intDefault42);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t Foo::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, intDefault42);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d
new file mode 100644
index 0000000..4804e39
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/Foo.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
new file mode 100644
index 0000000..ecc887e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp
@@ -0,0 +1,545 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/versioned/tests/BnFooInterface.h>
+#include <aidl/android/aidl/versioned/tests/BpFooInterface.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+static binder_status_t _aidl_android_aidl_versioned_tests_IFooInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnFooInterface> _aidl_impl = std::static_pointer_cast<BnFooInterface>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*originalApi*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->originalApi();
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*acceptUnionAndReturnString*/): {
+      ::aidl::android::aidl::versioned::tests::BazUnion in_u;
+      std::string _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_u);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->acceptUnionAndReturnString(in_u, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*ignoreParcelablesAndRepeatInt*/): {
+      ::aidl::android::aidl::versioned::tests::Foo in_inFoo;
+      ::aidl::android::aidl::versioned::tests::Foo in_inoutFoo;
+      ::aidl::android::aidl::versioned::tests::Foo out_outFoo;
+      int32_t in_value;
+      int32_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_inFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_inoutFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_value);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ignoreParcelablesAndRepeatInt(in_inFoo, &in_inoutFoo, &out_outFoo, in_value, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_inoutFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, out_outFoo);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 3 /*returnsLengthOfFooArray*/): {
+      std::vector<::aidl::android::aidl::versioned::tests::Foo> in_foos;
+      int32_t _aidl_return;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_foos);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->returnsLengthOfFooArray(in_foos, &_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 4 /*newApi*/): {
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->newApi();
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): {
+      int32_t _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): {
+      std::string _aidl_return;
+
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return);
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_versioned_tests_IFooInterface_clazz = ::ndk::ICInterface::defineClass(IFooInterface::descriptor, _aidl_android_aidl_versioned_tests_IFooInterface_onTransact);
+
+BpFooInterface::BpFooInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpFooInterface::~BpFooInterface() {}
+
+::ndk::ScopedAStatus BpFooInterface::originalApi() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*originalApi*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->originalApi();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_u);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*acceptUnionAndReturnString*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->acceptUnionAndReturnString(in_u, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_inFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_inoutFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_value);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*ignoreParcelablesAndRepeatInt*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->ignoreParcelablesAndRepeatInt(in_inFoo, in_inoutFoo, out_outFoo, in_value, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_inoutFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), out_outFoo);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_foos);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 3 /*returnsLengthOfFooArray*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->returnsLengthOfFooArray(in_foos, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::newApi() {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 4 /*newApi*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->newApi();
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::getInterfaceVersion(int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  if (_aidl_cached_version != -1) {
+    *_aidl_return = _aidl_cached_version;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->getInterfaceVersion(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_version = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpFooInterface::getInterfaceHash(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex);
+  if (_aidl_cached_hash != "-1") {
+    *_aidl_return = _aidl_cached_hash;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IFooInterface::getDefaultImpl()) {
+    _aidl_status = IFooInterface::getDefaultImpl()->getInterfaceHash(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_hash = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  return _aidl_status;
+}
+// Source for BnFooInterface
+BnFooInterface::BnFooInterface() {}
+BnFooInterface::~BnFooInterface() {}
+::ndk::SpAIBinder BnFooInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_versioned_tests_IFooInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+::ndk::ScopedAStatus BnFooInterface::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = IFooInterface::version;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus BnFooInterface::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = IFooInterface::hash;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+// Source for IFooInterface
+const char* IFooInterface::descriptor = "android.aidl.versioned.tests.IFooInterface";
+IFooInterface::IFooInterface() {}
+IFooInterface::~IFooInterface() {}
+
+
+std::shared_ptr<IFooInterface> IFooInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_versioned_tests_IFooInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpFooInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IFooInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpFooInterface>(binder);
+}
+
+binder_status_t IFooInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<IFooInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t IFooInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<IFooInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IFooInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool IFooInterface::setDefaultImpl(const std::shared_ptr<IFooInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IFooInterface::default_impl);
+  if (impl) {
+    IFooInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<IFooInterface>& IFooInterface::getDefaultImpl() {
+  return IFooInterface::default_impl;
+}
+std::shared_ptr<IFooInterface> IFooInterface::default_impl = nullptr;
+::ndk::ScopedAStatus IFooInterfaceDefault::originalApi() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& /*in_u*/, std::string* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& /*in_inFoo*/, ::aidl::android::aidl::versioned::tests::Foo* /*in_inoutFoo*/, ::aidl::android::aidl::versioned::tests::Foo* /*out_outFoo*/, int32_t /*in_value*/, int32_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& /*in_foos*/, int32_t* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::newApi() {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = 0;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus IFooInterfaceDefault::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = "";
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::SpAIBinder IFooInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool IFooInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
new file mode 100644
index 0000000..ef86f46
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/android/aidl/versioned/tests/IFooInterface.cpp : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h
new file mode 100644
index 0000000..9093489
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BazUnion.h
@@ -0,0 +1,165 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BazUnion {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Tag : int32_t {
+    intNum = 0,
+    longNum = 1,
+  };
+
+  // Expose tag symbols for legacy code
+  static const inline Tag intNum = Tag::intNum;
+  static const inline Tag longNum = Tag::longNum;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, BazUnion>;
+
+  BazUnion() : _value(std::in_place_index<static_cast<size_t>(intNum)>, int32_t(0)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr BazUnion(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit BazUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static BazUnion make(_Tp&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static BazUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return BazUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  binder_status_t readFromParcel(const AParcel* _parcel);
+  binder_status_t writeToParcel(AParcel* _parcel) const;
+
+  inline bool operator!=(const BazUnion& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const BazUnion& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const BazUnion& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const BazUnion& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const BazUnion& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const BazUnion& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "BazUnion{";
+    switch (getTag()) {
+    case intNum: os << "intNum: " << ::android::internal::ToString(get<intNum>()); break;
+    case longNum: os << "longNum: " << ::android::internal::ToString(get<longNum>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t, int64_t> _value;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+[[nodiscard]] static inline std::string toString(BazUnion::Tag val) {
+  switch(val) {
+  case BazUnion::Tag::intNum:
+    return "intNum";
+  case BazUnion::Tag::longNum:
+    return "longNum";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::versioned::tests::BazUnion::Tag, 2> enum_values<aidl::android::aidl::versioned::tests::BazUnion::Tag> = {
+  aidl::android::aidl::versioned::tests::BazUnion::Tag::intNum,
+  aidl::android::aidl::versioned::tests::BazUnion::Tag::longNum,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h
new file mode 100644
index 0000000..3bb5a11
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h
new file mode 100644
index 0000000..c6d06ac
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h
new file mode 100644
index 0000000..069e441
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BnFooInterface.h
@@ -0,0 +1,69 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BnFooInterface : public ::ndk::BnCInterface<IFooInterface> {
+public:
+  BnFooInterface();
+  virtual ~BnFooInterface();
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) final;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) final;
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class IFooInterfaceDelegator : public BnFooInterface {
+public:
+  explicit IFooInterfaceDelegator(const std::shared_ptr<IFooInterface> &impl) : _impl(impl) {
+     int32_t _impl_ver = 0;
+     if (!impl->getInterfaceVersion(&_impl_ver).isOk()) {;
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Delegator failed to get version of the implementation.");
+     }
+     if (_impl_ver != IFooInterface::version) {
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Mismatched versions of delegator and implementation is not allowed.");
+     }
+  }
+
+  ::ndk::ScopedAStatus originalApi() override {
+    return _impl->originalApi();
+  }
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override {
+    return _impl->acceptUnionAndReturnString(in_u, _aidl_return);
+  }
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override {
+    return _impl->ignoreParcelablesAndRepeatInt(in_inFoo, in_inoutFoo, out_outFoo, in_value, _aidl_return);
+  }
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override {
+    return _impl->returnsLengthOfFooArray(in_foos, _aidl_return);
+  }
+  ::ndk::ScopedAStatus newApi() override {
+    return _impl->newApi();
+  }
+protected:
+private:
+  std::shared_ptr<IFooInterface> _impl;
+};
+
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h
new file mode 100644
index 0000000..3e223c3
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpBazUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/BazUnion.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h
new file mode 100644
index 0000000..f49a40a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFoo.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h
new file mode 100644
index 0000000..a3cfec1
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/BpFooInterface.h
@@ -0,0 +1,36 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/versioned/tests/IFooInterface.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class BpFooInterface : public ::ndk::BpCInterface<IFooInterface> {
+public:
+  explicit BpFooInterface(const ::ndk::SpAIBinder& binder);
+  virtual ~BpFooInterface();
+
+  ::ndk::ScopedAStatus originalApi() override;
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus newApi() override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  int32_t _aidl_cached_version = -1;
+  std::string _aidl_cached_hash = "-1";
+  std::mutex _aidl_cached_hash_mutex;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h
new file mode 100644
index 0000000..25ac236
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/Foo.h
@@ -0,0 +1,66 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/Foo.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class Foo {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t intDefault42 = 42;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const Foo& rhs) const {
+    return std::tie(intDefault42) != std::tie(rhs.intDefault42);
+  }
+  inline bool operator<(const Foo& rhs) const {
+    return std::tie(intDefault42) < std::tie(rhs.intDefault42);
+  }
+  inline bool operator<=(const Foo& rhs) const {
+    return std::tie(intDefault42) <= std::tie(rhs.intDefault42);
+  }
+  inline bool operator==(const Foo& rhs) const {
+    return std::tie(intDefault42) == std::tie(rhs.intDefault42);
+  }
+  inline bool operator>(const Foo& rhs) const {
+    return std::tie(intDefault42) > std::tie(rhs.intDefault42);
+  }
+  inline bool operator>=(const Foo& rhs) const {
+    return std::tie(intDefault42) >= std::tie(rhs.intDefault42);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Foo{";
+    os << "intDefault42: " << ::android::internal::ToString(intDefault42);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h
new file mode 100644
index 0000000..a282516
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/include/aidl/android/aidl/versioned/tests/IFooInterface.h
@@ -0,0 +1,75 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging/android/aidl/versioned/tests/IFooInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-ndk-source/gen/staging -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <aidl/android/aidl/versioned/tests/BazUnion.h>
+#include <aidl/android/aidl/versioned/tests/Foo.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::versioned::tests {
+class Foo;
+}  // namespace aidl::android::aidl::versioned::tests
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace versioned {
+namespace tests {
+class IFooInterfaceDelegator;
+
+class IFooInterface : public ::ndk::ICInterface {
+public:
+  typedef IFooInterfaceDelegator DefaultDelegator;
+  static const char* descriptor;
+  IFooInterface();
+  virtual ~IFooInterface();
+
+  static inline const int32_t version = 3;
+  static inline const std::string hash = "70d76c61eb0c82288e924862c10b910d1b7d8cf8";
+  static constexpr uint32_t TRANSACTION_originalApi = FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_acceptUnionAndReturnString = FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_ignoreParcelablesAndRepeatInt = FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_returnsLengthOfFooArray = FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_newApi = FIRST_CALL_TRANSACTION + 4;
+
+  static std::shared_ptr<IFooInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IFooInterface>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IFooInterface>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<IFooInterface>& impl);
+  static const std::shared_ptr<IFooInterface>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus originalApi() = 0;
+  virtual ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus newApi() = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) = 0;
+private:
+  static std::shared_ptr<IFooInterface> default_impl;
+};
+class IFooInterfaceDefault : public IFooInterface {
+public:
+  ::ndk::ScopedAStatus originalApi() override;
+  ::ndk::ScopedAStatus acceptUnionAndReturnString(const ::aidl::android::aidl::versioned::tests::BazUnion& in_u, std::string* _aidl_return) override;
+  ::ndk::ScopedAStatus ignoreParcelablesAndRepeatInt(const ::aidl::android::aidl::versioned::tests::Foo& in_inFoo, ::aidl::android::aidl::versioned::tests::Foo* in_inoutFoo, ::aidl::android::aidl::versioned::tests::Foo* out_outFoo, int32_t in_value, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus returnsLengthOfFooArray(const std::vector<::aidl::android::aidl::versioned::tests::Foo>& in_foos, int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus newApi() override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace tests
+}  // namespace versioned
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-ndk-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs
new file mode 100644
index 0000000..3cf76d9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs
@@ -0,0 +1,67 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub enum r#BazUnion {
+  IntNum(i32),
+  LongNum(i64),
+}
+impl Default for r#BazUnion {
+  fn default() -> Self {
+    Self::IntNum(0)
+  }
+}
+impl binder::Parcelable for r#BazUnion {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    match self {
+      Self::IntNum(v) => {
+        parcel.write(&0i32)?;
+        parcel.write(v)
+      }
+      Self::LongNum(v) => {
+        parcel.write(&1i32)?;
+        parcel.write(v)
+      }
+    }
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    let tag: i32 = parcel.read()?;
+    match tag {
+      0 => {
+        let value: i32 = parcel.read()?;
+        *self = Self::IntNum(value);
+        Ok(())
+      }
+      1 => {
+        let value: i64 = parcel.read()?;
+        *self = Self::LongNum(value);
+        Ok(())
+      }
+      _ => {
+        Err(binder::StatusCode::BAD_VALUE)
+      }
+    }
+  }
+}
+binder::impl_serialize_for_parcelable!(r#BazUnion);
+binder::impl_deserialize_for_parcelable!(r#BazUnion);
+impl binder::binder_impl::ParcelableMetadata for r#BazUnion {
+  fn get_descriptor() -> &'static str { "android.aidl.versioned.tests.BazUnion" }
+}
+pub mod r#Tag {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#Tag : [i32; 2] {
+      r#intNum = 0,
+      r#longNum = 1,
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#BazUnion as _7_android_4_aidl_9_versioned_5_tests_8_BazUnion;
+ pub use super::r#Tag::r#Tag as _7_android_4_aidl_9_versioned_5_tests_8_BazUnion_3_Tag;
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d
new file mode 100644
index 0000000..8689dce
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/BazUnion.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/Foo.rs b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/Foo.rs
new file mode 100644
index 0000000..7fc28b7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/Foo.rs
@@ -0,0 +1,41 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#[derive(Debug)]
+pub struct r#Foo {
+  pub r#intDefault42: i32,
+}
+impl Default for r#Foo {
+  fn default() -> Self {
+    Self {
+      r#intDefault42: 42,
+    }
+  }
+}
+impl binder::Parcelable for r#Foo {
+  fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_write(|subparcel| {
+      subparcel.write(&self.r#intDefault42)?;
+      Ok(())
+    })
+  }
+  fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+    parcel.sized_read(|subparcel| {
+      if subparcel.has_more_data() {
+        self.r#intDefault42 = subparcel.read()?;
+      }
+      Ok(())
+    })
+  }
+}
+binder::impl_serialize_for_parcelable!(r#Foo);
+binder::impl_deserialize_for_parcelable!(r#Foo);
+impl binder::binder_impl::ParcelableMetadata for r#Foo {
+  fn get_descriptor() -> &'static str { "android.aidl.versioned.tests.Foo" }
+}
+pub(crate) mod mangled {
+ pub use super::r#Foo as _7_android_4_aidl_9_versioned_5_tests_3_Foo;
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d
new file mode 100644
index 0000000..1146377
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/Foo.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/Foo.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs
new file mode 100644
index 0000000..7f7786e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs
@@ -0,0 +1,493 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 3 --hash 70d76c61eb0c82288e924862c10b910d1b7d8cf8 --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d -o out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen -Nsystem/tools/aidl/aidl_api/aidl-test-versioned-interface/3 system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  IFooInterface["android.aidl.versioned.tests.IFooInterface"] {
+    native: BnFooInterface(on_transact),
+    proxy: BpFooInterface {
+      cached_version: std::sync::atomic::AtomicI32 = std::sync::atomic::AtomicI32::new(-1),
+      cached_hash: std::sync::Mutex<Option<String>> = std::sync::Mutex::new(None)
+    },
+    async: IFooInterfaceAsync,
+  }
+}
+pub trait IFooInterface: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  fn r#originalApi(&self) -> binder::Result<()>;
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String>;
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32>;
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32>;
+  fn r#newApi(&self) -> binder::Result<()>;
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    Ok(VERSION)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    Ok(HASH.into())
+  }
+  fn getDefaultImpl() -> IFooInterfaceDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: IFooInterfaceDefaultRef) -> IFooInterfaceDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait IFooInterfaceAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  fn r#originalApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#acceptUnionAndReturnString<'a>(&'a self, _arg_u: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::BoxFuture<'a, binder::Result<String>>;
+  fn r#ignoreParcelablesAndRepeatInt<'a>(&'a self, _arg_inFoo: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::BoxFuture<'a, binder::Result<i32>>;
+  fn r#returnsLengthOfFooArray<'a>(&'a self, _arg_foos: &'a [crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::BoxFuture<'a, binder::Result<i32>>;
+  fn r#newApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    Box::pin(async move { Ok(VERSION) })
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    Box::pin(async move { Ok(HASH.into()) })
+  }
+}
+#[::async_trait::async_trait]
+pub trait IFooInterfaceAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.versioned.tests.IFooInterface" }
+  async fn r#originalApi(&self) -> binder::Result<()>;
+  async fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String>;
+  async fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32>;
+  async fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32>;
+  async fn r#newApi(&self) -> binder::Result<()>;
+}
+impl BnFooInterface {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IFooInterface>
+  where
+    T: IFooInterfaceAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> IFooInterface for Wrapper<T, R>
+    where
+      T: IFooInterfaceAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#originalApi(&self) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#originalApi())
+      }
+      fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+        self._rt.block_on(self._inner.r#acceptUnionAndReturnString(_arg_u))
+      }
+      fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+        self._rt.block_on(self._inner.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value))
+      }
+      fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+        self._rt.block_on(self._inner.r#returnsLengthOfFooArray(_arg_foos))
+      }
+      fn r#newApi(&self) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#newApi())
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait IFooInterfaceDefault: Send + Sync {
+  fn r#originalApi(&self) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#newApi(&self) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#originalApi: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  pub const r#acceptUnionAndReturnString: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+  pub const r#ignoreParcelablesAndRepeatInt: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+  pub const r#returnsLengthOfFooArray: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 3;
+  pub const r#newApi: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 4;
+  pub const r#getInterfaceVersion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777214;
+  pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213;
+}
+pub type IFooInterfaceDefaultRef = Option<std::sync::Arc<dyn IFooInterfaceDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None);
+}
+pub const VERSION: i32 = 3;
+pub const HASH: &str = "70d76c61eb0c82288e924862c10b910d1b7d8cf8";
+impl BpFooInterface {
+  fn build_parcel_originalApi(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_originalApi(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#originalApi();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_u)?;
+    Ok(aidl_data)
+  }
+  fn read_response_acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#acceptUnionAndReturnString(_arg_u);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_inFoo)?;
+    aidl_data.write(_arg_inoutFoo)?;
+    aidl_data.write(&_arg_value)?;
+    Ok(aidl_data)
+  }
+  fn read_response_ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    _aidl_reply.read_onto(_arg_inoutFoo)?;
+    _aidl_reply.read_onto(_arg_outFoo)?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_foos)?;
+    Ok(aidl_data)
+  }
+  fn read_response_returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo], _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#returnsLengthOfFooArray(_arg_foos);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_newApi(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_newApi(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as IFooInterface>::getDefaultImpl() {
+        return _aidl_default_impl.r#newApi();
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_getInterfaceVersion(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceVersion(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    self.cached_version.store(_aidl_return, std::sync::atomic::Ordering::Relaxed);
+    Ok(_aidl_return)
+  }
+  fn build_parcel_getInterfaceHash(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceHash(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    *self.cached_hash.lock().unwrap() = Some(_aidl_return.clone());
+    Ok(_aidl_return)
+  }
+}
+impl IFooInterface for BpFooInterface {
+  fn r#originalApi(&self) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_originalApi()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#originalApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_originalApi(_aidl_reply)
+  }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> {
+    let _aidl_data = self.build_parcel_acceptUnionAndReturnString(_arg_u)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#acceptUnionAndReturnString, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_acceptUnionAndReturnString(_arg_u, _aidl_reply)
+  }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> {
+    let _aidl_data = self.build_parcel_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#ignoreParcelablesAndRepeatInt, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value, _aidl_reply)
+  }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> {
+    let _aidl_data = self.build_parcel_returnsLengthOfFooArray(_arg_foos)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#returnsLengthOfFooArray, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_returnsLengthOfFooArray(_arg_foos, _aidl_reply)
+  }
+  fn r#newApi(&self) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_newApi()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#newApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_newApi(_aidl_reply)
+  }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Ok(_aidl_version); }
+    let _aidl_data = self.build_parcel_getInterfaceVersion()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceVersion(_aidl_reply)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Ok(_aidl_hash.clone());
+      }
+    }
+    let _aidl_data = self.build_parcel_getInterfaceHash()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceHash(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> IFooInterfaceAsync<P> for BpFooInterface {
+  fn r#originalApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_originalApi() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#originalApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_originalApi(_aidl_reply)
+      }
+    )
+  }
+  fn r#acceptUnionAndReturnString<'a>(&'a self, _arg_u: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::BoxFuture<'a, binder::Result<String>> {
+    let _aidl_data = match self.build_parcel_acceptUnionAndReturnString(_arg_u) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#acceptUnionAndReturnString, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_acceptUnionAndReturnString(_arg_u, _aidl_reply)
+      }
+    )
+  }
+  fn r#ignoreParcelablesAndRepeatInt<'a>(&'a self, _arg_inFoo: &'a crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &'a mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_data = match self.build_parcel_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#ignoreParcelablesAndRepeatInt, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value, _aidl_reply)
+      }
+    )
+  }
+  fn r#returnsLengthOfFooArray<'a>(&'a self, _arg_foos: &'a [crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_data = match self.build_parcel_returnsLengthOfFooArray(_arg_foos) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#returnsLengthOfFooArray, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_returnsLengthOfFooArray(_arg_foos, _aidl_reply)
+      }
+    )
+  }
+  fn r#newApi<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_newApi() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#newApi, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_newApi(_aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Box::pin(std::future::ready(Ok(_aidl_version))); }
+    let _aidl_data = match self.build_parcel_getInterfaceVersion() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceVersion(_aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Box::pin(std::future::ready(Ok(_aidl_hash.clone())));
+      }
+    }
+    let _aidl_data = match self.build_parcel_getInterfaceHash() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceHash(_aidl_reply)
+      }
+    )
+  }
+}
+impl IFooInterface for binder::binder_impl::Binder<BnFooInterface> {
+  fn r#originalApi(&self) -> binder::Result<()> { self.0.r#originalApi() }
+  fn r#acceptUnionAndReturnString(&self, _arg_u: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion) -> binder::Result<String> { self.0.r#acceptUnionAndReturnString(_arg_u) }
+  fn r#ignoreParcelablesAndRepeatInt(&self, _arg_inFoo: &crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_inoutFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_outFoo: &mut crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo, _arg_value: i32) -> binder::Result<i32> { self.0.r#ignoreParcelablesAndRepeatInt(_arg_inFoo, _arg_inoutFoo, _arg_outFoo, _arg_value) }
+  fn r#returnsLengthOfFooArray(&self, _arg_foos: &[crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo]) -> binder::Result<i32> { self.0.r#returnsLengthOfFooArray(_arg_foos) }
+  fn r#newApi(&self) -> binder::Result<()> { self.0.r#newApi() }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> { self.0.r#getInterfaceVersion() }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> { self.0.r#getInterfaceHash() }
+}
+fn on_transact(_aidl_service: &dyn IFooInterface, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#originalApi => {
+      let _aidl_return = _aidl_service.r#originalApi();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#acceptUnionAndReturnString => {
+      let _arg_u: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_8_BazUnion = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#acceptUnionAndReturnString(&_arg_u);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#ignoreParcelablesAndRepeatInt => {
+      let _arg_inFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = _aidl_data.read()?;
+      let mut _arg_inoutFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = _aidl_data.read()?;
+      let mut _arg_outFoo: crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo = Default::default();
+      let _arg_value: i32 = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#ignoreParcelablesAndRepeatInt(&_arg_inFoo, &mut _arg_inoutFoo, &mut _arg_outFoo, _arg_value);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+          _aidl_reply.write(&_arg_inoutFoo)?;
+          _aidl_reply.write(&_arg_outFoo)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#returnsLengthOfFooArray => {
+      let _arg_foos: Vec<crate::mangled::_7_android_4_aidl_9_versioned_5_tests_3_Foo> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#returnsLengthOfFooArray(&_arg_foos);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#newApi => {
+      let _aidl_return = _aidl_service.r#newApi();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceVersion => {
+      let _aidl_return = _aidl_service.r#getInterfaceVersion();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceHash => {
+      let _aidl_return = _aidl_service.r#getInterfaceHash();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#IFooInterface as _7_android_4_aidl_9_versioned_5_tests_13_IFooInterface;
+}
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d
new file mode 100644
index 0000000..8d46fc6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs : \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/IFooInterface.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/BazUnion.aidl \
+  system/tools/aidl/aidl_api/aidl-test-versioned-interface/3/android/aidl/versioned/tests/Foo.aidl
diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/timestamp b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Data.cpp b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Data.cpp
new file mode 100644
index 0000000..ced4029
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Data.cpp
@@ -0,0 +1,84 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Data.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+#include <android/aidl/loggable/Data.h>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+::android::status_t Data::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&num);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&str);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readParcelable(&nestedUnion);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readByte(reinterpret_cast<int8_t *>(&nestedEnum));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t Data::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(num);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeUtf8AsUtf16(str);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeParcelable(nestedUnion);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeByte(static_cast<int8_t>(nestedEnum));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Data.cpp.d b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Data.cpp.d
new file mode 100644
index 0000000..7397bf0
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Data.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Data.cpp : \
+  system/tools/aidl/tests/android/aidl/loggable/Data.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Enum.cpp b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Enum.cpp
new file mode 100644
index 0000000..8dd4fd4
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Enum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Enum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Enum.cpp.d b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Enum.cpp.d
new file mode 100644
index 0000000..56840c6
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Enum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Enum.cpp : \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/ILoggableInterface.cpp b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/ILoggableInterface.cpp
new file mode 100644
index 0000000..d41aa9f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/ILoggableInterface.cpp
@@ -0,0 +1,663 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/ILoggableInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+#include <android/aidl/loggable/ILoggableInterface.h>
+#include <android/aidl/loggable/BpLoggableInterface.h>
+namespace android {
+namespace aidl {
+namespace loggable {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(LoggableInterface, "android.aidl.loggable.ILoggableInterface")
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/loggable/BpLoggableInterface.h>
+#include <android/aidl/loggable/BnLoggableInterface.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+
+BpLoggableInterface::BpLoggableInterface(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<ILoggableInterface>(_aidl_impl){
+}
+
+std::function<void(const BpLoggableInterface::TransactionLog&)> BpLoggableInterface::logFunc;
+
+::android::binder::Status BpLoggableInterface::LogThis(bool boolValue, ::std::vector<bool>* boolArray, int8_t byteValue, ::std::vector<uint8_t>* byteArray, char16_t charValue, ::std::vector<char16_t>* charArray, int32_t intValue, ::std::vector<int32_t>* intArray, int64_t longValue, ::std::vector<int64_t>* longArray, float floatValue, ::std::vector<float>* floatArray, double doubleValue, ::std::vector<double>* doubleArray, const ::android::String16& stringValue, ::std::vector<::android::String16>* stringArray, ::std::vector<::android::String16>* listValue, const ::android::aidl::loggable::Data& dataValue, const ::android::sp<::android::IBinder>& binderValue, ::std::optional<::android::os::ParcelFileDescriptor>* pfdValue, ::std::vector<::android::os::ParcelFileDescriptor>* pfdArray, ::std::vector<::android::String16>* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ILoggableInterface::LogThis::cppClient");
+  BpLoggableInterface::TransactionLog _transaction_log;
+  if (BpLoggableInterface::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("boolValue", ::android::internal::ToString(boolValue));
+    _transaction_log.input_args.emplace_back("boolArray", ::android::internal::ToString(*boolArray));
+    _transaction_log.input_args.emplace_back("byteValue", ::android::internal::ToString(byteValue));
+    _transaction_log.input_args.emplace_back("byteArray", ::android::internal::ToString(*byteArray));
+    _transaction_log.input_args.emplace_back("charValue", ::android::internal::ToString(charValue));
+    _transaction_log.input_args.emplace_back("charArray", ::android::internal::ToString(*charArray));
+    _transaction_log.input_args.emplace_back("intValue", ::android::internal::ToString(intValue));
+    _transaction_log.input_args.emplace_back("intArray", ::android::internal::ToString(*intArray));
+    _transaction_log.input_args.emplace_back("longValue", ::android::internal::ToString(longValue));
+    _transaction_log.input_args.emplace_back("longArray", ::android::internal::ToString(*longArray));
+    _transaction_log.input_args.emplace_back("floatValue", ::android::internal::ToString(floatValue));
+    _transaction_log.input_args.emplace_back("floatArray", ::android::internal::ToString(*floatArray));
+    _transaction_log.input_args.emplace_back("doubleValue", ::android::internal::ToString(doubleValue));
+    _transaction_log.input_args.emplace_back("doubleArray", ::android::internal::ToString(*doubleArray));
+    _transaction_log.input_args.emplace_back("stringValue", ::android::internal::ToString(stringValue));
+    _transaction_log.input_args.emplace_back("stringArray", ::android::internal::ToString(*stringArray));
+    _transaction_log.input_args.emplace_back("listValue", ::android::internal::ToString(*listValue));
+    _transaction_log.input_args.emplace_back("dataValue", ::android::internal::ToString(dataValue));
+    _transaction_log.input_args.emplace_back("binderValue", ::android::internal::ToString(binderValue));
+    _transaction_log.input_args.emplace_back("pfdValue", ::android::internal::ToString(*pfdValue));
+    _transaction_log.input_args.emplace_back("pfdArray", ::android::internal::ToString(*pfdArray));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeBool(boolValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeBoolVector(*boolArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(byteValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByteVector(*byteArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeChar(charValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeCharVector(*charArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(intValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32Vector(*intArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt64(longValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt64Vector(*longArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFloat(floatValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeFloatVector(*floatArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeDouble(doubleValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeDoubleVector(*doubleArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16(stringValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(*stringArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeString16Vector(*listValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(dataValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(binderValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeNullableParcelable(*pfdValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelableVector(*pfdArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnLoggableInterface::TRANSACTION_LogThis, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ILoggableInterface::getDefaultImpl())) {
+     return ILoggableInterface::getDefaultImpl()->LogThis(boolValue, boolArray, byteValue, byteArray, charValue, charArray, intValue, intArray, longValue, longArray, floatValue, floatArray, doubleValue, doubleArray, stringValue, stringArray, listValue, dataValue, binderValue, pfdValue, pfdArray, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readString16Vector(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readBoolVector(boolArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readByteVector(byteArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readCharVector(charArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readInt32Vector(intArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readInt64Vector(longArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readFloatVector(floatArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readDoubleVector(doubleArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readString16Vector(stringArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readString16Vector(listValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(pfdValue);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelableVector(pfdArray);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpLoggableInterface::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.loggable.ILoggableInterface";
+    _transaction_log.method_name = "LogThis";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.output_args.emplace_back("boolArray", ::android::internal::ToString(*boolArray));
+    _transaction_log.output_args.emplace_back("byteArray", ::android::internal::ToString(*byteArray));
+    _transaction_log.output_args.emplace_back("charArray", ::android::internal::ToString(*charArray));
+    _transaction_log.output_args.emplace_back("intArray", ::android::internal::ToString(*intArray));
+    _transaction_log.output_args.emplace_back("longArray", ::android::internal::ToString(*longArray));
+    _transaction_log.output_args.emplace_back("floatArray", ::android::internal::ToString(*floatArray));
+    _transaction_log.output_args.emplace_back("doubleArray", ::android::internal::ToString(*doubleArray));
+    _transaction_log.output_args.emplace_back("stringArray", ::android::internal::ToString(*stringArray));
+    _transaction_log.output_args.emplace_back("listValue", ::android::internal::ToString(*listValue));
+    _transaction_log.output_args.emplace_back("pfdValue", ::android::internal::ToString(*pfdValue));
+    _transaction_log.output_args.emplace_back("pfdArray", ::android::internal::ToString(*pfdArray));
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpLoggableInterface::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/loggable/BnLoggableInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+
+BnLoggableInterface::BnLoggableInterface()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnLoggableInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnLoggableInterface::TRANSACTION_LogThis:
+  {
+    bool in_boolValue;
+    ::std::vector<bool> in_boolArray;
+    int8_t in_byteValue;
+    ::std::vector<uint8_t> in_byteArray;
+    char16_t in_charValue;
+    ::std::vector<char16_t> in_charArray;
+    int32_t in_intValue;
+    ::std::vector<int32_t> in_intArray;
+    int64_t in_longValue;
+    ::std::vector<int64_t> in_longArray;
+    float in_floatValue;
+    ::std::vector<float> in_floatArray;
+    double in_doubleValue;
+    ::std::vector<double> in_doubleArray;
+    ::android::String16 in_stringValue;
+    ::std::vector<::android::String16> in_stringArray;
+    ::std::vector<::android::String16> in_listValue;
+    ::android::aidl::loggable::Data in_dataValue;
+    ::android::sp<::android::IBinder> in_binderValue;
+    ::std::optional<::android::os::ParcelFileDescriptor> in_pfdValue;
+    ::std::vector<::android::os::ParcelFileDescriptor> in_pfdArray;
+    ::std::vector<::android::String16> _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ILoggableInterface::LogThis::cppServer");
+    _aidl_ret_status = _aidl_data.readBool(&in_boolValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readBoolVector(&in_boolArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readByte(&in_byteValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readByteVector(&in_byteArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readChar(&in_charValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readCharVector(&in_charArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readInt32(&in_intValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readInt32Vector(&in_intArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readInt64(&in_longValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readInt64Vector(&in_longArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readFloat(&in_floatValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readFloatVector(&in_floatArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readDouble(&in_doubleValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readDoubleVector(&in_doubleArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readString16(&in_stringValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_stringArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readString16Vector(&in_listValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readParcelable(&in_dataValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readNullableStrongBinder(&in_binderValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readParcelable(&in_pfdValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_data.readParcelableVector(&in_pfdArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnLoggableInterface::TransactionLog _transaction_log;
+    if (BnLoggableInterface::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_boolValue", ::android::internal::ToString(in_boolValue));
+      _transaction_log.input_args.emplace_back("in_boolArray", ::android::internal::ToString(in_boolArray));
+      _transaction_log.input_args.emplace_back("in_byteValue", ::android::internal::ToString(in_byteValue));
+      _transaction_log.input_args.emplace_back("in_byteArray", ::android::internal::ToString(in_byteArray));
+      _transaction_log.input_args.emplace_back("in_charValue", ::android::internal::ToString(in_charValue));
+      _transaction_log.input_args.emplace_back("in_charArray", ::android::internal::ToString(in_charArray));
+      _transaction_log.input_args.emplace_back("in_intValue", ::android::internal::ToString(in_intValue));
+      _transaction_log.input_args.emplace_back("in_intArray", ::android::internal::ToString(in_intArray));
+      _transaction_log.input_args.emplace_back("in_longValue", ::android::internal::ToString(in_longValue));
+      _transaction_log.input_args.emplace_back("in_longArray", ::android::internal::ToString(in_longArray));
+      _transaction_log.input_args.emplace_back("in_floatValue", ::android::internal::ToString(in_floatValue));
+      _transaction_log.input_args.emplace_back("in_floatArray", ::android::internal::ToString(in_floatArray));
+      _transaction_log.input_args.emplace_back("in_doubleValue", ::android::internal::ToString(in_doubleValue));
+      _transaction_log.input_args.emplace_back("in_doubleArray", ::android::internal::ToString(in_doubleArray));
+      _transaction_log.input_args.emplace_back("in_stringValue", ::android::internal::ToString(in_stringValue));
+      _transaction_log.input_args.emplace_back("in_stringArray", ::android::internal::ToString(in_stringArray));
+      _transaction_log.input_args.emplace_back("in_listValue", ::android::internal::ToString(in_listValue));
+      _transaction_log.input_args.emplace_back("in_dataValue", ::android::internal::ToString(in_dataValue));
+      _transaction_log.input_args.emplace_back("in_binderValue", ::android::internal::ToString(in_binderValue));
+      _transaction_log.input_args.emplace_back("in_pfdValue", ::android::internal::ToString(in_pfdValue));
+      _transaction_log.input_args.emplace_back("in_pfdArray", ::android::internal::ToString(in_pfdArray));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(LogThis(in_boolValue, &in_boolArray, in_byteValue, &in_byteArray, in_charValue, &in_charArray, in_intValue, &in_intArray, in_longValue, &in_longArray, in_floatValue, &in_floatArray, in_doubleValue, &in_doubleArray, in_stringValue, &in_stringArray, &in_listValue, in_dataValue, in_binderValue, &in_pfdValue, &in_pfdArray, &_aidl_return));
+    if (BnLoggableInterface::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.loggable.ILoggableInterface";
+      _transaction_log.method_name = "LogThis";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.output_args.emplace_back("in_boolArray", ::android::internal::ToString(in_boolArray));
+      _transaction_log.output_args.emplace_back("in_byteArray", ::android::internal::ToString(in_byteArray));
+      _transaction_log.output_args.emplace_back("in_charArray", ::android::internal::ToString(in_charArray));
+      _transaction_log.output_args.emplace_back("in_intArray", ::android::internal::ToString(in_intArray));
+      _transaction_log.output_args.emplace_back("in_longArray", ::android::internal::ToString(in_longArray));
+      _transaction_log.output_args.emplace_back("in_floatArray", ::android::internal::ToString(in_floatArray));
+      _transaction_log.output_args.emplace_back("in_doubleArray", ::android::internal::ToString(in_doubleArray));
+      _transaction_log.output_args.emplace_back("in_stringArray", ::android::internal::ToString(in_stringArray));
+      _transaction_log.output_args.emplace_back("in_listValue", ::android::internal::ToString(in_listValue));
+      _transaction_log.output_args.emplace_back("in_pfdValue", ::android::internal::ToString(in_pfdValue));
+      _transaction_log.output_args.emplace_back("in_pfdArray", ::android::internal::ToString(in_pfdArray));
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      BnLoggableInterface::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16Vector(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeBoolVector(in_boolArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByteVector(in_byteArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeCharVector(in_charArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt32Vector(in_intArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeInt64Vector(in_longArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeFloatVector(in_floatArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeDoubleVector(in_doubleArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16Vector(in_stringArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeString16Vector(in_listValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeNullableParcelable(in_pfdValue);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelableVector(in_pfdArray);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+std::function<void(const BnLoggableInterface::TransactionLog&)> BnLoggableInterface::logFunc;
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/loggable/ILoggableInterface.h>
+#include <android/aidl/loggable/ILoggableInterface.h>
+namespace android {
+namespace aidl {
+namespace loggable {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ILoggableInterface, Sub, "android.aidl.loggable.ILoggableInterface.ISub")
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/loggable/ILoggableInterface.h>
+#include <android/aidl/loggable/ILoggableInterface.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+
+ILoggableInterface::BpSub::BpSub(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<ISub>(_aidl_impl){
+}
+
+std::function<void(const ILoggableInterface::BpSub::TransactionLog&)> ILoggableInterface::BpSub::logFunc;
+
+::android::binder::Status ILoggableInterface::BpSub::Log(int32_t value) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ISub::Log::cppClient");
+  ILoggableInterface::BpSub::TransactionLog _transaction_log;
+  if (ILoggableInterface::BpSub::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("value", ::android::internal::ToString(value));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeInt32(value);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ILoggableInterface::BnSub::TRANSACTION_Log, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ISub::getDefaultImpl())) {
+     return ISub::getDefaultImpl()->Log(value);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (ILoggableInterface::BpSub::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.loggable.ILoggableInterface.ISub";
+    _transaction_log.method_name = "Log";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    ILoggableInterface::BpSub::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/loggable/ILoggableInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+
+ILoggableInterface::BnSub::BnSub()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ILoggableInterface::BnSub::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnSub::TRANSACTION_Log:
+  {
+    int32_t in_value;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ISub::Log::cppServer");
+    _aidl_ret_status = _aidl_data.readInt32(&in_value);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    ILoggableInterface::BnSub::TransactionLog _transaction_log;
+    if (ILoggableInterface::BnSub::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_value", ::android::internal::ToString(in_value));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(Log(in_value));
+    if (ILoggableInterface::BnSub::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.loggable.ILoggableInterface.ISub";
+      _transaction_log.method_name = "Log";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      ILoggableInterface::BnSub::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+std::function<void(const ILoggableInterface::BnSub::TransactionLog&)> ILoggableInterface::BnSub::logFunc;
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/ILoggableInterface.cpp.d b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/ILoggableInterface.cpp.d
new file mode 100644
index 0000000..ac79ae8
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/ILoggableInterface.cpp.d
@@ -0,0 +1,5 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/ILoggableInterface.cpp : \
+  system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Data.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Union.cpp b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Union.cpp
new file mode 100644
index 0000000..416cbdc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Union.cpp
@@ -0,0 +1,49 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+#include <android/aidl/loggable/Union.h>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+::android::status_t Union::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case num: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<num>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<num>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case str: {
+    ::std::string _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readUtf8FromUtf16(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<::std::string>) {
+      set<str>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<str>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t Union::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case num: return _aidl_parcel->writeInt32(get<num>());
+  case str: return _aidl_parcel->writeUtf8AsUtf16(get<str>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Union.cpp.d b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Union.cpp.d
new file mode 100644
index 0000000..b8cc8a5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Union.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/android/aidl/loggable/Union.cpp : \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnData.h b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnData.h
new file mode 100644
index 0000000..ad100b0
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnData.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Data.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnEnum.h b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnEnum.h
new file mode 100644
index 0000000..0dfbfb9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Enum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnLoggableInterface.h b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnLoggableInterface.h
new file mode 100644
index 0000000..8aa6cce
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnLoggableInterface.h
@@ -0,0 +1,54 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/ILoggableInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/loggable/ILoggableInterface.h>
+#include <functional>
+#include <android/binder_to_string.h>
+#include <android/aidl/loggable/BnLoggableInterface.h>
+#include <android/aidl/loggable/ILoggableInterface.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace loggable {
+class BnLoggableInterface : public ::android::BnInterface<ILoggableInterface> {
+public:
+  static constexpr uint32_t TRANSACTION_LogThis = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  explicit BnLoggableInterface();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+};  // class BnLoggableInterface
+
+class ILoggableInterfaceDelegator : public BnLoggableInterface {
+public:
+  explicit ILoggableInterfaceDelegator(const ::android::sp<ILoggableInterface> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<ILoggableInterface> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status LogThis(bool boolValue, ::std::vector<bool>* boolArray, int8_t byteValue, ::std::vector<uint8_t>* byteArray, char16_t charValue, ::std::vector<char16_t>* charArray, int32_t intValue, ::std::vector<int32_t>* intArray, int64_t longValue, ::std::vector<int64_t>* longArray, float floatValue, ::std::vector<float>* floatArray, double doubleValue, ::std::vector<double>* doubleArray, const ::android::String16& stringValue, ::std::vector<::android::String16>* stringArray, ::std::vector<::android::String16>* listValue, const ::android::aidl::loggable::Data& dataValue, const ::android::sp<::android::IBinder>& binderValue, ::std::optional<::android::os::ParcelFileDescriptor>* pfdValue, ::std::vector<::android::os::ParcelFileDescriptor>* pfdArray, ::std::vector<::android::String16>* _aidl_return) override {
+    return _aidl_delegate->LogThis(boolValue, boolArray, byteValue, byteArray, charValue, charArray, intValue, intArray, longValue, longArray, floatValue, floatArray, doubleValue, doubleArray, stringValue, stringArray, listValue, dataValue, binderValue, pfdValue, pfdArray, _aidl_return);
+  }
+private:
+  ::android::sp<ILoggableInterface> _aidl_delegate;
+};  // class ILoggableInterfaceDelegator
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnUnion.h b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnUnion.h
new file mode 100644
index 0000000..08b0b5f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BnUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bn classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpData.h b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpData.h
new file mode 100644
index 0000000..c9cdd22
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpData.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Data.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpEnum.h b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpEnum.h
new file mode 100644
index 0000000..135a2fc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Enum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpLoggableInterface.h b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpLoggableInterface.h
new file mode 100644
index 0000000..6b8e370
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpLoggableInterface.h
@@ -0,0 +1,40 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/ILoggableInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/loggable/ILoggableInterface.h>
+#include <functional>
+#include <android/binder_to_string.h>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+class BpLoggableInterface : public ::android::BpInterface<ILoggableInterface> {
+public:
+  explicit BpLoggableInterface(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpLoggableInterface() = default;
+  ::android::binder::Status LogThis(bool boolValue, ::std::vector<bool>* boolArray, int8_t byteValue, ::std::vector<uint8_t>* byteArray, char16_t charValue, ::std::vector<char16_t>* charArray, int32_t intValue, ::std::vector<int32_t>* intArray, int64_t longValue, ::std::vector<int64_t>* longArray, float floatValue, ::std::vector<float>* floatArray, double doubleValue, ::std::vector<double>* doubleArray, const ::android::String16& stringValue, ::std::vector<::android::String16>* stringArray, ::std::vector<::android::String16>* listValue, const ::android::aidl::loggable::Data& dataValue, const ::android::sp<::android::IBinder>& binderValue, ::std::optional<::android::os::ParcelFileDescriptor>* pfdValue, ::std::vector<::android::os::ParcelFileDescriptor>* pfdArray, ::std::vector<::android::String16>* _aidl_return) override;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+};  // class BpLoggableInterface
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpUnion.h b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpUnion.h
new file mode 100644
index 0000000..30144bf
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/BpUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+#error TODO(b/111362593) parcelables do not have bp classes
\ No newline at end of file
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Data.h b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Data.h
new file mode 100644
index 0000000..08fb469
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Data.h
@@ -0,0 +1,64 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Data.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+#pragma once
+
+#include <android/aidl/loggable/Enum.h>
+#include <android/aidl/loggable/Union.h>
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cstdint>
+#include <string>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+class Data : public ::android::Parcelable {
+public:
+  int32_t num = 0;
+  ::std::string str;
+  ::android::aidl::loggable::Union nestedUnion;
+  ::android::aidl::loggable::Enum nestedEnum = ::android::aidl::loggable::Enum::FOO;
+  inline bool operator!=(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) != std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator<(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) < std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator<=(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) <= std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator==(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) == std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator>(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) > std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator>=(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) >= std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.loggable.Data");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Data{";
+    os << "num: " << ::android::internal::ToString(num);
+    os << ", str: " << ::android::internal::ToString(str);
+    os << ", nestedUnion: " << ::android::internal::ToString(nestedUnion);
+    os << ", nestedEnum: " << ::android::internal::ToString(nestedEnum);
+    os << "}";
+    return os.str();
+  }
+};  // class Data
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Enum.h b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Enum.h
new file mode 100644
index 0000000..c9fbc1a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Enum.h
@@ -0,0 +1,45 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Enum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <binder/Enums.h>
+#include <cstdint>
+#include <string>
+
+namespace android {
+namespace aidl {
+namespace loggable {
+enum class Enum : int8_t {
+  FOO = 42,
+};
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace loggable {
+[[nodiscard]] static inline std::string toString(Enum val) {
+  switch(val) {
+  case Enum::FOO:
+    return "FOO";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::loggable::Enum, 1> enum_values<::android::aidl::loggable::Enum> = {
+  ::android::aidl::loggable::Enum::FOO,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/ILoggableInterface.h b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/ILoggableInterface.h
new file mode 100644
index 0000000..8c766f7
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/ILoggableInterface.h
@@ -0,0 +1,120 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/ILoggableInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+#pragma once
+
+#include <android/aidl/loggable/Data.h>
+#include <android/binder_to_string.h>
+#include <binder/Delegate.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/ParcelFileDescriptor.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cstdint>
+#include <functional>
+#include <optional>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <vector>
+
+namespace android::aidl::loggable {
+class Data;
+}  // namespace android::aidl::loggable
+namespace android {
+namespace aidl {
+namespace loggable {
+class ILoggableInterfaceDelegator;
+
+class ILoggableInterface : public ::android::IInterface {
+public:
+  typedef ILoggableInterfaceDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(LoggableInterface)
+  class ISubDelegator;
+
+  class ISub : public ::android::IInterface {
+  public:
+    typedef ISubDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(Sub)
+    virtual ::android::binder::Status Log(int32_t value) = 0;
+  };  // class ISub
+
+  class ISubDefault : public ISub {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+    ::android::binder::Status Log(int32_t /*value*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+  };  // class ISubDefault
+  class BpSub : public ::android::BpInterface<ISub> {
+  public:
+    explicit BpSub(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpSub() = default;
+    ::android::binder::Status Log(int32_t value) override;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  };  // class BpSub
+  class BnSub : public ::android::BnInterface<ISub> {
+  public:
+    static constexpr uint32_t TRANSACTION_Log = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+    explicit BnSub();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  };  // class BnSub
+
+  class ISubDelegator : public BnSub {
+  public:
+    explicit ISubDelegator(const ::android::sp<ISub> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<ISub> getImpl() { return _aidl_delegate; }
+    ::android::binder::Status Log(int32_t value) override {
+      return _aidl_delegate->Log(value);
+    }
+  private:
+    ::android::sp<ISub> _aidl_delegate;
+  };  // class ISubDelegator
+  virtual ::android::binder::Status LogThis(bool boolValue, ::std::vector<bool>* boolArray, int8_t byteValue, ::std::vector<uint8_t>* byteArray, char16_t charValue, ::std::vector<char16_t>* charArray, int32_t intValue, ::std::vector<int32_t>* intArray, int64_t longValue, ::std::vector<int64_t>* longArray, float floatValue, ::std::vector<float>* floatArray, double doubleValue, ::std::vector<double>* doubleArray, const ::android::String16& stringValue, ::std::vector<::android::String16>* stringArray, ::std::vector<::android::String16>* listValue, const ::android::aidl::loggable::Data& dataValue, const ::android::sp<::android::IBinder>& binderValue, ::std::optional<::android::os::ParcelFileDescriptor>* pfdValue, ::std::vector<::android::os::ParcelFileDescriptor>* pfdArray, ::std::vector<::android::String16>* _aidl_return) = 0;
+};  // class ILoggableInterface
+
+class ILoggableInterfaceDefault : public ILoggableInterface {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status LogThis(bool /*boolValue*/, ::std::vector<bool>* /*boolArray*/, int8_t /*byteValue*/, ::std::vector<uint8_t>* /*byteArray*/, char16_t /*charValue*/, ::std::vector<char16_t>* /*charArray*/, int32_t /*intValue*/, ::std::vector<int32_t>* /*intArray*/, int64_t /*longValue*/, ::std::vector<int64_t>* /*longArray*/, float /*floatValue*/, ::std::vector<float>* /*floatArray*/, double /*doubleValue*/, ::std::vector<double>* /*doubleArray*/, const ::android::String16& /*stringValue*/, ::std::vector<::android::String16>* /*stringArray*/, ::std::vector<::android::String16>* /*listValue*/, const ::android::aidl::loggable::Data& /*dataValue*/, const ::android::sp<::android::IBinder>& /*binderValue*/, ::std::optional<::android::os::ParcelFileDescriptor>* /*pfdValue*/, ::std::vector<::android::os::ParcelFileDescriptor>* /*pfdArray*/, ::std::vector<::android::String16>* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+};  // class ILoggableInterfaceDefault
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Union.h b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Union.h
new file mode 100644
index 0000000..083c9f2
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/include/android/aidl/loggable/Union.h
@@ -0,0 +1,150 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging/android/aidl/loggable/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-cpp-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Enums.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <cassert>
+#include <cstdint>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace loggable {
+class Union : public ::android::Parcelable {
+public:
+  enum class Tag : int32_t {
+    num = 0,
+    str = 1,
+  };
+  // Expose tag symbols for legacy code
+  static const inline Tag num = Tag::num;
+  static const inline Tag str = Tag::str;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, Union>;
+
+  Union() : _value(std::in_place_index<static_cast<size_t>(num)>, int32_t(43)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr Union(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit Union(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static Union make(_Tp&&... _args) {
+    return Union(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static Union make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return Union(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  inline bool operator!=(const Union& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const Union& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const Union& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const Union& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const Union& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const Union& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+  ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+  static const ::android::String16& getParcelableDescriptor() {
+    static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.loggable.Union");
+    return DESCRIPTOR;
+  }
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Union{";
+    switch (getTag()) {
+    case num: os << "num: " << ::android::internal::ToString(get<num>()); break;
+    case str: os << "str: " << ::android::internal::ToString(get<str>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t, ::std::string> _value;
+};  // class Union
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace loggable {
+[[nodiscard]] static inline std::string toString(Union::Tag val) {
+  switch(val) {
+  case Union::Tag::num:
+    return "num";
+  case Union::Tag::str:
+    return "str";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::loggable::Union::Tag, 2> enum_values<::android::aidl::loggable::Union::Tag> = {
+  ::android::aidl::loggable::Union::Tag::num,
+  ::android::aidl::loggable::Union::Tag::str,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/timestamp b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-cpp-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Data.java b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Data.java
new file mode 100644
index 0000000..823be4d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Data.java
@@ -0,0 +1,71 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Data.java.d -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+package android.aidl.loggable;
+public class Data implements android.os.Parcelable
+{
+  public int num = 0;
+  public java.lang.String str;
+  public android.aidl.loggable.Union nestedUnion;
+  public byte nestedEnum = android.aidl.loggable.Enum.FOO;
+  public static final android.os.Parcelable.Creator<Data> CREATOR = new android.os.Parcelable.Creator<Data>() {
+    @Override
+    public Data createFromParcel(android.os.Parcel _aidl_source) {
+      Data _aidl_out = new Data();
+      _aidl_out.readFromParcel(_aidl_source);
+      return _aidl_out;
+    }
+    @Override
+    public Data[] newArray(int _aidl_size) {
+      return new Data[_aidl_size];
+    }
+  };
+  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.writeInt(0);
+    _aidl_parcel.writeInt(num);
+    _aidl_parcel.writeString(str);
+    _aidl_parcel.writeTypedObject(nestedUnion, _aidl_flag);
+    _aidl_parcel.writeByte(nestedEnum);
+    int _aidl_end_pos = _aidl_parcel.dataPosition();
+    _aidl_parcel.setDataPosition(_aidl_start_pos);
+    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+    _aidl_parcel.setDataPosition(_aidl_end_pos);
+  }
+  public final void readFromParcel(android.os.Parcel _aidl_parcel)
+  {
+    int _aidl_start_pos = _aidl_parcel.dataPosition();
+    int _aidl_parcelable_size = _aidl_parcel.readInt();
+    try {
+      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      num = _aidl_parcel.readInt();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      str = _aidl_parcel.readString();
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      nestedUnion = _aidl_parcel.readTypedObject(android.aidl.loggable.Union.CREATOR);
+      if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+      nestedEnum = _aidl_parcel.readByte();
+    } finally {
+      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+      }
+      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    }
+  }
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    _mask |= describeContents(nestedUnion);
+    return _mask;
+  }
+  private int describeContents(Object _v) {
+    if (_v == null) return 0;
+    if (_v instanceof android.os.Parcelable) {
+      return ((android.os.Parcelable) _v).describeContents();
+    }
+    return 0;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Data.java.d b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Data.java.d
new file mode 100644
index 0000000..61f3c1e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Data.java.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Data.java : \
+  system/tools/aidl/tests/android/aidl/loggable/Data.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Enum.java b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Enum.java
new file mode 100644
index 0000000..8720f37
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Enum.java
@@ -0,0 +1,8 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Enum.java.d -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+package android.aidl.loggable;
+public @interface Enum {
+  public static final byte FOO = 42;
+}
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Enum.java.d b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Enum.java.d
new file mode 100644
index 0000000..0f2fb6f
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Enum.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Enum.java : \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/ILoggableInterface.java b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/ILoggableInterface.java
new file mode 100644
index 0000000..c716605
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/ILoggableInterface.java
@@ -0,0 +1,352 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/ILoggableInterface.java.d -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+package android.aidl.loggable;
+public interface ILoggableInterface extends android.os.IInterface
+{
+  /** Default implementation for ILoggableInterface. */
+  public static class Default implements android.aidl.loggable.ILoggableInterface
+  {
+    @Override public java.lang.String[] LogThis(boolean boolValue, boolean[] boolArray, byte byteValue, byte[] byteArray, char charValue, char[] charArray, int intValue, int[] intArray, long longValue, long[] longArray, float floatValue, float[] floatArray, double doubleValue, double[] doubleArray, java.lang.String stringValue, java.lang.String[] stringArray, java.util.List<java.lang.String> listValue, android.aidl.loggable.Data dataValue, android.os.IBinder binderValue, android.os.ParcelFileDescriptor pfdValue, android.os.ParcelFileDescriptor[] pfdArray) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.loggable.ILoggableInterface
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.loggable.ILoggableInterface interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.loggable.ILoggableInterface asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.loggable.ILoggableInterface))) {
+        return ((android.aidl.loggable.ILoggableInterface)iin);
+      }
+      return new android.aidl.loggable.ILoggableInterface.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_LogThis:
+        {
+          return "LogThis";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_LogThis:
+        {
+          boolean _arg0;
+          _arg0 = data.readBoolean();
+          boolean[] _arg1;
+          _arg1 = data.createBooleanArray();
+          byte _arg2;
+          _arg2 = data.readByte();
+          byte[] _arg3;
+          _arg3 = data.createByteArray();
+          char _arg4;
+          _arg4 = (char)data.readInt();
+          char[] _arg5;
+          _arg5 = data.createCharArray();
+          int _arg6;
+          _arg6 = data.readInt();
+          int[] _arg7;
+          _arg7 = data.createIntArray();
+          long _arg8;
+          _arg8 = data.readLong();
+          long[] _arg9;
+          _arg9 = data.createLongArray();
+          float _arg10;
+          _arg10 = data.readFloat();
+          float[] _arg11;
+          _arg11 = data.createFloatArray();
+          double _arg12;
+          _arg12 = data.readDouble();
+          double[] _arg13;
+          _arg13 = data.createDoubleArray();
+          java.lang.String _arg14;
+          _arg14 = data.readString();
+          java.lang.String[] _arg15;
+          _arg15 = data.createStringArray();
+          java.util.List<java.lang.String> _arg16;
+          _arg16 = data.createStringArrayList();
+          android.aidl.loggable.Data _arg17;
+          _arg17 = data.readTypedObject(android.aidl.loggable.Data.CREATOR);
+          android.os.IBinder _arg18;
+          _arg18 = data.readStrongBinder();
+          android.os.ParcelFileDescriptor _arg19;
+          _arg19 = data.readTypedObject(android.os.ParcelFileDescriptor.CREATOR);
+          android.os.ParcelFileDescriptor[] _arg20;
+          _arg20 = data.createTypedArray(android.os.ParcelFileDescriptor.CREATOR);
+          data.enforceNoDataAvail();
+          java.lang.String[] _result = this.LogThis(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15, _arg16, _arg17, _arg18, _arg19, _arg20);
+          reply.writeNoException();
+          reply.writeStringArray(_result);
+          reply.writeBooleanArray(_arg1);
+          reply.writeByteArray(_arg3);
+          reply.writeCharArray(_arg5);
+          reply.writeIntArray(_arg7);
+          reply.writeLongArray(_arg9);
+          reply.writeFloatArray(_arg11);
+          reply.writeDoubleArray(_arg13);
+          reply.writeStringArray(_arg15);
+          reply.writeStringList(_arg16);
+          reply.writeTypedObject(_arg19, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          reply.writeTypedArray(_arg20, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.loggable.ILoggableInterface
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public java.lang.String[] LogThis(boolean boolValue, boolean[] boolArray, byte byteValue, byte[] byteArray, char charValue, char[] charArray, int intValue, int[] intArray, long longValue, long[] longArray, float floatValue, float[] floatArray, double doubleValue, double[] doubleArray, java.lang.String stringValue, java.lang.String[] stringArray, java.util.List<java.lang.String> listValue, android.aidl.loggable.Data dataValue, android.os.IBinder binderValue, android.os.ParcelFileDescriptor pfdValue, android.os.ParcelFileDescriptor[] pfdArray) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        java.lang.String[] _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeBoolean(boolValue);
+          _data.writeBooleanArray(boolArray);
+          _data.writeByte(byteValue);
+          _data.writeByteArray(byteArray);
+          _data.writeInt(((int)charValue));
+          _data.writeCharArray(charArray);
+          _data.writeInt(intValue);
+          _data.writeIntArray(intArray);
+          _data.writeLong(longValue);
+          _data.writeLongArray(longArray);
+          _data.writeFloat(floatValue);
+          _data.writeFloatArray(floatArray);
+          _data.writeDouble(doubleValue);
+          _data.writeDoubleArray(doubleArray);
+          _data.writeString(stringValue);
+          _data.writeStringArray(stringArray);
+          _data.writeStringList(listValue);
+          _data.writeTypedObject(dataValue, 0);
+          _data.writeStrongBinder(binderValue);
+          _data.writeTypedObject(pfdValue, 0);
+          _data.writeTypedArray(pfdArray, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_LogThis, _data, _reply, 0);
+          _reply.readException();
+          _result = _reply.createStringArray();
+          _reply.readBooleanArray(boolArray);
+          _reply.readByteArray(byteArray);
+          _reply.readCharArray(charArray);
+          _reply.readIntArray(intArray);
+          _reply.readLongArray(longArray);
+          _reply.readFloatArray(floatArray);
+          _reply.readDoubleArray(doubleArray);
+          _reply.readStringArray(stringArray);
+          _reply.readStringList(listValue);
+          if ((0!=_reply.readInt())) {
+            pfdValue = android.os.ParcelFileDescriptor.CREATOR.createFromParcel(_reply);
+          }
+          _reply.readTypedArray(pfdArray, android.os.ParcelFileDescriptor.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+    }
+    static final int TRANSACTION_LogThis = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 0;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android.aidl.loggable.ILoggableInterface";
+  public java.lang.String[] LogThis(boolean boolValue, boolean[] boolArray, byte byteValue, byte[] byteArray, char charValue, char[] charArray, int intValue, int[] intArray, long longValue, long[] longArray, float floatValue, float[] floatArray, double doubleValue, double[] doubleArray, java.lang.String stringValue, java.lang.String[] stringArray, java.util.List<java.lang.String> listValue, android.aidl.loggable.Data dataValue, android.os.IBinder binderValue, android.os.ParcelFileDescriptor pfdValue, android.os.ParcelFileDescriptor[] pfdArray) throws android.os.RemoteException;
+  public interface ISub extends android.os.IInterface
+  {
+    /** Default implementation for ISub. */
+    public static class Default implements android.aidl.loggable.ILoggableInterface.ISub
+    {
+      @Override public void Log(int value) throws android.os.RemoteException
+      {
+      }
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.loggable.ILoggableInterface.ISub
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.loggable.ILoggableInterface.ISub interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.loggable.ILoggableInterface.ISub asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.loggable.ILoggableInterface.ISub))) {
+          return ((android.aidl.loggable.ILoggableInterface.ISub)iin);
+        }
+        return new android.aidl.loggable.ILoggableInterface.ISub.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      /** @hide */
+      public static java.lang.String getDefaultTransactionName(int transactionCode)
+      {
+        switch (transactionCode)
+        {
+          case TRANSACTION_Log:
+          {
+            return "Log";
+          }
+          default:
+          {
+            return null;
+          }
+        }
+      }
+      /** @hide */
+      public java.lang.String getTransactionName(int transactionCode)
+      {
+        return this.getDefaultTransactionName(transactionCode);
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+          data.enforceInterface(descriptor);
+        }
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        switch (code)
+        {
+          case TRANSACTION_Log:
+          {
+            int _arg0;
+            _arg0 = data.readInt();
+            data.enforceNoDataAvail();
+            this.Log(_arg0);
+            reply.writeNoException();
+            break;
+          }
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+        return true;
+      }
+      private static class Proxy implements android.aidl.loggable.ILoggableInterface.ISub
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+        @Override public void Log(int value) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeInt(value);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_Log, _data, _reply, 0);
+            _reply.readException();
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+        }
+      }
+      static final int TRANSACTION_Log = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+      /** @hide */
+      public int getMaxTransactionId()
+      {
+        return 0;
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android.aidl.loggable.ILoggableInterface.ISub";
+    public void Log(int value) throws android.os.RemoteException;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/ILoggableInterface.java.d b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/ILoggableInterface.java.d
new file mode 100644
index 0000000..670f2c1
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/ILoggableInterface.java.d
@@ -0,0 +1,5 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/ILoggableInterface.java : \
+  system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Data.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Union.java b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Union.java
new file mode 100644
index 0000000..999c2c9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Union.java
@@ -0,0 +1,135 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Union.java.d -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+package android.aidl.loggable;
+public final class Union implements android.os.Parcelable {
+  // tags for union fields
+  public final static int num = 0;  // int num;
+  public final static int str = 1;  // String str;
+
+  private int _tag;
+  private Object _value;
+
+  public Union() {
+    int _value = 43;
+    this._tag = num;
+    this._value = _value;
+  }
+
+  private Union(android.os.Parcel _aidl_parcel) {
+    readFromParcel(_aidl_parcel);
+  }
+
+  private Union(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+
+  public int getTag() {
+    return _tag;
+  }
+
+  // int num;
+
+  public static Union num(int _value) {
+    return new Union(num, _value);
+  }
+
+  public int getNum() {
+    _assertTag(num);
+    return (int) _value;
+  }
+
+  public void setNum(int _value) {
+    _set(num, _value);
+  }
+
+  // String str;
+
+  public static Union str(java.lang.String _value) {
+    return new Union(str, _value);
+  }
+
+  public java.lang.String getStr() {
+    _assertTag(str);
+    return (java.lang.String) _value;
+  }
+
+  public void setStr(java.lang.String _value) {
+    _set(str, _value);
+  }
+
+  public static final android.os.Parcelable.Creator<Union> CREATOR = new android.os.Parcelable.Creator<Union>() {
+    @Override
+    public Union createFromParcel(android.os.Parcel _aidl_source) {
+      return new Union(_aidl_source);
+    }
+    @Override
+    public Union[] newArray(int _aidl_size) {
+      return new Union[_aidl_size];
+    }
+  };
+
+  @Override
+  public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+    _aidl_parcel.writeInt(_tag);
+    switch (_tag) {
+    case num:
+      _aidl_parcel.writeInt(getNum());
+      break;
+    case str:
+      _aidl_parcel.writeString(getStr());
+      break;
+    }
+  }
+
+  public void readFromParcel(android.os.Parcel _aidl_parcel) {
+    int _aidl_tag;
+    _aidl_tag = _aidl_parcel.readInt();
+    switch (_aidl_tag) {
+    case num: {
+      int _aidl_value;
+      _aidl_value = _aidl_parcel.readInt();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    case str: {
+      java.lang.String _aidl_value;
+      _aidl_value = _aidl_parcel.readString();
+      _set(_aidl_tag, _aidl_value);
+      return; }
+    }
+    throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+  }
+
+  @Override
+  public int describeContents() {
+    int _mask = 0;
+    switch (getTag()) {
+    }
+    return _mask;
+  }
+
+  private void _assertTag(int tag) {
+    if (getTag() != tag) {
+      throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+    }
+  }
+
+  private String _tagString(int _tag) {
+    switch (_tag) {
+    case num: return "num";
+    case str: return "str";
+    }
+    throw new IllegalStateException("unknown field: " + _tag);
+  }
+
+  private void _set(int _tag, Object _value) {
+    this._tag = _tag;
+    this._value = _value;
+  }
+  public static @interface Tag {
+    public static final int num = 0;
+    public static final int str = 1;
+  }
+}
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Union.java.d b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Union.java.d
new file mode 100644
index 0000000..2059f00
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Union.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-java-source/gen/android/aidl/loggable/Union.java : \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/timestamp b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-java-source/gen/timestamp
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Data.cpp b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Data.cpp
new file mode 100644
index 0000000..9236aa9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Data.cpp
@@ -0,0 +1,83 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Data.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+#include "aidl/android/aidl/loggable/Data.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+const char* Data::descriptor = "android.aidl.loggable.Data";
+
+binder_status_t Data::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &num);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &str);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &nestedUnion);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &nestedEnum);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t Data::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, num);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, str);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, nestedUnion);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, nestedEnum);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Data.cpp.d b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Data.cpp.d
new file mode 100644
index 0000000..fbb8a7e
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Data.cpp.d
@@ -0,0 +1,4 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Data.cpp : \
+  system/tools/aidl/tests/android/aidl/loggable/Data.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Enum.cpp b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Enum.cpp
new file mode 100644
index 0000000..2064dc0
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Enum.cpp
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Enum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Enum.cpp.d b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Enum.cpp.d
new file mode 100644
index 0000000..2060e60
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Enum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Enum.cpp : \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/ILoggableInterface.cpp b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/ILoggableInterface.cpp
new file mode 100644
index 0000000..0207903
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/ILoggableInterface.cpp
@@ -0,0 +1,663 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/ILoggableInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+#include "aidl/android/aidl/loggable/ILoggableInterface.h"
+
+#include <android/binder_parcel_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/loggable/BnLoggableInterface.h>
+#include <aidl/android/aidl/loggable/BpLoggableInterface.h>
+
+namespace {
+struct ScopedTrace {
+  inline explicit ScopedTrace(const char* name) { ATrace_beginSection(name); }
+  inline ~ScopedTrace() { ATrace_endSection(); }
+};
+}  // namespace
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+static binder_status_t _aidl_android_aidl_loggable_ILoggableInterface_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnLoggableInterface> _aidl_impl = std::static_pointer_cast<BnLoggableInterface>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*LogThis*/): {
+      bool in_boolValue;
+      std::vector<bool> in_boolArray;
+      int8_t in_byteValue;
+      std::vector<uint8_t> in_byteArray;
+      char16_t in_charValue;
+      std::vector<char16_t> in_charArray;
+      int32_t in_intValue;
+      std::vector<int32_t> in_intArray;
+      int64_t in_longValue;
+      std::vector<int64_t> in_longArray;
+      float in_floatValue;
+      std::vector<float> in_floatArray;
+      double in_doubleValue;
+      std::vector<double> in_doubleArray;
+      std::string in_stringValue;
+      std::vector<std::string> in_stringArray;
+      std::vector<std::string> in_listValue;
+      ::aidl::android::aidl::loggable::Data in_dataValue;
+      ::ndk::SpAIBinder in_binderValue;
+      ::ndk::ScopedFileDescriptor in_pfdValue;
+      std::vector<::ndk::ScopedFileDescriptor> in_pfdArray;
+      std::vector<std::string> _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ILoggableInterface::LogThis::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_boolValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_boolArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_byteValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_byteArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_charValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_charArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_intValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_intArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_longValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_longArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_floatValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_floatArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_doubleValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_doubleArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_stringValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_stringArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_listValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_dataValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_binderValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_in, &in_pfdValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_pfdArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnLoggableInterface::TransactionLog _transaction_log;
+      if (BnLoggableInterface::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_boolValue", ::android::internal::ToString(in_boolValue));
+        _transaction_log.input_args.emplace_back("in_boolArray", ::android::internal::ToString(in_boolArray));
+        _transaction_log.input_args.emplace_back("in_byteValue", ::android::internal::ToString(in_byteValue));
+        _transaction_log.input_args.emplace_back("in_byteArray", ::android::internal::ToString(in_byteArray));
+        _transaction_log.input_args.emplace_back("in_charValue", ::android::internal::ToString(in_charValue));
+        _transaction_log.input_args.emplace_back("in_charArray", ::android::internal::ToString(in_charArray));
+        _transaction_log.input_args.emplace_back("in_intValue", ::android::internal::ToString(in_intValue));
+        _transaction_log.input_args.emplace_back("in_intArray", ::android::internal::ToString(in_intArray));
+        _transaction_log.input_args.emplace_back("in_longValue", ::android::internal::ToString(in_longValue));
+        _transaction_log.input_args.emplace_back("in_longArray", ::android::internal::ToString(in_longArray));
+        _transaction_log.input_args.emplace_back("in_floatValue", ::android::internal::ToString(in_floatValue));
+        _transaction_log.input_args.emplace_back("in_floatArray", ::android::internal::ToString(in_floatArray));
+        _transaction_log.input_args.emplace_back("in_doubleValue", ::android::internal::ToString(in_doubleValue));
+        _transaction_log.input_args.emplace_back("in_doubleArray", ::android::internal::ToString(in_doubleArray));
+        _transaction_log.input_args.emplace_back("in_stringValue", ::android::internal::ToString(in_stringValue));
+        _transaction_log.input_args.emplace_back("in_stringArray", ::android::internal::ToString(in_stringArray));
+        _transaction_log.input_args.emplace_back("in_listValue", ::android::internal::ToString(in_listValue));
+        _transaction_log.input_args.emplace_back("in_dataValue", ::android::internal::ToString(in_dataValue));
+        _transaction_log.input_args.emplace_back("in_binderValue", ::android::internal::ToString(in_binderValue));
+        _transaction_log.input_args.emplace_back("in_pfdValue", ::android::internal::ToString(in_pfdValue));
+        _transaction_log.input_args.emplace_back("in_pfdArray", ::android::internal::ToString(in_pfdArray));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->LogThis(in_boolValue, &in_boolArray, in_byteValue, &in_byteArray, in_charValue, &in_charArray, in_intValue, &in_intArray, in_longValue, &in_longArray, in_floatValue, &in_floatArray, in_doubleValue, &in_doubleArray, in_stringValue, &in_stringArray, &in_listValue, in_dataValue, in_binderValue, &in_pfdValue, &in_pfdArray, &_aidl_return);
+      if (BnLoggableInterface::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.loggable.ILoggableInterface";
+        _transaction_log.method_name = "LogThis";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.output_args.emplace_back("in_boolArray", ::android::internal::ToString(in_boolArray));
+        _transaction_log.output_args.emplace_back("in_byteArray", ::android::internal::ToString(in_byteArray));
+        _transaction_log.output_args.emplace_back("in_charArray", ::android::internal::ToString(in_charArray));
+        _transaction_log.output_args.emplace_back("in_intArray", ::android::internal::ToString(in_intArray));
+        _transaction_log.output_args.emplace_back("in_longArray", ::android::internal::ToString(in_longArray));
+        _transaction_log.output_args.emplace_back("in_floatArray", ::android::internal::ToString(in_floatArray));
+        _transaction_log.output_args.emplace_back("in_doubleArray", ::android::internal::ToString(in_doubleArray));
+        _transaction_log.output_args.emplace_back("in_stringArray", ::android::internal::ToString(in_stringArray));
+        _transaction_log.output_args.emplace_back("in_listValue", ::android::internal::ToString(in_listValue));
+        _transaction_log.output_args.emplace_back("in_pfdValue", ::android::internal::ToString(in_pfdValue));
+        _transaction_log.output_args.emplace_back("in_pfdArray", ::android::internal::ToString(in_pfdArray));
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnLoggableInterface::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_boolArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_byteArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_charArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_intArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_longArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_floatArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_doubleArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_stringArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_listValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_out, in_pfdValue);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, in_pfdArray);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_loggable_ILoggableInterface_clazz = ::ndk::ICInterface::defineClass(ILoggableInterface::descriptor, _aidl_android_aidl_loggable_ILoggableInterface_onTransact);
+
+BpLoggableInterface::BpLoggableInterface(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpLoggableInterface::~BpLoggableInterface() {}
+std::function<void(const BpLoggableInterface::TransactionLog&)> BpLoggableInterface::logFunc;
+
+::ndk::ScopedAStatus BpLoggableInterface::LogThis(bool in_boolValue, std::vector<bool>* in_boolArray, int8_t in_byteValue, std::vector<uint8_t>* in_byteArray, char16_t in_charValue, std::vector<char16_t>* in_charArray, int32_t in_intValue, std::vector<int32_t>* in_intArray, int64_t in_longValue, std::vector<int64_t>* in_longArray, float in_floatValue, std::vector<float>* in_floatArray, double in_doubleValue, std::vector<double>* in_doubleArray, const std::string& in_stringValue, std::vector<std::string>* in_stringArray, std::vector<std::string>* in_listValue, const ::aidl::android::aidl::loggable::Data& in_dataValue, const ::ndk::SpAIBinder& in_binderValue, ::ndk::ScopedFileDescriptor* in_pfdValue, std::vector<::ndk::ScopedFileDescriptor>* in_pfdArray, std::vector<std::string>* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpLoggableInterface::TransactionLog _transaction_log;
+  if (BpLoggableInterface::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_boolValue", ::android::internal::ToString(in_boolValue));
+    _transaction_log.input_args.emplace_back("in_boolArray", ::android::internal::ToString(*in_boolArray));
+    _transaction_log.input_args.emplace_back("in_byteValue", ::android::internal::ToString(in_byteValue));
+    _transaction_log.input_args.emplace_back("in_byteArray", ::android::internal::ToString(*in_byteArray));
+    _transaction_log.input_args.emplace_back("in_charValue", ::android::internal::ToString(in_charValue));
+    _transaction_log.input_args.emplace_back("in_charArray", ::android::internal::ToString(*in_charArray));
+    _transaction_log.input_args.emplace_back("in_intValue", ::android::internal::ToString(in_intValue));
+    _transaction_log.input_args.emplace_back("in_intArray", ::android::internal::ToString(*in_intArray));
+    _transaction_log.input_args.emplace_back("in_longValue", ::android::internal::ToString(in_longValue));
+    _transaction_log.input_args.emplace_back("in_longArray", ::android::internal::ToString(*in_longArray));
+    _transaction_log.input_args.emplace_back("in_floatValue", ::android::internal::ToString(in_floatValue));
+    _transaction_log.input_args.emplace_back("in_floatArray", ::android::internal::ToString(*in_floatArray));
+    _transaction_log.input_args.emplace_back("in_doubleValue", ::android::internal::ToString(in_doubleValue));
+    _transaction_log.input_args.emplace_back("in_doubleArray", ::android::internal::ToString(*in_doubleArray));
+    _transaction_log.input_args.emplace_back("in_stringValue", ::android::internal::ToString(in_stringValue));
+    _transaction_log.input_args.emplace_back("in_stringArray", ::android::internal::ToString(*in_stringArray));
+    _transaction_log.input_args.emplace_back("in_listValue", ::android::internal::ToString(*in_listValue));
+    _transaction_log.input_args.emplace_back("in_dataValue", ::android::internal::ToString(in_dataValue));
+    _transaction_log.input_args.emplace_back("in_binderValue", ::android::internal::ToString(in_binderValue));
+    _transaction_log.input_args.emplace_back("in_pfdValue", ::android::internal::ToString(*in_pfdValue));
+    _transaction_log.input_args.emplace_back("in_pfdArray", ::android::internal::ToString(*in_pfdArray));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ILoggableInterface::LogThis::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_boolValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_boolArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_byteValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_byteArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_charValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_charArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_intValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_intArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_longValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_longArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_floatValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_floatArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_doubleValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_doubleArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_stringValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_stringArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_listValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_dataValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), in_binderValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeNullableData(_aidl_in.get(), *in_pfdValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), *in_pfdArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*LogThis*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ILoggableInterface::getDefaultImpl()) {
+    _aidl_status = ILoggableInterface::getDefaultImpl()->LogThis(in_boolValue, in_boolArray, in_byteValue, in_byteArray, in_charValue, in_charArray, in_intValue, in_intArray, in_longValue, in_longArray, in_floatValue, in_floatArray, in_doubleValue, in_doubleArray, in_stringValue, in_stringArray, in_listValue, in_dataValue, in_binderValue, in_pfdValue, in_pfdArray, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_boolArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_byteArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_charArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_intArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_longArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_floatArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_doubleArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_stringArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_listValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readNullableData(_aidl_out.get(), in_pfdValue);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), in_pfdArray);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpLoggableInterface::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.loggable.ILoggableInterface";
+    _transaction_log.method_name = "LogThis";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.output_args.emplace_back("in_boolArray", ::android::internal::ToString(*in_boolArray));
+    _transaction_log.output_args.emplace_back("in_byteArray", ::android::internal::ToString(*in_byteArray));
+    _transaction_log.output_args.emplace_back("in_charArray", ::android::internal::ToString(*in_charArray));
+    _transaction_log.output_args.emplace_back("in_intArray", ::android::internal::ToString(*in_intArray));
+    _transaction_log.output_args.emplace_back("in_longArray", ::android::internal::ToString(*in_longArray));
+    _transaction_log.output_args.emplace_back("in_floatArray", ::android::internal::ToString(*in_floatArray));
+    _transaction_log.output_args.emplace_back("in_doubleArray", ::android::internal::ToString(*in_doubleArray));
+    _transaction_log.output_args.emplace_back("in_stringArray", ::android::internal::ToString(*in_stringArray));
+    _transaction_log.output_args.emplace_back("in_listValue", ::android::internal::ToString(*in_listValue));
+    _transaction_log.output_args.emplace_back("in_pfdValue", ::android::internal::ToString(*in_pfdValue));
+    _transaction_log.output_args.emplace_back("in_pfdArray", ::android::internal::ToString(*in_pfdArray));
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpLoggableInterface::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+// Source for BnLoggableInterface
+BnLoggableInterface::BnLoggableInterface() {}
+BnLoggableInterface::~BnLoggableInterface() {}
+std::function<void(const BnLoggableInterface::TransactionLog&)> BnLoggableInterface::logFunc;
+::ndk::SpAIBinder BnLoggableInterface::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_loggable_ILoggableInterface_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for ILoggableInterface
+const char* ILoggableInterface::descriptor = "android.aidl.loggable.ILoggableInterface";
+ILoggableInterface::ILoggableInterface() {}
+ILoggableInterface::~ILoggableInterface() {}
+
+
+std::shared_ptr<ILoggableInterface> ILoggableInterface::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_loggable_ILoggableInterface_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpLoggableInterface>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<ILoggableInterface>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpLoggableInterface>(binder);
+}
+
+binder_status_t ILoggableInterface::writeToParcel(AParcel* parcel, const std::shared_ptr<ILoggableInterface>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ILoggableInterface::readFromParcel(const AParcel* parcel, std::shared_ptr<ILoggableInterface>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = ILoggableInterface::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ILoggableInterface::setDefaultImpl(const std::shared_ptr<ILoggableInterface>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!ILoggableInterface::default_impl);
+  if (impl) {
+    ILoggableInterface::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ILoggableInterface>& ILoggableInterface::getDefaultImpl() {
+  return ILoggableInterface::default_impl;
+}
+std::shared_ptr<ILoggableInterface> ILoggableInterface::default_impl = nullptr;
+::ndk::ScopedAStatus ILoggableInterfaceDefault::LogThis(bool /*in_boolValue*/, std::vector<bool>* /*in_boolArray*/, int8_t /*in_byteValue*/, std::vector<uint8_t>* /*in_byteArray*/, char16_t /*in_charValue*/, std::vector<char16_t>* /*in_charArray*/, int32_t /*in_intValue*/, std::vector<int32_t>* /*in_intArray*/, int64_t /*in_longValue*/, std::vector<int64_t>* /*in_longArray*/, float /*in_floatValue*/, std::vector<float>* /*in_floatArray*/, double /*in_doubleValue*/, std::vector<double>* /*in_doubleArray*/, const std::string& /*in_stringValue*/, std::vector<std::string>* /*in_stringArray*/, std::vector<std::string>* /*in_listValue*/, const ::aidl::android::aidl::loggable::Data& /*in_dataValue*/, const ::ndk::SpAIBinder& /*in_binderValue*/, ::ndk::ScopedFileDescriptor* /*in_pfdValue*/, std::vector<::ndk::ScopedFileDescriptor>* /*in_pfdArray*/, std::vector<std::string>* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder ILoggableInterfaceDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ILoggableInterfaceDefault::isRemote() {
+  return false;
+}
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+static binder_status_t _aidl_android_aidl_loggable_ILoggableInterface_ISub_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<ILoggableInterface::BnSub> _aidl_impl = std::static_pointer_cast<ILoggableInterface::BnSub>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*Log*/): {
+      int32_t in_value;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ISub::Log::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_value);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ILoggableInterface::BnSub::TransactionLog _transaction_log;
+      if (ILoggableInterface::BnSub::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_value", ::android::internal::ToString(in_value));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->Log(in_value);
+      if (ILoggableInterface::BnSub::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.loggable.ILoggableInterface.ISub";
+        _transaction_log.method_name = "Log";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        ILoggableInterface::BnSub::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_loggable_ILoggableInterface_ISub_clazz = ::ndk::ICInterface::defineClass(ILoggableInterface::ISub::descriptor, _aidl_android_aidl_loggable_ILoggableInterface_ISub_onTransact);
+
+ILoggableInterface::BpSub::BpSub(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ILoggableInterface::BpSub::~BpSub() {}
+std::function<void(const ILoggableInterface::BpSub::TransactionLog&)> ILoggableInterface::BpSub::logFunc;
+
+::ndk::ScopedAStatus ILoggableInterface::BpSub::Log(int32_t in_value) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ILoggableInterface::BpSub::TransactionLog _transaction_log;
+  if (ILoggableInterface::BpSub::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_value", ::android::internal::ToString(in_value));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ISub::Log::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_value);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*Log*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ISub::getDefaultImpl()) {
+    _aidl_status = ISub::getDefaultImpl()->Log(in_value);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ILoggableInterface::BpSub::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.loggable.ILoggableInterface.ISub";
+    _transaction_log.method_name = "Log";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    ILoggableInterface::BpSub::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+// Source for BnSub
+ILoggableInterface::BnSub::BnSub() {}
+ILoggableInterface::BnSub::~BnSub() {}
+std::function<void(const ILoggableInterface::BnSub::TransactionLog&)> ILoggableInterface::BnSub::logFunc;
+::ndk::SpAIBinder ILoggableInterface::BnSub::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_loggable_ILoggableInterface_ISub_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+// Source for ISub
+const char* ILoggableInterface::ISub::descriptor = "android.aidl.loggable.ILoggableInterface.ISub";
+ILoggableInterface::ISub::ISub() {}
+ILoggableInterface::ISub::~ISub() {}
+
+
+std::shared_ptr<ILoggableInterface::ISub> ILoggableInterface::ISub::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_loggable_ILoggableInterface_ISub_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ILoggableInterface::BpSub>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<ISub>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ILoggableInterface::BpSub>(binder);
+}
+
+binder_status_t ILoggableInterface::ISub::writeToParcel(AParcel* parcel, const std::shared_ptr<ISub>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ILoggableInterface::ISub::readFromParcel(const AParcel* parcel, std::shared_ptr<ISub>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = ISub::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ILoggableInterface::ISub::setDefaultImpl(const std::shared_ptr<ISub>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!ISub::default_impl);
+  if (impl) {
+    ISub::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ILoggableInterface::ISub>& ILoggableInterface::ISub::getDefaultImpl() {
+  return ISub::default_impl;
+}
+std::shared_ptr<ILoggableInterface::ISub> ILoggableInterface::ISub::default_impl = nullptr;
+::ndk::ScopedAStatus ILoggableInterface::ISubDefault::Log(int32_t /*in_value*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::SpAIBinder ILoggableInterface::ISubDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ILoggableInterface::ISubDefault::isRemote() {
+  return false;
+}
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/ILoggableInterface.cpp.d b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/ILoggableInterface.cpp.d
new file mode 100644
index 0000000..3bcdcd4
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/ILoggableInterface.cpp.d
@@ -0,0 +1,5 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/ILoggableInterface.cpp : \
+  system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Data.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl \
+  system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Union.cpp b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Union.cpp
new file mode 100644
index 0000000..cf59dea
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Union.cpp
@@ -0,0 +1,56 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+#include "aidl/android/aidl/loggable/Union.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+const char* Union::descriptor = "android.aidl.loggable.Union";
+
+binder_status_t Union::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case num: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<num>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<num>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case str: {
+    std::string _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<std::string>) {
+      set<str>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<str>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t Union::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case num: return ::ndk::AParcel_writeData(_parcel, get<num>());
+  case str: return ::ndk::AParcel_writeData(_parcel, get<str>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Union.cpp.d b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Union.cpp.d
new file mode 100644
index 0000000..2dba0dc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Union.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/android/aidl/loggable/Union.cpp : \
+  system/tools/aidl/tests/android/aidl/loggable/Union.aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnData.h b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnData.h
new file mode 100644
index 0000000..0853c35
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnData.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Data.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnEnum.h b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnEnum.h
new file mode 100644
index 0000000..4667de9
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Enum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+#error TODO(b/111362593) enums do not have bn classes
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnLoggableInterface.h b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnLoggableInterface.h
new file mode 100644
index 0000000..cff5548
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnLoggableInterface.h
@@ -0,0 +1,61 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/ILoggableInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/loggable/ILoggableInterface.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+class BnLoggableInterface : public ::ndk::BnCInterface<ILoggableInterface> {
+public:
+  BnLoggableInterface();
+  virtual ~BnLoggableInterface();
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class ILoggableInterfaceDelegator : public BnLoggableInterface {
+public:
+  explicit ILoggableInterfaceDelegator(const std::shared_ptr<ILoggableInterface> &impl) : _impl(impl) {
+  }
+
+  ::ndk::ScopedAStatus LogThis(bool in_boolValue, std::vector<bool>* in_boolArray, int8_t in_byteValue, std::vector<uint8_t>* in_byteArray, char16_t in_charValue, std::vector<char16_t>* in_charArray, int32_t in_intValue, std::vector<int32_t>* in_intArray, int64_t in_longValue, std::vector<int64_t>* in_longArray, float in_floatValue, std::vector<float>* in_floatArray, double in_doubleValue, std::vector<double>* in_doubleArray, const std::string& in_stringValue, std::vector<std::string>* in_stringArray, std::vector<std::string>* in_listValue, const ::aidl::android::aidl::loggable::Data& in_dataValue, const ::ndk::SpAIBinder& in_binderValue, ::ndk::ScopedFileDescriptor* in_pfdValue, std::vector<::ndk::ScopedFileDescriptor>* in_pfdArray, std::vector<std::string>* _aidl_return) override {
+    return _impl->LogThis(in_boolValue, in_boolArray, in_byteValue, in_byteArray, in_charValue, in_charArray, in_intValue, in_intArray, in_longValue, in_longArray, in_floatValue, in_floatArray, in_doubleValue, in_doubleArray, in_stringValue, in_stringArray, in_listValue, in_dataValue, in_binderValue, in_pfdValue, in_pfdArray, _aidl_return);
+  }
+protected:
+private:
+  std::shared_ptr<ILoggableInterface> _impl;
+};
+
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnUnion.h b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnUnion.h
new file mode 100644
index 0000000..75ce96d
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BnUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpData.h b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpData.h
new file mode 100644
index 0000000..e6ae909
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpData.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Data.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpEnum.h b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpEnum.h
new file mode 100644
index 0000000..18ce96a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpEnum.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Enum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+#error TODO(b/111362593) enums do not have bp classes
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpLoggableInterface.h b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpLoggableInterface.h
new file mode 100644
index 0000000..c86c907
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpLoggableInterface.h
@@ -0,0 +1,44 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/ILoggableInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/loggable/ILoggableInterface.h"
+
+#include <android/binder_ibinder.h>
+#include <functional>
+#include <chrono>
+#include <sstream>
+#include <android/trace.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+class BpLoggableInterface : public ::ndk::BpCInterface<ILoggableInterface> {
+public:
+  explicit BpLoggableInterface(const ::ndk::SpAIBinder& binder);
+  virtual ~BpLoggableInterface();
+
+  ::ndk::ScopedAStatus LogThis(bool in_boolValue, std::vector<bool>* in_boolArray, int8_t in_byteValue, std::vector<uint8_t>* in_byteArray, char16_t in_charValue, std::vector<char16_t>* in_charArray, int32_t in_intValue, std::vector<int32_t>* in_intArray, int64_t in_longValue, std::vector<int64_t>* in_longArray, float in_floatValue, std::vector<float>* in_floatArray, double in_doubleValue, std::vector<double>* in_doubleArray, const std::string& in_stringValue, std::vector<std::string>* in_stringArray, std::vector<std::string>* in_listValue, const ::aidl::android::aidl::loggable::Data& in_dataValue, const ::ndk::SpAIBinder& in_binderValue, ::ndk::ScopedFileDescriptor* in_pfdValue, std::vector<::ndk::ScopedFileDescriptor>* in_pfdArray, std::vector<std::string>* _aidl_return) override;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+};
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpUnion.h b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpUnion.h
new file mode 100644
index 0000000..5b286fc
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/BpUnion.h
@@ -0,0 +1,5 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Data.h b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Data.h
new file mode 100644
index 0000000..4801d23
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Data.h
@@ -0,0 +1,72 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Data.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Data.aidl
+ */
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/loggable/Enum.h>
+#include <aidl/android/aidl/loggable/Union.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+class Data {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  int32_t num = 0;
+  std::string str;
+  ::aidl::android::aidl::loggable::Union nestedUnion;
+  ::aidl::android::aidl::loggable::Enum nestedEnum = ::aidl::android::aidl::loggable::Enum::FOO;
+
+  binder_status_t readFromParcel(const AParcel* parcel);
+  binder_status_t writeToParcel(AParcel* parcel) const;
+
+  inline bool operator!=(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) != std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator<(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) < std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator<=(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) <= std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator==(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) == std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator>(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) > std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+  inline bool operator>=(const Data& rhs) const {
+    return std::tie(num, str, nestedUnion, nestedEnum) >= std::tie(rhs.num, rhs.str, rhs.nestedUnion, rhs.nestedEnum);
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Data{";
+    os << "num: " << ::android::internal::ToString(num);
+    os << ", str: " << ::android::internal::ToString(str);
+    os << ", nestedUnion: " << ::android::internal::ToString(nestedUnion);
+    os << ", nestedEnum: " << ::android::internal::ToString(nestedEnum);
+    os << "}";
+    return os.str();
+  }
+};
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Enum.h b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Enum.h
new file mode 100644
index 0000000..36bbeb5
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Enum.h
@@ -0,0 +1,56 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Enum.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Enum.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#include <android/binder_enums.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+enum class Enum : int8_t {
+  FOO = 42,
+};
+
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+[[nodiscard]] static inline std::string toString(Enum val) {
+  switch(val) {
+  case Enum::FOO:
+    return "FOO";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::loggable::Enum, 1> enum_values<aidl::android::aidl::loggable::Enum> = {
+  aidl::android::aidl::loggable::Enum::FOO,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/ILoggableInterface.h b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/ILoggableInterface.h
new file mode 100644
index 0000000..121100a
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/ILoggableInterface.h
@@ -0,0 +1,130 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/ILoggableInterface.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/ILoggableInterface.aidl
+ */
+#pragma once
+
+#include <chrono>
+#include <cstdint>
+#include <functional>
+#include <memory>
+#include <optional>
+#include <sstream>
+#include <string>
+#include <vector>
+#include <android/binder_ibinder.h>
+#include <android/binder_interface_utils.h>
+#include <android/trace.h>
+#include <aidl/android/aidl/loggable/Data.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+namespace aidl::android::aidl::loggable {
+class Data;
+}  // namespace aidl::android::aidl::loggable
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+class ILoggableInterfaceDelegator;
+
+class ILoggableInterface : public ::ndk::ICInterface {
+public:
+  typedef ILoggableInterfaceDelegator DefaultDelegator;
+  static const char* descriptor;
+  ILoggableInterface();
+  virtual ~ILoggableInterface();
+
+  class ISubDelegator;
+
+  class ISub : public ::ndk::ICInterface {
+  public:
+    typedef ISubDelegator DefaultDelegator;
+    static const char* descriptor;
+    ISub();
+    virtual ~ISub();
+
+    static constexpr uint32_t TRANSACTION_Log = FIRST_CALL_TRANSACTION + 0;
+
+    static std::shared_ptr<ISub> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<ISub>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<ISub>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<ISub>& impl);
+    static const std::shared_ptr<ISub>& getDefaultImpl();
+    virtual ::ndk::ScopedAStatus Log(int32_t in_value) = 0;
+  private:
+    static std::shared_ptr<ISub> default_impl;
+  };
+  class ISubDefault : public ISub {
+  public:
+    ::ndk::ScopedAStatus Log(int32_t in_value) override;
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpSub : public ::ndk::BpCInterface<ISub> {
+  public:
+    explicit BpSub(const ::ndk::SpAIBinder& binder);
+    virtual ~BpSub();
+
+    ::ndk::ScopedAStatus Log(int32_t in_value) override;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  };
+  class BnSub : public ::ndk::BnCInterface<ISub> {
+  public:
+    BnSub();
+    virtual ~BnSub();
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  static constexpr uint32_t TRANSACTION_LogThis = FIRST_CALL_TRANSACTION + 0;
+
+  static std::shared_ptr<ILoggableInterface> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<ILoggableInterface>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<ILoggableInterface>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<ILoggableInterface>& impl);
+  static const std::shared_ptr<ILoggableInterface>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus LogThis(bool in_boolValue, std::vector<bool>* in_boolArray, int8_t in_byteValue, std::vector<uint8_t>* in_byteArray, char16_t in_charValue, std::vector<char16_t>* in_charArray, int32_t in_intValue, std::vector<int32_t>* in_intArray, int64_t in_longValue, std::vector<int64_t>* in_longArray, float in_floatValue, std::vector<float>* in_floatArray, double in_doubleValue, std::vector<double>* in_doubleArray, const std::string& in_stringValue, std::vector<std::string>* in_stringArray, std::vector<std::string>* in_listValue, const ::aidl::android::aidl::loggable::Data& in_dataValue, const ::ndk::SpAIBinder& in_binderValue, ::ndk::ScopedFileDescriptor* in_pfdValue, std::vector<::ndk::ScopedFileDescriptor>* in_pfdArray, std::vector<std::string>* _aidl_return) = 0;
+private:
+  static std::shared_ptr<ILoggableInterface> default_impl;
+};
+class ILoggableInterfaceDefault : public ILoggableInterface {
+public:
+  ::ndk::ScopedAStatus LogThis(bool in_boolValue, std::vector<bool>* in_boolArray, int8_t in_byteValue, std::vector<uint8_t>* in_byteArray, char16_t in_charValue, std::vector<char16_t>* in_charArray, int32_t in_intValue, std::vector<int32_t>* in_intArray, int64_t in_longValue, std::vector<int64_t>* in_longArray, float in_floatValue, std::vector<float>* in_floatArray, double in_doubleValue, std::vector<double>* in_doubleArray, const std::string& in_stringValue, std::vector<std::string>* in_stringArray, std::vector<std::string>* in_listValue, const ::aidl::android::aidl::loggable::Data& in_dataValue, const ::ndk::SpAIBinder& in_binderValue, ::ndk::ScopedFileDescriptor* in_pfdValue, std::vector<::ndk::ScopedFileDescriptor>* in_pfdArray, std::vector<std::string>* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Union.h b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Union.h
new file mode 100644
index 0000000..2ed86aa
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/include/aidl/android/aidl/loggable/Union.h
@@ -0,0 +1,161 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging/android/aidl/loggable/Union.cpp.d -h out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/aidl_test_loggable_interface-ndk-source/gen/staging -Nsystem/tools/aidl/tests system/tools/aidl/tests/android/aidl/loggable/Union.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+class Union {
+public:
+  typedef std::false_type fixed_size;
+  static const char* descriptor;
+
+  enum class Tag : int32_t {
+    num = 0,
+    str = 1,
+  };
+
+  // Expose tag symbols for legacy code
+  static const inline Tag num = Tag::num;
+  static const inline Tag str = Tag::str;
+
+  template<typename _Tp>
+  static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, Union>;
+
+  Union() : _value(std::in_place_index<static_cast<size_t>(num)>, int32_t(43)) { }
+
+  template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+  // NOLINTNEXTLINE(google-explicit-constructor)
+  constexpr Union(_Tp&& _arg)
+      : _value(std::forward<_Tp>(_arg)) {}
+
+  template <size_t _Np, typename... _Tp>
+  constexpr explicit Union(std::in_place_index_t<_Np>, _Tp&&... _args)
+      : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+  template <Tag _tag, typename... _Tp>
+  static Union make(_Tp&&... _args) {
+    return Union(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+  }
+
+  template <Tag _tag, typename _Tp, typename... _Up>
+  static Union make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+    return Union(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+  }
+
+  Tag getTag() const {
+    return static_cast<Tag>(_value.index());
+  }
+
+  template <Tag _tag>
+  const auto& get() const {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag>
+  auto& get() {
+    if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+    return std::get<static_cast<size_t>(_tag)>(_value);
+  }
+
+  template <Tag _tag, typename... _Tp>
+  void set(_Tp&&... _args) {
+    _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+  }
+
+  binder_status_t readFromParcel(const AParcel* _parcel);
+  binder_status_t writeToParcel(AParcel* _parcel) const;
+
+  inline bool operator!=(const Union& rhs) const {
+    return _value != rhs._value;
+  }
+  inline bool operator<(const Union& rhs) const {
+    return _value < rhs._value;
+  }
+  inline bool operator<=(const Union& rhs) const {
+    return _value <= rhs._value;
+  }
+  inline bool operator==(const Union& rhs) const {
+    return _value == rhs._value;
+  }
+  inline bool operator>(const Union& rhs) const {
+    return _value > rhs._value;
+  }
+  inline bool operator>=(const Union& rhs) const {
+    return _value >= rhs._value;
+  }
+
+  static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+  inline std::string toString() const {
+    std::ostringstream os;
+    os << "Union{";
+    switch (getTag()) {
+    case num: os << "num: " << ::android::internal::ToString(get<num>()); break;
+    case str: os << "str: " << ::android::internal::ToString(get<str>()); break;
+    }
+    os << "}";
+    return os.str();
+  }
+private:
+  std::variant<int32_t, std::string> _value;
+};
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace loggable {
+[[nodiscard]] static inline std::string toString(Union::Tag val) {
+  switch(val) {
+  case Union::Tag::num:
+    return "num";
+  case Union::Tag::str:
+    return "str";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace loggable
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::loggable::Union::Tag, 2> enum_values<aidl::android::aidl::loggable::Union::Tag> = {
+  aidl::android::aidl::loggable::Union::Tag::num,
+  aidl::android::aidl::loggable::Union::Tag::str,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/timestamp b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/aidl_test_loggable_interface-ndk-source/gen/timestamp
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp
new file mode 100644
index 0000000..a7feb85
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp
@@ -0,0 +1,1097 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android/aidl/test/trunk/BpTrunkStableTest.h>
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(TrunkStableTest, "android.aidl.test.trunk.ITrunkStableTest")
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/BpTrunkStableTest.h>
+#include <android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+
+BpTrunkStableTest::BpTrunkStableTest(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<ITrunkStableTest>(_aidl_impl){
+}
+
+std::function<void(const BpTrunkStableTest::TransactionLog&)> BpTrunkStableTest::logFunc;
+
+::android::binder::Status BpTrunkStableTest::repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatParcelable::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_repeatParcelable, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->repeatParcelable(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status BpTrunkStableTest::repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatEnum::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(static_cast<int8_t>(input));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_repeatEnum, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->repeatEnum(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readByte(reinterpret_cast<int8_t *>(_aidl_return));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatEnum";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status BpTrunkStableTest::repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatUnion::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_repeatUnion, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->repeatUnion(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatUnion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status BpTrunkStableTest::callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::callMyCallback::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("cb", ::android::internal::ToString(cb));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(cb);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_callMyCallback, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->callMyCallback(cb);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "callMyCallback";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+int32_t BpTrunkStableTest::getInterfaceVersion() {
+  if (cached_version_ == -1) {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnTrunkStableTest::TRANSACTION_getInterfaceVersion, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        cached_version_ = reply.readInt32();
+      }
+    }
+  }
+  return cached_version_;
+}
+
+
+std::string BpTrunkStableTest::getInterfaceHash() {
+  std::lock_guard<std::mutex> lockGuard(cached_hash_mutex_);
+  if (cached_hash_ == "-1") {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnTrunkStableTest::TRANSACTION_getInterfaceHash, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        reply.readUtf8FromUtf16(&cached_hash_);
+      }
+    }
+  }
+  return cached_hash_;
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+
+BnTrunkStableTest::BnTrunkStableTest()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnTrunkStableTest::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnTrunkStableTest::TRANSACTION_repeatParcelable:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatParcelable(in_input, &_aidl_return));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "repeatParcelable";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_repeatEnum:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyEnum _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_input));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatEnum(in_input, &_aidl_return));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "repeatEnum";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByte(static_cast<int8_t>(_aidl_return));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_repeatUnion:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyUnion in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyUnion _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatUnion::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatUnion(in_input, &_aidl_return));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "repeatUnion";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_callMyCallback:
+  {
+    ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback> in_cb;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::callMyCallback::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinder(&in_cb);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_cb", ::android::internal::ToString(in_cb));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(callMyCallback(in_cb));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "callMyCallback";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_getInterfaceVersion:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeInt32(ITrunkStableTest::VERSION);
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_getInterfaceHash:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeUtf8AsUtf16(ITrunkStableTest::HASH);
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+int32_t BnTrunkStableTest::getInterfaceVersion() {
+  return ITrunkStableTest::VERSION;
+}
+std::string BnTrunkStableTest::getInterfaceHash() {
+  return ITrunkStableTest::HASH;
+}
+std::function<void(const BnTrunkStableTest::TransactionLog&)> BnTrunkStableTest::logFunc;
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+::android::status_t ITrunkStableTest::MyParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ITrunkStableTest::MyParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+::android::status_t ITrunkStableTest::MyUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case a: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<a>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<a>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case b: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<b>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<b>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t ITrunkStableTest::MyUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case a: return _aidl_parcel->writeInt32(get<a>());
+  case b: return _aidl_parcel->writeInt32(get<b>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ITrunkStableTest, MyCallback, "android.aidl.test.trunk.ITrunkStableTest.IMyCallback")
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+
+ITrunkStableTest::BpMyCallback::BpMyCallback(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IMyCallback>(_aidl_impl){
+}
+
+std::function<void(const ITrunkStableTest::BpMyCallback::TransactionLog&)> ITrunkStableTest::BpMyCallback::logFunc;
+
+::android::binder::Status ITrunkStableTest::BpMyCallback::repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatParcelable::cppClient");
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_repeatParcelable, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl())) {
+     return IMyCallback::getDefaultImpl()->repeatParcelable(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status ITrunkStableTest::BpMyCallback::repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatEnum::cppClient");
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(static_cast<int8_t>(input));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_repeatEnum, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl())) {
+     return IMyCallback::getDefaultImpl()->repeatEnum(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readByte(reinterpret_cast<int8_t *>(_aidl_return));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatEnum";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status ITrunkStableTest::BpMyCallback::repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatUnion::cppClient");
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_repeatUnion, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl())) {
+     return IMyCallback::getDefaultImpl()->repeatUnion(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatUnion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+int32_t ITrunkStableTest::BpMyCallback::getInterfaceVersion() {
+  if (cached_version_ == -1) {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_getInterfaceVersion, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        cached_version_ = reply.readInt32();
+      }
+    }
+  }
+  return cached_version_;
+}
+
+
+std::string ITrunkStableTest::BpMyCallback::getInterfaceHash() {
+  std::lock_guard<std::mutex> lockGuard(cached_hash_mutex_);
+  if (cached_hash_ == "-1") {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_getInterfaceHash, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        reply.readUtf8FromUtf16(&cached_hash_);
+      }
+    }
+  }
+  return cached_hash_;
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+
+ITrunkStableTest::BnMyCallback::BnMyCallback()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ITrunkStableTest::BnMyCallback::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnMyCallback::TRANSACTION_repeatParcelable:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatParcelable(in_input, &_aidl_return));
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+      _transaction_log.method_name = "repeatParcelable";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnMyCallback::TRANSACTION_repeatEnum:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyEnum _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_input));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatEnum(in_input, &_aidl_return));
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+      _transaction_log.method_name = "repeatEnum";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByte(static_cast<int8_t>(_aidl_return));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnMyCallback::TRANSACTION_repeatUnion:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyUnion in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyUnion _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatUnion::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatUnion(in_input, &_aidl_return));
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+      _transaction_log.method_name = "repeatUnion";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnMyCallback::TRANSACTION_getInterfaceVersion:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeInt32(IMyCallback::VERSION);
+  }
+  break;
+  case BnMyCallback::TRANSACTION_getInterfaceHash:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeUtf8AsUtf16(IMyCallback::HASH);
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+int32_t ITrunkStableTest::BnMyCallback::getInterfaceVersion() {
+  return IMyCallback::VERSION;
+}
+std::string ITrunkStableTest::BnMyCallback::getInterfaceHash() {
+  return IMyCallback::HASH;
+}
+std::function<void(const ITrunkStableTest::BnMyCallback::TransactionLog&)> ITrunkStableTest::BnMyCallback::logFunc;
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d
new file mode 100644
index 0000000..65ed144
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp : \
+  system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/BnTrunkStableTest.h b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/BnTrunkStableTest.h
new file mode 100644
index 0000000..44df565
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/BnTrunkStableTest.h
@@ -0,0 +1,84 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <functional>
+#include <android/binder_to_string.h>
+#include <android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class BnTrunkStableTest : public ::android::BnInterface<ITrunkStableTest> {
+public:
+  static constexpr uint32_t TRANSACTION_repeatParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_repeatEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_repeatUnion = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_callMyCallback = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_getInterfaceVersion = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777214;
+  static constexpr uint32_t TRANSACTION_getInterfaceHash = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777213;
+  explicit BnTrunkStableTest();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  int32_t getInterfaceVersion();
+  std::string getInterfaceHash();
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+};  // class BnTrunkStableTest
+
+class ITrunkStableTestDelegator : public BnTrunkStableTest {
+public:
+  explicit ITrunkStableTestDelegator(const ::android::sp<ITrunkStableTest> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<ITrunkStableTest> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override {
+    return _aidl_delegate->repeatParcelable(input, _aidl_return);
+  }
+  ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override {
+    return _aidl_delegate->repeatEnum(input, _aidl_return);
+  }
+  ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override {
+    return _aidl_delegate->repeatUnion(input, _aidl_return);
+  }
+  ::android::binder::Status callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb) override {
+    ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallbackDelegator> _cb;
+    if (cb) {
+      _cb = ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallbackDelegator>::cast(delegate(cb));
+    }
+    return _aidl_delegate->callMyCallback(_cb);
+  }
+  int32_t getInterfaceVersion() override {
+    int32_t _delegator_ver = BnTrunkStableTest::getInterfaceVersion();
+    int32_t _impl_ver = _aidl_delegate->getInterfaceVersion();
+    return _delegator_ver < _impl_ver ? _delegator_ver : _impl_ver;
+  }
+  std::string getInterfaceHash() override {
+    return _aidl_delegate->getInterfaceHash();
+  }
+private:
+  ::android::sp<ITrunkStableTest> _aidl_delegate;
+};  // class ITrunkStableTestDelegator
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/BpTrunkStableTest.h b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/BpTrunkStableTest.h
new file mode 100644
index 0000000..2305195
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/BpTrunkStableTest.h
@@ -0,0 +1,51 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <functional>
+#include <android/binder_to_string.h>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class BpTrunkStableTest : public ::android::BpInterface<ITrunkStableTest> {
+public:
+  explicit BpTrunkStableTest(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpTrunkStableTest() = default;
+  ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+  ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+  ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+  ::android::binder::Status callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb) override;
+  int32_t getInterfaceVersion() override;
+  std::string getInterfaceHash() override;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+private:
+  int32_t cached_version_ = -1;
+  std::string cached_hash_ = "-1";
+  std::mutex cached_hash_mutex_;
+};  // class BpTrunkStableTest
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/ITrunkStableTest.h b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/ITrunkStableTest.h
new file mode 100644
index 0000000..6925759
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/ITrunkStableTest.h
@@ -0,0 +1,396 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Delegate.h>
+#include <binder/Enums.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cassert>
+#include <cstdint>
+#include <functional>
+#include <string>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class ITrunkStableTestDelegator;
+
+class ITrunkStableTest : public ::android::IInterface {
+public:
+  typedef ITrunkStableTestDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(TrunkStableTest)
+  static inline const int32_t VERSION = 1;
+  static inline const std::string HASH = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+  class MyParcelable : public ::android::Parcelable {
+  public:
+    int32_t a = 0;
+    int32_t b = 0;
+    inline bool operator!=(const MyParcelable& rhs) const {
+      return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator<(const MyParcelable& rhs) const {
+      return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator<=(const MyParcelable& rhs) const {
+      return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator==(const MyParcelable& rhs) const {
+      return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator>(const MyParcelable& rhs) const {
+      return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator>=(const MyParcelable& rhs) const {
+      return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.test.trunk.ITrunkStableTest.MyParcelable");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyParcelable{";
+      os << "a: " << ::android::internal::ToString(a);
+      os << ", b: " << ::android::internal::ToString(b);
+      os << "}";
+      return os.str();
+    }
+  };  // class MyParcelable
+  enum class MyEnum : int8_t {
+    ZERO = 0,
+    ONE = 1,
+    TWO = 2,
+  };
+  class MyUnion : public ::android::Parcelable {
+  public:
+    enum class Tag : int32_t {
+      a = 0,
+      b = 1,
+    };
+    // Expose tag symbols for legacy code
+    static const inline Tag a = Tag::a;
+    static const inline Tag b = Tag::b;
+
+    template<typename _Tp>
+    static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, MyUnion>;
+
+    MyUnion() : _value(std::in_place_index<static_cast<size_t>(a)>, int32_t(0)) { }
+
+    template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+    // NOLINTNEXTLINE(google-explicit-constructor)
+    constexpr MyUnion(_Tp&& _arg)
+        : _value(std::forward<_Tp>(_arg)) {}
+
+    template <size_t _Np, typename... _Tp>
+    constexpr explicit MyUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+        : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+    template <Tag _tag, typename... _Tp>
+    static MyUnion make(_Tp&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+    }
+
+    template <Tag _tag, typename _Tp, typename... _Up>
+    static MyUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+    }
+
+    Tag getTag() const {
+      return static_cast<Tag>(_value.index());
+    }
+
+    template <Tag _tag>
+    const auto& get() const {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag>
+    auto& get() {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag, typename... _Tp>
+    void set(_Tp&&... _args) {
+      _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+    }
+
+    inline bool operator!=(const MyUnion& rhs) const {
+      return _value != rhs._value;
+    }
+    inline bool operator<(const MyUnion& rhs) const {
+      return _value < rhs._value;
+    }
+    inline bool operator<=(const MyUnion& rhs) const {
+      return _value <= rhs._value;
+    }
+    inline bool operator==(const MyUnion& rhs) const {
+      return _value == rhs._value;
+    }
+    inline bool operator>(const MyUnion& rhs) const {
+      return _value > rhs._value;
+    }
+    inline bool operator>=(const MyUnion& rhs) const {
+      return _value >= rhs._value;
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.test.trunk.ITrunkStableTest.MyUnion");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyUnion{";
+      switch (getTag()) {
+      case a: os << "a: " << ::android::internal::ToString(get<a>()); break;
+      case b: os << "b: " << ::android::internal::ToString(get<b>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    std::variant<int32_t, int32_t> _value;
+  };  // class MyUnion
+  class IMyCallbackDelegator;
+
+  class IMyCallback : public ::android::IInterface {
+  public:
+    typedef IMyCallbackDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(MyCallback)
+    static inline const int32_t VERSION = 1;
+    static inline const std::string HASH = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+    virtual ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) = 0;
+    virtual ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) = 0;
+    virtual ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) = 0;
+    virtual int32_t getInterfaceVersion() = 0;
+    virtual std::string getInterfaceHash() = 0;
+  };  // class IMyCallback
+
+  class IMyCallbackDefault : public IMyCallback {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+    ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    int32_t getInterfaceVersion() override {
+      return 0;
+    }
+    std::string getInterfaceHash() override {
+      return "";
+    }
+  };  // class IMyCallbackDefault
+  class BpMyCallback : public ::android::BpInterface<IMyCallback> {
+  public:
+    explicit BpMyCallback(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpMyCallback() = default;
+    ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+    ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+    ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+    int32_t getInterfaceVersion() override;
+    std::string getInterfaceHash() override;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  private:
+    int32_t cached_version_ = -1;
+    std::string cached_hash_ = "-1";
+    std::mutex cached_hash_mutex_;
+  };  // class BpMyCallback
+  class BnMyCallback : public ::android::BnInterface<IMyCallback> {
+  public:
+    static constexpr uint32_t TRANSACTION_repeatParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+    static constexpr uint32_t TRANSACTION_repeatEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+    static constexpr uint32_t TRANSACTION_repeatUnion = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+    static constexpr uint32_t TRANSACTION_getInterfaceVersion = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777214;
+    static constexpr uint32_t TRANSACTION_getInterfaceHash = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777213;
+    explicit BnMyCallback();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+    int32_t getInterfaceVersion();
+    std::string getInterfaceHash();
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  };  // class BnMyCallback
+
+  class IMyCallbackDelegator : public BnMyCallback {
+  public:
+    explicit IMyCallbackDelegator(const ::android::sp<IMyCallback> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<IMyCallback> getImpl() { return _aidl_delegate; }
+    ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override {
+      return _aidl_delegate->repeatParcelable(input, _aidl_return);
+    }
+    ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override {
+      return _aidl_delegate->repeatEnum(input, _aidl_return);
+    }
+    ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override {
+      return _aidl_delegate->repeatUnion(input, _aidl_return);
+    }
+    int32_t getInterfaceVersion() override {
+      int32_t _delegator_ver = BnMyCallback::getInterfaceVersion();
+      int32_t _impl_ver = _aidl_delegate->getInterfaceVersion();
+      return _delegator_ver < _impl_ver ? _delegator_ver : _impl_ver;
+    }
+    std::string getInterfaceHash() override {
+      return _aidl_delegate->getInterfaceHash();
+    }
+  private:
+    ::android::sp<IMyCallback> _aidl_delegate;
+  };  // class IMyCallbackDelegator
+  virtual ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) = 0;
+  virtual ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) = 0;
+  virtual ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) = 0;
+  virtual ::android::binder::Status callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb) = 0;
+  virtual int32_t getInterfaceVersion() = 0;
+  virtual std::string getInterfaceHash() = 0;
+};  // class ITrunkStableTest
+
+class ITrunkStableTestDefault : public ITrunkStableTest {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& /*cb*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  int32_t getInterfaceVersion() override {
+    return 0;
+  }
+  std::string getInterfaceHash() override {
+    return "";
+  }
+};  // class ITrunkStableTestDefault
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+[[nodiscard]] static inline std::string toString(ITrunkStableTest::MyEnum val) {
+  switch(val) {
+  case ITrunkStableTest::MyEnum::ZERO:
+    return "ZERO";
+  case ITrunkStableTest::MyEnum::ONE:
+    return "ONE";
+  case ITrunkStableTest::MyEnum::TWO:
+    return "TWO";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::test::trunk::ITrunkStableTest::MyEnum, 3> enum_values<::android::aidl::test::trunk::ITrunkStableTest::MyEnum> = {
+  ::android::aidl::test::trunk::ITrunkStableTest::MyEnum::ZERO,
+  ::android::aidl::test::trunk::ITrunkStableTest::MyEnum::ONE,
+  ::android::aidl::test::trunk::ITrunkStableTest::MyEnum::TWO,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+[[nodiscard]] static inline std::string toString(ITrunkStableTest::MyUnion::Tag val) {
+  switch(val) {
+  case ITrunkStableTest::MyUnion::Tag::a:
+    return "a";
+  case ITrunkStableTest::MyUnion::Tag::b:
+    return "b";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag, 2> enum_values<::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag> = {
+  ::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::a,
+  ::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::b,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/timestamp b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/timestamp
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java
new file mode 100644
index 0000000..2f91b05
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java
@@ -0,0 +1,812 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java.d -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+package android.aidl.test.trunk;
+public interface ITrunkStableTest extends android.os.IInterface
+{
+  /**
+   * The version of this interface that the caller is built against.
+   * This might be different from what {@link #getInterfaceVersion()
+   * getInterfaceVersion} returns as that is the version of the interface
+   * that the remote object is implementing.
+   */
+  public static final int VERSION = 1;
+  public static final String HASH = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+  /** Default implementation for ITrunkStableTest. */
+  public static class Default implements android.aidl.test.trunk.ITrunkStableTest
+  {
+    @Override public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public byte repeatEnum(byte input) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public void callMyCallback(android.aidl.test.trunk.ITrunkStableTest.IMyCallback cb) throws android.os.RemoteException
+    {
+    }
+    @Override
+    public int getInterfaceVersion() {
+      return 0;
+    }
+    @Override
+    public String getInterfaceHash() {
+      return "";
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.test.trunk.ITrunkStableTest
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.test.trunk.ITrunkStableTest interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.test.trunk.ITrunkStableTest asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.test.trunk.ITrunkStableTest))) {
+        return ((android.aidl.test.trunk.ITrunkStableTest)iin);
+      }
+      return new android.aidl.test.trunk.ITrunkStableTest.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_repeatParcelable:
+        {
+          return "repeatParcelable";
+        }
+        case TRANSACTION_repeatEnum:
+        {
+          return "repeatEnum";
+        }
+        case TRANSACTION_repeatUnion:
+        {
+          return "repeatUnion";
+        }
+        case TRANSACTION_callMyCallback:
+        {
+          return "callMyCallback";
+        }
+        case TRANSACTION_getInterfaceVersion:
+        {
+          return "getInterfaceVersion";
+        }
+        case TRANSACTION_getInterfaceHash:
+        {
+          return "getInterfaceHash";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceVersion) {
+        reply.writeNoException();
+        reply.writeInt(getInterfaceVersion());
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceHash) {
+        reply.writeNoException();
+        reply.writeString(getInterfaceHash());
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_repeatParcelable:
+        {
+          android.aidl.test.trunk.ITrunkStableTest.MyParcelable _arg0;
+          _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyParcelable.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.test.trunk.ITrunkStableTest.MyParcelable _result = this.repeatParcelable(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_repeatEnum:
+        {
+          byte _arg0;
+          _arg0 = data.readByte();
+          data.enforceNoDataAvail();
+          byte _result = this.repeatEnum(_arg0);
+          reply.writeNoException();
+          reply.writeByte(_result);
+          break;
+        }
+        case TRANSACTION_repeatUnion:
+        {
+          android.aidl.test.trunk.ITrunkStableTest.MyUnion _arg0;
+          _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyUnion.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.test.trunk.ITrunkStableTest.MyUnion _result = this.repeatUnion(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_callMyCallback:
+        {
+          android.aidl.test.trunk.ITrunkStableTest.IMyCallback _arg0;
+          _arg0 = android.aidl.test.trunk.ITrunkStableTest.IMyCallback.Stub.asInterface(data.readStrongBinder());
+          data.enforceNoDataAvail();
+          this.callMyCallback(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.test.trunk.ITrunkStableTest
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      private int mCachedVersion = -1;
+      private String mCachedHash = "-1";
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.test.trunk.ITrunkStableTest.MyParcelable _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_repeatParcelable, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method repeatParcelable is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyParcelable.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public byte repeatEnum(byte input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        byte _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeByte(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_repeatEnum, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method repeatEnum is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readByte();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.test.trunk.ITrunkStableTest.MyUnion _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_repeatUnion, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method repeatUnion is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyUnion.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public void callMyCallback(android.aidl.test.trunk.ITrunkStableTest.IMyCallback cb) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStrongInterface(cb);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_callMyCallback, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method callMyCallback is unimplemented.");
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override
+      public int getInterfaceVersion() throws android.os.RemoteException {
+        if (mCachedVersion == -1) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceVersion, data, reply, 0);
+            reply.readException();
+            mCachedVersion = reply.readInt();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedVersion;
+      }
+      @Override
+      public synchronized String getInterfaceHash() throws android.os.RemoteException {
+        if ("-1".equals(mCachedHash)) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceHash, data, reply, 0);
+            reply.readException();
+            mCachedHash = reply.readString();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedHash;
+      }
+    }
+    static final int TRANSACTION_repeatParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    static final int TRANSACTION_repeatEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    static final int TRANSACTION_repeatUnion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+    static final int TRANSACTION_callMyCallback = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+    static final int TRANSACTION_getInterfaceVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777214);
+    static final int TRANSACTION_getInterfaceHash = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777213);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 16777214;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android$aidl$test$trunk$ITrunkStableTest".replace('$', '.');
+  public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException;
+  public byte repeatEnum(byte input) throws android.os.RemoteException;
+  public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException;
+  public void callMyCallback(android.aidl.test.trunk.ITrunkStableTest.IMyCallback cb) throws android.os.RemoteException;
+  public int getInterfaceVersion() throws android.os.RemoteException;
+  public String getInterfaceHash() throws android.os.RemoteException;
+  public static class MyParcelable implements android.os.Parcelable
+  {
+    public int a = 0;
+    public int b = 0;
+    public static final android.os.Parcelable.Creator<MyParcelable> CREATOR = new android.os.Parcelable.Creator<MyParcelable>() {
+      @Override
+      public MyParcelable createFromParcel(android.os.Parcel _aidl_source) {
+        MyParcelable _aidl_out = new MyParcelable();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public MyParcelable[] newArray(int _aidl_size) {
+        return new MyParcelable[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeInt(a);
+      _aidl_parcel.writeInt(b);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        a = _aidl_parcel.readInt();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        b = _aidl_parcel.readInt();
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+  public static @interface MyEnum {
+    public static final byte ZERO = 0;
+    public static final byte ONE = 1;
+    public static final byte TWO = 2;
+  }
+  public static final class MyUnion implements android.os.Parcelable {
+    // tags for union fields
+    public final static int a = 0;  // int a;
+    public final static int b = 1;  // int b;
+
+    private int _tag;
+    private Object _value;
+
+    public MyUnion() {
+      int _value = 0;
+      this._tag = a;
+      this._value = _value;
+    }
+
+    private MyUnion(android.os.Parcel _aidl_parcel) {
+      readFromParcel(_aidl_parcel);
+    }
+
+    private MyUnion(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+
+    public int getTag() {
+      return _tag;
+    }
+
+    // int a;
+
+    public static MyUnion a(int _value) {
+      return new MyUnion(a, _value);
+    }
+
+    public int getA() {
+      _assertTag(a);
+      return (int) _value;
+    }
+
+    public void setA(int _value) {
+      _set(a, _value);
+    }
+
+    // int b;
+
+    public static MyUnion b(int _value) {
+      return new MyUnion(b, _value);
+    }
+
+    public int getB() {
+      _assertTag(b);
+      return (int) _value;
+    }
+
+    public void setB(int _value) {
+      _set(b, _value);
+    }
+
+    public static final android.os.Parcelable.Creator<MyUnion> CREATOR = new android.os.Parcelable.Creator<MyUnion>() {
+      @Override
+      public MyUnion createFromParcel(android.os.Parcel _aidl_source) {
+        return new MyUnion(_aidl_source);
+      }
+      @Override
+      public MyUnion[] newArray(int _aidl_size) {
+        return new MyUnion[_aidl_size];
+      }
+    };
+
+    @Override
+    public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+      _aidl_parcel.writeInt(_tag);
+      switch (_tag) {
+      case a:
+        _aidl_parcel.writeInt(getA());
+        break;
+      case b:
+        _aidl_parcel.writeInt(getB());
+        break;
+      }
+    }
+
+    public void readFromParcel(android.os.Parcel _aidl_parcel) {
+      int _aidl_tag;
+      _aidl_tag = _aidl_parcel.readInt();
+      switch (_aidl_tag) {
+      case a: {
+        int _aidl_value;
+        _aidl_value = _aidl_parcel.readInt();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case b: {
+        int _aidl_value;
+        _aidl_value = _aidl_parcel.readInt();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      }
+      throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+    }
+
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      switch (getTag()) {
+      }
+      return _mask;
+    }
+
+    private void _assertTag(int tag) {
+      if (getTag() != tag) {
+        throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+      }
+    }
+
+    private String _tagString(int _tag) {
+      switch (_tag) {
+      case a: return "a";
+      case b: return "b";
+      }
+      throw new IllegalStateException("unknown field: " + _tag);
+    }
+
+    private void _set(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+    public static @interface Tag {
+      public static final int a = 0;
+      public static final int b = 1;
+    }
+  }
+  public interface IMyCallback extends android.os.IInterface
+  {
+    /**
+     * The version of this interface that the caller is built against.
+     * This might be different from what {@link #getInterfaceVersion()
+     * getInterfaceVersion} returns as that is the version of the interface
+     * that the remote object is implementing.
+     */
+    public static final int VERSION = 1;
+    public static final String HASH = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+    /** Default implementation for IMyCallback. */
+    public static class Default implements android.aidl.test.trunk.ITrunkStableTest.IMyCallback
+    {
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public byte repeatEnum(byte input) throws android.os.RemoteException
+      {
+        return 0;
+      }
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override
+      public int getInterfaceVersion() {
+        return 0;
+      }
+      @Override
+      public String getInterfaceHash() {
+        return "";
+      }
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.test.trunk.ITrunkStableTest.IMyCallback
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.test.trunk.ITrunkStableTest.IMyCallback interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.test.trunk.ITrunkStableTest.IMyCallback asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.test.trunk.ITrunkStableTest.IMyCallback))) {
+          return ((android.aidl.test.trunk.ITrunkStableTest.IMyCallback)iin);
+        }
+        return new android.aidl.test.trunk.ITrunkStableTest.IMyCallback.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      /** @hide */
+      public static java.lang.String getDefaultTransactionName(int transactionCode)
+      {
+        switch (transactionCode)
+        {
+          case TRANSACTION_repeatParcelable:
+          {
+            return "repeatParcelable";
+          }
+          case TRANSACTION_repeatEnum:
+          {
+            return "repeatEnum";
+          }
+          case TRANSACTION_repeatUnion:
+          {
+            return "repeatUnion";
+          }
+          case TRANSACTION_getInterfaceVersion:
+          {
+            return "getInterfaceVersion";
+          }
+          case TRANSACTION_getInterfaceHash:
+          {
+            return "getInterfaceHash";
+          }
+          default:
+          {
+            return null;
+          }
+        }
+      }
+      /** @hide */
+      public java.lang.String getTransactionName(int transactionCode)
+      {
+        return this.getDefaultTransactionName(transactionCode);
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+          data.enforceInterface(descriptor);
+        }
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        else if (code == TRANSACTION_getInterfaceVersion) {
+          reply.writeNoException();
+          reply.writeInt(getInterfaceVersion());
+          return true;
+        }
+        else if (code == TRANSACTION_getInterfaceHash) {
+          reply.writeNoException();
+          reply.writeString(getInterfaceHash());
+          return true;
+        }
+        switch (code)
+        {
+          case TRANSACTION_repeatParcelable:
+          {
+            android.aidl.test.trunk.ITrunkStableTest.MyParcelable _arg0;
+            _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyParcelable.CREATOR);
+            data.enforceNoDataAvail();
+            android.aidl.test.trunk.ITrunkStableTest.MyParcelable _result = this.repeatParcelable(_arg0);
+            reply.writeNoException();
+            reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+            break;
+          }
+          case TRANSACTION_repeatEnum:
+          {
+            byte _arg0;
+            _arg0 = data.readByte();
+            data.enforceNoDataAvail();
+            byte _result = this.repeatEnum(_arg0);
+            reply.writeNoException();
+            reply.writeByte(_result);
+            break;
+          }
+          case TRANSACTION_repeatUnion:
+          {
+            android.aidl.test.trunk.ITrunkStableTest.MyUnion _arg0;
+            _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyUnion.CREATOR);
+            data.enforceNoDataAvail();
+            android.aidl.test.trunk.ITrunkStableTest.MyUnion _result = this.repeatUnion(_arg0);
+            reply.writeNoException();
+            reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+            break;
+          }
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+        return true;
+      }
+      private static class Proxy implements android.aidl.test.trunk.ITrunkStableTest.IMyCallback
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        private int mCachedVersion = -1;
+        private String mCachedHash = "-1";
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+        @Override public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.aidl.test.trunk.ITrunkStableTest.MyParcelable _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeTypedObject(input, 0);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_repeatParcelable, _data, _reply, 0);
+            if (!_status) {
+              throw new android.os.RemoteException("Method repeatParcelable is unimplemented.");
+            }
+            _reply.readException();
+            _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyParcelable.CREATOR);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public byte repeatEnum(byte input) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          byte _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeByte(input);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_repeatEnum, _data, _reply, 0);
+            if (!_status) {
+              throw new android.os.RemoteException("Method repeatEnum is unimplemented.");
+            }
+            _reply.readException();
+            _result = _reply.readByte();
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.aidl.test.trunk.ITrunkStableTest.MyUnion _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeTypedObject(input, 0);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_repeatUnion, _data, _reply, 0);
+            if (!_status) {
+              throw new android.os.RemoteException("Method repeatUnion is unimplemented.");
+            }
+            _reply.readException();
+            _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyUnion.CREATOR);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override
+        public int getInterfaceVersion() throws android.os.RemoteException {
+          if (mCachedVersion == -1) {
+            android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+            android.os.Parcel reply = android.os.Parcel.obtain();
+            try {
+              data.writeInterfaceToken(DESCRIPTOR);
+              boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceVersion, data, reply, 0);
+              reply.readException();
+              mCachedVersion = reply.readInt();
+            } finally {
+              reply.recycle();
+              data.recycle();
+            }
+          }
+          return mCachedVersion;
+        }
+        @Override
+        public synchronized String getInterfaceHash() throws android.os.RemoteException {
+          if ("-1".equals(mCachedHash)) {
+            android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+            android.os.Parcel reply = android.os.Parcel.obtain();
+            try {
+              data.writeInterfaceToken(DESCRIPTOR);
+              boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceHash, data, reply, 0);
+              reply.readException();
+              mCachedHash = reply.readString();
+            } finally {
+              reply.recycle();
+              data.recycle();
+            }
+          }
+          return mCachedHash;
+        }
+      }
+      static final int TRANSACTION_repeatParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+      static final int TRANSACTION_repeatEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+      static final int TRANSACTION_repeatUnion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+      static final int TRANSACTION_getInterfaceVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777214);
+      static final int TRANSACTION_getInterfaceHash = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777213);
+      /** @hide */
+      public int getMaxTransactionId()
+      {
+        return 16777214;
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android$aidl$test$trunk$ITrunkStableTest$IMyCallback".replace('$', '.');
+    public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException;
+    public byte repeatEnum(byte input) throws android.os.RemoteException;
+    public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException;
+    public int getInterfaceVersion() throws android.os.RemoteException;
+    public String getInterfaceHash() throws android.os.RemoteException;
+  }
+}
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java.d b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java.d
new file mode 100644
index 0000000..e280c96
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java : \
+  system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/timestamp b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/timestamp
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp
new file mode 100644
index 0000000..eac8143
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp
@@ -0,0 +1,1435 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#include "aidl/android/aidl/test/trunk/ITrunkStableTest.h"
+
+#include <android/binder_parcel_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <aidl/android/aidl/test/trunk/BpTrunkStableTest.h>
+
+namespace {
+struct ScopedTrace {
+  inline explicit ScopedTrace(const char* name) { ATrace_beginSection(name); }
+  inline ~ScopedTrace() { ATrace_endSection(); }
+};
+}  // namespace
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+static binder_status_t _aidl_android_aidl_test_trunk_ITrunkStableTest_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnTrunkStableTest> _aidl_impl = std::static_pointer_cast<BnTrunkStableTest>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*repeatParcelable*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatParcelable::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatParcelable(in_input, &_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "repeatParcelable";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*repeatEnum*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatEnum::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatEnum(in_input, &_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "repeatEnum";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*repeatUnion*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatUnion::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatUnion(in_input, &_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "repeatUnion";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 3 /*callMyCallback*/): {
+      std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback> in_cb;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::callMyCallback::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_cb);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_cb", ::android::internal::ToString(in_cb));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->callMyCallback(in_cb);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "callMyCallback";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): {
+      int32_t _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::getInterfaceVersion::server");
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "getInterfaceVersion";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): {
+      std::string _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::getInterfaceHash::server");
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "getInterfaceHash";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_test_trunk_ITrunkStableTest_clazz = ::ndk::ICInterface::defineClass(ITrunkStableTest::descriptor, _aidl_android_aidl_test_trunk_ITrunkStableTest_onTransact);
+
+BpTrunkStableTest::BpTrunkStableTest(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpTrunkStableTest::~BpTrunkStableTest() {}
+std::function<void(const BpTrunkStableTest::TransactionLog&)> BpTrunkStableTest::logFunc;
+
+::ndk::ScopedAStatus BpTrunkStableTest::repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatParcelable::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*repeatParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->repeatParcelable(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatEnum::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*repeatEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->repeatEnum(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatEnum";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatUnion::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*repeatUnion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->repeatUnion(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatUnion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_cb", ::android::internal::ToString(in_cb));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::callMyCallback::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_cb);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 3 /*callMyCallback*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->callMyCallback(in_cb);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "callMyCallback";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::getInterfaceVersion(int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  if (_aidl_cached_version != -1) {
+    *_aidl_return = _aidl_cached_version;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::getInterfaceVersion::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->getInterfaceVersion(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_version = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "getInterfaceVersion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::getInterfaceHash(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex);
+  if (_aidl_cached_hash != "-1") {
+    *_aidl_return = _aidl_cached_hash;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::getInterfaceHash::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->getInterfaceHash(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_hash = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "getInterfaceHash";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+// Source for BnTrunkStableTest
+BnTrunkStableTest::BnTrunkStableTest() {}
+BnTrunkStableTest::~BnTrunkStableTest() {}
+std::function<void(const BnTrunkStableTest::TransactionLog&)> BnTrunkStableTest::logFunc;
+::ndk::SpAIBinder BnTrunkStableTest::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_test_trunk_ITrunkStableTest_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+::ndk::ScopedAStatus BnTrunkStableTest::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = ITrunkStableTest::version;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus BnTrunkStableTest::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = ITrunkStableTest::hash;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+// Source for ITrunkStableTest
+const char* ITrunkStableTest::descriptor = "android.aidl.test.trunk.ITrunkStableTest";
+ITrunkStableTest::ITrunkStableTest() {}
+ITrunkStableTest::~ITrunkStableTest() {}
+
+
+std::shared_ptr<ITrunkStableTest> ITrunkStableTest::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_test_trunk_ITrunkStableTest_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpTrunkStableTest>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<ITrunkStableTest>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpTrunkStableTest>(binder);
+}
+
+binder_status_t ITrunkStableTest::writeToParcel(AParcel* parcel, const std::shared_ptr<ITrunkStableTest>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ITrunkStableTest::readFromParcel(const AParcel* parcel, std::shared_ptr<ITrunkStableTest>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = ITrunkStableTest::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ITrunkStableTest::setDefaultImpl(const std::shared_ptr<ITrunkStableTest>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!ITrunkStableTest::default_impl);
+  if (impl) {
+    ITrunkStableTest::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ITrunkStableTest>& ITrunkStableTest::getDefaultImpl() {
+  return ITrunkStableTest::default_impl;
+}
+std::shared_ptr<ITrunkStableTest> ITrunkStableTest::default_impl = nullptr;
+::ndk::ScopedAStatus ITrunkStableTestDefault::repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& /*in_cb*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = 0;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = "";
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::SpAIBinder ITrunkStableTestDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ITrunkStableTestDefault::isRemote() {
+  return false;
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+const char* ITrunkStableTest::MyParcelable::descriptor = "android.aidl.test.trunk.ITrunkStableTest.MyParcelable";
+
+binder_status_t ITrunkStableTest::MyParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ITrunkStableTest::MyParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+const char* ITrunkStableTest::MyUnion::descriptor = "android.aidl.test.trunk.ITrunkStableTest.MyUnion";
+
+binder_status_t ITrunkStableTest::MyUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case a: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<a>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<a>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case b: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<b>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<b>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t ITrunkStableTest::MyUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case a: return ::ndk::AParcel_writeData(_parcel, get<a>());
+  case b: return ::ndk::AParcel_writeData(_parcel, get<b>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+static binder_status_t _aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<ITrunkStableTest::BnMyCallback> _aidl_impl = std::static_pointer_cast<ITrunkStableTest::BnMyCallback>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*repeatParcelable*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatParcelable::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatParcelable(in_input, &_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "repeatParcelable";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*repeatEnum*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatEnum::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatEnum(in_input, &_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "repeatEnum";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*repeatUnion*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatUnion::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatUnion(in_input, &_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "repeatUnion";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): {
+      int32_t _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::getInterfaceVersion::server");
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "getInterfaceVersion";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): {
+      std::string _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::getInterfaceHash::server");
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "getInterfaceHash";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_clazz = ::ndk::ICInterface::defineClass(ITrunkStableTest::IMyCallback::descriptor, _aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_onTransact);
+
+ITrunkStableTest::BpMyCallback::BpMyCallback(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ITrunkStableTest::BpMyCallback::~BpMyCallback() {}
+std::function<void(const ITrunkStableTest::BpMyCallback::TransactionLog&)> ITrunkStableTest::BpMyCallback::logFunc;
+
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatParcelable::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*repeatParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->repeatParcelable(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatEnum::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*repeatEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->repeatEnum(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatEnum";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatUnion::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*repeatUnion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->repeatUnion(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatUnion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::getInterfaceVersion(int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  if (_aidl_cached_version != -1) {
+    *_aidl_return = _aidl_cached_version;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::getInterfaceVersion::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->getInterfaceVersion(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_version = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "getInterfaceVersion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::getInterfaceHash(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex);
+  if (_aidl_cached_hash != "-1") {
+    *_aidl_return = _aidl_cached_hash;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::getInterfaceHash::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->getInterfaceHash(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_hash = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "getInterfaceHash";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+// Source for BnMyCallback
+ITrunkStableTest::BnMyCallback::BnMyCallback() {}
+ITrunkStableTest::BnMyCallback::~BnMyCallback() {}
+std::function<void(const ITrunkStableTest::BnMyCallback::TransactionLog&)> ITrunkStableTest::BnMyCallback::logFunc;
+::ndk::SpAIBinder ITrunkStableTest::BnMyCallback::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+::ndk::ScopedAStatus ITrunkStableTest::BnMyCallback::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = IMyCallback::version;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus ITrunkStableTest::BnMyCallback::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = IMyCallback::hash;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+// Source for IMyCallback
+const char* ITrunkStableTest::IMyCallback::descriptor = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+ITrunkStableTest::IMyCallback::IMyCallback() {}
+ITrunkStableTest::IMyCallback::~IMyCallback() {}
+
+
+std::shared_ptr<ITrunkStableTest::IMyCallback> ITrunkStableTest::IMyCallback::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ITrunkStableTest::BpMyCallback>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IMyCallback>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ITrunkStableTest::BpMyCallback>(binder);
+}
+
+binder_status_t ITrunkStableTest::IMyCallback::writeToParcel(AParcel* parcel, const std::shared_ptr<IMyCallback>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ITrunkStableTest::IMyCallback::readFromParcel(const AParcel* parcel, std::shared_ptr<IMyCallback>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IMyCallback::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ITrunkStableTest::IMyCallback::setDefaultImpl(const std::shared_ptr<IMyCallback>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IMyCallback::default_impl);
+  if (impl) {
+    IMyCallback::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ITrunkStableTest::IMyCallback>& ITrunkStableTest::IMyCallback::getDefaultImpl() {
+  return IMyCallback::default_impl;
+}
+std::shared_ptr<ITrunkStableTest::IMyCallback> ITrunkStableTest::IMyCallback::default_impl = nullptr;
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = 0;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = "";
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::SpAIBinder ITrunkStableTest::IMyCallbackDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ITrunkStableTest::IMyCallbackDefault::isRemote() {
+  return false;
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d
new file mode 100644
index 0000000..d5781d7
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp : \
+  system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/BnTrunkStableTest.h b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/BnTrunkStableTest.h
new file mode 100644
index 0000000..eb3c3ac
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/BnTrunkStableTest.h
@@ -0,0 +1,81 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/test/trunk/ITrunkStableTest.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class BnTrunkStableTest : public ::ndk::BnCInterface<ITrunkStableTest> {
+public:
+  BnTrunkStableTest();
+  virtual ~BnTrunkStableTest();
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) final;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) final;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class ITrunkStableTestDelegator : public BnTrunkStableTest {
+public:
+  explicit ITrunkStableTestDelegator(const std::shared_ptr<ITrunkStableTest> &impl) : _impl(impl) {
+     int32_t _impl_ver = 0;
+     if (!impl->getInterfaceVersion(&_impl_ver).isOk()) {;
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Delegator failed to get version of the implementation.");
+     }
+     if (_impl_ver != ITrunkStableTest::version) {
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Mismatched versions of delegator and implementation is not allowed.");
+     }
+  }
+
+  ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override {
+    return _impl->repeatParcelable(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override {
+    return _impl->repeatEnum(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override {
+    return _impl->repeatUnion(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) override {
+    return _impl->callMyCallback(in_cb);
+  }
+protected:
+private:
+  std::shared_ptr<ITrunkStableTest> _impl;
+};
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/BpTrunkStableTest.h b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/BpTrunkStableTest.h
new file mode 100644
index 0000000..62bd6ca
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/BpTrunkStableTest.h
@@ -0,0 +1,54 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/test/trunk/ITrunkStableTest.h"
+
+#include <android/binder_ibinder.h>
+#include <functional>
+#include <chrono>
+#include <sstream>
+#include <android/trace.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class BpTrunkStableTest : public ::ndk::BpCInterface<ITrunkStableTest> {
+public:
+  explicit BpTrunkStableTest(const ::ndk::SpAIBinder& binder);
+  virtual ~BpTrunkStableTest();
+
+  ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+  ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+  ::ndk::ScopedAStatus callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  int32_t _aidl_cached_version = -1;
+  std::string _aidl_cached_hash = "-1";
+  std::mutex _aidl_cached_hash_mutex;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+};
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/ITrunkStableTest.h b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/ITrunkStableTest.h
new file mode 100644
index 0000000..4075f7b
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/ITrunkStableTest.h
@@ -0,0 +1,385 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <chrono>
+#include <cstdint>
+#include <functional>
+#include <memory>
+#include <optional>
+#include <sstream>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_ibinder.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <android/trace.h>
+#include <aidl/android/aidl/test/trunk/ITrunkStableTest.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class ITrunkStableTestDelegator;
+
+class ITrunkStableTest : public ::ndk::ICInterface {
+public:
+  typedef ITrunkStableTestDelegator DefaultDelegator;
+  static const char* descriptor;
+  ITrunkStableTest();
+  virtual ~ITrunkStableTest();
+
+  class MyParcelable {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    int32_t a = 0;
+    int32_t b = 0;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const MyParcelable& rhs) const {
+      return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator<(const MyParcelable& rhs) const {
+      return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator<=(const MyParcelable& rhs) const {
+      return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator==(const MyParcelable& rhs) const {
+      return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator>(const MyParcelable& rhs) const {
+      return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator>=(const MyParcelable& rhs) const {
+      return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyParcelable{";
+      os << "a: " << ::android::internal::ToString(a);
+      os << ", b: " << ::android::internal::ToString(b);
+      os << "}";
+      return os.str();
+    }
+  };
+  enum class MyEnum : int8_t {
+    ZERO = 0,
+    ONE = 1,
+    TWO = 2,
+  };
+
+  class MyUnion {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    enum class Tag : int32_t {
+      a = 0,
+      b = 1,
+    };
+
+    // Expose tag symbols for legacy code
+    static const inline Tag a = Tag::a;
+    static const inline Tag b = Tag::b;
+
+    template<typename _Tp>
+    static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, MyUnion>;
+
+    MyUnion() : _value(std::in_place_index<static_cast<size_t>(a)>, int32_t(0)) { }
+
+    template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+    // NOLINTNEXTLINE(google-explicit-constructor)
+    constexpr MyUnion(_Tp&& _arg)
+        : _value(std::forward<_Tp>(_arg)) {}
+
+    template <size_t _Np, typename... _Tp>
+    constexpr explicit MyUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+        : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+    template <Tag _tag, typename... _Tp>
+    static MyUnion make(_Tp&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+    }
+
+    template <Tag _tag, typename _Tp, typename... _Up>
+    static MyUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+    }
+
+    Tag getTag() const {
+      return static_cast<Tag>(_value.index());
+    }
+
+    template <Tag _tag>
+    const auto& get() const {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag>
+    auto& get() {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag, typename... _Tp>
+    void set(_Tp&&... _args) {
+      _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+    }
+
+    binder_status_t readFromParcel(const AParcel* _parcel);
+    binder_status_t writeToParcel(AParcel* _parcel) const;
+
+    inline bool operator!=(const MyUnion& rhs) const {
+      return _value != rhs._value;
+    }
+    inline bool operator<(const MyUnion& rhs) const {
+      return _value < rhs._value;
+    }
+    inline bool operator<=(const MyUnion& rhs) const {
+      return _value <= rhs._value;
+    }
+    inline bool operator==(const MyUnion& rhs) const {
+      return _value == rhs._value;
+    }
+    inline bool operator>(const MyUnion& rhs) const {
+      return _value > rhs._value;
+    }
+    inline bool operator>=(const MyUnion& rhs) const {
+      return _value >= rhs._value;
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyUnion{";
+      switch (getTag()) {
+      case a: os << "a: " << ::android::internal::ToString(get<a>()); break;
+      case b: os << "b: " << ::android::internal::ToString(get<b>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    std::variant<int32_t, int32_t> _value;
+  };
+  class IMyCallbackDelegator;
+
+  class IMyCallback : public ::ndk::ICInterface {
+  public:
+    typedef IMyCallbackDelegator DefaultDelegator;
+    static const char* descriptor;
+    IMyCallback();
+    virtual ~IMyCallback();
+
+    static inline const int32_t version = 1;
+    static inline const std::string hash = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+    static constexpr uint32_t TRANSACTION_repeatParcelable = FIRST_CALL_TRANSACTION + 0;
+    static constexpr uint32_t TRANSACTION_repeatEnum = FIRST_CALL_TRANSACTION + 1;
+    static constexpr uint32_t TRANSACTION_repeatUnion = FIRST_CALL_TRANSACTION + 2;
+
+    static std::shared_ptr<IMyCallback> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IMyCallback>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IMyCallback>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<IMyCallback>& impl);
+    static const std::shared_ptr<IMyCallback>& getDefaultImpl();
+    virtual ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) = 0;
+  private:
+    static std::shared_ptr<IMyCallback> default_impl;
+  };
+  class IMyCallbackDefault : public IMyCallback {
+  public:
+    ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+    ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+    ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpMyCallback : public ::ndk::BpCInterface<IMyCallback> {
+  public:
+    explicit BpMyCallback(const ::ndk::SpAIBinder& binder);
+    virtual ~BpMyCallback();
+
+    ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+    ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+    ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+    int32_t _aidl_cached_version = -1;
+    std::string _aidl_cached_hash = "-1";
+    std::mutex _aidl_cached_hash_mutex;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  };
+  class BnMyCallback : public ::ndk::BnCInterface<IMyCallback> {
+  public:
+    BnMyCallback();
+    virtual ~BnMyCallback();
+    ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) final;
+    ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) final;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  static inline const int32_t version = 1;
+  static inline const std::string hash = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+  static constexpr uint32_t TRANSACTION_repeatParcelable = FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_repeatEnum = FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_repeatUnion = FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_callMyCallback = FIRST_CALL_TRANSACTION + 3;
+
+  static std::shared_ptr<ITrunkStableTest> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<ITrunkStableTest>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<ITrunkStableTest>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<ITrunkStableTest>& impl);
+  static const std::shared_ptr<ITrunkStableTest>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) = 0;
+private:
+  static std::shared_ptr<ITrunkStableTest> default_impl;
+};
+class ITrunkStableTestDefault : public ITrunkStableTest {
+public:
+  ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+  ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+  ::ndk::ScopedAStatus callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+[[nodiscard]] static inline std::string toString(ITrunkStableTest::MyEnum val) {
+  switch(val) {
+  case ITrunkStableTest::MyEnum::ZERO:
+    return "ZERO";
+  case ITrunkStableTest::MyEnum::ONE:
+    return "ONE";
+  case ITrunkStableTest::MyEnum::TWO:
+    return "TWO";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum, 3> enum_values<aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum> = {
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum::ZERO,
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum::ONE,
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum::TWO,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+[[nodiscard]] static inline std::string toString(ITrunkStableTest::MyUnion::Tag val) {
+  switch(val) {
+  case ITrunkStableTest::MyUnion::Tag::a:
+    return "a";
+  case ITrunkStableTest::MyUnion::Tag::b:
+    return "b";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag, 2> enum_values<aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag> = {
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::a,
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::b,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/timestamp b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/timestamp
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs
new file mode 100644
index 0000000..03ca423
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs
@@ -0,0 +1,916 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs.d -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  ITrunkStableTest["android.aidl.test.trunk.ITrunkStableTest"] {
+    native: BnTrunkStableTest(on_transact),
+    proxy: BpTrunkStableTest {
+      cached_version: std::sync::atomic::AtomicI32 = std::sync::atomic::AtomicI32::new(-1),
+      cached_hash: std::sync::Mutex<Option<String>> = std::sync::Mutex::new(None)
+    },
+    async: ITrunkStableTestAsync,
+  }
+}
+pub trait ITrunkStableTest: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest" }
+  fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>;
+  fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>;
+  fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>;
+  fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()>;
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    Ok(VERSION)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    Ok(HASH.into())
+  }
+  fn getDefaultImpl() -> ITrunkStableTestDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: ITrunkStableTestDefaultRef) -> ITrunkStableTestDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait ITrunkStableTestAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest" }
+  fn r#repeatParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>>;
+  fn r#repeatEnum<'a>(&'a self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>>;
+  fn r#repeatUnion<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>>;
+  fn r#callMyCallback<'a>(&'a self, _arg_cb: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    Box::pin(async move { Ok(VERSION) })
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    Box::pin(async move { Ok(HASH.into()) })
+  }
+}
+#[::async_trait::async_trait]
+pub trait ITrunkStableTestAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest" }
+  async fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>;
+  async fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>;
+  async fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>;
+  async fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()>;
+}
+impl BnTrunkStableTest {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn ITrunkStableTest>
+  where
+    T: ITrunkStableTestAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> ITrunkStableTest for Wrapper<T, R>
+    where
+      T: ITrunkStableTestAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+        self._rt.block_on(self._inner.r#repeatParcelable(_arg_input))
+      }
+      fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+        self._rt.block_on(self._inner.r#repeatEnum(_arg_input))
+      }
+      fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+        self._rt.block_on(self._inner.r#repeatUnion(_arg_input))
+      }
+      fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#callMyCallback(_arg_cb))
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait ITrunkStableTestDefault: Send + Sync {
+  fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#repeatParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  pub const r#repeatEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+  pub const r#repeatUnion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+  pub const r#callMyCallback: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 3;
+  pub const r#getInterfaceVersion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777214;
+  pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213;
+}
+pub type ITrunkStableTestDefaultRef = Option<std::sync::Arc<dyn ITrunkStableTestDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<ITrunkStableTestDefaultRef> = std::sync::Mutex::new(None);
+}
+pub const VERSION: i32 = 1;
+pub const HASH: &str = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+impl BpTrunkStableTest {
+  fn build_parcel_repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#repeatParcelable(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#repeatEnum(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#repeatUnion(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_cb)?;
+    Ok(aidl_data)
+  }
+  fn read_response_callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#callMyCallback(_arg_cb);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_getInterfaceVersion(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceVersion(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    self.cached_version.store(_aidl_return, std::sync::atomic::Ordering::Relaxed);
+    Ok(_aidl_return)
+  }
+  fn build_parcel_getInterfaceHash(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceHash(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    *self.cached_hash.lock().unwrap() = Some(_aidl_return.clone());
+    Ok(_aidl_return)
+  }
+}
+impl ITrunkStableTest for BpTrunkStableTest {
+  fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+    let _aidl_data = self.build_parcel_repeatParcelable(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#repeatParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_repeatParcelable(_arg_input, _aidl_reply)
+  }
+  fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+    let _aidl_data = self.build_parcel_repeatEnum(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#repeatEnum, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_repeatEnum(_arg_input, _aidl_reply)
+  }
+  fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+    let _aidl_data = self.build_parcel_repeatUnion(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#repeatUnion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_repeatUnion(_arg_input, _aidl_reply)
+  }
+  fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_callMyCallback(_arg_cb)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#callMyCallback, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_callMyCallback(_arg_cb, _aidl_reply)
+  }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Ok(_aidl_version); }
+    let _aidl_data = self.build_parcel_getInterfaceVersion()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceVersion(_aidl_reply)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Ok(_aidl_hash.clone());
+      }
+    }
+    let _aidl_data = self.build_parcel_getInterfaceHash()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceHash(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> ITrunkStableTestAsync<P> for BpTrunkStableTest {
+  fn r#repeatParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>> {
+    let _aidl_data = match self.build_parcel_repeatParcelable(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#repeatParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_repeatParcelable(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#repeatEnum<'a>(&'a self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>> {
+    let _aidl_data = match self.build_parcel_repeatEnum(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#repeatEnum, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_repeatEnum(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#repeatUnion<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>> {
+    let _aidl_data = match self.build_parcel_repeatUnion(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#repeatUnion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_repeatUnion(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#callMyCallback<'a>(&'a self, _arg_cb: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_callMyCallback(_arg_cb) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#callMyCallback, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_callMyCallback(_arg_cb, _aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Box::pin(std::future::ready(Ok(_aidl_version))); }
+    let _aidl_data = match self.build_parcel_getInterfaceVersion() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceVersion(_aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Box::pin(std::future::ready(Ok(_aidl_hash.clone())));
+      }
+    }
+    let _aidl_data = match self.build_parcel_getInterfaceHash() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceHash(_aidl_reply)
+      }
+    )
+  }
+}
+impl ITrunkStableTest for binder::binder_impl::Binder<BnTrunkStableTest> {
+  fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> { self.0.r#repeatParcelable(_arg_input) }
+  fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> { self.0.r#repeatEnum(_arg_input) }
+  fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> { self.0.r#repeatUnion(_arg_input) }
+  fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()> { self.0.r#callMyCallback(_arg_cb) }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> { self.0.r#getInterfaceVersion() }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> { self.0.r#getInterfaceHash() }
+}
+fn on_transact(_aidl_service: &dyn ITrunkStableTest, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#repeatParcelable => {
+      let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#repeatParcelable(&_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#repeatEnum => {
+      let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#repeatEnum(_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#repeatUnion => {
+      let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#repeatUnion(&_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#callMyCallback => {
+      let _arg_cb: binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#callMyCallback(&_arg_cb);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceVersion => {
+      let _aidl_return = _aidl_service.r#getInterfaceVersion();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceHash => {
+      let _aidl_return = _aidl_service.r#getInterfaceHash();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub mod r#MyParcelable {
+  #[derive(Debug)]
+  pub struct r#MyParcelable {
+    pub r#a: i32,
+    pub r#b: i32,
+  }
+  impl Default for r#MyParcelable {
+    fn default() -> Self {
+      Self {
+        r#a: 0,
+        r#b: 0,
+      }
+    }
+  }
+  impl binder::Parcelable for r#MyParcelable {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        subparcel.write(&self.r#a)?;
+        subparcel.write(&self.r#b)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#a = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#b = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyParcelable);
+  binder::impl_deserialize_for_parcelable!(r#MyParcelable);
+  impl binder::binder_impl::ParcelableMetadata for r#MyParcelable {
+    fn get_descriptor() -> &'static str { "android.aidl.test.trunk.ITrunkStableTest.MyParcelable" }
+  }
+}
+pub mod r#MyEnum {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#MyEnum : [i8; 3] {
+      r#ZERO = 0,
+      r#ONE = 1,
+      r#TWO = 2,
+    }
+  }
+}
+pub mod r#MyUnion {
+  #[derive(Debug)]
+  pub enum r#MyUnion {
+    A(i32),
+    B(i32),
+  }
+  impl Default for r#MyUnion {
+    fn default() -> Self {
+      Self::A(0)
+    }
+  }
+  impl binder::Parcelable for r#MyUnion {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      match self {
+        Self::A(v) => {
+          parcel.write(&0i32)?;
+          parcel.write(v)
+        }
+        Self::B(v) => {
+          parcel.write(&1i32)?;
+          parcel.write(v)
+        }
+      }
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      let tag: i32 = parcel.read()?;
+      match tag {
+        0 => {
+          let value: i32 = parcel.read()?;
+          *self = Self::A(value);
+          Ok(())
+        }
+        1 => {
+          let value: i32 = parcel.read()?;
+          *self = Self::B(value);
+          Ok(())
+        }
+        _ => {
+          Err(binder::StatusCode::BAD_VALUE)
+        }
+      }
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyUnion);
+  binder::impl_deserialize_for_parcelable!(r#MyUnion);
+  impl binder::binder_impl::ParcelableMetadata for r#MyUnion {
+    fn get_descriptor() -> &'static str { "android.aidl.test.trunk.ITrunkStableTest.MyUnion" }
+  }
+  pub mod r#Tag {
+    #![allow(non_upper_case_globals)]
+    use binder::declare_binder_enum;
+    declare_binder_enum! {
+      r#Tag : [i32; 2] {
+        r#a = 0,
+        r#b = 1,
+      }
+    }
+  }
+}
+pub mod r#IMyCallback {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    IMyCallback["android.aidl.test.trunk.ITrunkStableTest.IMyCallback"] {
+      native: BnMyCallback(on_transact),
+      proxy: BpMyCallback {
+        cached_version: std::sync::atomic::AtomicI32 = std::sync::atomic::AtomicI32::new(-1),
+        cached_hash: std::sync::Mutex<Option<String>> = std::sync::Mutex::new(None)
+      },
+      async: IMyCallbackAsync,
+    }
+  }
+  pub trait IMyCallback: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest.IMyCallback" }
+    fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>;
+    fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>;
+    fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>;
+    fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+      Ok(VERSION)
+    }
+    fn r#getInterfaceHash(&self) -> binder::Result<String> {
+      Ok(HASH.into())
+    }
+    fn getDefaultImpl() -> IMyCallbackDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: IMyCallbackDefaultRef) -> IMyCallbackDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait IMyCallbackAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest.IMyCallback" }
+    fn r#repeatParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>>;
+    fn r#repeatEnum<'a>(&'a self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>>;
+    fn r#repeatUnion<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>>;
+    fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+      Box::pin(async move { Ok(VERSION) })
+    }
+    fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+      Box::pin(async move { Ok(HASH.into()) })
+    }
+  }
+  #[::async_trait::async_trait]
+  pub trait IMyCallbackAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest.IMyCallback" }
+    async fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>;
+    async fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>;
+    async fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>;
+  }
+  impl BnMyCallback {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IMyCallback>
+    where
+      T: IMyCallbackAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> IMyCallback for Wrapper<T, R>
+      where
+        T: IMyCallbackAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+        fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+          self._rt.block_on(self._inner.r#repeatParcelable(_arg_input))
+        }
+        fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+          self._rt.block_on(self._inner.r#repeatEnum(_arg_input))
+        }
+        fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+          self._rt.block_on(self._inner.r#repeatUnion(_arg_input))
+        }
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait IMyCallbackDefault: Send + Sync {
+    fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+  }
+  pub mod transactions {
+    pub const r#repeatParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+    pub const r#repeatEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+    pub const r#repeatUnion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+    pub const r#getInterfaceVersion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777214;
+    pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213;
+  }
+  pub type IMyCallbackDefaultRef = Option<std::sync::Arc<dyn IMyCallbackDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<IMyCallbackDefaultRef> = std::sync::Mutex::new(None);
+  }
+  pub const VERSION: i32 = 1;
+  pub const HASH: &str = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+  impl BpMyCallback {
+    fn build_parcel_repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyCallback>::getDefaultImpl() {
+          return _aidl_default_impl.r#repeatParcelable(_arg_input);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable = _aidl_reply.read()?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(&_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyCallback>::getDefaultImpl() {
+          return _aidl_default_impl.r#repeatEnum(_arg_input);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum = _aidl_reply.read()?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyCallback>::getDefaultImpl() {
+          return _aidl_default_impl.r#repeatUnion(_arg_input);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion = _aidl_reply.read()?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_getInterfaceVersion(&self) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      Ok(aidl_data)
+    }
+    fn read_response_getInterfaceVersion(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: i32 = _aidl_reply.read()?;
+      self.cached_version.store(_aidl_return, std::sync::atomic::Ordering::Relaxed);
+      Ok(_aidl_return)
+    }
+    fn build_parcel_getInterfaceHash(&self) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      Ok(aidl_data)
+    }
+    fn read_response_getInterfaceHash(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: String = _aidl_reply.read()?;
+      *self.cached_hash.lock().unwrap() = Some(_aidl_return.clone());
+      Ok(_aidl_return)
+    }
+  }
+  impl IMyCallback for BpMyCallback {
+    fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+      let _aidl_data = self.build_parcel_repeatParcelable(_arg_input)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#repeatParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_repeatParcelable(_arg_input, _aidl_reply)
+    }
+    fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+      let _aidl_data = self.build_parcel_repeatEnum(_arg_input)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#repeatEnum, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_repeatEnum(_arg_input, _aidl_reply)
+    }
+    fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+      let _aidl_data = self.build_parcel_repeatUnion(_arg_input)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#repeatUnion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_repeatUnion(_arg_input, _aidl_reply)
+    }
+    fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+      let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+      if _aidl_version != -1 { return Ok(_aidl_version); }
+      let _aidl_data = self.build_parcel_getInterfaceVersion()?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_getInterfaceVersion(_aidl_reply)
+    }
+    fn r#getInterfaceHash(&self) -> binder::Result<String> {
+      {
+        let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+        if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+          return Ok(_aidl_hash.clone());
+        }
+      }
+      let _aidl_data = self.build_parcel_getInterfaceHash()?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_getInterfaceHash(_aidl_reply)
+    }
+  }
+  impl<P: binder::BinderAsyncPool> IMyCallbackAsync<P> for BpMyCallback {
+    fn r#repeatParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>> {
+      let _aidl_data = match self.build_parcel_repeatParcelable(_arg_input) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#repeatParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_repeatParcelable(_arg_input, _aidl_reply)
+        }
+      )
+    }
+    fn r#repeatEnum<'a>(&'a self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>> {
+      let _aidl_data = match self.build_parcel_repeatEnum(_arg_input) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#repeatEnum, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_repeatEnum(_arg_input, _aidl_reply)
+        }
+      )
+    }
+    fn r#repeatUnion<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>> {
+      let _aidl_data = match self.build_parcel_repeatUnion(_arg_input) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#repeatUnion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_repeatUnion(_arg_input, _aidl_reply)
+        }
+      )
+    }
+    fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+      let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+      if _aidl_version != -1 { return Box::pin(std::future::ready(Ok(_aidl_version))); }
+      let _aidl_data = match self.build_parcel_getInterfaceVersion() {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_getInterfaceVersion(_aidl_reply)
+        }
+      )
+    }
+    fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+      {
+        let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+        if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+          return Box::pin(std::future::ready(Ok(_aidl_hash.clone())));
+        }
+      }
+      let _aidl_data = match self.build_parcel_getInterfaceHash() {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_getInterfaceHash(_aidl_reply)
+        }
+      )
+    }
+  }
+  impl IMyCallback for binder::binder_impl::Binder<BnMyCallback> {
+    fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> { self.0.r#repeatParcelable(_arg_input) }
+    fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> { self.0.r#repeatEnum(_arg_input) }
+    fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> { self.0.r#repeatUnion(_arg_input) }
+    fn r#getInterfaceVersion(&self) -> binder::Result<i32> { self.0.r#getInterfaceVersion() }
+    fn r#getInterfaceHash(&self) -> binder::Result<String> { self.0.r#getInterfaceHash() }
+  }
+  fn on_transact(_aidl_service: &dyn IMyCallback, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      transactions::r#repeatParcelable => {
+        let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#repeatParcelable(&_arg_input);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#repeatEnum => {
+        let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#repeatEnum(_arg_input);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#repeatUnion => {
+        let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#repeatUnion(&_arg_input);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#getInterfaceVersion => {
+        let _aidl_return = _aidl_service.r#getInterfaceVersion();
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#getInterfaceHash => {
+        let _aidl_return = _aidl_service.r#getInterfaceHash();
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ITrunkStableTest as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest;
+ pub use super::r#MyParcelable::r#MyParcelable as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable;
+ pub use super::r#MyEnum::r#MyEnum as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum;
+ pub use super::r#MyUnion::r#MyUnion as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion;
+ pub use super::r#MyUnion::r#Tag::r#Tag as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion_3_Tag;
+ pub use super::r#IMyCallback::r#IMyCallback as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback;
+}
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs.d b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs.d
new file mode 100644
index 0000000..93fe9a2
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs : \
+  system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/timestamp b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/timestamp
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp
new file mode 100644
index 0000000..a272a31
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp
@@ -0,0 +1,1413 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version current --previous_api_dir=system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 --previous_hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android/aidl/test/trunk/BpTrunkStableTest.h>
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(TrunkStableTest, "android.aidl.test.trunk.ITrunkStableTest")
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/BpTrunkStableTest.h>
+#include <android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+
+BpTrunkStableTest::BpTrunkStableTest(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<ITrunkStableTest>(_aidl_impl){
+}
+
+std::function<void(const BpTrunkStableTest::TransactionLog&)> BpTrunkStableTest::logFunc;
+
+::android::binder::Status BpTrunkStableTest::repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatParcelable::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_repeatParcelable, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->repeatParcelable(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status BpTrunkStableTest::repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatEnum::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(static_cast<int8_t>(input));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_repeatEnum, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->repeatEnum(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readByte(reinterpret_cast<int8_t *>(_aidl_return));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatEnum";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status BpTrunkStableTest::repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatUnion::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_repeatUnion, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->repeatUnion(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatUnion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status BpTrunkStableTest::callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::callMyCallback::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("cb", ::android::internal::ToString(cb));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(cb);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_callMyCallback, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->callMyCallback(cb);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "callMyCallback";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status BpTrunkStableTest::repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatOtherParcelable::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  if (true) {
+    _aidl_ret_status = ::android::UNKNOWN_TRANSACTION;
+  } else {
+    _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+    if (((_aidl_ret_status) != (::android::OK))) {
+      goto _aidl_error;
+    }
+    _aidl_ret_status = _aidl_data.writeParcelable(input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      goto _aidl_error;
+    }
+    _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_repeatOtherParcelable, _aidl_data, &_aidl_reply, 0);
+  }
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->repeatOtherParcelable(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatOtherParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+int32_t BpTrunkStableTest::getInterfaceVersion() {
+  if (cached_version_ == -1) {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnTrunkStableTest::TRANSACTION_getInterfaceVersion, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        cached_version_ = reply.readInt32();
+      }
+    }
+  }
+  return cached_version_;
+}
+
+
+std::string BpTrunkStableTest::getInterfaceHash() {
+  std::lock_guard<std::mutex> lockGuard(cached_hash_mutex_);
+  if (cached_hash_ == "-1") {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnTrunkStableTest::TRANSACTION_getInterfaceHash, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        reply.readUtf8FromUtf16(&cached_hash_);
+      }
+    }
+  }
+  return cached_hash_;
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+
+BnTrunkStableTest::BnTrunkStableTest()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnTrunkStableTest::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnTrunkStableTest::TRANSACTION_repeatParcelable:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatParcelable(in_input, &_aidl_return));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "repeatParcelable";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_repeatEnum:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyEnum _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_input));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatEnum(in_input, &_aidl_return));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "repeatEnum";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByte(static_cast<int8_t>(_aidl_return));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_repeatUnion:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyUnion in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyUnion _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatUnion::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatUnion(in_input, &_aidl_return));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "repeatUnion";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_callMyCallback:
+  {
+    ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback> in_cb;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::callMyCallback::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinder(&in_cb);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_cb", ::android::internal::ToString(in_cb));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(callMyCallback(in_cb));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "callMyCallback";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_repeatOtherParcelable:
+  {
+    if (true) {
+      _aidl_ret_status = ::android::UNKNOWN_TRANSACTION;
+      break;
+    }
+    ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatOtherParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatOtherParcelable(in_input, &_aidl_return));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "repeatOtherParcelable";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_getInterfaceVersion:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeInt32(ITrunkStableTest::VERSION);
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_getInterfaceHash:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeUtf8AsUtf16(ITrunkStableTest::HASH);
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+int32_t BnTrunkStableTest::getInterfaceVersion() {
+  return ITrunkStableTest::VERSION;
+}
+std::string BnTrunkStableTest::getInterfaceHash() {
+  return ITrunkStableTest::HASH;
+}
+std::function<void(const BnTrunkStableTest::TransactionLog&)> BnTrunkStableTest::logFunc;
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+::android::status_t ITrunkStableTest::MyParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  if (false) {
+    _aidl_ret_status = _aidl_parcel->readInt32(&c);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      return _aidl_ret_status;
+    }
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ITrunkStableTest::MyParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (false) {
+    _aidl_ret_status = _aidl_parcel->writeInt32(c);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      return _aidl_ret_status;
+    }
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+::android::status_t ITrunkStableTest::MyUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case a: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<a>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<a>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case b: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<b>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<b>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case c: {
+    if (true) return ::android::BAD_VALUE;
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<c>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<c>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t ITrunkStableTest::MyUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case a: return _aidl_parcel->writeInt32(get<a>());
+  case b: return _aidl_parcel->writeInt32(get<b>());
+  case c: return true ? ::android::BAD_VALUE : _aidl_parcel->writeInt32(get<c>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ITrunkStableTest, MyCallback, "android.aidl.test.trunk.ITrunkStableTest.IMyCallback")
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+
+ITrunkStableTest::BpMyCallback::BpMyCallback(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IMyCallback>(_aidl_impl){
+}
+
+std::function<void(const ITrunkStableTest::BpMyCallback::TransactionLog&)> ITrunkStableTest::BpMyCallback::logFunc;
+
+::android::binder::Status ITrunkStableTest::BpMyCallback::repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatParcelable::cppClient");
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_repeatParcelable, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl())) {
+     return IMyCallback::getDefaultImpl()->repeatParcelable(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status ITrunkStableTest::BpMyCallback::repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatEnum::cppClient");
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(static_cast<int8_t>(input));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_repeatEnum, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl())) {
+     return IMyCallback::getDefaultImpl()->repeatEnum(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readByte(reinterpret_cast<int8_t *>(_aidl_return));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatEnum";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status ITrunkStableTest::BpMyCallback::repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatUnion::cppClient");
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_repeatUnion, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl())) {
+     return IMyCallback::getDefaultImpl()->repeatUnion(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatUnion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status ITrunkStableTest::BpMyCallback::repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatOtherParcelable::cppClient");
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  if (true) {
+    _aidl_ret_status = ::android::UNKNOWN_TRANSACTION;
+  } else {
+    _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+    if (((_aidl_ret_status) != (::android::OK))) {
+      goto _aidl_error;
+    }
+    _aidl_ret_status = _aidl_data.writeParcelable(input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      goto _aidl_error;
+    }
+    _aidl_ret_status = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_repeatOtherParcelable, _aidl_data, &_aidl_reply, 0);
+  }
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl())) {
+     return IMyCallback::getDefaultImpl()->repeatOtherParcelable(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatOtherParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+int32_t ITrunkStableTest::BpMyCallback::getInterfaceVersion() {
+  if (cached_version_ == -1) {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_getInterfaceVersion, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        cached_version_ = reply.readInt32();
+      }
+    }
+  }
+  return cached_version_;
+}
+
+
+std::string ITrunkStableTest::BpMyCallback::getInterfaceHash() {
+  std::lock_guard<std::mutex> lockGuard(cached_hash_mutex_);
+  if (cached_hash_ == "-1") {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_getInterfaceHash, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        reply.readUtf8FromUtf16(&cached_hash_);
+      }
+    }
+  }
+  return cached_hash_;
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+
+ITrunkStableTest::BnMyCallback::BnMyCallback()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ITrunkStableTest::BnMyCallback::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnMyCallback::TRANSACTION_repeatParcelable:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatParcelable(in_input, &_aidl_return));
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+      _transaction_log.method_name = "repeatParcelable";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnMyCallback::TRANSACTION_repeatEnum:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyEnum _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_input));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatEnum(in_input, &_aidl_return));
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+      _transaction_log.method_name = "repeatEnum";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByte(static_cast<int8_t>(_aidl_return));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnMyCallback::TRANSACTION_repeatUnion:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyUnion in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyUnion _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatUnion::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatUnion(in_input, &_aidl_return));
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+      _transaction_log.method_name = "repeatUnion";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnMyCallback::TRANSACTION_repeatOtherParcelable:
+  {
+    if (true) {
+      _aidl_ret_status = ::android::UNKNOWN_TRANSACTION;
+      break;
+    }
+    ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatOtherParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatOtherParcelable(in_input, &_aidl_return));
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+      _transaction_log.method_name = "repeatOtherParcelable";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnMyCallback::TRANSACTION_getInterfaceVersion:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeInt32(IMyCallback::VERSION);
+  }
+  break;
+  case BnMyCallback::TRANSACTION_getInterfaceHash:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeUtf8AsUtf16(IMyCallback::HASH);
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+int32_t ITrunkStableTest::BnMyCallback::getInterfaceVersion() {
+  return IMyCallback::VERSION;
+}
+std::string ITrunkStableTest::BnMyCallback::getInterfaceHash() {
+  return IMyCallback::HASH;
+}
+std::function<void(const ITrunkStableTest::BnMyCallback::TransactionLog&)> ITrunkStableTest::BnMyCallback::logFunc;
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+::android::status_t ITrunkStableTest::MyOtherParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ITrunkStableTest::MyOtherParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d
new file mode 100644
index 0000000..057b155
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp : \
+  system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/BnTrunkStableTest.h b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/BnTrunkStableTest.h
new file mode 100644
index 0000000..8d0d11e
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/BnTrunkStableTest.h
@@ -0,0 +1,88 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version current --previous_api_dir=system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 --previous_hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <functional>
+#include <android/binder_to_string.h>
+#include <android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class BnTrunkStableTest : public ::android::BnInterface<ITrunkStableTest> {
+public:
+  static constexpr uint32_t TRANSACTION_repeatParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_repeatEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_repeatUnion = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_callMyCallback = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_repeatOtherParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 4;
+  static constexpr uint32_t TRANSACTION_getInterfaceVersion = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777214;
+  static constexpr uint32_t TRANSACTION_getInterfaceHash = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777213;
+  explicit BnTrunkStableTest();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  int32_t getInterfaceVersion();
+  std::string getInterfaceHash();
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+};  // class BnTrunkStableTest
+
+class ITrunkStableTestDelegator : public BnTrunkStableTest {
+public:
+  explicit ITrunkStableTestDelegator(const ::android::sp<ITrunkStableTest> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<ITrunkStableTest> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override {
+    return _aidl_delegate->repeatParcelable(input, _aidl_return);
+  }
+  ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override {
+    return _aidl_delegate->repeatEnum(input, _aidl_return);
+  }
+  ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override {
+    return _aidl_delegate->repeatUnion(input, _aidl_return);
+  }
+  ::android::binder::Status callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb) override {
+    ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallbackDelegator> _cb;
+    if (cb) {
+      _cb = ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallbackDelegator>::cast(delegate(cb));
+    }
+    return _aidl_delegate->callMyCallback(_cb);
+  }
+  ::android::binder::Status repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override {
+    return _aidl_delegate->repeatOtherParcelable(input, _aidl_return);
+  }
+  int32_t getInterfaceVersion() override {
+    int32_t _delegator_ver = BnTrunkStableTest::getInterfaceVersion();
+    int32_t _impl_ver = _aidl_delegate->getInterfaceVersion();
+    return _delegator_ver < _impl_ver ? _delegator_ver : _impl_ver;
+  }
+  std::string getInterfaceHash() override {
+    return _aidl_delegate->getInterfaceHash();
+  }
+private:
+  ::android::sp<ITrunkStableTest> _aidl_delegate;
+};  // class ITrunkStableTestDelegator
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/BpTrunkStableTest.h b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/BpTrunkStableTest.h
new file mode 100644
index 0000000..8bb937f
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/BpTrunkStableTest.h
@@ -0,0 +1,52 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version current --previous_api_dir=system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 --previous_hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <functional>
+#include <android/binder_to_string.h>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class BpTrunkStableTest : public ::android::BpInterface<ITrunkStableTest> {
+public:
+  explicit BpTrunkStableTest(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpTrunkStableTest() = default;
+  ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+  ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+  ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+  ::android::binder::Status callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb) override;
+  ::android::binder::Status repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override;
+  int32_t getInterfaceVersion() override;
+  std::string getInterfaceHash() override;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+private:
+  int32_t cached_version_ = -1;
+  std::string cached_hash_ = "-1";
+  std::mutex cached_hash_mutex_;
+};  // class BpTrunkStableTest
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/ITrunkStableTest.h b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/ITrunkStableTest.h
new file mode 100644
index 0000000..0c005cc
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/ITrunkStableTest.h
@@ -0,0 +1,459 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version current --previous_api_dir=system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 --previous_hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Delegate.h>
+#include <binder/Enums.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cassert>
+#include <cstdint>
+#include <functional>
+#include <string>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class ITrunkStableTestDelegator;
+
+class ITrunkStableTest : public ::android::IInterface {
+public:
+  typedef ITrunkStableTestDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(TrunkStableTest)
+  static inline const int32_t VERSION = true ? 1 : 2;
+  static inline const std::string HASH = true ? "88311b9118fb6fe9eff4a2ca19121de0587f6d5f" : "notfrozen";
+  class MyParcelable : public ::android::Parcelable {
+  public:
+    int32_t a = 0;
+    int32_t b = 0;
+    int32_t c = 0;
+    inline bool operator!=(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) != std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator<(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) < std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator<=(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) <= std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator==(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) == std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator>(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) > std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator>=(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) >= std::tie(rhs.a, rhs.b, rhs.c);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.test.trunk.ITrunkStableTest.MyParcelable");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyParcelable{";
+      os << "a: " << ::android::internal::ToString(a);
+      os << ", b: " << ::android::internal::ToString(b);
+      os << ", c: " << ::android::internal::ToString(c);
+      os << "}";
+      return os.str();
+    }
+  };  // class MyParcelable
+  enum class MyEnum : int8_t {
+    ZERO = 0,
+    ONE = 1,
+    TWO = 2,
+    THREE = 3,
+  };
+  class MyUnion : public ::android::Parcelable {
+  public:
+    enum class Tag : int32_t {
+      a = 0,
+      b = 1,
+      c = 2,
+    };
+    // Expose tag symbols for legacy code
+    static const inline Tag a = Tag::a;
+    static const inline Tag b = Tag::b;
+    static const inline Tag c = Tag::c;
+
+    template<typename _Tp>
+    static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, MyUnion>;
+
+    MyUnion() : _value(std::in_place_index<static_cast<size_t>(a)>, int32_t(0)) { }
+
+    template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+    // NOLINTNEXTLINE(google-explicit-constructor)
+    constexpr MyUnion(_Tp&& _arg)
+        : _value(std::forward<_Tp>(_arg)) {}
+
+    template <size_t _Np, typename... _Tp>
+    constexpr explicit MyUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+        : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+    template <Tag _tag, typename... _Tp>
+    static MyUnion make(_Tp&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+    }
+
+    template <Tag _tag, typename _Tp, typename... _Up>
+    static MyUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+    }
+
+    Tag getTag() const {
+      return static_cast<Tag>(_value.index());
+    }
+
+    template <Tag _tag>
+    const auto& get() const {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag>
+    auto& get() {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag, typename... _Tp>
+    void set(_Tp&&... _args) {
+      _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+    }
+
+    inline bool operator!=(const MyUnion& rhs) const {
+      return _value != rhs._value;
+    }
+    inline bool operator<(const MyUnion& rhs) const {
+      return _value < rhs._value;
+    }
+    inline bool operator<=(const MyUnion& rhs) const {
+      return _value <= rhs._value;
+    }
+    inline bool operator==(const MyUnion& rhs) const {
+      return _value == rhs._value;
+    }
+    inline bool operator>(const MyUnion& rhs) const {
+      return _value > rhs._value;
+    }
+    inline bool operator>=(const MyUnion& rhs) const {
+      return _value >= rhs._value;
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.test.trunk.ITrunkStableTest.MyUnion");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyUnion{";
+      switch (getTag()) {
+      case a: os << "a: " << ::android::internal::ToString(get<a>()); break;
+      case b: os << "b: " << ::android::internal::ToString(get<b>()); break;
+      case c: os << "c: " << ::android::internal::ToString(get<c>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    std::variant<int32_t, int32_t, int32_t> _value;
+  };  // class MyUnion
+  class MyOtherParcelable : public ::android::Parcelable {
+  public:
+    int32_t a = 0;
+    int32_t b = 0;
+    inline bool operator!=(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator<(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator<=(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator==(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator>(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator>=(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyOtherParcelable{";
+      os << "a: " << ::android::internal::ToString(a);
+      os << ", b: " << ::android::internal::ToString(b);
+      os << "}";
+      return os.str();
+    }
+  };  // class MyOtherParcelable
+  class IMyCallbackDelegator;
+
+  class IMyCallback : public ::android::IInterface {
+  public:
+    typedef IMyCallbackDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(MyCallback)
+    static inline const int32_t VERSION = true ? 1 : 2;
+    static inline const std::string HASH = true ? "88311b9118fb6fe9eff4a2ca19121de0587f6d5f" : "notfrozen";
+    virtual ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) = 0;
+    virtual ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) = 0;
+    virtual ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) = 0;
+    virtual ::android::binder::Status repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) = 0;
+    virtual int32_t getInterfaceVersion() = 0;
+    virtual std::string getInterfaceHash() = 0;
+  };  // class IMyCallback
+
+  class IMyCallbackDefault : public IMyCallback {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+    ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    int32_t getInterfaceVersion() override {
+      return 0;
+    }
+    std::string getInterfaceHash() override {
+      return "";
+    }
+  };  // class IMyCallbackDefault
+  class BpMyCallback : public ::android::BpInterface<IMyCallback> {
+  public:
+    explicit BpMyCallback(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpMyCallback() = default;
+    ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+    ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+    ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+    ::android::binder::Status repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override;
+    int32_t getInterfaceVersion() override;
+    std::string getInterfaceHash() override;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  private:
+    int32_t cached_version_ = -1;
+    std::string cached_hash_ = "-1";
+    std::mutex cached_hash_mutex_;
+  };  // class BpMyCallback
+  class BnMyCallback : public ::android::BnInterface<IMyCallback> {
+  public:
+    static constexpr uint32_t TRANSACTION_repeatParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+    static constexpr uint32_t TRANSACTION_repeatEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+    static constexpr uint32_t TRANSACTION_repeatUnion = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+    static constexpr uint32_t TRANSACTION_repeatOtherParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
+    static constexpr uint32_t TRANSACTION_getInterfaceVersion = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777214;
+    static constexpr uint32_t TRANSACTION_getInterfaceHash = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777213;
+    explicit BnMyCallback();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+    int32_t getInterfaceVersion();
+    std::string getInterfaceHash();
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  };  // class BnMyCallback
+
+  class IMyCallbackDelegator : public BnMyCallback {
+  public:
+    explicit IMyCallbackDelegator(const ::android::sp<IMyCallback> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<IMyCallback> getImpl() { return _aidl_delegate; }
+    ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override {
+      return _aidl_delegate->repeatParcelable(input, _aidl_return);
+    }
+    ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override {
+      return _aidl_delegate->repeatEnum(input, _aidl_return);
+    }
+    ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override {
+      return _aidl_delegate->repeatUnion(input, _aidl_return);
+    }
+    ::android::binder::Status repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override {
+      return _aidl_delegate->repeatOtherParcelable(input, _aidl_return);
+    }
+    int32_t getInterfaceVersion() override {
+      int32_t _delegator_ver = BnMyCallback::getInterfaceVersion();
+      int32_t _impl_ver = _aidl_delegate->getInterfaceVersion();
+      return _delegator_ver < _impl_ver ? _delegator_ver : _impl_ver;
+    }
+    std::string getInterfaceHash() override {
+      return _aidl_delegate->getInterfaceHash();
+    }
+  private:
+    ::android::sp<IMyCallback> _aidl_delegate;
+  };  // class IMyCallbackDelegator
+  virtual ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) = 0;
+  virtual ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) = 0;
+  virtual ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) = 0;
+  virtual ::android::binder::Status callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb) = 0;
+  virtual ::android::binder::Status repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) = 0;
+  virtual int32_t getInterfaceVersion() = 0;
+  virtual std::string getInterfaceHash() = 0;
+};  // class ITrunkStableTest
+
+class ITrunkStableTestDefault : public ITrunkStableTest {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& /*cb*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  int32_t getInterfaceVersion() override {
+    return 0;
+  }
+  std::string getInterfaceHash() override {
+    return "";
+  }
+};  // class ITrunkStableTestDefault
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+[[nodiscard]] static inline std::string toString(ITrunkStableTest::MyEnum val) {
+  switch(val) {
+  case ITrunkStableTest::MyEnum::ZERO:
+    return "ZERO";
+  case ITrunkStableTest::MyEnum::ONE:
+    return "ONE";
+  case ITrunkStableTest::MyEnum::TWO:
+    return "TWO";
+  case ITrunkStableTest::MyEnum::THREE:
+    return "THREE";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::test::trunk::ITrunkStableTest::MyEnum, 4> enum_values<::android::aidl::test::trunk::ITrunkStableTest::MyEnum> = {
+  ::android::aidl::test::trunk::ITrunkStableTest::MyEnum::ZERO,
+  ::android::aidl::test::trunk::ITrunkStableTest::MyEnum::ONE,
+  ::android::aidl::test::trunk::ITrunkStableTest::MyEnum::TWO,
+  ::android::aidl::test::trunk::ITrunkStableTest::MyEnum::THREE,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+[[nodiscard]] static inline std::string toString(ITrunkStableTest::MyUnion::Tag val) {
+  switch(val) {
+  case ITrunkStableTest::MyUnion::Tag::a:
+    return "a";
+  case ITrunkStableTest::MyUnion::Tag::b:
+    return "b";
+  case ITrunkStableTest::MyUnion::Tag::c:
+    return "c";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag, 3> enum_values<::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag> = {
+  ::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::a,
+  ::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::b,
+  ::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::c,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/timestamp b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/timestamp
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java
new file mode 100644
index 0000000..61af968
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java
@@ -0,0 +1,998 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version platform_apis --previous_api_dir=system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 --previous_hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java.d -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+package android.aidl.test.trunk;
+public interface ITrunkStableTest extends android.os.IInterface
+{
+  /**
+   * The version of this interface that the caller is built against.
+   * This might be different from what {@link #getInterfaceVersion()
+   * getInterfaceVersion} returns as that is the version of the interface
+   * that the remote object is implementing.
+   */
+  public static final int VERSION = true ? 1 : 2;
+  public static final String HASH = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+  /** Default implementation for ITrunkStableTest. */
+  public static class Default implements android.aidl.test.trunk.ITrunkStableTest
+  {
+    @Override public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public byte repeatEnum(byte input) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public void callMyCallback(android.aidl.test.trunk.ITrunkStableTest.IMyCallback cb) throws android.os.RemoteException
+    {
+    }
+    @Override public android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable repeatOtherParcelable(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override
+    public int getInterfaceVersion() {
+      return 0;
+    }
+    @Override
+    public String getInterfaceHash() {
+      return "";
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.test.trunk.ITrunkStableTest
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.test.trunk.ITrunkStableTest interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.test.trunk.ITrunkStableTest asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.test.trunk.ITrunkStableTest))) {
+        return ((android.aidl.test.trunk.ITrunkStableTest)iin);
+      }
+      return new android.aidl.test.trunk.ITrunkStableTest.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_repeatParcelable:
+        {
+          return "repeatParcelable";
+        }
+        case TRANSACTION_repeatEnum:
+        {
+          return "repeatEnum";
+        }
+        case TRANSACTION_repeatUnion:
+        {
+          return "repeatUnion";
+        }
+        case TRANSACTION_callMyCallback:
+        {
+          return "callMyCallback";
+        }
+        case TRANSACTION_repeatOtherParcelable:
+        {
+          return "repeatOtherParcelable";
+        }
+        case TRANSACTION_getInterfaceVersion:
+        {
+          return "getInterfaceVersion";
+        }
+        case TRANSACTION_getInterfaceHash:
+        {
+          return "getInterfaceHash";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceVersion) {
+        reply.writeNoException();
+        reply.writeInt(getInterfaceVersion());
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceHash) {
+        reply.writeNoException();
+        reply.writeString(getInterfaceHash());
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_repeatParcelable:
+        {
+          android.aidl.test.trunk.ITrunkStableTest.MyParcelable _arg0;
+          _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyParcelable.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.test.trunk.ITrunkStableTest.MyParcelable _result = this.repeatParcelable(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_repeatEnum:
+        {
+          byte _arg0;
+          _arg0 = data.readByte();
+          data.enforceNoDataAvail();
+          byte _result = this.repeatEnum(_arg0);
+          reply.writeNoException();
+          reply.writeByte(_result);
+          break;
+        }
+        case TRANSACTION_repeatUnion:
+        {
+          android.aidl.test.trunk.ITrunkStableTest.MyUnion _arg0;
+          _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyUnion.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.test.trunk.ITrunkStableTest.MyUnion _result = this.repeatUnion(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_callMyCallback:
+        {
+          android.aidl.test.trunk.ITrunkStableTest.IMyCallback _arg0;
+          _arg0 = android.aidl.test.trunk.ITrunkStableTest.IMyCallback.Stub.asInterface(data.readStrongBinder());
+          data.enforceNoDataAvail();
+          this.callMyCallback(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_repeatOtherParcelable:
+        {
+          if (true) {
+            throw new android.os.RemoteException("Method repeatOtherParcelable is unimplemented.");
+          }
+          android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable _arg0;
+          _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable _result = this.repeatOtherParcelable(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.test.trunk.ITrunkStableTest
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      private int mCachedVersion = -1;
+      private String mCachedHash = "-1";
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.test.trunk.ITrunkStableTest.MyParcelable _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_repeatParcelable, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method repeatParcelable is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyParcelable.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public byte repeatEnum(byte input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        byte _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeByte(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_repeatEnum, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method repeatEnum is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readByte();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.test.trunk.ITrunkStableTest.MyUnion _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_repeatUnion, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method repeatUnion is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyUnion.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public void callMyCallback(android.aidl.test.trunk.ITrunkStableTest.IMyCallback cb) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStrongInterface(cb);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_callMyCallback, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method callMyCallback is unimplemented.");
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable repeatOtherParcelable(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable input) throws android.os.RemoteException
+      {
+        if (true) {
+          throw new android.os.RemoteException("Method repeatOtherParcelable is unimplemented.");
+        }
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_repeatOtherParcelable, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method repeatOtherParcelable is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override
+      public int getInterfaceVersion() throws android.os.RemoteException {
+        if (mCachedVersion == -1) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceVersion, data, reply, 0);
+            reply.readException();
+            mCachedVersion = reply.readInt();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedVersion;
+      }
+      @Override
+      public synchronized String getInterfaceHash() throws android.os.RemoteException {
+        if ("-1".equals(mCachedHash)) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceHash, data, reply, 0);
+            reply.readException();
+            mCachedHash = reply.readString();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedHash;
+      }
+    }
+    static final int TRANSACTION_repeatParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    static final int TRANSACTION_repeatEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    static final int TRANSACTION_repeatUnion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+    static final int TRANSACTION_callMyCallback = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+    static final int TRANSACTION_repeatOtherParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
+    static final int TRANSACTION_getInterfaceVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777214);
+    static final int TRANSACTION_getInterfaceHash = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777213);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 16777214;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android$aidl$test$trunk$ITrunkStableTest".replace('$', '.');
+  public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException;
+  public byte repeatEnum(byte input) throws android.os.RemoteException;
+  public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException;
+  public void callMyCallback(android.aidl.test.trunk.ITrunkStableTest.IMyCallback cb) throws android.os.RemoteException;
+  public android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable repeatOtherParcelable(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable input) throws android.os.RemoteException;
+  public int getInterfaceVersion() throws android.os.RemoteException;
+  public String getInterfaceHash() throws android.os.RemoteException;
+  public static class MyParcelable implements android.os.Parcelable
+  {
+    public int a = 0;
+    public int b = 0;
+    // New in V2
+    public int c = 0;
+    public static final android.os.Parcelable.Creator<MyParcelable> CREATOR = new android.os.Parcelable.Creator<MyParcelable>() {
+      @Override
+      public MyParcelable createFromParcel(android.os.Parcel _aidl_source) {
+        MyParcelable _aidl_out = new MyParcelable();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public MyParcelable[] newArray(int _aidl_size) {
+        return new MyParcelable[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeInt(a);
+      _aidl_parcel.writeInt(b);
+      if (false) {;
+        _aidl_parcel.writeInt(c);
+      };
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        a = _aidl_parcel.readInt();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        b = _aidl_parcel.readInt();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        if (false) {;
+          c = _aidl_parcel.readInt();
+        };
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+  public static @interface MyEnum {
+    public static final byte ZERO = 0;
+    public static final byte ONE = 1;
+    public static final byte TWO = 2;
+    // New in V2
+    public static final byte THREE = 3;
+  }
+  public static final class MyUnion implements android.os.Parcelable {
+    // tags for union fields
+    public final static int a = 0;  // int a;
+    public final static int b = 1;  // int b;
+    public final static int c = 2;  // int c;
+
+    private int _tag;
+    private Object _value;
+
+    public MyUnion() {
+      int _value = 0;
+      this._tag = a;
+      this._value = _value;
+    }
+
+    private MyUnion(android.os.Parcel _aidl_parcel) {
+      readFromParcel(_aidl_parcel);
+    }
+
+    private MyUnion(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+
+    public int getTag() {
+      return _tag;
+    }
+
+    // int a;
+
+    public static MyUnion a(int _value) {
+      return new MyUnion(a, _value);
+    }
+
+    public int getA() {
+      _assertTag(a);
+      return (int) _value;
+    }
+
+    public void setA(int _value) {
+      _set(a, _value);
+    }
+
+    // int b;
+
+    public static MyUnion b(int _value) {
+      return new MyUnion(b, _value);
+    }
+
+    public int getB() {
+      _assertTag(b);
+      return (int) _value;
+    }
+
+    public void setB(int _value) {
+      _set(b, _value);
+    }
+
+    // int c;
+
+    // New in V3
+    public static MyUnion c(int _value) {
+      return new MyUnion(c, _value);
+    }
+
+    public int getC() {
+      _assertTag(c);
+      return (int) _value;
+    }
+
+    public void setC(int _value) {
+      _set(c, _value);
+    }
+
+    public static final android.os.Parcelable.Creator<MyUnion> CREATOR = new android.os.Parcelable.Creator<MyUnion>() {
+      @Override
+      public MyUnion createFromParcel(android.os.Parcel _aidl_source) {
+        return new MyUnion(_aidl_source);
+      }
+      @Override
+      public MyUnion[] newArray(int _aidl_size) {
+        return new MyUnion[_aidl_size];
+      }
+    };
+
+    @Override
+    public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+      _aidl_parcel.writeInt(_tag);
+      switch (_tag) {
+      case a:
+        _aidl_parcel.writeInt(getA());
+        break;
+      case b:
+        _aidl_parcel.writeInt(getB());
+        break;
+      case c:
+        if (true) throw new IllegalArgumentException("union: unknown tag: " + _tag);
+        _aidl_parcel.writeInt(getC());
+        break;
+      }
+    }
+
+    public void readFromParcel(android.os.Parcel _aidl_parcel) {
+      int _aidl_tag;
+      _aidl_tag = _aidl_parcel.readInt();
+      switch (_aidl_tag) {
+      case a: {
+        int _aidl_value;
+        _aidl_value = _aidl_parcel.readInt();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case b: {
+        int _aidl_value;
+        _aidl_value = _aidl_parcel.readInt();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case c: {
+        if (true) throw new IllegalArgumentException("union: unknown tag: " + _tag);
+        int _aidl_value;
+        _aidl_value = _aidl_parcel.readInt();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      }
+      throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+    }
+
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      switch (getTag()) {
+      }
+      return _mask;
+    }
+
+    private void _assertTag(int tag) {
+      if (getTag() != tag) {
+        throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+      }
+    }
+
+    private String _tagString(int _tag) {
+      switch (_tag) {
+      case a: return "a";
+      case b: return "b";
+      case c: return "c";
+      }
+      throw new IllegalStateException("unknown field: " + _tag);
+    }
+
+    private void _set(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+    public static @interface Tag {
+      public static final int a = 0;
+      public static final int b = 1;
+      // New in V3
+      public static final int c = 2;
+    }
+  }
+  public interface IMyCallback extends android.os.IInterface
+  {
+    /**
+     * The version of this interface that the caller is built against.
+     * This might be different from what {@link #getInterfaceVersion()
+     * getInterfaceVersion} returns as that is the version of the interface
+     * that the remote object is implementing.
+     */
+    public static final int VERSION = true ? 1 : 2;
+    public static final String HASH = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+    /** Default implementation for IMyCallback. */
+    public static class Default implements android.aidl.test.trunk.ITrunkStableTest.IMyCallback
+    {
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public byte repeatEnum(byte input) throws android.os.RemoteException
+      {
+        return 0;
+      }
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable repeatOtherParcelable(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable input) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override
+      public int getInterfaceVersion() {
+        return 0;
+      }
+      @Override
+      public String getInterfaceHash() {
+        return "";
+      }
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.test.trunk.ITrunkStableTest.IMyCallback
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.test.trunk.ITrunkStableTest.IMyCallback interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.test.trunk.ITrunkStableTest.IMyCallback asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.test.trunk.ITrunkStableTest.IMyCallback))) {
+          return ((android.aidl.test.trunk.ITrunkStableTest.IMyCallback)iin);
+        }
+        return new android.aidl.test.trunk.ITrunkStableTest.IMyCallback.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      /** @hide */
+      public static java.lang.String getDefaultTransactionName(int transactionCode)
+      {
+        switch (transactionCode)
+        {
+          case TRANSACTION_repeatParcelable:
+          {
+            return "repeatParcelable";
+          }
+          case TRANSACTION_repeatEnum:
+          {
+            return "repeatEnum";
+          }
+          case TRANSACTION_repeatUnion:
+          {
+            return "repeatUnion";
+          }
+          case TRANSACTION_repeatOtherParcelable:
+          {
+            return "repeatOtherParcelable";
+          }
+          case TRANSACTION_getInterfaceVersion:
+          {
+            return "getInterfaceVersion";
+          }
+          case TRANSACTION_getInterfaceHash:
+          {
+            return "getInterfaceHash";
+          }
+          default:
+          {
+            return null;
+          }
+        }
+      }
+      /** @hide */
+      public java.lang.String getTransactionName(int transactionCode)
+      {
+        return this.getDefaultTransactionName(transactionCode);
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+          data.enforceInterface(descriptor);
+        }
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        else if (code == TRANSACTION_getInterfaceVersion) {
+          reply.writeNoException();
+          reply.writeInt(getInterfaceVersion());
+          return true;
+        }
+        else if (code == TRANSACTION_getInterfaceHash) {
+          reply.writeNoException();
+          reply.writeString(getInterfaceHash());
+          return true;
+        }
+        switch (code)
+        {
+          case TRANSACTION_repeatParcelable:
+          {
+            android.aidl.test.trunk.ITrunkStableTest.MyParcelable _arg0;
+            _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyParcelable.CREATOR);
+            data.enforceNoDataAvail();
+            android.aidl.test.trunk.ITrunkStableTest.MyParcelable _result = this.repeatParcelable(_arg0);
+            reply.writeNoException();
+            reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+            break;
+          }
+          case TRANSACTION_repeatEnum:
+          {
+            byte _arg0;
+            _arg0 = data.readByte();
+            data.enforceNoDataAvail();
+            byte _result = this.repeatEnum(_arg0);
+            reply.writeNoException();
+            reply.writeByte(_result);
+            break;
+          }
+          case TRANSACTION_repeatUnion:
+          {
+            android.aidl.test.trunk.ITrunkStableTest.MyUnion _arg0;
+            _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyUnion.CREATOR);
+            data.enforceNoDataAvail();
+            android.aidl.test.trunk.ITrunkStableTest.MyUnion _result = this.repeatUnion(_arg0);
+            reply.writeNoException();
+            reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+            break;
+          }
+          case TRANSACTION_repeatOtherParcelable:
+          {
+            if (true) {
+              throw new android.os.RemoteException("Method repeatOtherParcelable is unimplemented.");
+            }
+            android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable _arg0;
+            _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable.CREATOR);
+            data.enforceNoDataAvail();
+            android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable _result = this.repeatOtherParcelable(_arg0);
+            reply.writeNoException();
+            reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+            break;
+          }
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+        return true;
+      }
+      private static class Proxy implements android.aidl.test.trunk.ITrunkStableTest.IMyCallback
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        private int mCachedVersion = -1;
+        private String mCachedHash = "-1";
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+        @Override public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.aidl.test.trunk.ITrunkStableTest.MyParcelable _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeTypedObject(input, 0);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_repeatParcelable, _data, _reply, 0);
+            if (!_status) {
+              throw new android.os.RemoteException("Method repeatParcelable is unimplemented.");
+            }
+            _reply.readException();
+            _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyParcelable.CREATOR);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public byte repeatEnum(byte input) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          byte _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeByte(input);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_repeatEnum, _data, _reply, 0);
+            if (!_status) {
+              throw new android.os.RemoteException("Method repeatEnum is unimplemented.");
+            }
+            _reply.readException();
+            _result = _reply.readByte();
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.aidl.test.trunk.ITrunkStableTest.MyUnion _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeTypedObject(input, 0);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_repeatUnion, _data, _reply, 0);
+            if (!_status) {
+              throw new android.os.RemoteException("Method repeatUnion is unimplemented.");
+            }
+            _reply.readException();
+            _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyUnion.CREATOR);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable repeatOtherParcelable(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable input) throws android.os.RemoteException
+        {
+          if (true) {
+            throw new android.os.RemoteException("Method repeatOtherParcelable is unimplemented.");
+          }
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeTypedObject(input, 0);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_repeatOtherParcelable, _data, _reply, 0);
+            if (!_status) {
+              throw new android.os.RemoteException("Method repeatOtherParcelable is unimplemented.");
+            }
+            _reply.readException();
+            _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable.CREATOR);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override
+        public int getInterfaceVersion() throws android.os.RemoteException {
+          if (mCachedVersion == -1) {
+            android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+            android.os.Parcel reply = android.os.Parcel.obtain();
+            try {
+              data.writeInterfaceToken(DESCRIPTOR);
+              boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceVersion, data, reply, 0);
+              reply.readException();
+              mCachedVersion = reply.readInt();
+            } finally {
+              reply.recycle();
+              data.recycle();
+            }
+          }
+          return mCachedVersion;
+        }
+        @Override
+        public synchronized String getInterfaceHash() throws android.os.RemoteException {
+          if ("-1".equals(mCachedHash)) {
+            android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+            android.os.Parcel reply = android.os.Parcel.obtain();
+            try {
+              data.writeInterfaceToken(DESCRIPTOR);
+              boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceHash, data, reply, 0);
+              reply.readException();
+              mCachedHash = reply.readString();
+            } finally {
+              reply.recycle();
+              data.recycle();
+            }
+          }
+          return mCachedHash;
+        }
+      }
+      static final int TRANSACTION_repeatParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+      static final int TRANSACTION_repeatEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+      static final int TRANSACTION_repeatUnion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+      static final int TRANSACTION_repeatOtherParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+      static final int TRANSACTION_getInterfaceVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777214);
+      static final int TRANSACTION_getInterfaceHash = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777213);
+      /** @hide */
+      public int getMaxTransactionId()
+      {
+        return 16777214;
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android$aidl$test$trunk$ITrunkStableTest$IMyCallback".replace('$', '.');
+    public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException;
+    public byte repeatEnum(byte input) throws android.os.RemoteException;
+    public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException;
+    public android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable repeatOtherParcelable(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable input) throws android.os.RemoteException;
+    public int getInterfaceVersion() throws android.os.RemoteException;
+    public String getInterfaceHash() throws android.os.RemoteException;
+  }
+  // New in V2
+  public static class MyOtherParcelable implements android.os.Parcelable
+  {
+    public int a = 0;
+    public int b = 0;
+    public static final android.os.Parcelable.Creator<MyOtherParcelable> CREATOR = new android.os.Parcelable.Creator<MyOtherParcelable>() {
+      @Override
+      public MyOtherParcelable createFromParcel(android.os.Parcel _aidl_source) {
+        MyOtherParcelable _aidl_out = new MyOtherParcelable();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public MyOtherParcelable[] newArray(int _aidl_size) {
+        return new MyOtherParcelable[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeInt(a);
+      _aidl_parcel.writeInt(b);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        a = _aidl_parcel.readInt();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        b = _aidl_parcel.readInt();
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+}
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java.d b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java.d
new file mode 100644
index 0000000..8c375f9
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java : \
+  system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/timestamp b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/timestamp
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp
new file mode 100644
index 0000000..d9c62d1
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp
@@ -0,0 +1,1734 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version current --previous_api_dir=system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 --previous_hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#include "aidl/android/aidl/test/trunk/ITrunkStableTest.h"
+
+#include <android/binder_parcel_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <aidl/android/aidl/test/trunk/BpTrunkStableTest.h>
+
+namespace {
+struct ScopedTrace {
+  inline explicit ScopedTrace(const char* name) { ATrace_beginSection(name); }
+  inline ~ScopedTrace() { ATrace_endSection(); }
+};
+}  // namespace
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+static binder_status_t _aidl_android_aidl_test_trunk_ITrunkStableTest_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnTrunkStableTest> _aidl_impl = std::static_pointer_cast<BnTrunkStableTest>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*repeatParcelable*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatParcelable::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatParcelable(in_input, &_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "repeatParcelable";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*repeatEnum*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatEnum::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatEnum(in_input, &_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "repeatEnum";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*repeatUnion*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatUnion::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatUnion(in_input, &_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "repeatUnion";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 3 /*callMyCallback*/): {
+      std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback> in_cb;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::callMyCallback::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_cb);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_cb", ::android::internal::ToString(in_cb));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->callMyCallback(in_cb);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "callMyCallback";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 4 /*repeatOtherParcelable*/): {
+      if (true) break;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatOtherParcelable::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatOtherParcelable(in_input, &_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "repeatOtherParcelable";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): {
+      int32_t _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::getInterfaceVersion::server");
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "getInterfaceVersion";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): {
+      std::string _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::getInterfaceHash::server");
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "getInterfaceHash";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_test_trunk_ITrunkStableTest_clazz = ::ndk::ICInterface::defineClass(ITrunkStableTest::descriptor, _aidl_android_aidl_test_trunk_ITrunkStableTest_onTransact);
+
+BpTrunkStableTest::BpTrunkStableTest(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpTrunkStableTest::~BpTrunkStableTest() {}
+std::function<void(const BpTrunkStableTest::TransactionLog&)> BpTrunkStableTest::logFunc;
+
+::ndk::ScopedAStatus BpTrunkStableTest::repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatParcelable::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*repeatParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->repeatParcelable(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatEnum::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*repeatEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->repeatEnum(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatEnum";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatUnion::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*repeatUnion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->repeatUnion(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatUnion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_cb", ::android::internal::ToString(in_cb));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::callMyCallback::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_cb);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 3 /*callMyCallback*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->callMyCallback(in_cb);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "callMyCallback";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatOtherParcelable::client");
+  if (true) {
+    _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+    goto _aidl_error;
+  }
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 4 /*repeatOtherParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->repeatOtherParcelable(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatOtherParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::getInterfaceVersion(int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  if (_aidl_cached_version != -1) {
+    *_aidl_return = _aidl_cached_version;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::getInterfaceVersion::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->getInterfaceVersion(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_version = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "getInterfaceVersion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::getInterfaceHash(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex);
+  if (_aidl_cached_hash != "-1") {
+    *_aidl_return = _aidl_cached_hash;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::getInterfaceHash::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->getInterfaceHash(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_hash = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "getInterfaceHash";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+// Source for BnTrunkStableTest
+BnTrunkStableTest::BnTrunkStableTest() {}
+BnTrunkStableTest::~BnTrunkStableTest() {}
+std::function<void(const BnTrunkStableTest::TransactionLog&)> BnTrunkStableTest::logFunc;
+::ndk::SpAIBinder BnTrunkStableTest::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_test_trunk_ITrunkStableTest_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+::ndk::ScopedAStatus BnTrunkStableTest::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = ITrunkStableTest::version;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus BnTrunkStableTest::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = ITrunkStableTest::hash;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+// Source for ITrunkStableTest
+const char* ITrunkStableTest::descriptor = "android.aidl.test.trunk.ITrunkStableTest";
+ITrunkStableTest::ITrunkStableTest() {}
+ITrunkStableTest::~ITrunkStableTest() {}
+
+
+std::shared_ptr<ITrunkStableTest> ITrunkStableTest::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_test_trunk_ITrunkStableTest_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpTrunkStableTest>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<ITrunkStableTest>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpTrunkStableTest>(binder);
+}
+
+binder_status_t ITrunkStableTest::writeToParcel(AParcel* parcel, const std::shared_ptr<ITrunkStableTest>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ITrunkStableTest::readFromParcel(const AParcel* parcel, std::shared_ptr<ITrunkStableTest>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = ITrunkStableTest::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ITrunkStableTest::setDefaultImpl(const std::shared_ptr<ITrunkStableTest>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!ITrunkStableTest::default_impl);
+  if (impl) {
+    ITrunkStableTest::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ITrunkStableTest>& ITrunkStableTest::getDefaultImpl() {
+  return ITrunkStableTest::default_impl;
+}
+std::shared_ptr<ITrunkStableTest> ITrunkStableTest::default_impl = nullptr;
+::ndk::ScopedAStatus ITrunkStableTestDefault::repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& /*in_cb*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = 0;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = "";
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::SpAIBinder ITrunkStableTestDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ITrunkStableTestDefault::isRemote() {
+  return false;
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+const char* ITrunkStableTest::MyParcelable::descriptor = "android.aidl.test.trunk.ITrunkStableTest.MyParcelable";
+
+binder_status_t ITrunkStableTest::MyParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (false) {
+    if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+      AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+      return _aidl_ret_status;
+    }
+    _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &c);
+    if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  }
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ITrunkStableTest::MyParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (false) {
+    _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, c);
+    if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  }
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+const char* ITrunkStableTest::MyUnion::descriptor = "android.aidl.test.trunk.ITrunkStableTest.MyUnion";
+
+binder_status_t ITrunkStableTest::MyUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case a: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<a>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<a>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case b: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<b>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<b>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case c: {
+    if (true) return STATUS_BAD_VALUE;
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<c>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<c>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t ITrunkStableTest::MyUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case a: return ::ndk::AParcel_writeData(_parcel, get<a>());
+  case b: return ::ndk::AParcel_writeData(_parcel, get<b>());
+  case c: return true ? STATUS_BAD_VALUE : ::ndk::AParcel_writeData(_parcel, get<c>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+static binder_status_t _aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<ITrunkStableTest::BnMyCallback> _aidl_impl = std::static_pointer_cast<ITrunkStableTest::BnMyCallback>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*repeatParcelable*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatParcelable::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatParcelable(in_input, &_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "repeatParcelable";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*repeatEnum*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatEnum::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatEnum(in_input, &_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "repeatEnum";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*repeatUnion*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatUnion::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatUnion(in_input, &_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "repeatUnion";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 3 /*repeatOtherParcelable*/): {
+      if (true) break;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatOtherParcelable::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatOtherParcelable(in_input, &_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "repeatOtherParcelable";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): {
+      int32_t _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::getInterfaceVersion::server");
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "getInterfaceVersion";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): {
+      std::string _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::getInterfaceHash::server");
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "getInterfaceHash";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_clazz = ::ndk::ICInterface::defineClass(ITrunkStableTest::IMyCallback::descriptor, _aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_onTransact);
+
+ITrunkStableTest::BpMyCallback::BpMyCallback(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ITrunkStableTest::BpMyCallback::~BpMyCallback() {}
+std::function<void(const ITrunkStableTest::BpMyCallback::TransactionLog&)> ITrunkStableTest::BpMyCallback::logFunc;
+
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatParcelable::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*repeatParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->repeatParcelable(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatEnum::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*repeatEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->repeatEnum(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatEnum";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatUnion::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*repeatUnion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->repeatUnion(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatUnion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatOtherParcelable::client");
+  if (true) {
+    _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+    goto _aidl_error;
+  }
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 3 /*repeatOtherParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->repeatOtherParcelable(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatOtherParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::getInterfaceVersion(int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  if (_aidl_cached_version != -1) {
+    *_aidl_return = _aidl_cached_version;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::getInterfaceVersion::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->getInterfaceVersion(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_version = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "getInterfaceVersion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::getInterfaceHash(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex);
+  if (_aidl_cached_hash != "-1") {
+    *_aidl_return = _aidl_cached_hash;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::getInterfaceHash::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->getInterfaceHash(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_hash = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "getInterfaceHash";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+// Source for BnMyCallback
+ITrunkStableTest::BnMyCallback::BnMyCallback() {}
+ITrunkStableTest::BnMyCallback::~BnMyCallback() {}
+std::function<void(const ITrunkStableTest::BnMyCallback::TransactionLog&)> ITrunkStableTest::BnMyCallback::logFunc;
+::ndk::SpAIBinder ITrunkStableTest::BnMyCallback::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+::ndk::ScopedAStatus ITrunkStableTest::BnMyCallback::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = IMyCallback::version;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus ITrunkStableTest::BnMyCallback::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = IMyCallback::hash;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+// Source for IMyCallback
+const char* ITrunkStableTest::IMyCallback::descriptor = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+ITrunkStableTest::IMyCallback::IMyCallback() {}
+ITrunkStableTest::IMyCallback::~IMyCallback() {}
+
+
+std::shared_ptr<ITrunkStableTest::IMyCallback> ITrunkStableTest::IMyCallback::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ITrunkStableTest::BpMyCallback>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IMyCallback>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ITrunkStableTest::BpMyCallback>(binder);
+}
+
+binder_status_t ITrunkStableTest::IMyCallback::writeToParcel(AParcel* parcel, const std::shared_ptr<IMyCallback>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ITrunkStableTest::IMyCallback::readFromParcel(const AParcel* parcel, std::shared_ptr<IMyCallback>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IMyCallback::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ITrunkStableTest::IMyCallback::setDefaultImpl(const std::shared_ptr<IMyCallback>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IMyCallback::default_impl);
+  if (impl) {
+    IMyCallback::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ITrunkStableTest::IMyCallback>& ITrunkStableTest::IMyCallback::getDefaultImpl() {
+  return IMyCallback::default_impl;
+}
+std::shared_ptr<ITrunkStableTest::IMyCallback> ITrunkStableTest::IMyCallback::default_impl = nullptr;
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = 0;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = "";
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::SpAIBinder ITrunkStableTest::IMyCallbackDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ITrunkStableTest::IMyCallbackDefault::isRemote() {
+  return false;
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+const char* ITrunkStableTest::MyOtherParcelable::descriptor = "android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable";
+
+binder_status_t ITrunkStableTest::MyOtherParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ITrunkStableTest::MyOtherParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d
new file mode 100644
index 0000000..7e4948a
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp : \
+  system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/BnTrunkStableTest.h b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/BnTrunkStableTest.h
new file mode 100644
index 0000000..ac41e8b
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/BnTrunkStableTest.h
@@ -0,0 +1,84 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version current --previous_api_dir=system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 --previous_hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/test/trunk/ITrunkStableTest.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class BnTrunkStableTest : public ::ndk::BnCInterface<ITrunkStableTest> {
+public:
+  BnTrunkStableTest();
+  virtual ~BnTrunkStableTest();
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) final;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) final;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class ITrunkStableTestDelegator : public BnTrunkStableTest {
+public:
+  explicit ITrunkStableTestDelegator(const std::shared_ptr<ITrunkStableTest> &impl) : _impl(impl) {
+     int32_t _impl_ver = 0;
+     if (!impl->getInterfaceVersion(&_impl_ver).isOk()) {;
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Delegator failed to get version of the implementation.");
+     }
+     if (_impl_ver != ITrunkStableTest::version) {
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Mismatched versions of delegator and implementation is not allowed.");
+     }
+  }
+
+  ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override {
+    return _impl->repeatParcelable(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override {
+    return _impl->repeatEnum(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override {
+    return _impl->repeatUnion(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) override {
+    return _impl->callMyCallback(in_cb);
+  }
+  ::ndk::ScopedAStatus repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override {
+    return _impl->repeatOtherParcelable(in_input, _aidl_return);
+  }
+protected:
+private:
+  std::shared_ptr<ITrunkStableTest> _impl;
+};
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/BpTrunkStableTest.h b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/BpTrunkStableTest.h
new file mode 100644
index 0000000..5d42db5
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/BpTrunkStableTest.h
@@ -0,0 +1,55 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version current --previous_api_dir=system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 --previous_hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/test/trunk/ITrunkStableTest.h"
+
+#include <android/binder_ibinder.h>
+#include <functional>
+#include <chrono>
+#include <sstream>
+#include <android/trace.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class BpTrunkStableTest : public ::ndk::BpCInterface<ITrunkStableTest> {
+public:
+  explicit BpTrunkStableTest(const ::ndk::SpAIBinder& binder);
+  virtual ~BpTrunkStableTest();
+
+  ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+  ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+  ::ndk::ScopedAStatus callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) override;
+  ::ndk::ScopedAStatus repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  int32_t _aidl_cached_version = -1;
+  std::string _aidl_cached_hash = "-1";
+  std::mutex _aidl_cached_hash_mutex;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+};
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/ITrunkStableTest.h b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/ITrunkStableTest.h
new file mode 100644
index 0000000..e7997ac
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/ITrunkStableTest.h
@@ -0,0 +1,444 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version current --previous_api_dir=system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 --previous_hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <chrono>
+#include <cstdint>
+#include <functional>
+#include <memory>
+#include <optional>
+#include <sstream>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_ibinder.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <android/trace.h>
+#include <aidl/android/aidl/test/trunk/ITrunkStableTest.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class ITrunkStableTestDelegator;
+
+class ITrunkStableTest : public ::ndk::ICInterface {
+public:
+  typedef ITrunkStableTestDelegator DefaultDelegator;
+  static const char* descriptor;
+  ITrunkStableTest();
+  virtual ~ITrunkStableTest();
+
+  class MyParcelable {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    int32_t a = 0;
+    int32_t b = 0;
+    int32_t c = 0;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) != std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator<(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) < std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator<=(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) <= std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator==(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) == std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator>(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) > std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator>=(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) >= std::tie(rhs.a, rhs.b, rhs.c);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyParcelable{";
+      os << "a: " << ::android::internal::ToString(a);
+      os << ", b: " << ::android::internal::ToString(b);
+      os << ", c: " << ::android::internal::ToString(c);
+      os << "}";
+      return os.str();
+    }
+  };
+  enum class MyEnum : int8_t {
+    ZERO = 0,
+    ONE = 1,
+    TWO = 2,
+    THREE = 3,
+  };
+
+  class MyUnion {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    enum class Tag : int32_t {
+      a = 0,
+      b = 1,
+      c = 2,
+    };
+
+    // Expose tag symbols for legacy code
+    static const inline Tag a = Tag::a;
+    static const inline Tag b = Tag::b;
+    static const inline Tag c = Tag::c;
+
+    template<typename _Tp>
+    static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, MyUnion>;
+
+    MyUnion() : _value(std::in_place_index<static_cast<size_t>(a)>, int32_t(0)) { }
+
+    template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+    // NOLINTNEXTLINE(google-explicit-constructor)
+    constexpr MyUnion(_Tp&& _arg)
+        : _value(std::forward<_Tp>(_arg)) {}
+
+    template <size_t _Np, typename... _Tp>
+    constexpr explicit MyUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+        : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+    template <Tag _tag, typename... _Tp>
+    static MyUnion make(_Tp&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+    }
+
+    template <Tag _tag, typename _Tp, typename... _Up>
+    static MyUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+    }
+
+    Tag getTag() const {
+      return static_cast<Tag>(_value.index());
+    }
+
+    template <Tag _tag>
+    const auto& get() const {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag>
+    auto& get() {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag, typename... _Tp>
+    void set(_Tp&&... _args) {
+      _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+    }
+
+    binder_status_t readFromParcel(const AParcel* _parcel);
+    binder_status_t writeToParcel(AParcel* _parcel) const;
+
+    inline bool operator!=(const MyUnion& rhs) const {
+      return _value != rhs._value;
+    }
+    inline bool operator<(const MyUnion& rhs) const {
+      return _value < rhs._value;
+    }
+    inline bool operator<=(const MyUnion& rhs) const {
+      return _value <= rhs._value;
+    }
+    inline bool operator==(const MyUnion& rhs) const {
+      return _value == rhs._value;
+    }
+    inline bool operator>(const MyUnion& rhs) const {
+      return _value > rhs._value;
+    }
+    inline bool operator>=(const MyUnion& rhs) const {
+      return _value >= rhs._value;
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyUnion{";
+      switch (getTag()) {
+      case a: os << "a: " << ::android::internal::ToString(get<a>()); break;
+      case b: os << "b: " << ::android::internal::ToString(get<b>()); break;
+      case c: os << "c: " << ::android::internal::ToString(get<c>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    std::variant<int32_t, int32_t, int32_t> _value;
+  };
+  class MyOtherParcelable {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    int32_t a = 0;
+    int32_t b = 0;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator<(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator<=(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator==(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator>(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator>=(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyOtherParcelable{";
+      os << "a: " << ::android::internal::ToString(a);
+      os << ", b: " << ::android::internal::ToString(b);
+      os << "}";
+      return os.str();
+    }
+  };
+  class IMyCallbackDelegator;
+
+  class IMyCallback : public ::ndk::ICInterface {
+  public:
+    typedef IMyCallbackDelegator DefaultDelegator;
+    static const char* descriptor;
+    IMyCallback();
+    virtual ~IMyCallback();
+
+    static inline const int32_t version = true ? 1 : 2;
+    static inline const std::string hash = true ? "88311b9118fb6fe9eff4a2ca19121de0587f6d5f" : "notfrozen";
+    static constexpr uint32_t TRANSACTION_repeatParcelable = FIRST_CALL_TRANSACTION + 0;
+    static constexpr uint32_t TRANSACTION_repeatEnum = FIRST_CALL_TRANSACTION + 1;
+    static constexpr uint32_t TRANSACTION_repeatUnion = FIRST_CALL_TRANSACTION + 2;
+    static constexpr uint32_t TRANSACTION_repeatOtherParcelable = FIRST_CALL_TRANSACTION + 3;
+
+    static std::shared_ptr<IMyCallback> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IMyCallback>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IMyCallback>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<IMyCallback>& impl);
+    static const std::shared_ptr<IMyCallback>& getDefaultImpl();
+    virtual ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) = 0;
+  private:
+    static std::shared_ptr<IMyCallback> default_impl;
+  };
+  class IMyCallbackDefault : public IMyCallback {
+  public:
+    ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override;
+    ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+    ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpMyCallback : public ::ndk::BpCInterface<IMyCallback> {
+  public:
+    explicit BpMyCallback(const ::ndk::SpAIBinder& binder);
+    virtual ~BpMyCallback();
+
+    ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override;
+    ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+    ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+    int32_t _aidl_cached_version = -1;
+    std::string _aidl_cached_hash = "-1";
+    std::mutex _aidl_cached_hash_mutex;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  };
+  class BnMyCallback : public ::ndk::BnCInterface<IMyCallback> {
+  public:
+    BnMyCallback();
+    virtual ~BnMyCallback();
+    ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) final;
+    ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) final;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  static inline const int32_t version = true ? 1 : 2;
+  static inline const std::string hash = true ? "88311b9118fb6fe9eff4a2ca19121de0587f6d5f" : "notfrozen";
+  static constexpr uint32_t TRANSACTION_repeatParcelable = FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_repeatEnum = FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_repeatUnion = FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_callMyCallback = FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_repeatOtherParcelable = FIRST_CALL_TRANSACTION + 4;
+
+  static std::shared_ptr<ITrunkStableTest> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<ITrunkStableTest>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<ITrunkStableTest>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<ITrunkStableTest>& impl);
+  static const std::shared_ptr<ITrunkStableTest>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) = 0;
+  virtual ::ndk::ScopedAStatus repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) = 0;
+private:
+  static std::shared_ptr<ITrunkStableTest> default_impl;
+};
+class ITrunkStableTestDefault : public ITrunkStableTest {
+public:
+  ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+  ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+  ::ndk::ScopedAStatus callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) override;
+  ::ndk::ScopedAStatus repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+[[nodiscard]] static inline std::string toString(ITrunkStableTest::MyEnum val) {
+  switch(val) {
+  case ITrunkStableTest::MyEnum::ZERO:
+    return "ZERO";
+  case ITrunkStableTest::MyEnum::ONE:
+    return "ONE";
+  case ITrunkStableTest::MyEnum::TWO:
+    return "TWO";
+  case ITrunkStableTest::MyEnum::THREE:
+    return "THREE";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum, 4> enum_values<aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum> = {
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum::ZERO,
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum::ONE,
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum::TWO,
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum::THREE,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+[[nodiscard]] static inline std::string toString(ITrunkStableTest::MyUnion::Tag val) {
+  switch(val) {
+  case ITrunkStableTest::MyUnion::Tag::a:
+    return "a";
+  case ITrunkStableTest::MyUnion::Tag::b:
+    return "b";
+  case ITrunkStableTest::MyUnion::Tag::c:
+    return "c";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag, 3> enum_values<aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag> = {
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::a,
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::b,
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::c,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/timestamp b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/timestamp
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs
new file mode 100644
index 0000000..c7b4344
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs
@@ -0,0 +1,1127 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen --min_sdk_version current --previous_api_dir=system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 --previous_hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs.d -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  ITrunkStableTest["android.aidl.test.trunk.ITrunkStableTest"] {
+    native: BnTrunkStableTest(on_transact),
+    proxy: BpTrunkStableTest {
+      cached_version: std::sync::atomic::AtomicI32 = std::sync::atomic::AtomicI32::new(-1),
+      cached_hash: std::sync::Mutex<Option<String>> = std::sync::Mutex::new(None)
+    },
+    async: ITrunkStableTestAsync,
+  }
+}
+pub trait ITrunkStableTest: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest" }
+  fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>;
+  fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>;
+  fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>;
+  fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()>;
+  fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable>;
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    Ok(VERSION)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    Ok(HASH.into())
+  }
+  fn getDefaultImpl() -> ITrunkStableTestDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: ITrunkStableTestDefaultRef) -> ITrunkStableTestDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait ITrunkStableTestAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest" }
+  fn r#repeatParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>>;
+  fn r#repeatEnum<'a>(&'a self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>>;
+  fn r#repeatUnion<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>>;
+  fn r#callMyCallback<'a>(&'a self, _arg_cb: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#repeatOtherParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable>>;
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    Box::pin(async move { Ok(VERSION) })
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    Box::pin(async move { Ok(HASH.into()) })
+  }
+}
+#[::async_trait::async_trait]
+pub trait ITrunkStableTestAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest" }
+  async fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>;
+  async fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>;
+  async fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>;
+  async fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()>;
+  async fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable>;
+}
+impl BnTrunkStableTest {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn ITrunkStableTest>
+  where
+    T: ITrunkStableTestAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> ITrunkStableTest for Wrapper<T, R>
+    where
+      T: ITrunkStableTestAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+        self._rt.block_on(self._inner.r#repeatParcelable(_arg_input))
+      }
+      fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+        self._rt.block_on(self._inner.r#repeatEnum(_arg_input))
+      }
+      fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+        self._rt.block_on(self._inner.r#repeatUnion(_arg_input))
+      }
+      fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#callMyCallback(_arg_cb))
+      }
+      fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> {
+        self._rt.block_on(self._inner.r#repeatOtherParcelable(_arg_input))
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait ITrunkStableTestDefault: Send + Sync {
+  fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#repeatParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  pub const r#repeatEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+  pub const r#repeatUnion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+  pub const r#callMyCallback: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 3;
+  pub const r#repeatOtherParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 4;
+  pub const r#getInterfaceVersion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777214;
+  pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213;
+}
+pub type ITrunkStableTestDefaultRef = Option<std::sync::Arc<dyn ITrunkStableTestDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<ITrunkStableTestDefaultRef> = std::sync::Mutex::new(None);
+}
+pub const VERSION: i32 = if true {1} else {2};
+pub const HASH: &str = if true {"88311b9118fb6fe9eff4a2ca19121de0587f6d5f"} else {"notfrozen"};
+impl BpTrunkStableTest {
+  fn build_parcel_repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#repeatParcelable(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#repeatEnum(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#repeatUnion(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_cb)?;
+    Ok(aidl_data)
+  }
+  fn read_response_callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#callMyCallback(_arg_cb);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#repeatOtherParcelable(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_getInterfaceVersion(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceVersion(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    self.cached_version.store(_aidl_return, std::sync::atomic::Ordering::Relaxed);
+    Ok(_aidl_return)
+  }
+  fn build_parcel_getInterfaceHash(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceHash(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    *self.cached_hash.lock().unwrap() = Some(_aidl_return.clone());
+    Ok(_aidl_return)
+  }
+}
+impl ITrunkStableTest for BpTrunkStableTest {
+  fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+    let _aidl_data = self.build_parcel_repeatParcelable(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#repeatParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_repeatParcelable(_arg_input, _aidl_reply)
+  }
+  fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+    let _aidl_data = self.build_parcel_repeatEnum(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#repeatEnum, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_repeatEnum(_arg_input, _aidl_reply)
+  }
+  fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+    let _aidl_data = self.build_parcel_repeatUnion(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#repeatUnion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_repeatUnion(_arg_input, _aidl_reply)
+  }
+  fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_callMyCallback(_arg_cb)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#callMyCallback, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_callMyCallback(_arg_cb, _aidl_reply)
+  }
+  fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> {
+    if (true) {
+     return Err(binder::Status::from(binder::StatusCode::UNKNOWN_TRANSACTION));
+    } else {
+      let _aidl_data = self.build_parcel_repeatOtherParcelable(_arg_input)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#repeatOtherParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_repeatOtherParcelable(_arg_input, _aidl_reply)
+    }
+  }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Ok(_aidl_version); }
+    let _aidl_data = self.build_parcel_getInterfaceVersion()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceVersion(_aidl_reply)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Ok(_aidl_hash.clone());
+      }
+    }
+    let _aidl_data = self.build_parcel_getInterfaceHash()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceHash(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> ITrunkStableTestAsync<P> for BpTrunkStableTest {
+  fn r#repeatParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>> {
+    let _aidl_data = match self.build_parcel_repeatParcelable(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#repeatParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_repeatParcelable(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#repeatEnum<'a>(&'a self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>> {
+    let _aidl_data = match self.build_parcel_repeatEnum(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#repeatEnum, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_repeatEnum(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#repeatUnion<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>> {
+    let _aidl_data = match self.build_parcel_repeatUnion(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#repeatUnion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_repeatUnion(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#callMyCallback<'a>(&'a self, _arg_cb: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_callMyCallback(_arg_cb) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#callMyCallback, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_callMyCallback(_arg_cb, _aidl_reply)
+      }
+    )
+  }
+  fn r#repeatOtherParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable>> {
+    if (true) {
+     return Box::pin(std::future::ready(Err(binder::Status::from(binder::StatusCode::UNKNOWN_TRANSACTION))));
+    } else {
+      let _aidl_data = match self.build_parcel_repeatOtherParcelable(_arg_input) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#repeatOtherParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_repeatOtherParcelable(_arg_input, _aidl_reply)
+        }
+      )
+    }
+  }
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Box::pin(std::future::ready(Ok(_aidl_version))); }
+    let _aidl_data = match self.build_parcel_getInterfaceVersion() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceVersion(_aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Box::pin(std::future::ready(Ok(_aidl_hash.clone())));
+      }
+    }
+    let _aidl_data = match self.build_parcel_getInterfaceHash() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceHash(_aidl_reply)
+      }
+    )
+  }
+}
+impl ITrunkStableTest for binder::binder_impl::Binder<BnTrunkStableTest> {
+  fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> { self.0.r#repeatParcelable(_arg_input) }
+  fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> { self.0.r#repeatEnum(_arg_input) }
+  fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> { self.0.r#repeatUnion(_arg_input) }
+  fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()> { self.0.r#callMyCallback(_arg_cb) }
+  fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> { self.0.r#repeatOtherParcelable(_arg_input) }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> { self.0.r#getInterfaceVersion() }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> { self.0.r#getInterfaceHash() }
+}
+fn on_transact(_aidl_service: &dyn ITrunkStableTest, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#repeatParcelable => {
+      let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#repeatParcelable(&_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#repeatEnum => {
+      let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#repeatEnum(_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#repeatUnion => {
+      let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#repeatUnion(&_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#callMyCallback => {
+      let _arg_cb: binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#callMyCallback(&_arg_cb);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#repeatOtherParcelable => {
+      if (true) {
+        Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+      } else {
+        let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#repeatOtherParcelable(&_arg_input);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+    }
+    transactions::r#getInterfaceVersion => {
+      let _aidl_return = _aidl_service.r#getInterfaceVersion();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceHash => {
+      let _aidl_return = _aidl_service.r#getInterfaceHash();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub mod r#MyParcelable {
+  #[derive(Debug)]
+  pub struct r#MyParcelable {
+    pub r#a: i32,
+    pub r#b: i32,
+    pub r#c: i32,
+  }
+  impl Default for r#MyParcelable {
+    fn default() -> Self {
+      Self {
+        r#a: 0,
+        r#b: 0,
+        r#c: 0,
+      }
+    }
+  }
+  impl binder::Parcelable for r#MyParcelable {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        subparcel.write(&self.r#a)?;
+        subparcel.write(&self.r#b)?;
+        if (false) {
+          subparcel.write(&self.r#c)?;
+        }
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#a = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#b = subparcel.read()?;
+        }
+        if (false) {
+          if subparcel.has_more_data() {
+            self.r#c = subparcel.read()?;
+        }
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyParcelable);
+  binder::impl_deserialize_for_parcelable!(r#MyParcelable);
+  impl binder::binder_impl::ParcelableMetadata for r#MyParcelable {
+    fn get_descriptor() -> &'static str { "android.aidl.test.trunk.ITrunkStableTest.MyParcelable" }
+  }
+}
+pub mod r#MyEnum {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#MyEnum : [i8; 4] {
+      r#ZERO = 0,
+      r#ONE = 1,
+      r#TWO = 2,
+      r#THREE = 3,
+    }
+  }
+}
+pub mod r#MyUnion {
+  #[derive(Debug)]
+  pub enum r#MyUnion {
+    A(i32),
+    B(i32),
+    C(i32),
+  }
+  impl Default for r#MyUnion {
+    fn default() -> Self {
+      Self::A(0)
+    }
+  }
+  impl binder::Parcelable for r#MyUnion {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      match self {
+        Self::A(v) => {
+          parcel.write(&0i32)?;
+          parcel.write(v)
+        }
+        Self::B(v) => {
+          parcel.write(&1i32)?;
+          parcel.write(v)
+        }
+        Self::C(v) => {
+          if (true) {
+            Err(binder::StatusCode::BAD_VALUE)
+          } else {
+            parcel.write(&2i32)?;
+            parcel.write(v)
+          }
+        }
+      }
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      let tag: i32 = parcel.read()?;
+      match tag {
+        0 => {
+          let value: i32 = parcel.read()?;
+          *self = Self::A(value);
+          Ok(())
+        }
+        1 => {
+          let value: i32 = parcel.read()?;
+          *self = Self::B(value);
+          Ok(())
+        }
+        2 => {
+          if (true) {
+            Err(binder::StatusCode::BAD_VALUE)
+          } else {
+            let value: i32 = parcel.read()?;
+            *self = Self::C(value);
+            Ok(())
+          }
+        }
+        _ => {
+          Err(binder::StatusCode::BAD_VALUE)
+        }
+      }
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyUnion);
+  binder::impl_deserialize_for_parcelable!(r#MyUnion);
+  impl binder::binder_impl::ParcelableMetadata for r#MyUnion {
+    fn get_descriptor() -> &'static str { "android.aidl.test.trunk.ITrunkStableTest.MyUnion" }
+  }
+  pub mod r#Tag {
+    #![allow(non_upper_case_globals)]
+    use binder::declare_binder_enum;
+    declare_binder_enum! {
+      r#Tag : [i32; 3] {
+        r#a = 0,
+        r#b = 1,
+        r#c = 2,
+      }
+    }
+  }
+}
+pub mod r#IMyCallback {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    IMyCallback["android.aidl.test.trunk.ITrunkStableTest.IMyCallback"] {
+      native: BnMyCallback(on_transact),
+      proxy: BpMyCallback {
+        cached_version: std::sync::atomic::AtomicI32 = std::sync::atomic::AtomicI32::new(-1),
+        cached_hash: std::sync::Mutex<Option<String>> = std::sync::Mutex::new(None)
+      },
+      async: IMyCallbackAsync,
+    }
+  }
+  pub trait IMyCallback: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest.IMyCallback" }
+    fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>;
+    fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>;
+    fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>;
+    fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable>;
+    fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+      Ok(VERSION)
+    }
+    fn r#getInterfaceHash(&self) -> binder::Result<String> {
+      Ok(HASH.into())
+    }
+    fn getDefaultImpl() -> IMyCallbackDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: IMyCallbackDefaultRef) -> IMyCallbackDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait IMyCallbackAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest.IMyCallback" }
+    fn r#repeatParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>>;
+    fn r#repeatEnum<'a>(&'a self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>>;
+    fn r#repeatUnion<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>>;
+    fn r#repeatOtherParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable>>;
+    fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+      Box::pin(async move { Ok(VERSION) })
+    }
+    fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+      Box::pin(async move { Ok(HASH.into()) })
+    }
+  }
+  #[::async_trait::async_trait]
+  pub trait IMyCallbackAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest.IMyCallback" }
+    async fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>;
+    async fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>;
+    async fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>;
+    async fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable>;
+  }
+  impl BnMyCallback {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IMyCallback>
+    where
+      T: IMyCallbackAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> IMyCallback for Wrapper<T, R>
+      where
+        T: IMyCallbackAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+        fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+          self._rt.block_on(self._inner.r#repeatParcelable(_arg_input))
+        }
+        fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+          self._rt.block_on(self._inner.r#repeatEnum(_arg_input))
+        }
+        fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+          self._rt.block_on(self._inner.r#repeatUnion(_arg_input))
+        }
+        fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> {
+          self._rt.block_on(self._inner.r#repeatOtherParcelable(_arg_input))
+        }
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait IMyCallbackDefault: Send + Sync {
+    fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+  }
+  pub mod transactions {
+    pub const r#repeatParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+    pub const r#repeatEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+    pub const r#repeatUnion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+    pub const r#repeatOtherParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 3;
+    pub const r#getInterfaceVersion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777214;
+    pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213;
+  }
+  pub type IMyCallbackDefaultRef = Option<std::sync::Arc<dyn IMyCallbackDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<IMyCallbackDefaultRef> = std::sync::Mutex::new(None);
+  }
+  pub const VERSION: i32 = if true {1} else {2};
+  pub const HASH: &str = if true {"88311b9118fb6fe9eff4a2ca19121de0587f6d5f"} else {"notfrozen"};
+  impl BpMyCallback {
+    fn build_parcel_repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyCallback>::getDefaultImpl() {
+          return _aidl_default_impl.r#repeatParcelable(_arg_input);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable = _aidl_reply.read()?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(&_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyCallback>::getDefaultImpl() {
+          return _aidl_default_impl.r#repeatEnum(_arg_input);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum = _aidl_reply.read()?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyCallback>::getDefaultImpl() {
+          return _aidl_default_impl.r#repeatUnion(_arg_input);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion = _aidl_reply.read()?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyCallback>::getDefaultImpl() {
+          return _aidl_default_impl.r#repeatOtherParcelable(_arg_input);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable = _aidl_reply.read()?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_getInterfaceVersion(&self) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      Ok(aidl_data)
+    }
+    fn read_response_getInterfaceVersion(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: i32 = _aidl_reply.read()?;
+      self.cached_version.store(_aidl_return, std::sync::atomic::Ordering::Relaxed);
+      Ok(_aidl_return)
+    }
+    fn build_parcel_getInterfaceHash(&self) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      Ok(aidl_data)
+    }
+    fn read_response_getInterfaceHash(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: String = _aidl_reply.read()?;
+      *self.cached_hash.lock().unwrap() = Some(_aidl_return.clone());
+      Ok(_aidl_return)
+    }
+  }
+  impl IMyCallback for BpMyCallback {
+    fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+      let _aidl_data = self.build_parcel_repeatParcelable(_arg_input)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#repeatParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_repeatParcelable(_arg_input, _aidl_reply)
+    }
+    fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+      let _aidl_data = self.build_parcel_repeatEnum(_arg_input)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#repeatEnum, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_repeatEnum(_arg_input, _aidl_reply)
+    }
+    fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+      let _aidl_data = self.build_parcel_repeatUnion(_arg_input)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#repeatUnion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_repeatUnion(_arg_input, _aidl_reply)
+    }
+    fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> {
+      if (true) {
+       return Err(binder::Status::from(binder::StatusCode::UNKNOWN_TRANSACTION));
+      } else {
+        let _aidl_data = self.build_parcel_repeatOtherParcelable(_arg_input)?;
+        let _aidl_reply = self.binder.submit_transact(transactions::r#repeatOtherParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+        self.read_response_repeatOtherParcelable(_arg_input, _aidl_reply)
+      }
+    }
+    fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+      let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+      if _aidl_version != -1 { return Ok(_aidl_version); }
+      let _aidl_data = self.build_parcel_getInterfaceVersion()?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_getInterfaceVersion(_aidl_reply)
+    }
+    fn r#getInterfaceHash(&self) -> binder::Result<String> {
+      {
+        let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+        if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+          return Ok(_aidl_hash.clone());
+        }
+      }
+      let _aidl_data = self.build_parcel_getInterfaceHash()?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_getInterfaceHash(_aidl_reply)
+    }
+  }
+  impl<P: binder::BinderAsyncPool> IMyCallbackAsync<P> for BpMyCallback {
+    fn r#repeatParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>> {
+      let _aidl_data = match self.build_parcel_repeatParcelable(_arg_input) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#repeatParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_repeatParcelable(_arg_input, _aidl_reply)
+        }
+      )
+    }
+    fn r#repeatEnum<'a>(&'a self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>> {
+      let _aidl_data = match self.build_parcel_repeatEnum(_arg_input) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#repeatEnum, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_repeatEnum(_arg_input, _aidl_reply)
+        }
+      )
+    }
+    fn r#repeatUnion<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>> {
+      let _aidl_data = match self.build_parcel_repeatUnion(_arg_input) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#repeatUnion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_repeatUnion(_arg_input, _aidl_reply)
+        }
+      )
+    }
+    fn r#repeatOtherParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable>> {
+      if (true) {
+       return Box::pin(std::future::ready(Err(binder::Status::from(binder::StatusCode::UNKNOWN_TRANSACTION))));
+      } else {
+        let _aidl_data = match self.build_parcel_repeatOtherParcelable(_arg_input) {
+          Ok(_aidl_data) => _aidl_data,
+          Err(err) => return Box::pin(std::future::ready(Err(err))),
+        };
+        let binder = self.binder.clone();
+        P::spawn(
+          move || binder.submit_transact(transactions::r#repeatOtherParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+          move |_aidl_reply| async move {
+            self.read_response_repeatOtherParcelable(_arg_input, _aidl_reply)
+          }
+        )
+      }
+    }
+    fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+      let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+      if _aidl_version != -1 { return Box::pin(std::future::ready(Ok(_aidl_version))); }
+      let _aidl_data = match self.build_parcel_getInterfaceVersion() {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_getInterfaceVersion(_aidl_reply)
+        }
+      )
+    }
+    fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+      {
+        let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+        if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+          return Box::pin(std::future::ready(Ok(_aidl_hash.clone())));
+        }
+      }
+      let _aidl_data = match self.build_parcel_getInterfaceHash() {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_getInterfaceHash(_aidl_reply)
+        }
+      )
+    }
+  }
+  impl IMyCallback for binder::binder_impl::Binder<BnMyCallback> {
+    fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> { self.0.r#repeatParcelable(_arg_input) }
+    fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> { self.0.r#repeatEnum(_arg_input) }
+    fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> { self.0.r#repeatUnion(_arg_input) }
+    fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> { self.0.r#repeatOtherParcelable(_arg_input) }
+    fn r#getInterfaceVersion(&self) -> binder::Result<i32> { self.0.r#getInterfaceVersion() }
+    fn r#getInterfaceHash(&self) -> binder::Result<String> { self.0.r#getInterfaceHash() }
+  }
+  fn on_transact(_aidl_service: &dyn IMyCallback, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      transactions::r#repeatParcelable => {
+        let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#repeatParcelable(&_arg_input);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#repeatEnum => {
+        let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#repeatEnum(_arg_input);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#repeatUnion => {
+        let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#repeatUnion(&_arg_input);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#repeatOtherParcelable => {
+        if (true) {
+          Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+        } else {
+          let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable = _aidl_data.read()?;
+          let _aidl_return = _aidl_service.r#repeatOtherParcelable(&_arg_input);
+          match &_aidl_return {
+            Ok(_aidl_return) => {
+              _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+              _aidl_reply.write(_aidl_return)?;
+            }
+            Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+          }
+          Ok(())
+        }
+      }
+      transactions::r#getInterfaceVersion => {
+        let _aidl_return = _aidl_service.r#getInterfaceVersion();
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#getInterfaceHash => {
+        let _aidl_return = _aidl_service.r#getInterfaceHash();
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub mod r#MyOtherParcelable {
+  #[derive(Debug)]
+  pub struct r#MyOtherParcelable {
+    pub r#a: i32,
+    pub r#b: i32,
+  }
+  impl Default for r#MyOtherParcelable {
+    fn default() -> Self {
+      Self {
+        r#a: 0,
+        r#b: 0,
+      }
+    }
+  }
+  impl binder::Parcelable for r#MyOtherParcelable {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        subparcel.write(&self.r#a)?;
+        subparcel.write(&self.r#b)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#a = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#b = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyOtherParcelable);
+  binder::impl_deserialize_for_parcelable!(r#MyOtherParcelable);
+  impl binder::binder_impl::ParcelableMetadata for r#MyOtherParcelable {
+    fn get_descriptor() -> &'static str { "android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable" }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ITrunkStableTest as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest;
+ pub use super::r#MyParcelable::r#MyParcelable as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable;
+ pub use super::r#MyEnum::r#MyEnum as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum;
+ pub use super::r#MyUnion::r#MyUnion as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion;
+ pub use super::r#MyUnion::r#Tag::r#Tag as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion_3_Tag;
+ pub use super::r#IMyCallback::r#IMyCallback as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback;
+ pub use super::r#MyOtherParcelable::r#MyOtherParcelable as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable;
+}
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs.d b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs.d
new file mode 100644
index 0000000..7f3d91f
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs : \
+  system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/timestamp b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/timestamp
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp
new file mode 100644
index 0000000..a7feb85
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp
@@ -0,0 +1,1097 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android/aidl/test/trunk/BpTrunkStableTest.h>
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(TrunkStableTest, "android.aidl.test.trunk.ITrunkStableTest")
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/BpTrunkStableTest.h>
+#include <android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+
+BpTrunkStableTest::BpTrunkStableTest(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<ITrunkStableTest>(_aidl_impl){
+}
+
+std::function<void(const BpTrunkStableTest::TransactionLog&)> BpTrunkStableTest::logFunc;
+
+::android::binder::Status BpTrunkStableTest::repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatParcelable::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_repeatParcelable, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->repeatParcelable(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status BpTrunkStableTest::repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatEnum::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(static_cast<int8_t>(input));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_repeatEnum, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->repeatEnum(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readByte(reinterpret_cast<int8_t *>(_aidl_return));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatEnum";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status BpTrunkStableTest::repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatUnion::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_repeatUnion, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->repeatUnion(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatUnion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status BpTrunkStableTest::callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::callMyCallback::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("cb", ::android::internal::ToString(cb));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(cb);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_callMyCallback, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->callMyCallback(cb);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "callMyCallback";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+int32_t BpTrunkStableTest::getInterfaceVersion() {
+  if (cached_version_ == -1) {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnTrunkStableTest::TRANSACTION_getInterfaceVersion, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        cached_version_ = reply.readInt32();
+      }
+    }
+  }
+  return cached_version_;
+}
+
+
+std::string BpTrunkStableTest::getInterfaceHash() {
+  std::lock_guard<std::mutex> lockGuard(cached_hash_mutex_);
+  if (cached_hash_ == "-1") {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnTrunkStableTest::TRANSACTION_getInterfaceHash, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        reply.readUtf8FromUtf16(&cached_hash_);
+      }
+    }
+  }
+  return cached_hash_;
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+
+BnTrunkStableTest::BnTrunkStableTest()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnTrunkStableTest::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnTrunkStableTest::TRANSACTION_repeatParcelable:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatParcelable(in_input, &_aidl_return));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "repeatParcelable";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_repeatEnum:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyEnum _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_input));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatEnum(in_input, &_aidl_return));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "repeatEnum";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByte(static_cast<int8_t>(_aidl_return));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_repeatUnion:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyUnion in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyUnion _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatUnion::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatUnion(in_input, &_aidl_return));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "repeatUnion";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_callMyCallback:
+  {
+    ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback> in_cb;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::callMyCallback::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinder(&in_cb);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_cb", ::android::internal::ToString(in_cb));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(callMyCallback(in_cb));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "callMyCallback";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_getInterfaceVersion:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeInt32(ITrunkStableTest::VERSION);
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_getInterfaceHash:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeUtf8AsUtf16(ITrunkStableTest::HASH);
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+int32_t BnTrunkStableTest::getInterfaceVersion() {
+  return ITrunkStableTest::VERSION;
+}
+std::string BnTrunkStableTest::getInterfaceHash() {
+  return ITrunkStableTest::HASH;
+}
+std::function<void(const BnTrunkStableTest::TransactionLog&)> BnTrunkStableTest::logFunc;
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+::android::status_t ITrunkStableTest::MyParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ITrunkStableTest::MyParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+::android::status_t ITrunkStableTest::MyUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case a: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<a>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<a>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case b: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<b>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<b>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t ITrunkStableTest::MyUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case a: return _aidl_parcel->writeInt32(get<a>());
+  case b: return _aidl_parcel->writeInt32(get<b>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ITrunkStableTest, MyCallback, "android.aidl.test.trunk.ITrunkStableTest.IMyCallback")
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+
+ITrunkStableTest::BpMyCallback::BpMyCallback(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IMyCallback>(_aidl_impl){
+}
+
+std::function<void(const ITrunkStableTest::BpMyCallback::TransactionLog&)> ITrunkStableTest::BpMyCallback::logFunc;
+
+::android::binder::Status ITrunkStableTest::BpMyCallback::repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatParcelable::cppClient");
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_repeatParcelable, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl())) {
+     return IMyCallback::getDefaultImpl()->repeatParcelable(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status ITrunkStableTest::BpMyCallback::repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatEnum::cppClient");
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(static_cast<int8_t>(input));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_repeatEnum, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl())) {
+     return IMyCallback::getDefaultImpl()->repeatEnum(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readByte(reinterpret_cast<int8_t *>(_aidl_return));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatEnum";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status ITrunkStableTest::BpMyCallback::repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatUnion::cppClient");
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_repeatUnion, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl())) {
+     return IMyCallback::getDefaultImpl()->repeatUnion(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatUnion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+int32_t ITrunkStableTest::BpMyCallback::getInterfaceVersion() {
+  if (cached_version_ == -1) {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_getInterfaceVersion, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        cached_version_ = reply.readInt32();
+      }
+    }
+  }
+  return cached_version_;
+}
+
+
+std::string ITrunkStableTest::BpMyCallback::getInterfaceHash() {
+  std::lock_guard<std::mutex> lockGuard(cached_hash_mutex_);
+  if (cached_hash_ == "-1") {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_getInterfaceHash, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        reply.readUtf8FromUtf16(&cached_hash_);
+      }
+    }
+  }
+  return cached_hash_;
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+
+ITrunkStableTest::BnMyCallback::BnMyCallback()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ITrunkStableTest::BnMyCallback::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnMyCallback::TRANSACTION_repeatParcelable:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatParcelable(in_input, &_aidl_return));
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+      _transaction_log.method_name = "repeatParcelable";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnMyCallback::TRANSACTION_repeatEnum:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyEnum _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_input));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatEnum(in_input, &_aidl_return));
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+      _transaction_log.method_name = "repeatEnum";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByte(static_cast<int8_t>(_aidl_return));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnMyCallback::TRANSACTION_repeatUnion:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyUnion in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyUnion _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatUnion::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatUnion(in_input, &_aidl_return));
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+      _transaction_log.method_name = "repeatUnion";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnMyCallback::TRANSACTION_getInterfaceVersion:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeInt32(IMyCallback::VERSION);
+  }
+  break;
+  case BnMyCallback::TRANSACTION_getInterfaceHash:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeUtf8AsUtf16(IMyCallback::HASH);
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+int32_t ITrunkStableTest::BnMyCallback::getInterfaceVersion() {
+  return IMyCallback::VERSION;
+}
+std::string ITrunkStableTest::BnMyCallback::getInterfaceHash() {
+  return IMyCallback::HASH;
+}
+std::function<void(const ITrunkStableTest::BnMyCallback::TransactionLog&)> ITrunkStableTest::BnMyCallback::logFunc;
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d
new file mode 100644
index 0000000..65ed144
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp : \
+  system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/BnTrunkStableTest.h b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/BnTrunkStableTest.h
new file mode 100644
index 0000000..44df565
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/BnTrunkStableTest.h
@@ -0,0 +1,84 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <functional>
+#include <android/binder_to_string.h>
+#include <android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class BnTrunkStableTest : public ::android::BnInterface<ITrunkStableTest> {
+public:
+  static constexpr uint32_t TRANSACTION_repeatParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_repeatEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_repeatUnion = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_callMyCallback = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_getInterfaceVersion = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777214;
+  static constexpr uint32_t TRANSACTION_getInterfaceHash = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777213;
+  explicit BnTrunkStableTest();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  int32_t getInterfaceVersion();
+  std::string getInterfaceHash();
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+};  // class BnTrunkStableTest
+
+class ITrunkStableTestDelegator : public BnTrunkStableTest {
+public:
+  explicit ITrunkStableTestDelegator(const ::android::sp<ITrunkStableTest> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<ITrunkStableTest> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override {
+    return _aidl_delegate->repeatParcelable(input, _aidl_return);
+  }
+  ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override {
+    return _aidl_delegate->repeatEnum(input, _aidl_return);
+  }
+  ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override {
+    return _aidl_delegate->repeatUnion(input, _aidl_return);
+  }
+  ::android::binder::Status callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb) override {
+    ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallbackDelegator> _cb;
+    if (cb) {
+      _cb = ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallbackDelegator>::cast(delegate(cb));
+    }
+    return _aidl_delegate->callMyCallback(_cb);
+  }
+  int32_t getInterfaceVersion() override {
+    int32_t _delegator_ver = BnTrunkStableTest::getInterfaceVersion();
+    int32_t _impl_ver = _aidl_delegate->getInterfaceVersion();
+    return _delegator_ver < _impl_ver ? _delegator_ver : _impl_ver;
+  }
+  std::string getInterfaceHash() override {
+    return _aidl_delegate->getInterfaceHash();
+  }
+private:
+  ::android::sp<ITrunkStableTest> _aidl_delegate;
+};  // class ITrunkStableTestDelegator
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/BpTrunkStableTest.h b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/BpTrunkStableTest.h
new file mode 100644
index 0000000..2305195
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/BpTrunkStableTest.h
@@ -0,0 +1,51 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <functional>
+#include <android/binder_to_string.h>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class BpTrunkStableTest : public ::android::BpInterface<ITrunkStableTest> {
+public:
+  explicit BpTrunkStableTest(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpTrunkStableTest() = default;
+  ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+  ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+  ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+  ::android::binder::Status callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb) override;
+  int32_t getInterfaceVersion() override;
+  std::string getInterfaceHash() override;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+private:
+  int32_t cached_version_ = -1;
+  std::string cached_hash_ = "-1";
+  std::mutex cached_hash_mutex_;
+};  // class BpTrunkStableTest
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/ITrunkStableTest.h b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/ITrunkStableTest.h
new file mode 100644
index 0000000..6925759
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/android/aidl/test/trunk/ITrunkStableTest.h
@@ -0,0 +1,396 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Delegate.h>
+#include <binder/Enums.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cassert>
+#include <cstdint>
+#include <functional>
+#include <string>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class ITrunkStableTestDelegator;
+
+class ITrunkStableTest : public ::android::IInterface {
+public:
+  typedef ITrunkStableTestDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(TrunkStableTest)
+  static inline const int32_t VERSION = 1;
+  static inline const std::string HASH = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+  class MyParcelable : public ::android::Parcelable {
+  public:
+    int32_t a = 0;
+    int32_t b = 0;
+    inline bool operator!=(const MyParcelable& rhs) const {
+      return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator<(const MyParcelable& rhs) const {
+      return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator<=(const MyParcelable& rhs) const {
+      return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator==(const MyParcelable& rhs) const {
+      return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator>(const MyParcelable& rhs) const {
+      return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator>=(const MyParcelable& rhs) const {
+      return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.test.trunk.ITrunkStableTest.MyParcelable");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyParcelable{";
+      os << "a: " << ::android::internal::ToString(a);
+      os << ", b: " << ::android::internal::ToString(b);
+      os << "}";
+      return os.str();
+    }
+  };  // class MyParcelable
+  enum class MyEnum : int8_t {
+    ZERO = 0,
+    ONE = 1,
+    TWO = 2,
+  };
+  class MyUnion : public ::android::Parcelable {
+  public:
+    enum class Tag : int32_t {
+      a = 0,
+      b = 1,
+    };
+    // Expose tag symbols for legacy code
+    static const inline Tag a = Tag::a;
+    static const inline Tag b = Tag::b;
+
+    template<typename _Tp>
+    static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, MyUnion>;
+
+    MyUnion() : _value(std::in_place_index<static_cast<size_t>(a)>, int32_t(0)) { }
+
+    template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+    // NOLINTNEXTLINE(google-explicit-constructor)
+    constexpr MyUnion(_Tp&& _arg)
+        : _value(std::forward<_Tp>(_arg)) {}
+
+    template <size_t _Np, typename... _Tp>
+    constexpr explicit MyUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+        : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+    template <Tag _tag, typename... _Tp>
+    static MyUnion make(_Tp&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+    }
+
+    template <Tag _tag, typename _Tp, typename... _Up>
+    static MyUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+    }
+
+    Tag getTag() const {
+      return static_cast<Tag>(_value.index());
+    }
+
+    template <Tag _tag>
+    const auto& get() const {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag>
+    auto& get() {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag, typename... _Tp>
+    void set(_Tp&&... _args) {
+      _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+    }
+
+    inline bool operator!=(const MyUnion& rhs) const {
+      return _value != rhs._value;
+    }
+    inline bool operator<(const MyUnion& rhs) const {
+      return _value < rhs._value;
+    }
+    inline bool operator<=(const MyUnion& rhs) const {
+      return _value <= rhs._value;
+    }
+    inline bool operator==(const MyUnion& rhs) const {
+      return _value == rhs._value;
+    }
+    inline bool operator>(const MyUnion& rhs) const {
+      return _value > rhs._value;
+    }
+    inline bool operator>=(const MyUnion& rhs) const {
+      return _value >= rhs._value;
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.test.trunk.ITrunkStableTest.MyUnion");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyUnion{";
+      switch (getTag()) {
+      case a: os << "a: " << ::android::internal::ToString(get<a>()); break;
+      case b: os << "b: " << ::android::internal::ToString(get<b>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    std::variant<int32_t, int32_t> _value;
+  };  // class MyUnion
+  class IMyCallbackDelegator;
+
+  class IMyCallback : public ::android::IInterface {
+  public:
+    typedef IMyCallbackDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(MyCallback)
+    static inline const int32_t VERSION = 1;
+    static inline const std::string HASH = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+    virtual ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) = 0;
+    virtual ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) = 0;
+    virtual ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) = 0;
+    virtual int32_t getInterfaceVersion() = 0;
+    virtual std::string getInterfaceHash() = 0;
+  };  // class IMyCallback
+
+  class IMyCallbackDefault : public IMyCallback {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+    ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    int32_t getInterfaceVersion() override {
+      return 0;
+    }
+    std::string getInterfaceHash() override {
+      return "";
+    }
+  };  // class IMyCallbackDefault
+  class BpMyCallback : public ::android::BpInterface<IMyCallback> {
+  public:
+    explicit BpMyCallback(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpMyCallback() = default;
+    ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+    ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+    ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+    int32_t getInterfaceVersion() override;
+    std::string getInterfaceHash() override;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  private:
+    int32_t cached_version_ = -1;
+    std::string cached_hash_ = "-1";
+    std::mutex cached_hash_mutex_;
+  };  // class BpMyCallback
+  class BnMyCallback : public ::android::BnInterface<IMyCallback> {
+  public:
+    static constexpr uint32_t TRANSACTION_repeatParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+    static constexpr uint32_t TRANSACTION_repeatEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+    static constexpr uint32_t TRANSACTION_repeatUnion = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+    static constexpr uint32_t TRANSACTION_getInterfaceVersion = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777214;
+    static constexpr uint32_t TRANSACTION_getInterfaceHash = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777213;
+    explicit BnMyCallback();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+    int32_t getInterfaceVersion();
+    std::string getInterfaceHash();
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  };  // class BnMyCallback
+
+  class IMyCallbackDelegator : public BnMyCallback {
+  public:
+    explicit IMyCallbackDelegator(const ::android::sp<IMyCallback> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<IMyCallback> getImpl() { return _aidl_delegate; }
+    ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override {
+      return _aidl_delegate->repeatParcelable(input, _aidl_return);
+    }
+    ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override {
+      return _aidl_delegate->repeatEnum(input, _aidl_return);
+    }
+    ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override {
+      return _aidl_delegate->repeatUnion(input, _aidl_return);
+    }
+    int32_t getInterfaceVersion() override {
+      int32_t _delegator_ver = BnMyCallback::getInterfaceVersion();
+      int32_t _impl_ver = _aidl_delegate->getInterfaceVersion();
+      return _delegator_ver < _impl_ver ? _delegator_ver : _impl_ver;
+    }
+    std::string getInterfaceHash() override {
+      return _aidl_delegate->getInterfaceHash();
+    }
+  private:
+    ::android::sp<IMyCallback> _aidl_delegate;
+  };  // class IMyCallbackDelegator
+  virtual ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) = 0;
+  virtual ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) = 0;
+  virtual ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) = 0;
+  virtual ::android::binder::Status callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb) = 0;
+  virtual int32_t getInterfaceVersion() = 0;
+  virtual std::string getInterfaceHash() = 0;
+};  // class ITrunkStableTest
+
+class ITrunkStableTestDefault : public ITrunkStableTest {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& /*cb*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  int32_t getInterfaceVersion() override {
+    return 0;
+  }
+  std::string getInterfaceHash() override {
+    return "";
+  }
+};  // class ITrunkStableTestDefault
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+[[nodiscard]] static inline std::string toString(ITrunkStableTest::MyEnum val) {
+  switch(val) {
+  case ITrunkStableTest::MyEnum::ZERO:
+    return "ZERO";
+  case ITrunkStableTest::MyEnum::ONE:
+    return "ONE";
+  case ITrunkStableTest::MyEnum::TWO:
+    return "TWO";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::test::trunk::ITrunkStableTest::MyEnum, 3> enum_values<::android::aidl::test::trunk::ITrunkStableTest::MyEnum> = {
+  ::android::aidl::test::trunk::ITrunkStableTest::MyEnum::ZERO,
+  ::android::aidl::test::trunk::ITrunkStableTest::MyEnum::ONE,
+  ::android::aidl::test::trunk::ITrunkStableTest::MyEnum::TWO,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+[[nodiscard]] static inline std::string toString(ITrunkStableTest::MyUnion::Tag val) {
+  switch(val) {
+  case ITrunkStableTest::MyUnion::Tag::a:
+    return "a";
+  case ITrunkStableTest::MyUnion::Tag::b:
+    return "b";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag, 2> enum_values<::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag> = {
+  ::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::a,
+  ::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::b,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/timestamp b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source/gen/timestamp
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java
new file mode 100644
index 0000000..2f91b05
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java
@@ -0,0 +1,812 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java.d -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+package android.aidl.test.trunk;
+public interface ITrunkStableTest extends android.os.IInterface
+{
+  /**
+   * The version of this interface that the caller is built against.
+   * This might be different from what {@link #getInterfaceVersion()
+   * getInterfaceVersion} returns as that is the version of the interface
+   * that the remote object is implementing.
+   */
+  public static final int VERSION = 1;
+  public static final String HASH = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+  /** Default implementation for ITrunkStableTest. */
+  public static class Default implements android.aidl.test.trunk.ITrunkStableTest
+  {
+    @Override public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public byte repeatEnum(byte input) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public void callMyCallback(android.aidl.test.trunk.ITrunkStableTest.IMyCallback cb) throws android.os.RemoteException
+    {
+    }
+    @Override
+    public int getInterfaceVersion() {
+      return 0;
+    }
+    @Override
+    public String getInterfaceHash() {
+      return "";
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.test.trunk.ITrunkStableTest
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.test.trunk.ITrunkStableTest interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.test.trunk.ITrunkStableTest asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.test.trunk.ITrunkStableTest))) {
+        return ((android.aidl.test.trunk.ITrunkStableTest)iin);
+      }
+      return new android.aidl.test.trunk.ITrunkStableTest.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_repeatParcelable:
+        {
+          return "repeatParcelable";
+        }
+        case TRANSACTION_repeatEnum:
+        {
+          return "repeatEnum";
+        }
+        case TRANSACTION_repeatUnion:
+        {
+          return "repeatUnion";
+        }
+        case TRANSACTION_callMyCallback:
+        {
+          return "callMyCallback";
+        }
+        case TRANSACTION_getInterfaceVersion:
+        {
+          return "getInterfaceVersion";
+        }
+        case TRANSACTION_getInterfaceHash:
+        {
+          return "getInterfaceHash";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceVersion) {
+        reply.writeNoException();
+        reply.writeInt(getInterfaceVersion());
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceHash) {
+        reply.writeNoException();
+        reply.writeString(getInterfaceHash());
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_repeatParcelable:
+        {
+          android.aidl.test.trunk.ITrunkStableTest.MyParcelable _arg0;
+          _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyParcelable.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.test.trunk.ITrunkStableTest.MyParcelable _result = this.repeatParcelable(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_repeatEnum:
+        {
+          byte _arg0;
+          _arg0 = data.readByte();
+          data.enforceNoDataAvail();
+          byte _result = this.repeatEnum(_arg0);
+          reply.writeNoException();
+          reply.writeByte(_result);
+          break;
+        }
+        case TRANSACTION_repeatUnion:
+        {
+          android.aidl.test.trunk.ITrunkStableTest.MyUnion _arg0;
+          _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyUnion.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.test.trunk.ITrunkStableTest.MyUnion _result = this.repeatUnion(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_callMyCallback:
+        {
+          android.aidl.test.trunk.ITrunkStableTest.IMyCallback _arg0;
+          _arg0 = android.aidl.test.trunk.ITrunkStableTest.IMyCallback.Stub.asInterface(data.readStrongBinder());
+          data.enforceNoDataAvail();
+          this.callMyCallback(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.test.trunk.ITrunkStableTest
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      private int mCachedVersion = -1;
+      private String mCachedHash = "-1";
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.test.trunk.ITrunkStableTest.MyParcelable _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_repeatParcelable, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method repeatParcelable is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyParcelable.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public byte repeatEnum(byte input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        byte _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeByte(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_repeatEnum, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method repeatEnum is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readByte();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.test.trunk.ITrunkStableTest.MyUnion _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_repeatUnion, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method repeatUnion is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyUnion.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public void callMyCallback(android.aidl.test.trunk.ITrunkStableTest.IMyCallback cb) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStrongInterface(cb);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_callMyCallback, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method callMyCallback is unimplemented.");
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override
+      public int getInterfaceVersion() throws android.os.RemoteException {
+        if (mCachedVersion == -1) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceVersion, data, reply, 0);
+            reply.readException();
+            mCachedVersion = reply.readInt();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedVersion;
+      }
+      @Override
+      public synchronized String getInterfaceHash() throws android.os.RemoteException {
+        if ("-1".equals(mCachedHash)) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceHash, data, reply, 0);
+            reply.readException();
+            mCachedHash = reply.readString();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedHash;
+      }
+    }
+    static final int TRANSACTION_repeatParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    static final int TRANSACTION_repeatEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    static final int TRANSACTION_repeatUnion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+    static final int TRANSACTION_callMyCallback = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+    static final int TRANSACTION_getInterfaceVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777214);
+    static final int TRANSACTION_getInterfaceHash = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777213);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 16777214;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android$aidl$test$trunk$ITrunkStableTest".replace('$', '.');
+  public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException;
+  public byte repeatEnum(byte input) throws android.os.RemoteException;
+  public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException;
+  public void callMyCallback(android.aidl.test.trunk.ITrunkStableTest.IMyCallback cb) throws android.os.RemoteException;
+  public int getInterfaceVersion() throws android.os.RemoteException;
+  public String getInterfaceHash() throws android.os.RemoteException;
+  public static class MyParcelable implements android.os.Parcelable
+  {
+    public int a = 0;
+    public int b = 0;
+    public static final android.os.Parcelable.Creator<MyParcelable> CREATOR = new android.os.Parcelable.Creator<MyParcelable>() {
+      @Override
+      public MyParcelable createFromParcel(android.os.Parcel _aidl_source) {
+        MyParcelable _aidl_out = new MyParcelable();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public MyParcelable[] newArray(int _aidl_size) {
+        return new MyParcelable[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeInt(a);
+      _aidl_parcel.writeInt(b);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        a = _aidl_parcel.readInt();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        b = _aidl_parcel.readInt();
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+  public static @interface MyEnum {
+    public static final byte ZERO = 0;
+    public static final byte ONE = 1;
+    public static final byte TWO = 2;
+  }
+  public static final class MyUnion implements android.os.Parcelable {
+    // tags for union fields
+    public final static int a = 0;  // int a;
+    public final static int b = 1;  // int b;
+
+    private int _tag;
+    private Object _value;
+
+    public MyUnion() {
+      int _value = 0;
+      this._tag = a;
+      this._value = _value;
+    }
+
+    private MyUnion(android.os.Parcel _aidl_parcel) {
+      readFromParcel(_aidl_parcel);
+    }
+
+    private MyUnion(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+
+    public int getTag() {
+      return _tag;
+    }
+
+    // int a;
+
+    public static MyUnion a(int _value) {
+      return new MyUnion(a, _value);
+    }
+
+    public int getA() {
+      _assertTag(a);
+      return (int) _value;
+    }
+
+    public void setA(int _value) {
+      _set(a, _value);
+    }
+
+    // int b;
+
+    public static MyUnion b(int _value) {
+      return new MyUnion(b, _value);
+    }
+
+    public int getB() {
+      _assertTag(b);
+      return (int) _value;
+    }
+
+    public void setB(int _value) {
+      _set(b, _value);
+    }
+
+    public static final android.os.Parcelable.Creator<MyUnion> CREATOR = new android.os.Parcelable.Creator<MyUnion>() {
+      @Override
+      public MyUnion createFromParcel(android.os.Parcel _aidl_source) {
+        return new MyUnion(_aidl_source);
+      }
+      @Override
+      public MyUnion[] newArray(int _aidl_size) {
+        return new MyUnion[_aidl_size];
+      }
+    };
+
+    @Override
+    public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+      _aidl_parcel.writeInt(_tag);
+      switch (_tag) {
+      case a:
+        _aidl_parcel.writeInt(getA());
+        break;
+      case b:
+        _aidl_parcel.writeInt(getB());
+        break;
+      }
+    }
+
+    public void readFromParcel(android.os.Parcel _aidl_parcel) {
+      int _aidl_tag;
+      _aidl_tag = _aidl_parcel.readInt();
+      switch (_aidl_tag) {
+      case a: {
+        int _aidl_value;
+        _aidl_value = _aidl_parcel.readInt();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case b: {
+        int _aidl_value;
+        _aidl_value = _aidl_parcel.readInt();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      }
+      throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+    }
+
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      switch (getTag()) {
+      }
+      return _mask;
+    }
+
+    private void _assertTag(int tag) {
+      if (getTag() != tag) {
+        throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+      }
+    }
+
+    private String _tagString(int _tag) {
+      switch (_tag) {
+      case a: return "a";
+      case b: return "b";
+      }
+      throw new IllegalStateException("unknown field: " + _tag);
+    }
+
+    private void _set(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+    public static @interface Tag {
+      public static final int a = 0;
+      public static final int b = 1;
+    }
+  }
+  public interface IMyCallback extends android.os.IInterface
+  {
+    /**
+     * The version of this interface that the caller is built against.
+     * This might be different from what {@link #getInterfaceVersion()
+     * getInterfaceVersion} returns as that is the version of the interface
+     * that the remote object is implementing.
+     */
+    public static final int VERSION = 1;
+    public static final String HASH = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+    /** Default implementation for IMyCallback. */
+    public static class Default implements android.aidl.test.trunk.ITrunkStableTest.IMyCallback
+    {
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public byte repeatEnum(byte input) throws android.os.RemoteException
+      {
+        return 0;
+      }
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override
+      public int getInterfaceVersion() {
+        return 0;
+      }
+      @Override
+      public String getInterfaceHash() {
+        return "";
+      }
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.test.trunk.ITrunkStableTest.IMyCallback
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.test.trunk.ITrunkStableTest.IMyCallback interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.test.trunk.ITrunkStableTest.IMyCallback asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.test.trunk.ITrunkStableTest.IMyCallback))) {
+          return ((android.aidl.test.trunk.ITrunkStableTest.IMyCallback)iin);
+        }
+        return new android.aidl.test.trunk.ITrunkStableTest.IMyCallback.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      /** @hide */
+      public static java.lang.String getDefaultTransactionName(int transactionCode)
+      {
+        switch (transactionCode)
+        {
+          case TRANSACTION_repeatParcelable:
+          {
+            return "repeatParcelable";
+          }
+          case TRANSACTION_repeatEnum:
+          {
+            return "repeatEnum";
+          }
+          case TRANSACTION_repeatUnion:
+          {
+            return "repeatUnion";
+          }
+          case TRANSACTION_getInterfaceVersion:
+          {
+            return "getInterfaceVersion";
+          }
+          case TRANSACTION_getInterfaceHash:
+          {
+            return "getInterfaceHash";
+          }
+          default:
+          {
+            return null;
+          }
+        }
+      }
+      /** @hide */
+      public java.lang.String getTransactionName(int transactionCode)
+      {
+        return this.getDefaultTransactionName(transactionCode);
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+          data.enforceInterface(descriptor);
+        }
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        else if (code == TRANSACTION_getInterfaceVersion) {
+          reply.writeNoException();
+          reply.writeInt(getInterfaceVersion());
+          return true;
+        }
+        else if (code == TRANSACTION_getInterfaceHash) {
+          reply.writeNoException();
+          reply.writeString(getInterfaceHash());
+          return true;
+        }
+        switch (code)
+        {
+          case TRANSACTION_repeatParcelable:
+          {
+            android.aidl.test.trunk.ITrunkStableTest.MyParcelable _arg0;
+            _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyParcelable.CREATOR);
+            data.enforceNoDataAvail();
+            android.aidl.test.trunk.ITrunkStableTest.MyParcelable _result = this.repeatParcelable(_arg0);
+            reply.writeNoException();
+            reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+            break;
+          }
+          case TRANSACTION_repeatEnum:
+          {
+            byte _arg0;
+            _arg0 = data.readByte();
+            data.enforceNoDataAvail();
+            byte _result = this.repeatEnum(_arg0);
+            reply.writeNoException();
+            reply.writeByte(_result);
+            break;
+          }
+          case TRANSACTION_repeatUnion:
+          {
+            android.aidl.test.trunk.ITrunkStableTest.MyUnion _arg0;
+            _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyUnion.CREATOR);
+            data.enforceNoDataAvail();
+            android.aidl.test.trunk.ITrunkStableTest.MyUnion _result = this.repeatUnion(_arg0);
+            reply.writeNoException();
+            reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+            break;
+          }
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+        return true;
+      }
+      private static class Proxy implements android.aidl.test.trunk.ITrunkStableTest.IMyCallback
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        private int mCachedVersion = -1;
+        private String mCachedHash = "-1";
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+        @Override public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.aidl.test.trunk.ITrunkStableTest.MyParcelable _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeTypedObject(input, 0);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_repeatParcelable, _data, _reply, 0);
+            if (!_status) {
+              throw new android.os.RemoteException("Method repeatParcelable is unimplemented.");
+            }
+            _reply.readException();
+            _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyParcelable.CREATOR);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public byte repeatEnum(byte input) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          byte _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeByte(input);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_repeatEnum, _data, _reply, 0);
+            if (!_status) {
+              throw new android.os.RemoteException("Method repeatEnum is unimplemented.");
+            }
+            _reply.readException();
+            _result = _reply.readByte();
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.aidl.test.trunk.ITrunkStableTest.MyUnion _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeTypedObject(input, 0);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_repeatUnion, _data, _reply, 0);
+            if (!_status) {
+              throw new android.os.RemoteException("Method repeatUnion is unimplemented.");
+            }
+            _reply.readException();
+            _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyUnion.CREATOR);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override
+        public int getInterfaceVersion() throws android.os.RemoteException {
+          if (mCachedVersion == -1) {
+            android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+            android.os.Parcel reply = android.os.Parcel.obtain();
+            try {
+              data.writeInterfaceToken(DESCRIPTOR);
+              boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceVersion, data, reply, 0);
+              reply.readException();
+              mCachedVersion = reply.readInt();
+            } finally {
+              reply.recycle();
+              data.recycle();
+            }
+          }
+          return mCachedVersion;
+        }
+        @Override
+        public synchronized String getInterfaceHash() throws android.os.RemoteException {
+          if ("-1".equals(mCachedHash)) {
+            android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+            android.os.Parcel reply = android.os.Parcel.obtain();
+            try {
+              data.writeInterfaceToken(DESCRIPTOR);
+              boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceHash, data, reply, 0);
+              reply.readException();
+              mCachedHash = reply.readString();
+            } finally {
+              reply.recycle();
+              data.recycle();
+            }
+          }
+          return mCachedHash;
+        }
+      }
+      static final int TRANSACTION_repeatParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+      static final int TRANSACTION_repeatEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+      static final int TRANSACTION_repeatUnion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+      static final int TRANSACTION_getInterfaceVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777214);
+      static final int TRANSACTION_getInterfaceHash = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777213);
+      /** @hide */
+      public int getMaxTransactionId()
+      {
+        return 16777214;
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android$aidl$test$trunk$ITrunkStableTest$IMyCallback".replace('$', '.');
+    public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException;
+    public byte repeatEnum(byte input) throws android.os.RemoteException;
+    public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException;
+    public int getInterfaceVersion() throws android.os.RemoteException;
+    public String getInterfaceHash() throws android.os.RemoteException;
+  }
+}
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java.d b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java.d
new file mode 100644
index 0000000..e280c96
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java : \
+  system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/timestamp b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source/gen/timestamp
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp
new file mode 100644
index 0000000..eac8143
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp
@@ -0,0 +1,1435 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#include "aidl/android/aidl/test/trunk/ITrunkStableTest.h"
+
+#include <android/binder_parcel_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <aidl/android/aidl/test/trunk/BpTrunkStableTest.h>
+
+namespace {
+struct ScopedTrace {
+  inline explicit ScopedTrace(const char* name) { ATrace_beginSection(name); }
+  inline ~ScopedTrace() { ATrace_endSection(); }
+};
+}  // namespace
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+static binder_status_t _aidl_android_aidl_test_trunk_ITrunkStableTest_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnTrunkStableTest> _aidl_impl = std::static_pointer_cast<BnTrunkStableTest>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*repeatParcelable*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatParcelable::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatParcelable(in_input, &_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "repeatParcelable";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*repeatEnum*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatEnum::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatEnum(in_input, &_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "repeatEnum";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*repeatUnion*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatUnion::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatUnion(in_input, &_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "repeatUnion";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 3 /*callMyCallback*/): {
+      std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback> in_cb;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::callMyCallback::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_cb);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_cb", ::android::internal::ToString(in_cb));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->callMyCallback(in_cb);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "callMyCallback";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): {
+      int32_t _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::getInterfaceVersion::server");
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "getInterfaceVersion";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): {
+      std::string _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::getInterfaceHash::server");
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "getInterfaceHash";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_test_trunk_ITrunkStableTest_clazz = ::ndk::ICInterface::defineClass(ITrunkStableTest::descriptor, _aidl_android_aidl_test_trunk_ITrunkStableTest_onTransact);
+
+BpTrunkStableTest::BpTrunkStableTest(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpTrunkStableTest::~BpTrunkStableTest() {}
+std::function<void(const BpTrunkStableTest::TransactionLog&)> BpTrunkStableTest::logFunc;
+
+::ndk::ScopedAStatus BpTrunkStableTest::repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatParcelable::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*repeatParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->repeatParcelable(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatEnum::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*repeatEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->repeatEnum(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatEnum";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatUnion::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*repeatUnion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->repeatUnion(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatUnion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_cb", ::android::internal::ToString(in_cb));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::callMyCallback::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_cb);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 3 /*callMyCallback*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->callMyCallback(in_cb);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "callMyCallback";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::getInterfaceVersion(int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  if (_aidl_cached_version != -1) {
+    *_aidl_return = _aidl_cached_version;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::getInterfaceVersion::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->getInterfaceVersion(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_version = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "getInterfaceVersion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::getInterfaceHash(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex);
+  if (_aidl_cached_hash != "-1") {
+    *_aidl_return = _aidl_cached_hash;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::getInterfaceHash::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->getInterfaceHash(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_hash = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "getInterfaceHash";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+// Source for BnTrunkStableTest
+BnTrunkStableTest::BnTrunkStableTest() {}
+BnTrunkStableTest::~BnTrunkStableTest() {}
+std::function<void(const BnTrunkStableTest::TransactionLog&)> BnTrunkStableTest::logFunc;
+::ndk::SpAIBinder BnTrunkStableTest::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_test_trunk_ITrunkStableTest_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+::ndk::ScopedAStatus BnTrunkStableTest::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = ITrunkStableTest::version;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus BnTrunkStableTest::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = ITrunkStableTest::hash;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+// Source for ITrunkStableTest
+const char* ITrunkStableTest::descriptor = "android.aidl.test.trunk.ITrunkStableTest";
+ITrunkStableTest::ITrunkStableTest() {}
+ITrunkStableTest::~ITrunkStableTest() {}
+
+
+std::shared_ptr<ITrunkStableTest> ITrunkStableTest::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_test_trunk_ITrunkStableTest_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpTrunkStableTest>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<ITrunkStableTest>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpTrunkStableTest>(binder);
+}
+
+binder_status_t ITrunkStableTest::writeToParcel(AParcel* parcel, const std::shared_ptr<ITrunkStableTest>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ITrunkStableTest::readFromParcel(const AParcel* parcel, std::shared_ptr<ITrunkStableTest>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = ITrunkStableTest::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ITrunkStableTest::setDefaultImpl(const std::shared_ptr<ITrunkStableTest>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!ITrunkStableTest::default_impl);
+  if (impl) {
+    ITrunkStableTest::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ITrunkStableTest>& ITrunkStableTest::getDefaultImpl() {
+  return ITrunkStableTest::default_impl;
+}
+std::shared_ptr<ITrunkStableTest> ITrunkStableTest::default_impl = nullptr;
+::ndk::ScopedAStatus ITrunkStableTestDefault::repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& /*in_cb*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = 0;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = "";
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::SpAIBinder ITrunkStableTestDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ITrunkStableTestDefault::isRemote() {
+  return false;
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+const char* ITrunkStableTest::MyParcelable::descriptor = "android.aidl.test.trunk.ITrunkStableTest.MyParcelable";
+
+binder_status_t ITrunkStableTest::MyParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ITrunkStableTest::MyParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+const char* ITrunkStableTest::MyUnion::descriptor = "android.aidl.test.trunk.ITrunkStableTest.MyUnion";
+
+binder_status_t ITrunkStableTest::MyUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case a: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<a>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<a>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case b: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<b>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<b>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t ITrunkStableTest::MyUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case a: return ::ndk::AParcel_writeData(_parcel, get<a>());
+  case b: return ::ndk::AParcel_writeData(_parcel, get<b>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+static binder_status_t _aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<ITrunkStableTest::BnMyCallback> _aidl_impl = std::static_pointer_cast<ITrunkStableTest::BnMyCallback>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*repeatParcelable*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatParcelable::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatParcelable(in_input, &_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "repeatParcelable";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*repeatEnum*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatEnum::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatEnum(in_input, &_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "repeatEnum";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*repeatUnion*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatUnion::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatUnion(in_input, &_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "repeatUnion";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): {
+      int32_t _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::getInterfaceVersion::server");
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "getInterfaceVersion";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): {
+      std::string _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::getInterfaceHash::server");
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "getInterfaceHash";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_clazz = ::ndk::ICInterface::defineClass(ITrunkStableTest::IMyCallback::descriptor, _aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_onTransact);
+
+ITrunkStableTest::BpMyCallback::BpMyCallback(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ITrunkStableTest::BpMyCallback::~BpMyCallback() {}
+std::function<void(const ITrunkStableTest::BpMyCallback::TransactionLog&)> ITrunkStableTest::BpMyCallback::logFunc;
+
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatParcelable::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*repeatParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->repeatParcelable(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatEnum::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*repeatEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->repeatEnum(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatEnum";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatUnion::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*repeatUnion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->repeatUnion(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatUnion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::getInterfaceVersion(int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  if (_aidl_cached_version != -1) {
+    *_aidl_return = _aidl_cached_version;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::getInterfaceVersion::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->getInterfaceVersion(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_version = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "getInterfaceVersion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::getInterfaceHash(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex);
+  if (_aidl_cached_hash != "-1") {
+    *_aidl_return = _aidl_cached_hash;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::getInterfaceHash::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->getInterfaceHash(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_hash = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "getInterfaceHash";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+// Source for BnMyCallback
+ITrunkStableTest::BnMyCallback::BnMyCallback() {}
+ITrunkStableTest::BnMyCallback::~BnMyCallback() {}
+std::function<void(const ITrunkStableTest::BnMyCallback::TransactionLog&)> ITrunkStableTest::BnMyCallback::logFunc;
+::ndk::SpAIBinder ITrunkStableTest::BnMyCallback::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+::ndk::ScopedAStatus ITrunkStableTest::BnMyCallback::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = IMyCallback::version;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus ITrunkStableTest::BnMyCallback::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = IMyCallback::hash;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+// Source for IMyCallback
+const char* ITrunkStableTest::IMyCallback::descriptor = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+ITrunkStableTest::IMyCallback::IMyCallback() {}
+ITrunkStableTest::IMyCallback::~IMyCallback() {}
+
+
+std::shared_ptr<ITrunkStableTest::IMyCallback> ITrunkStableTest::IMyCallback::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ITrunkStableTest::BpMyCallback>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IMyCallback>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ITrunkStableTest::BpMyCallback>(binder);
+}
+
+binder_status_t ITrunkStableTest::IMyCallback::writeToParcel(AParcel* parcel, const std::shared_ptr<IMyCallback>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ITrunkStableTest::IMyCallback::readFromParcel(const AParcel* parcel, std::shared_ptr<IMyCallback>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IMyCallback::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ITrunkStableTest::IMyCallback::setDefaultImpl(const std::shared_ptr<IMyCallback>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IMyCallback::default_impl);
+  if (impl) {
+    IMyCallback::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ITrunkStableTest::IMyCallback>& ITrunkStableTest::IMyCallback::getDefaultImpl() {
+  return IMyCallback::default_impl;
+}
+std::shared_ptr<ITrunkStableTest::IMyCallback> ITrunkStableTest::IMyCallback::default_impl = nullptr;
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = 0;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = "";
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::SpAIBinder ITrunkStableTest::IMyCallbackDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ITrunkStableTest::IMyCallbackDefault::isRemote() {
+  return false;
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d
new file mode 100644
index 0000000..d5781d7
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp : \
+  system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/BnTrunkStableTest.h b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/BnTrunkStableTest.h
new file mode 100644
index 0000000..eb3c3ac
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/BnTrunkStableTest.h
@@ -0,0 +1,81 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/test/trunk/ITrunkStableTest.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class BnTrunkStableTest : public ::ndk::BnCInterface<ITrunkStableTest> {
+public:
+  BnTrunkStableTest();
+  virtual ~BnTrunkStableTest();
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) final;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) final;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class ITrunkStableTestDelegator : public BnTrunkStableTest {
+public:
+  explicit ITrunkStableTestDelegator(const std::shared_ptr<ITrunkStableTest> &impl) : _impl(impl) {
+     int32_t _impl_ver = 0;
+     if (!impl->getInterfaceVersion(&_impl_ver).isOk()) {;
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Delegator failed to get version of the implementation.");
+     }
+     if (_impl_ver != ITrunkStableTest::version) {
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Mismatched versions of delegator and implementation is not allowed.");
+     }
+  }
+
+  ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override {
+    return _impl->repeatParcelable(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override {
+    return _impl->repeatEnum(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override {
+    return _impl->repeatUnion(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) override {
+    return _impl->callMyCallback(in_cb);
+  }
+protected:
+private:
+  std::shared_ptr<ITrunkStableTest> _impl;
+};
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/BpTrunkStableTest.h b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/BpTrunkStableTest.h
new file mode 100644
index 0000000..62bd6ca
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/BpTrunkStableTest.h
@@ -0,0 +1,54 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/test/trunk/ITrunkStableTest.h"
+
+#include <android/binder_ibinder.h>
+#include <functional>
+#include <chrono>
+#include <sstream>
+#include <android/trace.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class BpTrunkStableTest : public ::ndk::BpCInterface<ITrunkStableTest> {
+public:
+  explicit BpTrunkStableTest(const ::ndk::SpAIBinder& binder);
+  virtual ~BpTrunkStableTest();
+
+  ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+  ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+  ::ndk::ScopedAStatus callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  int32_t _aidl_cached_version = -1;
+  std::string _aidl_cached_hash = "-1";
+  std::mutex _aidl_cached_hash_mutex;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+};
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/ITrunkStableTest.h b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/ITrunkStableTest.h
new file mode 100644
index 0000000..4075f7b
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/aidl/android/aidl/test/trunk/ITrunkStableTest.h
@@ -0,0 +1,385 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <chrono>
+#include <cstdint>
+#include <functional>
+#include <memory>
+#include <optional>
+#include <sstream>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_ibinder.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <android/trace.h>
+#include <aidl/android/aidl/test/trunk/ITrunkStableTest.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class ITrunkStableTestDelegator;
+
+class ITrunkStableTest : public ::ndk::ICInterface {
+public:
+  typedef ITrunkStableTestDelegator DefaultDelegator;
+  static const char* descriptor;
+  ITrunkStableTest();
+  virtual ~ITrunkStableTest();
+
+  class MyParcelable {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    int32_t a = 0;
+    int32_t b = 0;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const MyParcelable& rhs) const {
+      return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator<(const MyParcelable& rhs) const {
+      return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator<=(const MyParcelable& rhs) const {
+      return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator==(const MyParcelable& rhs) const {
+      return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator>(const MyParcelable& rhs) const {
+      return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator>=(const MyParcelable& rhs) const {
+      return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyParcelable{";
+      os << "a: " << ::android::internal::ToString(a);
+      os << ", b: " << ::android::internal::ToString(b);
+      os << "}";
+      return os.str();
+    }
+  };
+  enum class MyEnum : int8_t {
+    ZERO = 0,
+    ONE = 1,
+    TWO = 2,
+  };
+
+  class MyUnion {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    enum class Tag : int32_t {
+      a = 0,
+      b = 1,
+    };
+
+    // Expose tag symbols for legacy code
+    static const inline Tag a = Tag::a;
+    static const inline Tag b = Tag::b;
+
+    template<typename _Tp>
+    static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, MyUnion>;
+
+    MyUnion() : _value(std::in_place_index<static_cast<size_t>(a)>, int32_t(0)) { }
+
+    template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+    // NOLINTNEXTLINE(google-explicit-constructor)
+    constexpr MyUnion(_Tp&& _arg)
+        : _value(std::forward<_Tp>(_arg)) {}
+
+    template <size_t _Np, typename... _Tp>
+    constexpr explicit MyUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+        : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+    template <Tag _tag, typename... _Tp>
+    static MyUnion make(_Tp&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+    }
+
+    template <Tag _tag, typename _Tp, typename... _Up>
+    static MyUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+    }
+
+    Tag getTag() const {
+      return static_cast<Tag>(_value.index());
+    }
+
+    template <Tag _tag>
+    const auto& get() const {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag>
+    auto& get() {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag, typename... _Tp>
+    void set(_Tp&&... _args) {
+      _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+    }
+
+    binder_status_t readFromParcel(const AParcel* _parcel);
+    binder_status_t writeToParcel(AParcel* _parcel) const;
+
+    inline bool operator!=(const MyUnion& rhs) const {
+      return _value != rhs._value;
+    }
+    inline bool operator<(const MyUnion& rhs) const {
+      return _value < rhs._value;
+    }
+    inline bool operator<=(const MyUnion& rhs) const {
+      return _value <= rhs._value;
+    }
+    inline bool operator==(const MyUnion& rhs) const {
+      return _value == rhs._value;
+    }
+    inline bool operator>(const MyUnion& rhs) const {
+      return _value > rhs._value;
+    }
+    inline bool operator>=(const MyUnion& rhs) const {
+      return _value >= rhs._value;
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyUnion{";
+      switch (getTag()) {
+      case a: os << "a: " << ::android::internal::ToString(get<a>()); break;
+      case b: os << "b: " << ::android::internal::ToString(get<b>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    std::variant<int32_t, int32_t> _value;
+  };
+  class IMyCallbackDelegator;
+
+  class IMyCallback : public ::ndk::ICInterface {
+  public:
+    typedef IMyCallbackDelegator DefaultDelegator;
+    static const char* descriptor;
+    IMyCallback();
+    virtual ~IMyCallback();
+
+    static inline const int32_t version = 1;
+    static inline const std::string hash = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+    static constexpr uint32_t TRANSACTION_repeatParcelable = FIRST_CALL_TRANSACTION + 0;
+    static constexpr uint32_t TRANSACTION_repeatEnum = FIRST_CALL_TRANSACTION + 1;
+    static constexpr uint32_t TRANSACTION_repeatUnion = FIRST_CALL_TRANSACTION + 2;
+
+    static std::shared_ptr<IMyCallback> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IMyCallback>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IMyCallback>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<IMyCallback>& impl);
+    static const std::shared_ptr<IMyCallback>& getDefaultImpl();
+    virtual ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) = 0;
+  private:
+    static std::shared_ptr<IMyCallback> default_impl;
+  };
+  class IMyCallbackDefault : public IMyCallback {
+  public:
+    ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+    ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+    ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpMyCallback : public ::ndk::BpCInterface<IMyCallback> {
+  public:
+    explicit BpMyCallback(const ::ndk::SpAIBinder& binder);
+    virtual ~BpMyCallback();
+
+    ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+    ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+    ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+    int32_t _aidl_cached_version = -1;
+    std::string _aidl_cached_hash = "-1";
+    std::mutex _aidl_cached_hash_mutex;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  };
+  class BnMyCallback : public ::ndk::BnCInterface<IMyCallback> {
+  public:
+    BnMyCallback();
+    virtual ~BnMyCallback();
+    ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) final;
+    ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) final;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  static inline const int32_t version = 1;
+  static inline const std::string hash = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+  static constexpr uint32_t TRANSACTION_repeatParcelable = FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_repeatEnum = FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_repeatUnion = FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_callMyCallback = FIRST_CALL_TRANSACTION + 3;
+
+  static std::shared_ptr<ITrunkStableTest> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<ITrunkStableTest>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<ITrunkStableTest>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<ITrunkStableTest>& impl);
+  static const std::shared_ptr<ITrunkStableTest>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) = 0;
+private:
+  static std::shared_ptr<ITrunkStableTest> default_impl;
+};
+class ITrunkStableTestDefault : public ITrunkStableTest {
+public:
+  ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+  ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+  ::ndk::ScopedAStatus callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+[[nodiscard]] static inline std::string toString(ITrunkStableTest::MyEnum val) {
+  switch(val) {
+  case ITrunkStableTest::MyEnum::ZERO:
+    return "ZERO";
+  case ITrunkStableTest::MyEnum::ONE:
+    return "ONE";
+  case ITrunkStableTest::MyEnum::TWO:
+    return "TWO";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum, 3> enum_values<aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum> = {
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum::ZERO,
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum::ONE,
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum::TWO,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+[[nodiscard]] static inline std::string toString(ITrunkStableTest::MyUnion::Tag val) {
+  switch(val) {
+  case ITrunkStableTest::MyUnion::Tag::a:
+    return "a";
+  case ITrunkStableTest::MyUnion::Tag::b:
+    return "b";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag, 2> enum_values<aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag> = {
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::a,
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::b,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/timestamp b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source/gen/timestamp
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs
new file mode 100644
index 0000000..03ca423
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs
@@ -0,0 +1,916 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust --structured --version 1 --hash 88311b9118fb6fe9eff4a2ca19121de0587f6d5f --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs.d -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen -Nsystem/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1 system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  ITrunkStableTest["android.aidl.test.trunk.ITrunkStableTest"] {
+    native: BnTrunkStableTest(on_transact),
+    proxy: BpTrunkStableTest {
+      cached_version: std::sync::atomic::AtomicI32 = std::sync::atomic::AtomicI32::new(-1),
+      cached_hash: std::sync::Mutex<Option<String>> = std::sync::Mutex::new(None)
+    },
+    async: ITrunkStableTestAsync,
+  }
+}
+pub trait ITrunkStableTest: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest" }
+  fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>;
+  fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>;
+  fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>;
+  fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()>;
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    Ok(VERSION)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    Ok(HASH.into())
+  }
+  fn getDefaultImpl() -> ITrunkStableTestDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: ITrunkStableTestDefaultRef) -> ITrunkStableTestDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait ITrunkStableTestAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest" }
+  fn r#repeatParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>>;
+  fn r#repeatEnum<'a>(&'a self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>>;
+  fn r#repeatUnion<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>>;
+  fn r#callMyCallback<'a>(&'a self, _arg_cb: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    Box::pin(async move { Ok(VERSION) })
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    Box::pin(async move { Ok(HASH.into()) })
+  }
+}
+#[::async_trait::async_trait]
+pub trait ITrunkStableTestAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest" }
+  async fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>;
+  async fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>;
+  async fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>;
+  async fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()>;
+}
+impl BnTrunkStableTest {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn ITrunkStableTest>
+  where
+    T: ITrunkStableTestAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> ITrunkStableTest for Wrapper<T, R>
+    where
+      T: ITrunkStableTestAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+        self._rt.block_on(self._inner.r#repeatParcelable(_arg_input))
+      }
+      fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+        self._rt.block_on(self._inner.r#repeatEnum(_arg_input))
+      }
+      fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+        self._rt.block_on(self._inner.r#repeatUnion(_arg_input))
+      }
+      fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#callMyCallback(_arg_cb))
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait ITrunkStableTestDefault: Send + Sync {
+  fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#repeatParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  pub const r#repeatEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+  pub const r#repeatUnion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+  pub const r#callMyCallback: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 3;
+  pub const r#getInterfaceVersion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777214;
+  pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213;
+}
+pub type ITrunkStableTestDefaultRef = Option<std::sync::Arc<dyn ITrunkStableTestDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<ITrunkStableTestDefaultRef> = std::sync::Mutex::new(None);
+}
+pub const VERSION: i32 = 1;
+pub const HASH: &str = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+impl BpTrunkStableTest {
+  fn build_parcel_repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#repeatParcelable(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#repeatEnum(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#repeatUnion(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_cb)?;
+    Ok(aidl_data)
+  }
+  fn read_response_callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#callMyCallback(_arg_cb);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_getInterfaceVersion(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceVersion(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    self.cached_version.store(_aidl_return, std::sync::atomic::Ordering::Relaxed);
+    Ok(_aidl_return)
+  }
+  fn build_parcel_getInterfaceHash(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceHash(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    *self.cached_hash.lock().unwrap() = Some(_aidl_return.clone());
+    Ok(_aidl_return)
+  }
+}
+impl ITrunkStableTest for BpTrunkStableTest {
+  fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+    let _aidl_data = self.build_parcel_repeatParcelable(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#repeatParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_repeatParcelable(_arg_input, _aidl_reply)
+  }
+  fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+    let _aidl_data = self.build_parcel_repeatEnum(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#repeatEnum, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_repeatEnum(_arg_input, _aidl_reply)
+  }
+  fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+    let _aidl_data = self.build_parcel_repeatUnion(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#repeatUnion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_repeatUnion(_arg_input, _aidl_reply)
+  }
+  fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_callMyCallback(_arg_cb)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#callMyCallback, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_callMyCallback(_arg_cb, _aidl_reply)
+  }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Ok(_aidl_version); }
+    let _aidl_data = self.build_parcel_getInterfaceVersion()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceVersion(_aidl_reply)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Ok(_aidl_hash.clone());
+      }
+    }
+    let _aidl_data = self.build_parcel_getInterfaceHash()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceHash(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> ITrunkStableTestAsync<P> for BpTrunkStableTest {
+  fn r#repeatParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>> {
+    let _aidl_data = match self.build_parcel_repeatParcelable(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#repeatParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_repeatParcelable(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#repeatEnum<'a>(&'a self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>> {
+    let _aidl_data = match self.build_parcel_repeatEnum(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#repeatEnum, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_repeatEnum(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#repeatUnion<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>> {
+    let _aidl_data = match self.build_parcel_repeatUnion(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#repeatUnion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_repeatUnion(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#callMyCallback<'a>(&'a self, _arg_cb: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_callMyCallback(_arg_cb) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#callMyCallback, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_callMyCallback(_arg_cb, _aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Box::pin(std::future::ready(Ok(_aidl_version))); }
+    let _aidl_data = match self.build_parcel_getInterfaceVersion() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceVersion(_aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Box::pin(std::future::ready(Ok(_aidl_hash.clone())));
+      }
+    }
+    let _aidl_data = match self.build_parcel_getInterfaceHash() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceHash(_aidl_reply)
+      }
+    )
+  }
+}
+impl ITrunkStableTest for binder::binder_impl::Binder<BnTrunkStableTest> {
+  fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> { self.0.r#repeatParcelable(_arg_input) }
+  fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> { self.0.r#repeatEnum(_arg_input) }
+  fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> { self.0.r#repeatUnion(_arg_input) }
+  fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()> { self.0.r#callMyCallback(_arg_cb) }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> { self.0.r#getInterfaceVersion() }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> { self.0.r#getInterfaceHash() }
+}
+fn on_transact(_aidl_service: &dyn ITrunkStableTest, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#repeatParcelable => {
+      let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#repeatParcelable(&_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#repeatEnum => {
+      let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#repeatEnum(_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#repeatUnion => {
+      let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#repeatUnion(&_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#callMyCallback => {
+      let _arg_cb: binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#callMyCallback(&_arg_cb);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceVersion => {
+      let _aidl_return = _aidl_service.r#getInterfaceVersion();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceHash => {
+      let _aidl_return = _aidl_service.r#getInterfaceHash();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub mod r#MyParcelable {
+  #[derive(Debug)]
+  pub struct r#MyParcelable {
+    pub r#a: i32,
+    pub r#b: i32,
+  }
+  impl Default for r#MyParcelable {
+    fn default() -> Self {
+      Self {
+        r#a: 0,
+        r#b: 0,
+      }
+    }
+  }
+  impl binder::Parcelable for r#MyParcelable {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        subparcel.write(&self.r#a)?;
+        subparcel.write(&self.r#b)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#a = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#b = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyParcelable);
+  binder::impl_deserialize_for_parcelable!(r#MyParcelable);
+  impl binder::binder_impl::ParcelableMetadata for r#MyParcelable {
+    fn get_descriptor() -> &'static str { "android.aidl.test.trunk.ITrunkStableTest.MyParcelable" }
+  }
+}
+pub mod r#MyEnum {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#MyEnum : [i8; 3] {
+      r#ZERO = 0,
+      r#ONE = 1,
+      r#TWO = 2,
+    }
+  }
+}
+pub mod r#MyUnion {
+  #[derive(Debug)]
+  pub enum r#MyUnion {
+    A(i32),
+    B(i32),
+  }
+  impl Default for r#MyUnion {
+    fn default() -> Self {
+      Self::A(0)
+    }
+  }
+  impl binder::Parcelable for r#MyUnion {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      match self {
+        Self::A(v) => {
+          parcel.write(&0i32)?;
+          parcel.write(v)
+        }
+        Self::B(v) => {
+          parcel.write(&1i32)?;
+          parcel.write(v)
+        }
+      }
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      let tag: i32 = parcel.read()?;
+      match tag {
+        0 => {
+          let value: i32 = parcel.read()?;
+          *self = Self::A(value);
+          Ok(())
+        }
+        1 => {
+          let value: i32 = parcel.read()?;
+          *self = Self::B(value);
+          Ok(())
+        }
+        _ => {
+          Err(binder::StatusCode::BAD_VALUE)
+        }
+      }
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyUnion);
+  binder::impl_deserialize_for_parcelable!(r#MyUnion);
+  impl binder::binder_impl::ParcelableMetadata for r#MyUnion {
+    fn get_descriptor() -> &'static str { "android.aidl.test.trunk.ITrunkStableTest.MyUnion" }
+  }
+  pub mod r#Tag {
+    #![allow(non_upper_case_globals)]
+    use binder::declare_binder_enum;
+    declare_binder_enum! {
+      r#Tag : [i32; 2] {
+        r#a = 0,
+        r#b = 1,
+      }
+    }
+  }
+}
+pub mod r#IMyCallback {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    IMyCallback["android.aidl.test.trunk.ITrunkStableTest.IMyCallback"] {
+      native: BnMyCallback(on_transact),
+      proxy: BpMyCallback {
+        cached_version: std::sync::atomic::AtomicI32 = std::sync::atomic::AtomicI32::new(-1),
+        cached_hash: std::sync::Mutex<Option<String>> = std::sync::Mutex::new(None)
+      },
+      async: IMyCallbackAsync,
+    }
+  }
+  pub trait IMyCallback: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest.IMyCallback" }
+    fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>;
+    fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>;
+    fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>;
+    fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+      Ok(VERSION)
+    }
+    fn r#getInterfaceHash(&self) -> binder::Result<String> {
+      Ok(HASH.into())
+    }
+    fn getDefaultImpl() -> IMyCallbackDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: IMyCallbackDefaultRef) -> IMyCallbackDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait IMyCallbackAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest.IMyCallback" }
+    fn r#repeatParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>>;
+    fn r#repeatEnum<'a>(&'a self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>>;
+    fn r#repeatUnion<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>>;
+    fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+      Box::pin(async move { Ok(VERSION) })
+    }
+    fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+      Box::pin(async move { Ok(HASH.into()) })
+    }
+  }
+  #[::async_trait::async_trait]
+  pub trait IMyCallbackAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest.IMyCallback" }
+    async fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>;
+    async fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>;
+    async fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>;
+  }
+  impl BnMyCallback {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IMyCallback>
+    where
+      T: IMyCallbackAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> IMyCallback for Wrapper<T, R>
+      where
+        T: IMyCallbackAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+        fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+          self._rt.block_on(self._inner.r#repeatParcelable(_arg_input))
+        }
+        fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+          self._rt.block_on(self._inner.r#repeatEnum(_arg_input))
+        }
+        fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+          self._rt.block_on(self._inner.r#repeatUnion(_arg_input))
+        }
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait IMyCallbackDefault: Send + Sync {
+    fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+  }
+  pub mod transactions {
+    pub const r#repeatParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+    pub const r#repeatEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+    pub const r#repeatUnion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+    pub const r#getInterfaceVersion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777214;
+    pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213;
+  }
+  pub type IMyCallbackDefaultRef = Option<std::sync::Arc<dyn IMyCallbackDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<IMyCallbackDefaultRef> = std::sync::Mutex::new(None);
+  }
+  pub const VERSION: i32 = 1;
+  pub const HASH: &str = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f";
+  impl BpMyCallback {
+    fn build_parcel_repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyCallback>::getDefaultImpl() {
+          return _aidl_default_impl.r#repeatParcelable(_arg_input);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable = _aidl_reply.read()?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(&_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyCallback>::getDefaultImpl() {
+          return _aidl_default_impl.r#repeatEnum(_arg_input);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum = _aidl_reply.read()?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyCallback>::getDefaultImpl() {
+          return _aidl_default_impl.r#repeatUnion(_arg_input);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion = _aidl_reply.read()?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_getInterfaceVersion(&self) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      Ok(aidl_data)
+    }
+    fn read_response_getInterfaceVersion(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: i32 = _aidl_reply.read()?;
+      self.cached_version.store(_aidl_return, std::sync::atomic::Ordering::Relaxed);
+      Ok(_aidl_return)
+    }
+    fn build_parcel_getInterfaceHash(&self) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      Ok(aidl_data)
+    }
+    fn read_response_getInterfaceHash(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: String = _aidl_reply.read()?;
+      *self.cached_hash.lock().unwrap() = Some(_aidl_return.clone());
+      Ok(_aidl_return)
+    }
+  }
+  impl IMyCallback for BpMyCallback {
+    fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+      let _aidl_data = self.build_parcel_repeatParcelable(_arg_input)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#repeatParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_repeatParcelable(_arg_input, _aidl_reply)
+    }
+    fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+      let _aidl_data = self.build_parcel_repeatEnum(_arg_input)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#repeatEnum, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_repeatEnum(_arg_input, _aidl_reply)
+    }
+    fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+      let _aidl_data = self.build_parcel_repeatUnion(_arg_input)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#repeatUnion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_repeatUnion(_arg_input, _aidl_reply)
+    }
+    fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+      let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+      if _aidl_version != -1 { return Ok(_aidl_version); }
+      let _aidl_data = self.build_parcel_getInterfaceVersion()?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_getInterfaceVersion(_aidl_reply)
+    }
+    fn r#getInterfaceHash(&self) -> binder::Result<String> {
+      {
+        let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+        if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+          return Ok(_aidl_hash.clone());
+        }
+      }
+      let _aidl_data = self.build_parcel_getInterfaceHash()?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_getInterfaceHash(_aidl_reply)
+    }
+  }
+  impl<P: binder::BinderAsyncPool> IMyCallbackAsync<P> for BpMyCallback {
+    fn r#repeatParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>> {
+      let _aidl_data = match self.build_parcel_repeatParcelable(_arg_input) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#repeatParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_repeatParcelable(_arg_input, _aidl_reply)
+        }
+      )
+    }
+    fn r#repeatEnum<'a>(&'a self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>> {
+      let _aidl_data = match self.build_parcel_repeatEnum(_arg_input) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#repeatEnum, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_repeatEnum(_arg_input, _aidl_reply)
+        }
+      )
+    }
+    fn r#repeatUnion<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>> {
+      let _aidl_data = match self.build_parcel_repeatUnion(_arg_input) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#repeatUnion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_repeatUnion(_arg_input, _aidl_reply)
+        }
+      )
+    }
+    fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+      let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+      if _aidl_version != -1 { return Box::pin(std::future::ready(Ok(_aidl_version))); }
+      let _aidl_data = match self.build_parcel_getInterfaceVersion() {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_getInterfaceVersion(_aidl_reply)
+        }
+      )
+    }
+    fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+      {
+        let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+        if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+          return Box::pin(std::future::ready(Ok(_aidl_hash.clone())));
+        }
+      }
+      let _aidl_data = match self.build_parcel_getInterfaceHash() {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_getInterfaceHash(_aidl_reply)
+        }
+      )
+    }
+  }
+  impl IMyCallback for binder::binder_impl::Binder<BnMyCallback> {
+    fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> { self.0.r#repeatParcelable(_arg_input) }
+    fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> { self.0.r#repeatEnum(_arg_input) }
+    fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> { self.0.r#repeatUnion(_arg_input) }
+    fn r#getInterfaceVersion(&self) -> binder::Result<i32> { self.0.r#getInterfaceVersion() }
+    fn r#getInterfaceHash(&self) -> binder::Result<String> { self.0.r#getInterfaceHash() }
+  }
+  fn on_transact(_aidl_service: &dyn IMyCallback, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      transactions::r#repeatParcelable => {
+        let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#repeatParcelable(&_arg_input);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#repeatEnum => {
+        let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#repeatEnum(_arg_input);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#repeatUnion => {
+        let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#repeatUnion(&_arg_input);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#getInterfaceVersion => {
+        let _aidl_return = _aidl_service.r#getInterfaceVersion();
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#getInterfaceHash => {
+        let _aidl_return = _aidl_service.r#getInterfaceHash();
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ITrunkStableTest as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest;
+ pub use super::r#MyParcelable::r#MyParcelable as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable;
+ pub use super::r#MyEnum::r#MyEnum as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum;
+ pub use super::r#MyUnion::r#MyUnion as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion;
+ pub use super::r#MyUnion::r#Tag::r#Tag as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion_3_Tag;
+ pub use super::r#IMyCallback::r#IMyCallback as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback;
+}
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs.d b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs.d
new file mode 100644
index 0000000..93fe9a2
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs : \
+  system/tools/aidl/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/timestamp b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/timestamp
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp
new file mode 100644
index 0000000..6caeeb7
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp
@@ -0,0 +1,1392 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android/aidl/test/trunk/BpTrunkStableTest.h>
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(TrunkStableTest, "android.aidl.test.trunk.ITrunkStableTest")
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/BpTrunkStableTest.h>
+#include <android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+
+BpTrunkStableTest::BpTrunkStableTest(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<ITrunkStableTest>(_aidl_impl){
+}
+
+std::function<void(const BpTrunkStableTest::TransactionLog&)> BpTrunkStableTest::logFunc;
+
+::android::binder::Status BpTrunkStableTest::repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatParcelable::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_repeatParcelable, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->repeatParcelable(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status BpTrunkStableTest::repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatEnum::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(static_cast<int8_t>(input));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_repeatEnum, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->repeatEnum(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readByte(reinterpret_cast<int8_t *>(_aidl_return));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatEnum";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status BpTrunkStableTest::repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatUnion::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_repeatUnion, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->repeatUnion(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatUnion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status BpTrunkStableTest::callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::callMyCallback::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("cb", ::android::internal::ToString(cb));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeStrongBinder(cb);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_callMyCallback, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->callMyCallback(cb);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "callMyCallback";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status BpTrunkStableTest::repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatOtherParcelable::cppClient");
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(BnTrunkStableTest::TRANSACTION_repeatOtherParcelable, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl())) {
+     return ITrunkStableTest::getDefaultImpl()->repeatOtherParcelable(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatOtherParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+int32_t BpTrunkStableTest::getInterfaceVersion() {
+  if (cached_version_ == -1) {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnTrunkStableTest::TRANSACTION_getInterfaceVersion, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        cached_version_ = reply.readInt32();
+      }
+    }
+  }
+  return cached_version_;
+}
+
+
+std::string BpTrunkStableTest::getInterfaceHash() {
+  std::lock_guard<std::mutex> lockGuard(cached_hash_mutex_);
+  if (cached_hash_ == "-1") {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(BnTrunkStableTest::TRANSACTION_getInterfaceHash, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        reply.readUtf8FromUtf16(&cached_hash_);
+      }
+    }
+  }
+  return cached_hash_;
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+
+BnTrunkStableTest::BnTrunkStableTest()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t BnTrunkStableTest::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnTrunkStableTest::TRANSACTION_repeatParcelable:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatParcelable(in_input, &_aidl_return));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "repeatParcelable";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_repeatEnum:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyEnum _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_input));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatEnum(in_input, &_aidl_return));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "repeatEnum";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByte(static_cast<int8_t>(_aidl_return));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_repeatUnion:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyUnion in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyUnion _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatUnion::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatUnion(in_input, &_aidl_return));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "repeatUnion";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_callMyCallback:
+  {
+    ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback> in_cb;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::callMyCallback::cppServer");
+    _aidl_ret_status = _aidl_data.readStrongBinder(&in_cb);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_cb", ::android::internal::ToString(in_cb));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(callMyCallback(in_cb));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "callMyCallback";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_repeatOtherParcelable:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::ITrunkStableTest::repeatOtherParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    BnTrunkStableTest::TransactionLog _transaction_log;
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatOtherParcelable(in_input, &_aidl_return));
+    if (BnTrunkStableTest::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+      _transaction_log.method_name = "repeatOtherParcelable";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      BnTrunkStableTest::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_getInterfaceVersion:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeInt32(ITrunkStableTest::VERSION);
+  }
+  break;
+  case BnTrunkStableTest::TRANSACTION_getInterfaceHash:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeUtf8AsUtf16(ITrunkStableTest::HASH);
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+int32_t BnTrunkStableTest::getInterfaceVersion() {
+  return ITrunkStableTest::VERSION;
+}
+std::string BnTrunkStableTest::getInterfaceHash() {
+  return ITrunkStableTest::HASH;
+}
+std::function<void(const BnTrunkStableTest::TransactionLog&)> BnTrunkStableTest::logFunc;
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+::android::status_t ITrunkStableTest::MyParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&c);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ITrunkStableTest::MyParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(c);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+::android::status_t ITrunkStableTest::MyUnion::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_tag)) != ::android::OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case a: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<a>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<a>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case b: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<b>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<b>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  case c: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = _aidl_parcel->readInt32(&_aidl_value)) != ::android::OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<c>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<c>(std::move(_aidl_value));
+    }
+    return ::android::OK; }
+  }
+  return ::android::BAD_VALUE;
+}
+::android::status_t ITrunkStableTest::MyUnion::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = _aidl_parcel->writeInt32(static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != ::android::OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case a: return _aidl_parcel->writeInt32(get<a>());
+  case b: return _aidl_parcel->writeInt32(get<b>());
+  case c: return _aidl_parcel->writeInt32(get<c>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_NESTED_INTERFACE(ITrunkStableTest, MyCallback, "android.aidl.test.trunk.ITrunkStableTest.IMyCallback")
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+
+ITrunkStableTest::BpMyCallback::BpMyCallback(const ::android::sp<::android::IBinder>& _aidl_impl)
+    : BpInterface<IMyCallback>(_aidl_impl){
+}
+
+std::function<void(const ITrunkStableTest::BpMyCallback::TransactionLog&)> ITrunkStableTest::BpMyCallback::logFunc;
+
+::android::binder::Status ITrunkStableTest::BpMyCallback::repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatParcelable::cppClient");
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_repeatParcelable, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl())) {
+     return IMyCallback::getDefaultImpl()->repeatParcelable(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status ITrunkStableTest::BpMyCallback::repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatEnum::cppClient");
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeByte(static_cast<int8_t>(input));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_repeatEnum, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl())) {
+     return IMyCallback::getDefaultImpl()->repeatEnum(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readByte(reinterpret_cast<int8_t *>(_aidl_return));
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatEnum";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status ITrunkStableTest::BpMyCallback::repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatUnion::cppClient");
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_repeatUnion, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl())) {
+     return IMyCallback::getDefaultImpl()->repeatUnion(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatUnion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+::android::binder::Status ITrunkStableTest::BpMyCallback::repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) {
+  ::android::Parcel _aidl_data;
+  _aidl_data.markForBinder(remoteStrong());
+  ::android::Parcel _aidl_reply;
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  ::android::binder::Status _aidl_status;
+  ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatOtherParcelable::cppClient");
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("input", ::android::internal::ToString(input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_data.writeParcelable(input);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_repeatOtherParcelable, _aidl_data, &_aidl_reply, 0);
+  if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl())) {
+     return IMyCallback::getDefaultImpl()->repeatOtherParcelable(input, _aidl_return);
+  }
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  if (!_aidl_status.isOk()) {
+    return _aidl_status;
+  }
+  _aidl_ret_status = _aidl_reply.readParcelable(_aidl_return);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    goto _aidl_error;
+  }
+  _aidl_error:
+  _aidl_status.setFromStatusT(_aidl_ret_status);
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatOtherParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = _aidl_status.exceptionCode();
+    _transaction_log.exception_message = _aidl_status.exceptionMessage();
+    _transaction_log.transaction_error = _aidl_status.transactionError();
+    _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+
+int32_t ITrunkStableTest::BpMyCallback::getInterfaceVersion() {
+  if (cached_version_ == -1) {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_getInterfaceVersion, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        cached_version_ = reply.readInt32();
+      }
+    }
+  }
+  return cached_version_;
+}
+
+
+std::string ITrunkStableTest::BpMyCallback::getInterfaceHash() {
+  std::lock_guard<std::mutex> lockGuard(cached_hash_mutex_);
+  if (cached_hash_ == "-1") {
+    ::android::Parcel data;
+    ::android::Parcel reply;
+    data.writeInterfaceToken(getInterfaceDescriptor());
+    ::android::status_t err = remote()->transact(ITrunkStableTest::BnMyCallback::TRANSACTION_getInterfaceHash, data, &reply);
+    if (err == ::android::OK) {
+      ::android::binder::Status _aidl_status;
+      err = _aidl_status.readFromParcel(reply);
+      if (err == ::android::OK && _aidl_status.isOk()) {
+        reply.readUtf8FromUtf16(&cached_hash_);
+      }
+    }
+  }
+  return cached_hash_;
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+#include <chrono>
+#include <functional>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+
+ITrunkStableTest::BnMyCallback::BnMyCallback()
+{
+  ::android::internal::Stability::markCompilationUnit(this);
+}
+
+::android::status_t ITrunkStableTest::BnMyCallback::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  switch (_aidl_code) {
+  case BnMyCallback::TRANSACTION_repeatParcelable:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatParcelable(in_input, &_aidl_return));
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+      _transaction_log.method_name = "repeatParcelable";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnMyCallback::TRANSACTION_repeatEnum:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyEnum _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatEnum::cppServer");
+    _aidl_ret_status = _aidl_data.readByte(reinterpret_cast<int8_t *>(&in_input));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatEnum(in_input, &_aidl_return));
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+      _transaction_log.method_name = "repeatEnum";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeByte(static_cast<int8_t>(_aidl_return));
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnMyCallback::TRANSACTION_repeatUnion:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyUnion in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyUnion _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatUnion::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatUnion(in_input, &_aidl_return));
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+      _transaction_log.method_name = "repeatUnion";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnMyCallback::TRANSACTION_repeatOtherParcelable:
+  {
+    ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable in_input;
+    ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable _aidl_return;
+    if (!(_aidl_data.checkInterface(this))) {
+      _aidl_ret_status = ::android::BAD_TYPE;
+      break;
+    }
+    ::android::binder::ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "AIDL::cpp::IMyCallback::repeatOtherParcelable::cppServer");
+    _aidl_ret_status = _aidl_data.readParcelable(&in_input);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+    }
+    auto _log_start = std::chrono::steady_clock::now();
+    if (auto st = _aidl_data.enforceNoDataAvail(); !st.isOk()) {
+      _aidl_ret_status = st.writeToParcel(_aidl_reply);
+      break;
+    }
+    ::android::binder::Status _aidl_status(repeatOtherParcelable(in_input, &_aidl_return));
+    if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      auto _log_end = std::chrono::steady_clock::now();
+      _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+      _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+      _transaction_log.method_name = "repeatOtherParcelable";
+      _transaction_log.stub_address = static_cast<const void*>(this);
+      _transaction_log.proxy_address = nullptr;
+      _transaction_log.exception_code = _aidl_status.exceptionCode();
+      _transaction_log.exception_message = _aidl_status.exceptionMessage();
+      _transaction_log.transaction_error = _aidl_status.transactionError();
+      _transaction_log.service_specific_error_code = _aidl_status.serviceSpecificErrorCode();
+      _transaction_log.result = ::android::internal::ToString(_aidl_return);
+      ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+    }
+    _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+    if (!_aidl_status.isOk()) {
+      break;
+    }
+    _aidl_ret_status = _aidl_reply->writeParcelable(_aidl_return);
+    if (((_aidl_ret_status) != (::android::OK))) {
+      break;
+    }
+  }
+  break;
+  case BnMyCallback::TRANSACTION_getInterfaceVersion:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeInt32(IMyCallback::VERSION);
+  }
+  break;
+  case BnMyCallback::TRANSACTION_getInterfaceHash:
+  {
+    _aidl_data.checkInterface(this);
+    _aidl_reply->writeNoException();
+    _aidl_reply->writeUtf8AsUtf16(IMyCallback::HASH);
+  }
+  break;
+  default:
+  {
+    _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+  }
+  break;
+  }
+  if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+    _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeOverParcel(_aidl_reply);
+  }
+  return _aidl_ret_status;
+}
+
+int32_t ITrunkStableTest::BnMyCallback::getInterfaceVersion() {
+  return IMyCallback::VERSION;
+}
+std::string ITrunkStableTest::BnMyCallback::getInterfaceHash() {
+  return IMyCallback::HASH;
+}
+std::function<void(const ITrunkStableTest::BnMyCallback::TransactionLog&)> ITrunkStableTest::BnMyCallback::logFunc;
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+::android::status_t ITrunkStableTest::MyOtherParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+  int32_t _aidl_parcelable_raw_size = 0;
+  _aidl_ret_status = _aidl_parcel->readInt32(&_aidl_parcelable_raw_size);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcelable_raw_size < 4) return ::android::BAD_VALUE;
+  size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  if (_aidl_parcel->dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) {
+    _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->readInt32(&b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+::android::status_t ITrunkStableTest::MyOtherParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+  ::android::status_t _aidl_ret_status = ::android::OK;
+  auto _aidl_start_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->writeInt32(0);
+  _aidl_ret_status = _aidl_parcel->writeInt32(a);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = _aidl_parcel->writeInt32(b);
+  if (((_aidl_ret_status) != (::android::OK))) {
+    return _aidl_ret_status;
+  }
+  auto _aidl_end_pos = _aidl_parcel->dataPosition();
+  _aidl_parcel->setDataPosition(_aidl_start_pos);
+  _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+  _aidl_parcel->setDataPosition(_aidl_end_pos);
+  return _aidl_ret_status;
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d
new file mode 100644
index 0000000..057b155
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp : \
+  system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/BnTrunkStableTest.h b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/BnTrunkStableTest.h
new file mode 100644
index 0000000..5e929de
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/BnTrunkStableTest.h
@@ -0,0 +1,88 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <functional>
+#include <android/binder_to_string.h>
+#include <android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <binder/Delegate.h>
+
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class BnTrunkStableTest : public ::android::BnInterface<ITrunkStableTest> {
+public:
+  static constexpr uint32_t TRANSACTION_repeatParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_repeatEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_repeatUnion = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_callMyCallback = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_repeatOtherParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 4;
+  static constexpr uint32_t TRANSACTION_getInterfaceVersion = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777214;
+  static constexpr uint32_t TRANSACTION_getInterfaceHash = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777213;
+  explicit BnTrunkStableTest();
+  ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+  int32_t getInterfaceVersion();
+  std::string getInterfaceHash();
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+};  // class BnTrunkStableTest
+
+class ITrunkStableTestDelegator : public BnTrunkStableTest {
+public:
+  explicit ITrunkStableTestDelegator(const ::android::sp<ITrunkStableTest> &impl) : _aidl_delegate(impl) {}
+
+  ::android::sp<ITrunkStableTest> getImpl() { return _aidl_delegate; }
+  ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override {
+    return _aidl_delegate->repeatParcelable(input, _aidl_return);
+  }
+  ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override {
+    return _aidl_delegate->repeatEnum(input, _aidl_return);
+  }
+  ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override {
+    return _aidl_delegate->repeatUnion(input, _aidl_return);
+  }
+  ::android::binder::Status callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb) override {
+    ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallbackDelegator> _cb;
+    if (cb) {
+      _cb = ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallbackDelegator>::cast(delegate(cb));
+    }
+    return _aidl_delegate->callMyCallback(_cb);
+  }
+  ::android::binder::Status repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override {
+    return _aidl_delegate->repeatOtherParcelable(input, _aidl_return);
+  }
+  int32_t getInterfaceVersion() override {
+    int32_t _delegator_ver = BnTrunkStableTest::getInterfaceVersion();
+    int32_t _impl_ver = _aidl_delegate->getInterfaceVersion();
+    return _delegator_ver < _impl_ver ? _delegator_ver : _impl_ver;
+  }
+  std::string getInterfaceHash() override {
+    return _aidl_delegate->getInterfaceHash();
+  }
+private:
+  ::android::sp<ITrunkStableTest> _aidl_delegate;
+};  // class ITrunkStableTestDelegator
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/BpTrunkStableTest.h b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/BpTrunkStableTest.h
new file mode 100644
index 0000000..7645a01
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/BpTrunkStableTest.h
@@ -0,0 +1,52 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <functional>
+#include <android/binder_to_string.h>
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class BpTrunkStableTest : public ::android::BpInterface<ITrunkStableTest> {
+public:
+  explicit BpTrunkStableTest(const ::android::sp<::android::IBinder>& _aidl_impl);
+  virtual ~BpTrunkStableTest() = default;
+  ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+  ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+  ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+  ::android::binder::Status callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb) override;
+  ::android::binder::Status repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override;
+  int32_t getInterfaceVersion() override;
+  std::string getInterfaceHash() override;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+private:
+  int32_t cached_version_ = -1;
+  std::string cached_hash_ = "-1";
+  std::mutex cached_hash_mutex_;
+};  // class BpTrunkStableTest
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/ITrunkStableTest.h b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/ITrunkStableTest.h
new file mode 100644
index 0000000..470e216
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/android/aidl/test/trunk/ITrunkStableTest.h
@@ -0,0 +1,459 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=cpp -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include <android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android/binder_to_string.h>
+#include <array>
+#include <binder/Delegate.h>
+#include <binder/Enums.h>
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <binder/Trace.h>
+#include <cassert>
+#include <cstdint>
+#include <functional>
+#include <string>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+#include <utils/String16.h>
+#include <utils/StrongPointer.h>
+#include <variant>
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class ITrunkStableTestDelegator;
+
+class ITrunkStableTest : public ::android::IInterface {
+public:
+  typedef ITrunkStableTestDelegator DefaultDelegator;
+  DECLARE_META_INTERFACE(TrunkStableTest)
+  static inline const int32_t VERSION = 2;
+  static inline const std::string HASH = "notfrozen";
+  class MyParcelable : public ::android::Parcelable {
+  public:
+    int32_t a = 0;
+    int32_t b = 0;
+    int32_t c = 0;
+    inline bool operator!=(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) != std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator<(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) < std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator<=(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) <= std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator==(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) == std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator>(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) > std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator>=(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) >= std::tie(rhs.a, rhs.b, rhs.c);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.test.trunk.ITrunkStableTest.MyParcelable");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyParcelable{";
+      os << "a: " << ::android::internal::ToString(a);
+      os << ", b: " << ::android::internal::ToString(b);
+      os << ", c: " << ::android::internal::ToString(c);
+      os << "}";
+      return os.str();
+    }
+  };  // class MyParcelable
+  enum class MyEnum : int8_t {
+    ZERO = 0,
+    ONE = 1,
+    TWO = 2,
+    THREE = 3,
+  };
+  class MyUnion : public ::android::Parcelable {
+  public:
+    enum class Tag : int32_t {
+      a = 0,
+      b = 1,
+      c = 2,
+    };
+    // Expose tag symbols for legacy code
+    static const inline Tag a = Tag::a;
+    static const inline Tag b = Tag::b;
+    static const inline Tag c = Tag::c;
+
+    template<typename _Tp>
+    static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, MyUnion>;
+
+    MyUnion() : _value(std::in_place_index<static_cast<size_t>(a)>, int32_t(0)) { }
+
+    template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+    // NOLINTNEXTLINE(google-explicit-constructor)
+    constexpr MyUnion(_Tp&& _arg)
+        : _value(std::forward<_Tp>(_arg)) {}
+
+    template <size_t _Np, typename... _Tp>
+    constexpr explicit MyUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+        : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+    template <Tag _tag, typename... _Tp>
+    static MyUnion make(_Tp&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+    }
+
+    template <Tag _tag, typename _Tp, typename... _Up>
+    static MyUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+    }
+
+    Tag getTag() const {
+      return static_cast<Tag>(_value.index());
+    }
+
+    template <Tag _tag>
+    const auto& get() const {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag>
+    auto& get() {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag, typename... _Tp>
+    void set(_Tp&&... _args) {
+      _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+    }
+
+    inline bool operator!=(const MyUnion& rhs) const {
+      return _value != rhs._value;
+    }
+    inline bool operator<(const MyUnion& rhs) const {
+      return _value < rhs._value;
+    }
+    inline bool operator<=(const MyUnion& rhs) const {
+      return _value <= rhs._value;
+    }
+    inline bool operator==(const MyUnion& rhs) const {
+      return _value == rhs._value;
+    }
+    inline bool operator>(const MyUnion& rhs) const {
+      return _value > rhs._value;
+    }
+    inline bool operator>=(const MyUnion& rhs) const {
+      return _value >= rhs._value;
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.test.trunk.ITrunkStableTest.MyUnion");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyUnion{";
+      switch (getTag()) {
+      case a: os << "a: " << ::android::internal::ToString(get<a>()); break;
+      case b: os << "b: " << ::android::internal::ToString(get<b>()); break;
+      case c: os << "c: " << ::android::internal::ToString(get<c>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    std::variant<int32_t, int32_t, int32_t> _value;
+  };  // class MyUnion
+  class MyOtherParcelable : public ::android::Parcelable {
+  public:
+    int32_t a = 0;
+    int32_t b = 0;
+    inline bool operator!=(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator<(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator<=(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator==(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator>(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator>=(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+    }
+
+    ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+    ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+    static const ::android::String16& getParcelableDescriptor() {
+      static const ::android::StaticString16 DESCRIPTOR (u"android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable");
+      return DESCRIPTOR;
+    }
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyOtherParcelable{";
+      os << "a: " << ::android::internal::ToString(a);
+      os << ", b: " << ::android::internal::ToString(b);
+      os << "}";
+      return os.str();
+    }
+  };  // class MyOtherParcelable
+  class IMyCallbackDelegator;
+
+  class IMyCallback : public ::android::IInterface {
+  public:
+    typedef IMyCallbackDelegator DefaultDelegator;
+    DECLARE_META_INTERFACE(MyCallback)
+    static inline const int32_t VERSION = 2;
+    static inline const std::string HASH = "notfrozen";
+    virtual ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) = 0;
+    virtual ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) = 0;
+    virtual ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) = 0;
+    virtual ::android::binder::Status repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) = 0;
+    virtual int32_t getInterfaceVersion() = 0;
+    virtual std::string getInterfaceHash() = 0;
+  };  // class IMyCallback
+
+  class IMyCallbackDefault : public IMyCallback {
+  public:
+    ::android::IBinder* onAsBinder() override {
+      return nullptr;
+    }
+    ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    ::android::binder::Status repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* /*_aidl_return*/) override {
+      return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+    }
+    int32_t getInterfaceVersion() override {
+      return 0;
+    }
+    std::string getInterfaceHash() override {
+      return "";
+    }
+  };  // class IMyCallbackDefault
+  class BpMyCallback : public ::android::BpInterface<IMyCallback> {
+  public:
+    explicit BpMyCallback(const ::android::sp<::android::IBinder>& _aidl_impl);
+    virtual ~BpMyCallback() = default;
+    ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+    ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+    ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+    ::android::binder::Status repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override;
+    int32_t getInterfaceVersion() override;
+    std::string getInterfaceHash() override;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  private:
+    int32_t cached_version_ = -1;
+    std::string cached_hash_ = "-1";
+    std::mutex cached_hash_mutex_;
+  };  // class BpMyCallback
+  class BnMyCallback : public ::android::BnInterface<IMyCallback> {
+  public:
+    static constexpr uint32_t TRANSACTION_repeatParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
+    static constexpr uint32_t TRANSACTION_repeatEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+    static constexpr uint32_t TRANSACTION_repeatUnion = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+    static constexpr uint32_t TRANSACTION_repeatOtherParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
+    static constexpr uint32_t TRANSACTION_getInterfaceVersion = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777214;
+    static constexpr uint32_t TRANSACTION_getInterfaceHash = ::android::IBinder::FIRST_CALL_TRANSACTION + 16777213;
+    explicit BnMyCallback();
+    ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+    int32_t getInterfaceVersion();
+    std::string getInterfaceHash();
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  };  // class BnMyCallback
+
+  class IMyCallbackDelegator : public BnMyCallback {
+  public:
+    explicit IMyCallbackDelegator(const ::android::sp<IMyCallback> &impl) : _aidl_delegate(impl) {}
+
+    ::android::sp<IMyCallback> getImpl() { return _aidl_delegate; }
+    ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override {
+      return _aidl_delegate->repeatParcelable(input, _aidl_return);
+    }
+    ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override {
+      return _aidl_delegate->repeatEnum(input, _aidl_return);
+    }
+    ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override {
+      return _aidl_delegate->repeatUnion(input, _aidl_return);
+    }
+    ::android::binder::Status repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override {
+      return _aidl_delegate->repeatOtherParcelable(input, _aidl_return);
+    }
+    int32_t getInterfaceVersion() override {
+      int32_t _delegator_ver = BnMyCallback::getInterfaceVersion();
+      int32_t _impl_ver = _aidl_delegate->getInterfaceVersion();
+      return _delegator_ver < _impl_ver ? _delegator_ver : _impl_ver;
+    }
+    std::string getInterfaceHash() override {
+      return _aidl_delegate->getInterfaceHash();
+    }
+  private:
+    ::android::sp<IMyCallback> _aidl_delegate;
+  };  // class IMyCallbackDelegator
+  virtual ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) = 0;
+  virtual ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum input, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) = 0;
+  virtual ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& input, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) = 0;
+  virtual ::android::binder::Status callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& cb) = 0;
+  virtual ::android::binder::Status repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& input, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) = 0;
+  virtual int32_t getInterfaceVersion() = 0;
+  virtual std::string getInterfaceHash() = 0;
+};  // class ITrunkStableTest
+
+class ITrunkStableTestDefault : public ITrunkStableTest {
+public:
+  ::android::IBinder* onAsBinder() override {
+    return nullptr;
+  }
+  ::android::binder::Status repeatParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status repeatEnum(::android::aidl::test::trunk::ITrunkStableTest::MyEnum /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyEnum* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status repeatUnion(const ::android::aidl::test::trunk::ITrunkStableTest::MyUnion& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyUnion* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status callMyCallback(const ::android::sp<::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& /*cb*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  ::android::binder::Status repeatOtherParcelable(const ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& /*input*/, ::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* /*_aidl_return*/) override {
+    return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+  }
+  int32_t getInterfaceVersion() override {
+    return 0;
+  }
+  std::string getInterfaceHash() override {
+    return "";
+  }
+};  // class ITrunkStableTestDefault
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+[[nodiscard]] static inline std::string toString(ITrunkStableTest::MyEnum val) {
+  switch(val) {
+  case ITrunkStableTest::MyEnum::ZERO:
+    return "ZERO";
+  case ITrunkStableTest::MyEnum::ONE:
+    return "ONE";
+  case ITrunkStableTest::MyEnum::TWO:
+    return "TWO";
+  case ITrunkStableTest::MyEnum::THREE:
+    return "THREE";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::test::trunk::ITrunkStableTest::MyEnum, 4> enum_values<::android::aidl::test::trunk::ITrunkStableTest::MyEnum> = {
+  ::android::aidl::test::trunk::ITrunkStableTest::MyEnum::ZERO,
+  ::android::aidl::test::trunk::ITrunkStableTest::MyEnum::ONE,
+  ::android::aidl::test::trunk::ITrunkStableTest::MyEnum::TWO,
+  ::android::aidl::test::trunk::ITrunkStableTest::MyEnum::THREE,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+[[nodiscard]] static inline std::string toString(ITrunkStableTest::MyUnion::Tag val) {
+  switch(val) {
+  case ITrunkStableTest::MyUnion::Tag::a:
+    return "a";
+  case ITrunkStableTest::MyUnion::Tag::b:
+    return "b";
+  case ITrunkStableTest::MyUnion::Tag::c:
+    return "c";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+namespace android {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag, 3> enum_values<::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag> = {
+  ::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::a,
+  ::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::b,
+  ::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::c,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace android
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/timestamp b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source/gen/timestamp
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java
new file mode 100644
index 0000000..fb3acd3
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java
@@ -0,0 +1,980 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=java -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version platform_apis --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java.d -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+package android.aidl.test.trunk;
+public interface ITrunkStableTest extends android.os.IInterface
+{
+  /**
+   * The version of this interface that the caller is built against.
+   * This might be different from what {@link #getInterfaceVersion()
+   * getInterfaceVersion} returns as that is the version of the interface
+   * that the remote object is implementing.
+   */
+  public static final int VERSION = 2;
+  public static final String HASH = "notfrozen";
+  /** Default implementation for ITrunkStableTest. */
+  public static class Default implements android.aidl.test.trunk.ITrunkStableTest
+  {
+    @Override public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public byte repeatEnum(byte input) throws android.os.RemoteException
+    {
+      return 0;
+    }
+    @Override public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override public void callMyCallback(android.aidl.test.trunk.ITrunkStableTest.IMyCallback cb) throws android.os.RemoteException
+    {
+    }
+    @Override public android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable repeatOtherParcelable(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable input) throws android.os.RemoteException
+    {
+      return null;
+    }
+    @Override
+    public int getInterfaceVersion() {
+      return 0;
+    }
+    @Override
+    public String getInterfaceHash() {
+      return "";
+    }
+    @Override
+    public android.os.IBinder asBinder() {
+      return null;
+    }
+  }
+  /** Local-side IPC implementation stub class. */
+  public static abstract class Stub extends android.os.Binder implements android.aidl.test.trunk.ITrunkStableTest
+  {
+    /** Construct the stub at attach it to the interface. */
+    public Stub()
+    {
+      this.attachInterface(this, DESCRIPTOR);
+    }
+    /**
+     * Cast an IBinder object into an android.aidl.test.trunk.ITrunkStableTest interface,
+     * generating a proxy if needed.
+     */
+    public static android.aidl.test.trunk.ITrunkStableTest asInterface(android.os.IBinder obj)
+    {
+      if ((obj==null)) {
+        return null;
+      }
+      android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+      if (((iin!=null)&&(iin instanceof android.aidl.test.trunk.ITrunkStableTest))) {
+        return ((android.aidl.test.trunk.ITrunkStableTest)iin);
+      }
+      return new android.aidl.test.trunk.ITrunkStableTest.Stub.Proxy(obj);
+    }
+    @Override public android.os.IBinder asBinder()
+    {
+      return this;
+    }
+    /** @hide */
+    public static java.lang.String getDefaultTransactionName(int transactionCode)
+    {
+      switch (transactionCode)
+      {
+        case TRANSACTION_repeatParcelable:
+        {
+          return "repeatParcelable";
+        }
+        case TRANSACTION_repeatEnum:
+        {
+          return "repeatEnum";
+        }
+        case TRANSACTION_repeatUnion:
+        {
+          return "repeatUnion";
+        }
+        case TRANSACTION_callMyCallback:
+        {
+          return "callMyCallback";
+        }
+        case TRANSACTION_repeatOtherParcelable:
+        {
+          return "repeatOtherParcelable";
+        }
+        case TRANSACTION_getInterfaceVersion:
+        {
+          return "getInterfaceVersion";
+        }
+        case TRANSACTION_getInterfaceHash:
+        {
+          return "getInterfaceHash";
+        }
+        default:
+        {
+          return null;
+        }
+      }
+    }
+    /** @hide */
+    public java.lang.String getTransactionName(int transactionCode)
+    {
+      return this.getDefaultTransactionName(transactionCode);
+    }
+    @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+    {
+      java.lang.String descriptor = DESCRIPTOR;
+      if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+        data.enforceInterface(descriptor);
+      }
+      if (code == INTERFACE_TRANSACTION) {
+        reply.writeString(descriptor);
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceVersion) {
+        reply.writeNoException();
+        reply.writeInt(getInterfaceVersion());
+        return true;
+      }
+      else if (code == TRANSACTION_getInterfaceHash) {
+        reply.writeNoException();
+        reply.writeString(getInterfaceHash());
+        return true;
+      }
+      switch (code)
+      {
+        case TRANSACTION_repeatParcelable:
+        {
+          android.aidl.test.trunk.ITrunkStableTest.MyParcelable _arg0;
+          _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyParcelable.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.test.trunk.ITrunkStableTest.MyParcelable _result = this.repeatParcelable(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_repeatEnum:
+        {
+          byte _arg0;
+          _arg0 = data.readByte();
+          data.enforceNoDataAvail();
+          byte _result = this.repeatEnum(_arg0);
+          reply.writeNoException();
+          reply.writeByte(_result);
+          break;
+        }
+        case TRANSACTION_repeatUnion:
+        {
+          android.aidl.test.trunk.ITrunkStableTest.MyUnion _arg0;
+          _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyUnion.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.test.trunk.ITrunkStableTest.MyUnion _result = this.repeatUnion(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        case TRANSACTION_callMyCallback:
+        {
+          android.aidl.test.trunk.ITrunkStableTest.IMyCallback _arg0;
+          _arg0 = android.aidl.test.trunk.ITrunkStableTest.IMyCallback.Stub.asInterface(data.readStrongBinder());
+          data.enforceNoDataAvail();
+          this.callMyCallback(_arg0);
+          reply.writeNoException();
+          break;
+        }
+        case TRANSACTION_repeatOtherParcelable:
+        {
+          android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable _arg0;
+          _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable.CREATOR);
+          data.enforceNoDataAvail();
+          android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable _result = this.repeatOtherParcelable(_arg0);
+          reply.writeNoException();
+          reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+          break;
+        }
+        default:
+        {
+          return super.onTransact(code, data, reply, flags);
+        }
+      }
+      return true;
+    }
+    private static class Proxy implements android.aidl.test.trunk.ITrunkStableTest
+    {
+      private android.os.IBinder mRemote;
+      Proxy(android.os.IBinder remote)
+      {
+        mRemote = remote;
+      }
+      private int mCachedVersion = -1;
+      private String mCachedHash = "-1";
+      @Override public android.os.IBinder asBinder()
+      {
+        return mRemote;
+      }
+      public java.lang.String getInterfaceDescriptor()
+      {
+        return DESCRIPTOR;
+      }
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.test.trunk.ITrunkStableTest.MyParcelable _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_repeatParcelable, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method repeatParcelable is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyParcelable.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public byte repeatEnum(byte input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        byte _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeByte(input);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_repeatEnum, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method repeatEnum is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readByte();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.test.trunk.ITrunkStableTest.MyUnion _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_repeatUnion, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method repeatUnion is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyUnion.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override public void callMyCallback(android.aidl.test.trunk.ITrunkStableTest.IMyCallback cb) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeStrongInterface(cb);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_callMyCallback, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method callMyCallback is unimplemented.");
+          }
+          _reply.readException();
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+      }
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable repeatOtherParcelable(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable input) throws android.os.RemoteException
+      {
+        android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+        android.os.Parcel _reply = android.os.Parcel.obtain();
+        android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable _result;
+        try {
+          _data.writeInterfaceToken(DESCRIPTOR);
+          _data.writeTypedObject(input, 0);
+          boolean _status = mRemote.transact(Stub.TRANSACTION_repeatOtherParcelable, _data, _reply, 0);
+          if (!_status) {
+            throw new android.os.RemoteException("Method repeatOtherParcelable is unimplemented.");
+          }
+          _reply.readException();
+          _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable.CREATOR);
+        }
+        finally {
+          _reply.recycle();
+          _data.recycle();
+        }
+        return _result;
+      }
+      @Override
+      public int getInterfaceVersion() throws android.os.RemoteException {
+        if (mCachedVersion == -1) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceVersion, data, reply, 0);
+            reply.readException();
+            mCachedVersion = reply.readInt();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedVersion;
+      }
+      @Override
+      public synchronized String getInterfaceHash() throws android.os.RemoteException {
+        if ("-1".equals(mCachedHash)) {
+          android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel reply = android.os.Parcel.obtain();
+          try {
+            data.writeInterfaceToken(DESCRIPTOR);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceHash, data, reply, 0);
+            reply.readException();
+            mCachedHash = reply.readString();
+          } finally {
+            reply.recycle();
+            data.recycle();
+          }
+        }
+        return mCachedHash;
+      }
+    }
+    static final int TRANSACTION_repeatParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+    static final int TRANSACTION_repeatEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+    static final int TRANSACTION_repeatUnion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+    static final int TRANSACTION_callMyCallback = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+    static final int TRANSACTION_repeatOtherParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
+    static final int TRANSACTION_getInterfaceVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777214);
+    static final int TRANSACTION_getInterfaceHash = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777213);
+    /** @hide */
+    public int getMaxTransactionId()
+    {
+      return 16777214;
+    }
+  }
+  public static final java.lang.String DESCRIPTOR = "android$aidl$test$trunk$ITrunkStableTest".replace('$', '.');
+  public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException;
+  public byte repeatEnum(byte input) throws android.os.RemoteException;
+  public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException;
+  public void callMyCallback(android.aidl.test.trunk.ITrunkStableTest.IMyCallback cb) throws android.os.RemoteException;
+  public android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable repeatOtherParcelable(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable input) throws android.os.RemoteException;
+  public int getInterfaceVersion() throws android.os.RemoteException;
+  public String getInterfaceHash() throws android.os.RemoteException;
+  public static class MyParcelable implements android.os.Parcelable
+  {
+    public int a = 0;
+    public int b = 0;
+    // New in V2
+    public int c = 0;
+    public static final android.os.Parcelable.Creator<MyParcelable> CREATOR = new android.os.Parcelable.Creator<MyParcelable>() {
+      @Override
+      public MyParcelable createFromParcel(android.os.Parcel _aidl_source) {
+        MyParcelable _aidl_out = new MyParcelable();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public MyParcelable[] newArray(int _aidl_size) {
+        return new MyParcelable[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeInt(a);
+      _aidl_parcel.writeInt(b);
+      _aidl_parcel.writeInt(c);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        a = _aidl_parcel.readInt();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        b = _aidl_parcel.readInt();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        c = _aidl_parcel.readInt();
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+  public static @interface MyEnum {
+    public static final byte ZERO = 0;
+    public static final byte ONE = 1;
+    public static final byte TWO = 2;
+    // New in V2
+    public static final byte THREE = 3;
+  }
+  public static final class MyUnion implements android.os.Parcelable {
+    // tags for union fields
+    public final static int a = 0;  // int a;
+    public final static int b = 1;  // int b;
+    public final static int c = 2;  // int c;
+
+    private int _tag;
+    private Object _value;
+
+    public MyUnion() {
+      int _value = 0;
+      this._tag = a;
+      this._value = _value;
+    }
+
+    private MyUnion(android.os.Parcel _aidl_parcel) {
+      readFromParcel(_aidl_parcel);
+    }
+
+    private MyUnion(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+
+    public int getTag() {
+      return _tag;
+    }
+
+    // int a;
+
+    public static MyUnion a(int _value) {
+      return new MyUnion(a, _value);
+    }
+
+    public int getA() {
+      _assertTag(a);
+      return (int) _value;
+    }
+
+    public void setA(int _value) {
+      _set(a, _value);
+    }
+
+    // int b;
+
+    public static MyUnion b(int _value) {
+      return new MyUnion(b, _value);
+    }
+
+    public int getB() {
+      _assertTag(b);
+      return (int) _value;
+    }
+
+    public void setB(int _value) {
+      _set(b, _value);
+    }
+
+    // int c;
+
+    // New in V3
+    public static MyUnion c(int _value) {
+      return new MyUnion(c, _value);
+    }
+
+    public int getC() {
+      _assertTag(c);
+      return (int) _value;
+    }
+
+    public void setC(int _value) {
+      _set(c, _value);
+    }
+
+    public static final android.os.Parcelable.Creator<MyUnion> CREATOR = new android.os.Parcelable.Creator<MyUnion>() {
+      @Override
+      public MyUnion createFromParcel(android.os.Parcel _aidl_source) {
+        return new MyUnion(_aidl_source);
+      }
+      @Override
+      public MyUnion[] newArray(int _aidl_size) {
+        return new MyUnion[_aidl_size];
+      }
+    };
+
+    @Override
+    public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
+      _aidl_parcel.writeInt(_tag);
+      switch (_tag) {
+      case a:
+        _aidl_parcel.writeInt(getA());
+        break;
+      case b:
+        _aidl_parcel.writeInt(getB());
+        break;
+      case c:
+        _aidl_parcel.writeInt(getC());
+        break;
+      }
+    }
+
+    public void readFromParcel(android.os.Parcel _aidl_parcel) {
+      int _aidl_tag;
+      _aidl_tag = _aidl_parcel.readInt();
+      switch (_aidl_tag) {
+      case a: {
+        int _aidl_value;
+        _aidl_value = _aidl_parcel.readInt();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case b: {
+        int _aidl_value;
+        _aidl_value = _aidl_parcel.readInt();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      case c: {
+        int _aidl_value;
+        _aidl_value = _aidl_parcel.readInt();
+        _set(_aidl_tag, _aidl_value);
+        return; }
+      }
+      throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
+    }
+
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      switch (getTag()) {
+      }
+      return _mask;
+    }
+
+    private void _assertTag(int tag) {
+      if (getTag() != tag) {
+        throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
+      }
+    }
+
+    private String _tagString(int _tag) {
+      switch (_tag) {
+      case a: return "a";
+      case b: return "b";
+      case c: return "c";
+      }
+      throw new IllegalStateException("unknown field: " + _tag);
+    }
+
+    private void _set(int _tag, Object _value) {
+      this._tag = _tag;
+      this._value = _value;
+    }
+    public static @interface Tag {
+      public static final int a = 0;
+      public static final int b = 1;
+      // New in V3
+      public static final int c = 2;
+    }
+  }
+  public interface IMyCallback extends android.os.IInterface
+  {
+    /**
+     * The version of this interface that the caller is built against.
+     * This might be different from what {@link #getInterfaceVersion()
+     * getInterfaceVersion} returns as that is the version of the interface
+     * that the remote object is implementing.
+     */
+    public static final int VERSION = 2;
+    public static final String HASH = "notfrozen";
+    /** Default implementation for IMyCallback. */
+    public static class Default implements android.aidl.test.trunk.ITrunkStableTest.IMyCallback
+    {
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public byte repeatEnum(byte input) throws android.os.RemoteException
+      {
+        return 0;
+      }
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override public android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable repeatOtherParcelable(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable input) throws android.os.RemoteException
+      {
+        return null;
+      }
+      @Override
+      public int getInterfaceVersion() {
+        return 0;
+      }
+      @Override
+      public String getInterfaceHash() {
+        return "";
+      }
+      @Override
+      public android.os.IBinder asBinder() {
+        return null;
+      }
+    }
+    /** Local-side IPC implementation stub class. */
+    public static abstract class Stub extends android.os.Binder implements android.aidl.test.trunk.ITrunkStableTest.IMyCallback
+    {
+      /** Construct the stub at attach it to the interface. */
+      public Stub()
+      {
+        this.attachInterface(this, DESCRIPTOR);
+      }
+      /**
+       * Cast an IBinder object into an android.aidl.test.trunk.ITrunkStableTest.IMyCallback interface,
+       * generating a proxy if needed.
+       */
+      public static android.aidl.test.trunk.ITrunkStableTest.IMyCallback asInterface(android.os.IBinder obj)
+      {
+        if ((obj==null)) {
+          return null;
+        }
+        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+        if (((iin!=null)&&(iin instanceof android.aidl.test.trunk.ITrunkStableTest.IMyCallback))) {
+          return ((android.aidl.test.trunk.ITrunkStableTest.IMyCallback)iin);
+        }
+        return new android.aidl.test.trunk.ITrunkStableTest.IMyCallback.Stub.Proxy(obj);
+      }
+      @Override public android.os.IBinder asBinder()
+      {
+        return this;
+      }
+      /** @hide */
+      public static java.lang.String getDefaultTransactionName(int transactionCode)
+      {
+        switch (transactionCode)
+        {
+          case TRANSACTION_repeatParcelable:
+          {
+            return "repeatParcelable";
+          }
+          case TRANSACTION_repeatEnum:
+          {
+            return "repeatEnum";
+          }
+          case TRANSACTION_repeatUnion:
+          {
+            return "repeatUnion";
+          }
+          case TRANSACTION_repeatOtherParcelable:
+          {
+            return "repeatOtherParcelable";
+          }
+          case TRANSACTION_getInterfaceVersion:
+          {
+            return "getInterfaceVersion";
+          }
+          case TRANSACTION_getInterfaceHash:
+          {
+            return "getInterfaceHash";
+          }
+          default:
+          {
+            return null;
+          }
+        }
+      }
+      /** @hide */
+      public java.lang.String getTransactionName(int transactionCode)
+      {
+        return this.getDefaultTransactionName(transactionCode);
+      }
+      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+      {
+        java.lang.String descriptor = DESCRIPTOR;
+        if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
+          data.enforceInterface(descriptor);
+        }
+        if (code == INTERFACE_TRANSACTION) {
+          reply.writeString(descriptor);
+          return true;
+        }
+        else if (code == TRANSACTION_getInterfaceVersion) {
+          reply.writeNoException();
+          reply.writeInt(getInterfaceVersion());
+          return true;
+        }
+        else if (code == TRANSACTION_getInterfaceHash) {
+          reply.writeNoException();
+          reply.writeString(getInterfaceHash());
+          return true;
+        }
+        switch (code)
+        {
+          case TRANSACTION_repeatParcelable:
+          {
+            android.aidl.test.trunk.ITrunkStableTest.MyParcelable _arg0;
+            _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyParcelable.CREATOR);
+            data.enforceNoDataAvail();
+            android.aidl.test.trunk.ITrunkStableTest.MyParcelable _result = this.repeatParcelable(_arg0);
+            reply.writeNoException();
+            reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+            break;
+          }
+          case TRANSACTION_repeatEnum:
+          {
+            byte _arg0;
+            _arg0 = data.readByte();
+            data.enforceNoDataAvail();
+            byte _result = this.repeatEnum(_arg0);
+            reply.writeNoException();
+            reply.writeByte(_result);
+            break;
+          }
+          case TRANSACTION_repeatUnion:
+          {
+            android.aidl.test.trunk.ITrunkStableTest.MyUnion _arg0;
+            _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyUnion.CREATOR);
+            data.enforceNoDataAvail();
+            android.aidl.test.trunk.ITrunkStableTest.MyUnion _result = this.repeatUnion(_arg0);
+            reply.writeNoException();
+            reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+            break;
+          }
+          case TRANSACTION_repeatOtherParcelable:
+          {
+            android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable _arg0;
+            _arg0 = data.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable.CREATOR);
+            data.enforceNoDataAvail();
+            android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable _result = this.repeatOtherParcelable(_arg0);
+            reply.writeNoException();
+            reply.writeTypedObject(_result, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
+            break;
+          }
+          default:
+          {
+            return super.onTransact(code, data, reply, flags);
+          }
+        }
+        return true;
+      }
+      private static class Proxy implements android.aidl.test.trunk.ITrunkStableTest.IMyCallback
+      {
+        private android.os.IBinder mRemote;
+        Proxy(android.os.IBinder remote)
+        {
+          mRemote = remote;
+        }
+        private int mCachedVersion = -1;
+        private String mCachedHash = "-1";
+        @Override public android.os.IBinder asBinder()
+        {
+          return mRemote;
+        }
+        public java.lang.String getInterfaceDescriptor()
+        {
+          return DESCRIPTOR;
+        }
+        @Override public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.aidl.test.trunk.ITrunkStableTest.MyParcelable _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeTypedObject(input, 0);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_repeatParcelable, _data, _reply, 0);
+            if (!_status) {
+              throw new android.os.RemoteException("Method repeatParcelable is unimplemented.");
+            }
+            _reply.readException();
+            _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyParcelable.CREATOR);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public byte repeatEnum(byte input) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          byte _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeByte(input);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_repeatEnum, _data, _reply, 0);
+            if (!_status) {
+              throw new android.os.RemoteException("Method repeatEnum is unimplemented.");
+            }
+            _reply.readException();
+            _result = _reply.readByte();
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.aidl.test.trunk.ITrunkStableTest.MyUnion _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeTypedObject(input, 0);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_repeatUnion, _data, _reply, 0);
+            if (!_status) {
+              throw new android.os.RemoteException("Method repeatUnion is unimplemented.");
+            }
+            _reply.readException();
+            _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyUnion.CREATOR);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override public android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable repeatOtherParcelable(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable input) throws android.os.RemoteException
+        {
+          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
+          android.os.Parcel _reply = android.os.Parcel.obtain();
+          android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable _result;
+          try {
+            _data.writeInterfaceToken(DESCRIPTOR);
+            _data.writeTypedObject(input, 0);
+            boolean _status = mRemote.transact(Stub.TRANSACTION_repeatOtherParcelable, _data, _reply, 0);
+            if (!_status) {
+              throw new android.os.RemoteException("Method repeatOtherParcelable is unimplemented.");
+            }
+            _reply.readException();
+            _result = _reply.readTypedObject(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable.CREATOR);
+          }
+          finally {
+            _reply.recycle();
+            _data.recycle();
+          }
+          return _result;
+        }
+        @Override
+        public int getInterfaceVersion() throws android.os.RemoteException {
+          if (mCachedVersion == -1) {
+            android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+            android.os.Parcel reply = android.os.Parcel.obtain();
+            try {
+              data.writeInterfaceToken(DESCRIPTOR);
+              boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceVersion, data, reply, 0);
+              reply.readException();
+              mCachedVersion = reply.readInt();
+            } finally {
+              reply.recycle();
+              data.recycle();
+            }
+          }
+          return mCachedVersion;
+        }
+        @Override
+        public synchronized String getInterfaceHash() throws android.os.RemoteException {
+          if ("-1".equals(mCachedHash)) {
+            android.os.Parcel data = android.os.Parcel.obtain(asBinder());
+            android.os.Parcel reply = android.os.Parcel.obtain();
+            try {
+              data.writeInterfaceToken(DESCRIPTOR);
+              boolean _status = mRemote.transact(Stub.TRANSACTION_getInterfaceHash, data, reply, 0);
+              reply.readException();
+              mCachedHash = reply.readString();
+            } finally {
+              reply.recycle();
+              data.recycle();
+            }
+          }
+          return mCachedHash;
+        }
+      }
+      static final int TRANSACTION_repeatParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
+      static final int TRANSACTION_repeatEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+      static final int TRANSACTION_repeatUnion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+      static final int TRANSACTION_repeatOtherParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+      static final int TRANSACTION_getInterfaceVersion = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777214);
+      static final int TRANSACTION_getInterfaceHash = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16777213);
+      /** @hide */
+      public int getMaxTransactionId()
+      {
+        return 16777214;
+      }
+    }
+    public static final java.lang.String DESCRIPTOR = "android$aidl$test$trunk$ITrunkStableTest$IMyCallback".replace('$', '.');
+    public android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(android.aidl.test.trunk.ITrunkStableTest.MyParcelable input) throws android.os.RemoteException;
+    public byte repeatEnum(byte input) throws android.os.RemoteException;
+    public android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(android.aidl.test.trunk.ITrunkStableTest.MyUnion input) throws android.os.RemoteException;
+    public android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable repeatOtherParcelable(android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable input) throws android.os.RemoteException;
+    public int getInterfaceVersion() throws android.os.RemoteException;
+    public String getInterfaceHash() throws android.os.RemoteException;
+  }
+  // New in V2
+  public static class MyOtherParcelable implements android.os.Parcelable
+  {
+    public int a = 0;
+    public int b = 0;
+    public static final android.os.Parcelable.Creator<MyOtherParcelable> CREATOR = new android.os.Parcelable.Creator<MyOtherParcelable>() {
+      @Override
+      public MyOtherParcelable createFromParcel(android.os.Parcel _aidl_source) {
+        MyOtherParcelable _aidl_out = new MyOtherParcelable();
+        _aidl_out.readFromParcel(_aidl_source);
+        return _aidl_out;
+      }
+      @Override
+      public MyOtherParcelable[] newArray(int _aidl_size) {
+        return new MyOtherParcelable[_aidl_size];
+      }
+    };
+    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.writeInt(0);
+      _aidl_parcel.writeInt(a);
+      _aidl_parcel.writeInt(b);
+      int _aidl_end_pos = _aidl_parcel.dataPosition();
+      _aidl_parcel.setDataPosition(_aidl_start_pos);
+      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+      _aidl_parcel.setDataPosition(_aidl_end_pos);
+    }
+    public final void readFromParcel(android.os.Parcel _aidl_parcel)
+    {
+      int _aidl_start_pos = _aidl_parcel.dataPosition();
+      int _aidl_parcelable_size = _aidl_parcel.readInt();
+      try {
+        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        a = _aidl_parcel.readInt();
+        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
+        b = _aidl_parcel.readInt();
+      } finally {
+        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+        }
+        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+      }
+    }
+    @Override
+    public int describeContents() {
+      int _mask = 0;
+      return _mask;
+    }
+  }
+}
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java.d b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java.d
new file mode 100644
index 0000000..8c375f9
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/android/aidl/test/trunk/ITrunkStableTest.java : \
+  system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/timestamp b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source/gen/timestamp
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp
new file mode 100644
index 0000000..5ee4b25
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp
@@ -0,0 +1,1719 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#include "aidl/android/aidl/test/trunk/ITrunkStableTest.h"
+
+#include <android/binder_parcel_utils.h>
+#include <android/binder_to_string.h>
+#include <aidl/android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <aidl/android/aidl/test/trunk/BpTrunkStableTest.h>
+
+namespace {
+struct ScopedTrace {
+  inline explicit ScopedTrace(const char* name) { ATrace_beginSection(name); }
+  inline ~ScopedTrace() { ATrace_endSection(); }
+};
+}  // namespace
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+static binder_status_t _aidl_android_aidl_test_trunk_ITrunkStableTest_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<BnTrunkStableTest> _aidl_impl = std::static_pointer_cast<BnTrunkStableTest>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*repeatParcelable*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatParcelable::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatParcelable(in_input, &_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "repeatParcelable";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*repeatEnum*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatEnum::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatEnum(in_input, &_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "repeatEnum";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*repeatUnion*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatUnion::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatUnion(in_input, &_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "repeatUnion";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 3 /*callMyCallback*/): {
+      std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback> in_cb;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::callMyCallback::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_cb);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_cb", ::android::internal::ToString(in_cb));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->callMyCallback(in_cb);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "callMyCallback";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 4 /*repeatOtherParcelable*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatOtherParcelable::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatOtherParcelable(in_input, &_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "repeatOtherParcelable";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): {
+      int32_t _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::getInterfaceVersion::server");
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "getInterfaceVersion";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): {
+      std::string _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::getInterfaceHash::server");
+      BnTrunkStableTest::TransactionLog _transaction_log;
+      if (BnTrunkStableTest::logFunc != nullptr) {
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return);
+      if (BnTrunkStableTest::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+        _transaction_log.method_name = "getInterfaceHash";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        BnTrunkStableTest::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_test_trunk_ITrunkStableTest_clazz = ::ndk::ICInterface::defineClass(ITrunkStableTest::descriptor, _aidl_android_aidl_test_trunk_ITrunkStableTest_onTransact);
+
+BpTrunkStableTest::BpTrunkStableTest(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpTrunkStableTest::~BpTrunkStableTest() {}
+std::function<void(const BpTrunkStableTest::TransactionLog&)> BpTrunkStableTest::logFunc;
+
+::ndk::ScopedAStatus BpTrunkStableTest::repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatParcelable::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*repeatParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->repeatParcelable(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatEnum::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*repeatEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->repeatEnum(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatEnum";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatUnion::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*repeatUnion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->repeatUnion(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatUnion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_cb", ::android::internal::ToString(in_cb));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::callMyCallback::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_cb);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 3 /*callMyCallback*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->callMyCallback(in_cb);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "callMyCallback";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::repeatOtherParcelable::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 4 /*repeatOtherParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->repeatOtherParcelable(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "repeatOtherParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::getInterfaceVersion(int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  if (_aidl_cached_version != -1) {
+    *_aidl_return = _aidl_cached_version;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::getInterfaceVersion::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->getInterfaceVersion(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_version = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "getInterfaceVersion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus BpTrunkStableTest::getInterfaceHash(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex);
+  if (_aidl_cached_hash != "-1") {
+    *_aidl_return = _aidl_cached_hash;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  BpTrunkStableTest::TransactionLog _transaction_log;
+  if (BpTrunkStableTest::logFunc != nullptr) {
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::ITrunkStableTest::getInterfaceHash::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITrunkStableTest::getDefaultImpl()) {
+    _aidl_status = ITrunkStableTest::getDefaultImpl()->getInterfaceHash(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_hash = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (BpTrunkStableTest::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest";
+    _transaction_log.method_name = "getInterfaceHash";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    BpTrunkStableTest::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+// Source for BnTrunkStableTest
+BnTrunkStableTest::BnTrunkStableTest() {}
+BnTrunkStableTest::~BnTrunkStableTest() {}
+std::function<void(const BnTrunkStableTest::TransactionLog&)> BnTrunkStableTest::logFunc;
+::ndk::SpAIBinder BnTrunkStableTest::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_test_trunk_ITrunkStableTest_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+::ndk::ScopedAStatus BnTrunkStableTest::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = ITrunkStableTest::version;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus BnTrunkStableTest::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = ITrunkStableTest::hash;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+// Source for ITrunkStableTest
+const char* ITrunkStableTest::descriptor = "android.aidl.test.trunk.ITrunkStableTest";
+ITrunkStableTest::ITrunkStableTest() {}
+ITrunkStableTest::~ITrunkStableTest() {}
+
+
+std::shared_ptr<ITrunkStableTest> ITrunkStableTest::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_test_trunk_ITrunkStableTest_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<BpTrunkStableTest>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<ITrunkStableTest>(interface);
+  }
+  return ::ndk::SharedRefBase::make<BpTrunkStableTest>(binder);
+}
+
+binder_status_t ITrunkStableTest::writeToParcel(AParcel* parcel, const std::shared_ptr<ITrunkStableTest>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ITrunkStableTest::readFromParcel(const AParcel* parcel, std::shared_ptr<ITrunkStableTest>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = ITrunkStableTest::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ITrunkStableTest::setDefaultImpl(const std::shared_ptr<ITrunkStableTest>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!ITrunkStableTest::default_impl);
+  if (impl) {
+    ITrunkStableTest::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ITrunkStableTest>& ITrunkStableTest::getDefaultImpl() {
+  return ITrunkStableTest::default_impl;
+}
+std::shared_ptr<ITrunkStableTest> ITrunkStableTest::default_impl = nullptr;
+::ndk::ScopedAStatus ITrunkStableTestDefault::repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& /*in_cb*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = 0;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus ITrunkStableTestDefault::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = "";
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::SpAIBinder ITrunkStableTestDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ITrunkStableTestDefault::isRemote() {
+  return false;
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+const char* ITrunkStableTest::MyParcelable::descriptor = "android.aidl.test.trunk.ITrunkStableTest.MyParcelable";
+
+binder_status_t ITrunkStableTest::MyParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &c);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ITrunkStableTest::MyParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, c);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+const char* ITrunkStableTest::MyUnion::descriptor = "android.aidl.test.trunk.ITrunkStableTest.MyUnion";
+
+binder_status_t ITrunkStableTest::MyUnion::readFromParcel(const AParcel* _parcel) {
+  binder_status_t _aidl_ret_status;
+  int32_t _aidl_tag;
+  if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_tag)) != STATUS_OK) return _aidl_ret_status;
+  switch (static_cast<Tag>(_aidl_tag)) {
+  case a: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<a>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<a>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case b: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<b>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<b>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  case c: {
+    int32_t _aidl_value;
+    if ((_aidl_ret_status = ::ndk::AParcel_readData(_parcel, &_aidl_value)) != STATUS_OK) return _aidl_ret_status;
+    if constexpr (std::is_trivially_copyable_v<int32_t>) {
+      set<c>(_aidl_value);
+    } else {
+      // NOLINTNEXTLINE(performance-move-const-arg)
+      set<c>(std::move(_aidl_value));
+    }
+    return STATUS_OK; }
+  }
+  return STATUS_BAD_VALUE;
+}
+binder_status_t ITrunkStableTest::MyUnion::writeToParcel(AParcel* _parcel) const {
+  binder_status_t _aidl_ret_status = ::ndk::AParcel_writeData(_parcel, static_cast<int32_t>(getTag()));
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+  switch (getTag()) {
+  case a: return ::ndk::AParcel_writeData(_parcel, get<a>());
+  case b: return ::ndk::AParcel_writeData(_parcel, get<b>());
+  case c: return ::ndk::AParcel_writeData(_parcel, get<c>());
+  }
+  __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "can't reach here");
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+static binder_status_t _aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+  (void)_aidl_in;
+  (void)_aidl_out;
+  binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+  std::shared_ptr<ITrunkStableTest::BnMyCallback> _aidl_impl = std::static_pointer_cast<ITrunkStableTest::BnMyCallback>(::ndk::ICInterface::asInterface(_aidl_binder));
+  switch (_aidl_code) {
+    case (FIRST_CALL_TRANSACTION + 0 /*repeatParcelable*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatParcelable::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatParcelable(in_input, &_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "repeatParcelable";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 1 /*repeatEnum*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatEnum::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatEnum(in_input, &_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "repeatEnum";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 2 /*repeatUnion*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatUnion::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatUnion(in_input, &_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "repeatUnion";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 3 /*repeatOtherParcelable*/): {
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable in_input;
+      ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatOtherParcelable::server");
+      _aidl_ret_status = ::ndk::AParcel_readData(_aidl_in, &in_input);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->repeatOtherParcelable(in_input, &_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "repeatOtherParcelable";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): {
+      int32_t _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::getInterfaceVersion::server");
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "getInterfaceVersion";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+    case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): {
+      std::string _aidl_return;
+
+      ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::getInterfaceHash::server");
+      ITrunkStableTest::BnMyCallback::TransactionLog _transaction_log;
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+      }
+      auto _log_start = std::chrono::steady_clock::now();
+      ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return);
+      if (ITrunkStableTest::BnMyCallback::logFunc != nullptr) {
+        auto _log_end = std::chrono::steady_clock::now();
+        _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+        _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+        _transaction_log.method_name = "getInterfaceHash";
+        _transaction_log.stub_address = _aidl_impl.get();
+        _transaction_log.proxy_address = nullptr;
+        _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+        _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+        _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+        _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+        _transaction_log.result = ::android::internal::ToString(_aidl_return);
+        ITrunkStableTest::BnMyCallback::logFunc(_transaction_log);
+      }
+      _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      if (!AStatus_isOk(_aidl_status.get())) break;
+
+      _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_out, _aidl_return);
+      if (_aidl_ret_status != STATUS_OK) break;
+
+      break;
+    }
+  }
+  return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_clazz = ::ndk::ICInterface::defineClass(ITrunkStableTest::IMyCallback::descriptor, _aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_onTransact);
+
+ITrunkStableTest::BpMyCallback::BpMyCallback(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+ITrunkStableTest::BpMyCallback::~BpMyCallback() {}
+std::function<void(const ITrunkStableTest::BpMyCallback::TransactionLog&)> ITrunkStableTest::BpMyCallback::logFunc;
+
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatParcelable::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 0 /*repeatParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->repeatParcelable(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatEnum::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 1 /*repeatEnum*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->repeatEnum(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatEnum";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatUnion::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 2 /*repeatUnion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->repeatUnion(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatUnion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    _transaction_log.input_args.emplace_back("in_input", ::android::internal::ToString(in_input));
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::repeatOtherParcelable::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_in.get(), in_input);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 3 /*repeatOtherParcelable*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->repeatOtherParcelable(in_input, _aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "repeatOtherParcelable";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::getInterfaceVersion(int32_t* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  if (_aidl_cached_version != -1) {
+    *_aidl_return = _aidl_cached_version;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::getInterfaceVersion::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->getInterfaceVersion(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_version = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "getInterfaceVersion";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::BpMyCallback::getInterfaceHash(std::string* _aidl_return) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  ::ndk::ScopedAStatus _aidl_status;
+  const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex);
+  if (_aidl_cached_hash != "-1") {
+    *_aidl_return = _aidl_cached_hash;
+    _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+    return _aidl_status;
+  }
+  ::ndk::ScopedAParcel _aidl_in;
+  ::ndk::ScopedAParcel _aidl_out;
+
+  ITrunkStableTest::BpMyCallback::TransactionLog _transaction_log;
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+  }
+  auto _log_start = std::chrono::steady_clock::now();
+  ScopedTrace _aidl_trace("AIDL::ndk::IMyCallback::getInterfaceHash::client");
+  _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AIBinder_transact(
+    asBinder().get(),
+    (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/),
+    _aidl_in.getR(),
+    _aidl_out.getR(),
+    0
+    #ifdef BINDER_STABILITY_SUPPORT
+    | FLAG_PRIVATE_LOCAL
+    #endif  // BINDER_STABILITY_SUPPORT
+    );
+  if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IMyCallback::getDefaultImpl()) {
+    _aidl_status = IMyCallback::getDefaultImpl()->getInterfaceHash(_aidl_return);
+    goto _aidl_status_return;
+  }
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_out.get(), _aidl_return);
+  if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+  _aidl_cached_hash = *_aidl_return;
+  _aidl_error:
+  _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+  _aidl_status_return:
+  if (ITrunkStableTest::BpMyCallback::logFunc != nullptr) {
+    auto _log_end = std::chrono::steady_clock::now();
+    _transaction_log.duration_ms = std::chrono::duration<double, std::milli>(_log_end - _log_start).count();
+    _transaction_log.interface_name = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+    _transaction_log.method_name = "getInterfaceHash";
+    _transaction_log.stub_address = nullptr;
+    _transaction_log.proxy_address = static_cast<const void*>(this);
+    _transaction_log.exception_code = AStatus_getExceptionCode(_aidl_status.get());
+    _transaction_log.exception_message = AStatus_getMessage(_aidl_status.get());
+    _transaction_log.transaction_error = AStatus_getStatus(_aidl_status.get());
+    _transaction_log.service_specific_error_code = AStatus_getServiceSpecificError(_aidl_status.get());
+    _transaction_log.result = ::android::internal::ToString(*_aidl_return);
+    ITrunkStableTest::BpMyCallback::logFunc(_transaction_log);
+  }
+  return _aidl_status;
+}
+// Source for BnMyCallback
+ITrunkStableTest::BnMyCallback::BnMyCallback() {}
+ITrunkStableTest::BnMyCallback::~BnMyCallback() {}
+std::function<void(const ITrunkStableTest::BnMyCallback::TransactionLog&)> ITrunkStableTest::BnMyCallback::logFunc;
+::ndk::SpAIBinder ITrunkStableTest::BnMyCallback::createBinder() {
+  AIBinder* binder = AIBinder_new(_g_aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_clazz, static_cast<void*>(this));
+  #ifdef BINDER_STABILITY_SUPPORT
+  AIBinder_markCompilationUnitStability(binder);
+  #endif  // BINDER_STABILITY_SUPPORT
+  return ::ndk::SpAIBinder(binder);
+}
+::ndk::ScopedAStatus ITrunkStableTest::BnMyCallback::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = IMyCallback::version;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus ITrunkStableTest::BnMyCallback::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = IMyCallback::hash;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+// Source for IMyCallback
+const char* ITrunkStableTest::IMyCallback::descriptor = "android.aidl.test.trunk.ITrunkStableTest.IMyCallback";
+ITrunkStableTest::IMyCallback::IMyCallback() {}
+ITrunkStableTest::IMyCallback::~IMyCallback() {}
+
+
+std::shared_ptr<ITrunkStableTest::IMyCallback> ITrunkStableTest::IMyCallback::fromBinder(const ::ndk::SpAIBinder& binder) {
+  if (!AIBinder_associateClass(binder.get(), _g_aidl_android_aidl_test_trunk_ITrunkStableTest_IMyCallback_clazz)) {
+    #if __ANDROID_API__ >= 31
+    const AIBinder_Class* originalClass = AIBinder_getClass(binder.get());
+    if (originalClass == nullptr) return nullptr;
+    if (0 == strcmp(AIBinder_Class_getDescriptor(originalClass), descriptor)) {
+      return ::ndk::SharedRefBase::make<ITrunkStableTest::BpMyCallback>(binder);
+    }
+    #endif
+    return nullptr;
+  }
+  std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+  if (interface) {
+    return std::static_pointer_cast<IMyCallback>(interface);
+  }
+  return ::ndk::SharedRefBase::make<ITrunkStableTest::BpMyCallback>(binder);
+}
+
+binder_status_t ITrunkStableTest::IMyCallback::writeToParcel(AParcel* parcel, const std::shared_ptr<IMyCallback>& instance) {
+  return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t ITrunkStableTest::IMyCallback::readFromParcel(const AParcel* parcel, std::shared_ptr<IMyCallback>* instance) {
+  ::ndk::SpAIBinder binder;
+  binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+  if (status != STATUS_OK) return status;
+  *instance = IMyCallback::fromBinder(binder);
+  return STATUS_OK;
+}
+bool ITrunkStableTest::IMyCallback::setDefaultImpl(const std::shared_ptr<IMyCallback>& impl) {
+  // Only one user of this interface can use this function
+  // at a time. This is a heuristic to detect if two different
+  // users in the same process use this function.
+  assert(!IMyCallback::default_impl);
+  if (impl) {
+    IMyCallback::default_impl = impl;
+    return true;
+  }
+  return false;
+}
+const std::shared_ptr<ITrunkStableTest::IMyCallback>& ITrunkStableTest::IMyCallback::getDefaultImpl() {
+  return IMyCallback::default_impl;
+}
+std::shared_ptr<ITrunkStableTest::IMyCallback> ITrunkStableTest::IMyCallback::default_impl = nullptr;
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& /*in_input*/, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* /*_aidl_return*/) {
+  ::ndk::ScopedAStatus _aidl_status;
+  _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+  return _aidl_status;
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::getInterfaceVersion(int32_t* _aidl_return) {
+  *_aidl_return = 0;
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::ScopedAStatus ITrunkStableTest::IMyCallbackDefault::getInterfaceHash(std::string* _aidl_return) {
+  *_aidl_return = "";
+  return ::ndk::ScopedAStatus(AStatus_newOk());
+}
+::ndk::SpAIBinder ITrunkStableTest::IMyCallbackDefault::asBinder() {
+  return ::ndk::SpAIBinder();
+}
+bool ITrunkStableTest::IMyCallbackDefault::isRemote() {
+  return false;
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+const char* ITrunkStableTest::MyOtherParcelable::descriptor = "android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable";
+
+binder_status_t ITrunkStableTest::MyOtherParcelable::readFromParcel(const AParcel* _aidl_parcel) {
+  binder_status_t _aidl_ret_status = STATUS_OK;
+  int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  int32_t _aidl_parcelable_size = 0;
+  _aidl_ret_status = AParcel_readInt32(_aidl_parcel, &_aidl_parcelable_size);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (_aidl_parcelable_size < 4) return STATUS_BAD_VALUE;
+  if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) {
+    AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+    return _aidl_ret_status;
+  }
+  _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size);
+  return _aidl_ret_status;
+}
+binder_status_t ITrunkStableTest::MyOtherParcelable::writeToParcel(AParcel* _aidl_parcel) const {
+  binder_status_t _aidl_ret_status;
+  size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel);
+  _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, a);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, b);
+  if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+  size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos);
+  AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos);
+  AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos);
+  return _aidl_ret_status;
+}
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d
new file mode 100644
index 0000000..7e4948a
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/android/aidl/test/trunk/ITrunkStableTest.cpp : \
+  system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/BnTrunkStableTest.h b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/BnTrunkStableTest.h
new file mode 100644
index 0000000..dca4b1c
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/BnTrunkStableTest.h
@@ -0,0 +1,84 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/test/trunk/ITrunkStableTest.h"
+
+#include <android/binder_ibinder.h>
+#include <cassert>
+
+#ifndef __BIONIC__
+#ifndef __assert2
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class BnTrunkStableTest : public ::ndk::BnCInterface<ITrunkStableTest> {
+public:
+  BnTrunkStableTest();
+  virtual ~BnTrunkStableTest();
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) final;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) final;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+protected:
+  ::ndk::SpAIBinder createBinder() override;
+private:
+};
+class ITrunkStableTestDelegator : public BnTrunkStableTest {
+public:
+  explicit ITrunkStableTestDelegator(const std::shared_ptr<ITrunkStableTest> &impl) : _impl(impl) {
+     int32_t _impl_ver = 0;
+     if (!impl->getInterfaceVersion(&_impl_ver).isOk()) {;
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Delegator failed to get version of the implementation.");
+     }
+     if (_impl_ver != ITrunkStableTest::version) {
+        __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "Mismatched versions of delegator and implementation is not allowed.");
+     }
+  }
+
+  ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override {
+    return _impl->repeatParcelable(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override {
+    return _impl->repeatEnum(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override {
+    return _impl->repeatUnion(in_input, _aidl_return);
+  }
+  ::ndk::ScopedAStatus callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) override {
+    return _impl->callMyCallback(in_cb);
+  }
+  ::ndk::ScopedAStatus repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override {
+    return _impl->repeatOtherParcelable(in_input, _aidl_return);
+  }
+protected:
+private:
+  std::shared_ptr<ITrunkStableTest> _impl;
+};
+
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/BpTrunkStableTest.h b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/BpTrunkStableTest.h
new file mode 100644
index 0000000..5403f99
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/BpTrunkStableTest.h
@@ -0,0 +1,55 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include "aidl/android/aidl/test/trunk/ITrunkStableTest.h"
+
+#include <android/binder_ibinder.h>
+#include <functional>
+#include <chrono>
+#include <sstream>
+#include <android/trace.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class BpTrunkStableTest : public ::ndk::BpCInterface<ITrunkStableTest> {
+public:
+  explicit BpTrunkStableTest(const ::ndk::SpAIBinder& binder);
+  virtual ~BpTrunkStableTest();
+
+  ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+  ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+  ::ndk::ScopedAStatus callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) override;
+  ::ndk::ScopedAStatus repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  int32_t _aidl_cached_version = -1;
+  std::string _aidl_cached_hash = "-1";
+  std::mutex _aidl_cached_hash_mutex;
+  struct TransactionLog {
+    double duration_ms;
+    std::string interface_name;
+    std::string method_name;
+    const void* proxy_address;
+    const void* stub_address;
+    std::vector<std::pair<std::string, std::string>> input_args;
+    std::vector<std::pair<std::string, std::string>> output_args;
+    std::string result;
+    std::string exception_message;
+    int32_t exception_code;
+    int32_t transaction_error;
+    int32_t service_specific_error_code;
+  };
+  static std::function<void(const TransactionLog&)> logFunc;
+};
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/ITrunkStableTest.h b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/ITrunkStableTest.h
new file mode 100644
index 0000000..5c340c4
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/aidl/android/aidl/test/trunk/ITrunkStableTest.h
@@ -0,0 +1,444 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen -t --min_sdk_version current --log --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/staging/android/aidl/test/trunk/ITrunkStableTest.cpp.d -h out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/include/staging -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/staging -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#pragma once
+
+#include <array>
+#include <cassert>
+#include <chrono>
+#include <cstdint>
+#include <functional>
+#include <memory>
+#include <optional>
+#include <sstream>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <variant>
+#include <vector>
+#include <android/binder_enums.h>
+#include <android/binder_ibinder.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <android/trace.h>
+#include <aidl/android/aidl/test/trunk/ITrunkStableTest.h>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif  // BINDER_STABILITY_SUPPORT
+
+#ifndef __BIONIC__
+#define __assert2(a,b,c,d) ((void)0)
+#endif
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+class ITrunkStableTestDelegator;
+
+class ITrunkStableTest : public ::ndk::ICInterface {
+public:
+  typedef ITrunkStableTestDelegator DefaultDelegator;
+  static const char* descriptor;
+  ITrunkStableTest();
+  virtual ~ITrunkStableTest();
+
+  class MyParcelable {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    int32_t a = 0;
+    int32_t b = 0;
+    int32_t c = 0;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) != std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator<(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) < std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator<=(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) <= std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator==(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) == std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator>(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) > std::tie(rhs.a, rhs.b, rhs.c);
+    }
+    inline bool operator>=(const MyParcelable& rhs) const {
+      return std::tie(a, b, c) >= std::tie(rhs.a, rhs.b, rhs.c);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyParcelable{";
+      os << "a: " << ::android::internal::ToString(a);
+      os << ", b: " << ::android::internal::ToString(b);
+      os << ", c: " << ::android::internal::ToString(c);
+      os << "}";
+      return os.str();
+    }
+  };
+  enum class MyEnum : int8_t {
+    ZERO = 0,
+    ONE = 1,
+    TWO = 2,
+    THREE = 3,
+  };
+
+  class MyUnion {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    enum class Tag : int32_t {
+      a = 0,
+      b = 1,
+      c = 2,
+    };
+
+    // Expose tag symbols for legacy code
+    static const inline Tag a = Tag::a;
+    static const inline Tag b = Tag::b;
+    static const inline Tag c = Tag::c;
+
+    template<typename _Tp>
+    static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, MyUnion>;
+
+    MyUnion() : _value(std::in_place_index<static_cast<size_t>(a)>, int32_t(0)) { }
+
+    template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
+    // NOLINTNEXTLINE(google-explicit-constructor)
+    constexpr MyUnion(_Tp&& _arg)
+        : _value(std::forward<_Tp>(_arg)) {}
+
+    template <size_t _Np, typename... _Tp>
+    constexpr explicit MyUnion(std::in_place_index_t<_Np>, _Tp&&... _args)
+        : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
+
+    template <Tag _tag, typename... _Tp>
+    static MyUnion make(_Tp&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
+    }
+
+    template <Tag _tag, typename _Tp, typename... _Up>
+    static MyUnion make(std::initializer_list<_Tp> _il, _Up&&... _args) {
+      return MyUnion(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
+    }
+
+    Tag getTag() const {
+      return static_cast<Tag>(_value.index());
+    }
+
+    template <Tag _tag>
+    const auto& get() const {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag>
+    auto& get() {
+      if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
+      return std::get<static_cast<size_t>(_tag)>(_value);
+    }
+
+    template <Tag _tag, typename... _Tp>
+    void set(_Tp&&... _args) {
+      _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
+    }
+
+    binder_status_t readFromParcel(const AParcel* _parcel);
+    binder_status_t writeToParcel(AParcel* _parcel) const;
+
+    inline bool operator!=(const MyUnion& rhs) const {
+      return _value != rhs._value;
+    }
+    inline bool operator<(const MyUnion& rhs) const {
+      return _value < rhs._value;
+    }
+    inline bool operator<=(const MyUnion& rhs) const {
+      return _value <= rhs._value;
+    }
+    inline bool operator==(const MyUnion& rhs) const {
+      return _value == rhs._value;
+    }
+    inline bool operator>(const MyUnion& rhs) const {
+      return _value > rhs._value;
+    }
+    inline bool operator>=(const MyUnion& rhs) const {
+      return _value >= rhs._value;
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyUnion{";
+      switch (getTag()) {
+      case a: os << "a: " << ::android::internal::ToString(get<a>()); break;
+      case b: os << "b: " << ::android::internal::ToString(get<b>()); break;
+      case c: os << "c: " << ::android::internal::ToString(get<c>()); break;
+      }
+      os << "}";
+      return os.str();
+    }
+  private:
+    std::variant<int32_t, int32_t, int32_t> _value;
+  };
+  class MyOtherParcelable {
+  public:
+    typedef std::false_type fixed_size;
+    static const char* descriptor;
+
+    int32_t a = 0;
+    int32_t b = 0;
+
+    binder_status_t readFromParcel(const AParcel* parcel);
+    binder_status_t writeToParcel(AParcel* parcel) const;
+
+    inline bool operator!=(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) != std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator<(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) < std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator<=(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) <= std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator==(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) == std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator>(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) > std::tie(rhs.a, rhs.b);
+    }
+    inline bool operator>=(const MyOtherParcelable& rhs) const {
+      return std::tie(a, b) >= std::tie(rhs.a, rhs.b);
+    }
+
+    static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+    inline std::string toString() const {
+      std::ostringstream os;
+      os << "MyOtherParcelable{";
+      os << "a: " << ::android::internal::ToString(a);
+      os << ", b: " << ::android::internal::ToString(b);
+      os << "}";
+      return os.str();
+    }
+  };
+  class IMyCallbackDelegator;
+
+  class IMyCallback : public ::ndk::ICInterface {
+  public:
+    typedef IMyCallbackDelegator DefaultDelegator;
+    static const char* descriptor;
+    IMyCallback();
+    virtual ~IMyCallback();
+
+    static inline const int32_t version = 2;
+    static inline const std::string hash = "notfrozen";
+    static constexpr uint32_t TRANSACTION_repeatParcelable = FIRST_CALL_TRANSACTION + 0;
+    static constexpr uint32_t TRANSACTION_repeatEnum = FIRST_CALL_TRANSACTION + 1;
+    static constexpr uint32_t TRANSACTION_repeatUnion = FIRST_CALL_TRANSACTION + 2;
+    static constexpr uint32_t TRANSACTION_repeatOtherParcelable = FIRST_CALL_TRANSACTION + 3;
+
+    static std::shared_ptr<IMyCallback> fromBinder(const ::ndk::SpAIBinder& binder);
+    static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IMyCallback>& instance);
+    static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IMyCallback>* instance);
+    static bool setDefaultImpl(const std::shared_ptr<IMyCallback>& impl);
+    static const std::shared_ptr<IMyCallback>& getDefaultImpl();
+    virtual ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) = 0;
+    virtual ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) = 0;
+  private:
+    static std::shared_ptr<IMyCallback> default_impl;
+  };
+  class IMyCallbackDefault : public IMyCallback {
+  public:
+    ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override;
+    ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+    ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+    ::ndk::SpAIBinder asBinder() override;
+    bool isRemote() override;
+  };
+  class BpMyCallback : public ::ndk::BpCInterface<IMyCallback> {
+  public:
+    explicit BpMyCallback(const ::ndk::SpAIBinder& binder);
+    virtual ~BpMyCallback();
+
+    ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+    ::ndk::ScopedAStatus repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override;
+    ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+    ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+    int32_t _aidl_cached_version = -1;
+    std::string _aidl_cached_hash = "-1";
+    std::mutex _aidl_cached_hash_mutex;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  };
+  class BnMyCallback : public ::ndk::BnCInterface<IMyCallback> {
+  public:
+    BnMyCallback();
+    virtual ~BnMyCallback();
+    ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) final;
+    ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) final;
+    struct TransactionLog {
+      double duration_ms;
+      std::string interface_name;
+      std::string method_name;
+      const void* proxy_address;
+      const void* stub_address;
+      std::vector<std::pair<std::string, std::string>> input_args;
+      std::vector<std::pair<std::string, std::string>> output_args;
+      std::string result;
+      std::string exception_message;
+      int32_t exception_code;
+      int32_t transaction_error;
+      int32_t service_specific_error_code;
+    };
+    static std::function<void(const TransactionLog&)> logFunc;
+  protected:
+    ::ndk::SpAIBinder createBinder() override;
+  private:
+  };
+  static inline const int32_t version = 2;
+  static inline const std::string hash = "notfrozen";
+  static constexpr uint32_t TRANSACTION_repeatParcelable = FIRST_CALL_TRANSACTION + 0;
+  static constexpr uint32_t TRANSACTION_repeatEnum = FIRST_CALL_TRANSACTION + 1;
+  static constexpr uint32_t TRANSACTION_repeatUnion = FIRST_CALL_TRANSACTION + 2;
+  static constexpr uint32_t TRANSACTION_callMyCallback = FIRST_CALL_TRANSACTION + 3;
+  static constexpr uint32_t TRANSACTION_repeatOtherParcelable = FIRST_CALL_TRANSACTION + 4;
+
+  static std::shared_ptr<ITrunkStableTest> fromBinder(const ::ndk::SpAIBinder& binder);
+  static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<ITrunkStableTest>& instance);
+  static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<ITrunkStableTest>* instance);
+  static bool setDefaultImpl(const std::shared_ptr<ITrunkStableTest>& impl);
+  static const std::shared_ptr<ITrunkStableTest>& getDefaultImpl();
+  virtual ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) = 0;
+  virtual ::ndk::ScopedAStatus repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) = 0;
+  virtual ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) = 0;
+private:
+  static std::shared_ptr<ITrunkStableTest> default_impl;
+};
+class ITrunkStableTestDefault : public ITrunkStableTest {
+public:
+  ::ndk::ScopedAStatus repeatParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyParcelable* _aidl_return) override;
+  ::ndk::ScopedAStatus repeatEnum(::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum* _aidl_return) override;
+  ::ndk::ScopedAStatus repeatUnion(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion* _aidl_return) override;
+  ::ndk::ScopedAStatus callMyCallback(const std::shared_ptr<::aidl::android::aidl::test::trunk::ITrunkStableTest::IMyCallback>& in_cb) override;
+  ::ndk::ScopedAStatus repeatOtherParcelable(const ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable& in_input, ::aidl::android::aidl::test::trunk::ITrunkStableTest::MyOtherParcelable* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceVersion(int32_t* _aidl_return) override;
+  ::ndk::ScopedAStatus getInterfaceHash(std::string* _aidl_return) override;
+  ::ndk::SpAIBinder asBinder() override;
+  bool isRemote() override;
+};
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+[[nodiscard]] static inline std::string toString(ITrunkStableTest::MyEnum val) {
+  switch(val) {
+  case ITrunkStableTest::MyEnum::ZERO:
+    return "ZERO";
+  case ITrunkStableTest::MyEnum::ONE:
+    return "ONE";
+  case ITrunkStableTest::MyEnum::TWO:
+    return "TWO";
+  case ITrunkStableTest::MyEnum::THREE:
+    return "THREE";
+  default:
+    return std::to_string(static_cast<int8_t>(val));
+  }
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum, 4> enum_values<aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum> = {
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum::ZERO,
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum::ONE,
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum::TWO,
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyEnum::THREE,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace test {
+namespace trunk {
+[[nodiscard]] static inline std::string toString(ITrunkStableTest::MyUnion::Tag val) {
+  switch(val) {
+  case ITrunkStableTest::MyUnion::Tag::a:
+    return "a";
+  case ITrunkStableTest::MyUnion::Tag::b:
+    return "b";
+  case ITrunkStableTest::MyUnion::Tag::c:
+    return "c";
+  default:
+    return std::to_string(static_cast<int32_t>(val));
+  }
+}
+}  // namespace trunk
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+}  // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag, 3> enum_values<aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag> = {
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::a,
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::b,
+  aidl::android::aidl::test::trunk::ITrunkStableTest::MyUnion::Tag::c,
+};
+#pragma clang diagnostic pop
+}  // namespace internal
+}  // namespace ndk
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/timestamp b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source/gen/timestamp
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs
new file mode 100644
index 0000000..adf607d
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs
@@ -0,0 +1,1091 @@
+/*
+ * This file is auto-generated.  DO NOT MODIFY.
+ * Using: out/host/linux-x86/bin/aidl --lang=rust -Weverything -Wno-missing-permission-annotation -Werror --structured --version 2 --hash notfrozen --min_sdk_version current --ninja -d out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs.d -o out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen -Nsystem/tools/aidl/tests/trunk_stable_test system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
+ */
+#![forbid(unsafe_code)]
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+  ITrunkStableTest["android.aidl.test.trunk.ITrunkStableTest"] {
+    native: BnTrunkStableTest(on_transact),
+    proxy: BpTrunkStableTest {
+      cached_version: std::sync::atomic::AtomicI32 = std::sync::atomic::AtomicI32::new(-1),
+      cached_hash: std::sync::Mutex<Option<String>> = std::sync::Mutex::new(None)
+    },
+    async: ITrunkStableTestAsync,
+  }
+}
+pub trait ITrunkStableTest: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest" }
+  fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>;
+  fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>;
+  fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>;
+  fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()>;
+  fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable>;
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    Ok(VERSION)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    Ok(HASH.into())
+  }
+  fn getDefaultImpl() -> ITrunkStableTestDefaultRef where Self: Sized {
+    DEFAULT_IMPL.lock().unwrap().clone()
+  }
+  fn setDefaultImpl(d: ITrunkStableTestDefaultRef) -> ITrunkStableTestDefaultRef where Self: Sized {
+    std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+  }
+}
+pub trait ITrunkStableTestAsync<P>: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest" }
+  fn r#repeatParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>>;
+  fn r#repeatEnum<'a>(&'a self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>>;
+  fn r#repeatUnion<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>>;
+  fn r#callMyCallback<'a>(&'a self, _arg_cb: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::BoxFuture<'a, binder::Result<()>>;
+  fn r#repeatOtherParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable>>;
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    Box::pin(async move { Ok(VERSION) })
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    Box::pin(async move { Ok(HASH.into()) })
+  }
+}
+#[::async_trait::async_trait]
+pub trait ITrunkStableTestAsyncServer: binder::Interface + Send {
+  fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest" }
+  async fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>;
+  async fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>;
+  async fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>;
+  async fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()>;
+  async fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable>;
+}
+impl BnTrunkStableTest {
+  /// Create a new async binder service.
+  pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn ITrunkStableTest>
+  where
+    T: ITrunkStableTestAsyncServer + binder::Interface + Send + Sync + 'static,
+    R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+  {
+    struct Wrapper<T, R> {
+      _inner: T,
+      _rt: R,
+    }
+    impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+      fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+      fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+    }
+    impl<T, R> ITrunkStableTest for Wrapper<T, R>
+    where
+      T: ITrunkStableTestAsyncServer + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+        self._rt.block_on(self._inner.r#repeatParcelable(_arg_input))
+      }
+      fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+        self._rt.block_on(self._inner.r#repeatEnum(_arg_input))
+      }
+      fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+        self._rt.block_on(self._inner.r#repeatUnion(_arg_input))
+      }
+      fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()> {
+        self._rt.block_on(self._inner.r#callMyCallback(_arg_cb))
+      }
+      fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> {
+        self._rt.block_on(self._inner.r#repeatOtherParcelable(_arg_input))
+      }
+    }
+    let wrapped = Wrapper { _inner: inner, _rt: rt };
+    Self::new_binder(wrapped, features)
+  }
+}
+pub trait ITrunkStableTestDefault: Send + Sync {
+  fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+  fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> {
+    Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+  }
+}
+pub mod transactions {
+  pub const r#repeatParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+  pub const r#repeatEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+  pub const r#repeatUnion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+  pub const r#callMyCallback: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 3;
+  pub const r#repeatOtherParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 4;
+  pub const r#getInterfaceVersion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777214;
+  pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213;
+}
+pub type ITrunkStableTestDefaultRef = Option<std::sync::Arc<dyn ITrunkStableTestDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+  static ref DEFAULT_IMPL: std::sync::Mutex<ITrunkStableTestDefaultRef> = std::sync::Mutex::new(None);
+}
+pub const VERSION: i32 = 2;
+pub const HASH: &str = "notfrozen";
+impl BpTrunkStableTest {
+  fn build_parcel_repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#repeatParcelable(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(&_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#repeatEnum(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#repeatUnion(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_cb)?;
+    Ok(aidl_data)
+  }
+  fn read_response_callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<()> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#callMyCallback(_arg_cb);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    Ok(())
+  }
+  fn build_parcel_repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    aidl_data.write(_arg_input)?;
+    Ok(aidl_data)
+  }
+  fn read_response_repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> {
+    if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+      if let Some(_aidl_default_impl) = <Self as ITrunkStableTest>::getDefaultImpl() {
+        return _aidl_default_impl.r#repeatOtherParcelable(_arg_input);
+      }
+    }
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable = _aidl_reply.read()?;
+    Ok(_aidl_return)
+  }
+  fn build_parcel_getInterfaceVersion(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceVersion(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: i32 = _aidl_reply.read()?;
+    self.cached_version.store(_aidl_return, std::sync::atomic::Ordering::Relaxed);
+    Ok(_aidl_return)
+  }
+  fn build_parcel_getInterfaceHash(&self) -> binder::Result<binder::binder_impl::Parcel> {
+    let mut aidl_data = self.binder.prepare_transact()?;
+    Ok(aidl_data)
+  }
+  fn read_response_getInterfaceHash(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+    let _aidl_reply = _aidl_reply?;
+    let _aidl_status: binder::Status = _aidl_reply.read()?;
+    if !_aidl_status.is_ok() { return Err(_aidl_status); }
+    let _aidl_return: String = _aidl_reply.read()?;
+    *self.cached_hash.lock().unwrap() = Some(_aidl_return.clone());
+    Ok(_aidl_return)
+  }
+}
+impl ITrunkStableTest for BpTrunkStableTest {
+  fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+    let _aidl_data = self.build_parcel_repeatParcelable(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#repeatParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_repeatParcelable(_arg_input, _aidl_reply)
+  }
+  fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+    let _aidl_data = self.build_parcel_repeatEnum(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#repeatEnum, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_repeatEnum(_arg_input, _aidl_reply)
+  }
+  fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+    let _aidl_data = self.build_parcel_repeatUnion(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#repeatUnion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_repeatUnion(_arg_input, _aidl_reply)
+  }
+  fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()> {
+    let _aidl_data = self.build_parcel_callMyCallback(_arg_cb)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#callMyCallback, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_callMyCallback(_arg_cb, _aidl_reply)
+  }
+  fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> {
+    let _aidl_data = self.build_parcel_repeatOtherParcelable(_arg_input)?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#repeatOtherParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_repeatOtherParcelable(_arg_input, _aidl_reply)
+  }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Ok(_aidl_version); }
+    let _aidl_data = self.build_parcel_getInterfaceVersion()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceVersion(_aidl_reply)
+  }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Ok(_aidl_hash.clone());
+      }
+    }
+    let _aidl_data = self.build_parcel_getInterfaceHash()?;
+    let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+    self.read_response_getInterfaceHash(_aidl_reply)
+  }
+}
+impl<P: binder::BinderAsyncPool> ITrunkStableTestAsync<P> for BpTrunkStableTest {
+  fn r#repeatParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>> {
+    let _aidl_data = match self.build_parcel_repeatParcelable(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#repeatParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_repeatParcelable(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#repeatEnum<'a>(&'a self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>> {
+    let _aidl_data = match self.build_parcel_repeatEnum(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#repeatEnum, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_repeatEnum(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#repeatUnion<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>> {
+    let _aidl_data = match self.build_parcel_repeatUnion(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#repeatUnion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_repeatUnion(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#callMyCallback<'a>(&'a self, _arg_cb: &'a binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::BoxFuture<'a, binder::Result<()>> {
+    let _aidl_data = match self.build_parcel_callMyCallback(_arg_cb) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#callMyCallback, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_callMyCallback(_arg_cb, _aidl_reply)
+      }
+    )
+  }
+  fn r#repeatOtherParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable>> {
+    let _aidl_data = match self.build_parcel_repeatOtherParcelable(_arg_input) {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#repeatOtherParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_repeatOtherParcelable(_arg_input, _aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+    let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+    if _aidl_version != -1 { return Box::pin(std::future::ready(Ok(_aidl_version))); }
+    let _aidl_data = match self.build_parcel_getInterfaceVersion() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceVersion(_aidl_reply)
+      }
+    )
+  }
+  fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+    {
+      let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+      if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+        return Box::pin(std::future::ready(Ok(_aidl_hash.clone())));
+      }
+    }
+    let _aidl_data = match self.build_parcel_getInterfaceHash() {
+      Ok(_aidl_data) => _aidl_data,
+      Err(err) => return Box::pin(std::future::ready(Err(err))),
+    };
+    let binder = self.binder.clone();
+    P::spawn(
+      move || binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+      move |_aidl_reply| async move {
+        self.read_response_getInterfaceHash(_aidl_reply)
+      }
+    )
+  }
+}
+impl ITrunkStableTest for binder::binder_impl::Binder<BnTrunkStableTest> {
+  fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> { self.0.r#repeatParcelable(_arg_input) }
+  fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> { self.0.r#repeatEnum(_arg_input) }
+  fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> { self.0.r#repeatUnion(_arg_input) }
+  fn r#callMyCallback(&self, _arg_cb: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback>) -> binder::Result<()> { self.0.r#callMyCallback(_arg_cb) }
+  fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> { self.0.r#repeatOtherParcelable(_arg_input) }
+  fn r#getInterfaceVersion(&self) -> binder::Result<i32> { self.0.r#getInterfaceVersion() }
+  fn r#getInterfaceHash(&self) -> binder::Result<String> { self.0.r#getInterfaceHash() }
+}
+fn on_transact(_aidl_service: &dyn ITrunkStableTest, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+  match _aidl_code {
+    transactions::r#repeatParcelable => {
+      let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#repeatParcelable(&_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#repeatEnum => {
+      let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#repeatEnum(_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#repeatUnion => {
+      let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#repeatUnion(&_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#callMyCallback => {
+      let _arg_cb: binder::Strong<dyn crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback> = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#callMyCallback(&_arg_cb);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#repeatOtherParcelable => {
+      let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable = _aidl_data.read()?;
+      let _aidl_return = _aidl_service.r#repeatOtherParcelable(&_arg_input);
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceVersion => {
+      let _aidl_return = _aidl_service.r#getInterfaceVersion();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    transactions::r#getInterfaceHash => {
+      let _aidl_return = _aidl_service.r#getInterfaceHash();
+      match &_aidl_return {
+        Ok(_aidl_return) => {
+          _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+          _aidl_reply.write(_aidl_return)?;
+        }
+        Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+      }
+      Ok(())
+    }
+    _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+  }
+}
+pub mod r#MyParcelable {
+  #[derive(Debug)]
+  pub struct r#MyParcelable {
+    pub r#a: i32,
+    pub r#b: i32,
+    pub r#c: i32,
+  }
+  impl Default for r#MyParcelable {
+    fn default() -> Self {
+      Self {
+        r#a: 0,
+        r#b: 0,
+        r#c: 0,
+      }
+    }
+  }
+  impl binder::Parcelable for r#MyParcelable {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        subparcel.write(&self.r#a)?;
+        subparcel.write(&self.r#b)?;
+        subparcel.write(&self.r#c)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#a = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#b = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#c = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyParcelable);
+  binder::impl_deserialize_for_parcelable!(r#MyParcelable);
+  impl binder::binder_impl::ParcelableMetadata for r#MyParcelable {
+    fn get_descriptor() -> &'static str { "android.aidl.test.trunk.ITrunkStableTest.MyParcelable" }
+  }
+}
+pub mod r#MyEnum {
+  #![allow(non_upper_case_globals)]
+  use binder::declare_binder_enum;
+  declare_binder_enum! {
+    r#MyEnum : [i8; 4] {
+      r#ZERO = 0,
+      r#ONE = 1,
+      r#TWO = 2,
+      r#THREE = 3,
+    }
+  }
+}
+pub mod r#MyUnion {
+  #[derive(Debug)]
+  pub enum r#MyUnion {
+    A(i32),
+    B(i32),
+    C(i32),
+  }
+  impl Default for r#MyUnion {
+    fn default() -> Self {
+      Self::A(0)
+    }
+  }
+  impl binder::Parcelable for r#MyUnion {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      match self {
+        Self::A(v) => {
+          parcel.write(&0i32)?;
+          parcel.write(v)
+        }
+        Self::B(v) => {
+          parcel.write(&1i32)?;
+          parcel.write(v)
+        }
+        Self::C(v) => {
+          parcel.write(&2i32)?;
+          parcel.write(v)
+        }
+      }
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      let tag: i32 = parcel.read()?;
+      match tag {
+        0 => {
+          let value: i32 = parcel.read()?;
+          *self = Self::A(value);
+          Ok(())
+        }
+        1 => {
+          let value: i32 = parcel.read()?;
+          *self = Self::B(value);
+          Ok(())
+        }
+        2 => {
+          let value: i32 = parcel.read()?;
+          *self = Self::C(value);
+          Ok(())
+        }
+        _ => {
+          Err(binder::StatusCode::BAD_VALUE)
+        }
+      }
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyUnion);
+  binder::impl_deserialize_for_parcelable!(r#MyUnion);
+  impl binder::binder_impl::ParcelableMetadata for r#MyUnion {
+    fn get_descriptor() -> &'static str { "android.aidl.test.trunk.ITrunkStableTest.MyUnion" }
+  }
+  pub mod r#Tag {
+    #![allow(non_upper_case_globals)]
+    use binder::declare_binder_enum;
+    declare_binder_enum! {
+      r#Tag : [i32; 3] {
+        r#a = 0,
+        r#b = 1,
+        r#c = 2,
+      }
+    }
+  }
+}
+pub mod r#IMyCallback {
+  #![allow(non_upper_case_globals)]
+  #![allow(non_snake_case)]
+  #[allow(unused_imports)] use binder::binder_impl::IBinderInternal;
+  use binder::declare_binder_interface;
+  declare_binder_interface! {
+    IMyCallback["android.aidl.test.trunk.ITrunkStableTest.IMyCallback"] {
+      native: BnMyCallback(on_transact),
+      proxy: BpMyCallback {
+        cached_version: std::sync::atomic::AtomicI32 = std::sync::atomic::AtomicI32::new(-1),
+        cached_hash: std::sync::Mutex<Option<String>> = std::sync::Mutex::new(None)
+      },
+      async: IMyCallbackAsync,
+    }
+  }
+  pub trait IMyCallback: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest.IMyCallback" }
+    fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>;
+    fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>;
+    fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>;
+    fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable>;
+    fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+      Ok(VERSION)
+    }
+    fn r#getInterfaceHash(&self) -> binder::Result<String> {
+      Ok(HASH.into())
+    }
+    fn getDefaultImpl() -> IMyCallbackDefaultRef where Self: Sized {
+      DEFAULT_IMPL.lock().unwrap().clone()
+    }
+    fn setDefaultImpl(d: IMyCallbackDefaultRef) -> IMyCallbackDefaultRef where Self: Sized {
+      std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+    }
+  }
+  pub trait IMyCallbackAsync<P>: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest.IMyCallback" }
+    fn r#repeatParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>>;
+    fn r#repeatEnum<'a>(&'a self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>>;
+    fn r#repeatUnion<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>>;
+    fn r#repeatOtherParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable>>;
+    fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+      Box::pin(async move { Ok(VERSION) })
+    }
+    fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+      Box::pin(async move { Ok(HASH.into()) })
+    }
+  }
+  #[::async_trait::async_trait]
+  pub trait IMyCallbackAsyncServer: binder::Interface + Send {
+    fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.test.trunk.ITrunkStableTest.IMyCallback" }
+    async fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>;
+    async fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>;
+    async fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>;
+    async fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable>;
+  }
+  impl BnMyCallback {
+    /// Create a new async binder service.
+    pub fn new_async_binder<T, R>(inner: T, rt: R, features: binder::BinderFeatures) -> binder::Strong<dyn IMyCallback>
+    where
+      T: IMyCallbackAsyncServer + binder::Interface + Send + Sync + 'static,
+      R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+    {
+      struct Wrapper<T, R> {
+        _inner: T,
+        _rt: R,
+      }
+      impl<T, R> binder::Interface for Wrapper<T, R> where T: binder::Interface, R: Send + Sync {
+        fn as_binder(&self) -> binder::SpIBinder { self._inner.as_binder() }
+        fn dump(&self, _file: &std::fs::File, _args: &[&std::ffi::CStr]) -> std::result::Result<(), binder::StatusCode> { self._inner.dump(_file, _args) }
+      }
+      impl<T, R> IMyCallback for Wrapper<T, R>
+      where
+        T: IMyCallbackAsyncServer + Send + Sync + 'static,
+        R: binder::binder_impl::BinderAsyncRuntime + Send + Sync + 'static,
+      {
+        fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+          self._rt.block_on(self._inner.r#repeatParcelable(_arg_input))
+        }
+        fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+          self._rt.block_on(self._inner.r#repeatEnum(_arg_input))
+        }
+        fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+          self._rt.block_on(self._inner.r#repeatUnion(_arg_input))
+        }
+        fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> {
+          self._rt.block_on(self._inner.r#repeatOtherParcelable(_arg_input))
+        }
+      }
+      let wrapped = Wrapper { _inner: inner, _rt: rt };
+      Self::new_binder(wrapped, features)
+    }
+  }
+  pub trait IMyCallbackDefault: Send + Sync {
+    fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+    fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> {
+      Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+  }
+  pub mod transactions {
+    pub const r#repeatParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0;
+    pub const r#repeatEnum: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1;
+    pub const r#repeatUnion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 2;
+    pub const r#repeatOtherParcelable: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 3;
+    pub const r#getInterfaceVersion: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777214;
+    pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213;
+  }
+  pub type IMyCallbackDefaultRef = Option<std::sync::Arc<dyn IMyCallbackDefault>>;
+  use lazy_static::lazy_static;
+  lazy_static! {
+    static ref DEFAULT_IMPL: std::sync::Mutex<IMyCallbackDefaultRef> = std::sync::Mutex::new(None);
+  }
+  pub const VERSION: i32 = 2;
+  pub const HASH: &str = "notfrozen";
+  impl BpMyCallback {
+    fn build_parcel_repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyCallback>::getDefaultImpl() {
+          return _aidl_default_impl.r#repeatParcelable(_arg_input);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable = _aidl_reply.read()?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(&_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyCallback>::getDefaultImpl() {
+          return _aidl_default_impl.r#repeatEnum(_arg_input);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum = _aidl_reply.read()?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyCallback>::getDefaultImpl() {
+          return _aidl_default_impl.r#repeatUnion(_arg_input);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion = _aidl_reply.read()?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      aidl_data.write(_arg_input)?;
+      Ok(aidl_data)
+    }
+    fn read_response_repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> {
+      if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+        if let Some(_aidl_default_impl) = <Self as IMyCallback>::getDefaultImpl() {
+          return _aidl_default_impl.r#repeatOtherParcelable(_arg_input);
+        }
+      }
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable = _aidl_reply.read()?;
+      Ok(_aidl_return)
+    }
+    fn build_parcel_getInterfaceVersion(&self) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      Ok(aidl_data)
+    }
+    fn read_response_getInterfaceVersion(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<i32> {
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: i32 = _aidl_reply.read()?;
+      self.cached_version.store(_aidl_return, std::sync::atomic::Ordering::Relaxed);
+      Ok(_aidl_return)
+    }
+    fn build_parcel_getInterfaceHash(&self) -> binder::Result<binder::binder_impl::Parcel> {
+      let mut aidl_data = self.binder.prepare_transact()?;
+      Ok(aidl_data)
+    }
+    fn read_response_getInterfaceHash(&self, _aidl_reply: std::result::Result<binder::binder_impl::Parcel, binder::StatusCode>) -> binder::Result<String> {
+      let _aidl_reply = _aidl_reply?;
+      let _aidl_status: binder::Status = _aidl_reply.read()?;
+      if !_aidl_status.is_ok() { return Err(_aidl_status); }
+      let _aidl_return: String = _aidl_reply.read()?;
+      *self.cached_hash.lock().unwrap() = Some(_aidl_return.clone());
+      Ok(_aidl_return)
+    }
+  }
+  impl IMyCallback for BpMyCallback {
+    fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> {
+      let _aidl_data = self.build_parcel_repeatParcelable(_arg_input)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#repeatParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_repeatParcelable(_arg_input, _aidl_reply)
+    }
+    fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> {
+      let _aidl_data = self.build_parcel_repeatEnum(_arg_input)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#repeatEnum, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_repeatEnum(_arg_input, _aidl_reply)
+    }
+    fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> {
+      let _aidl_data = self.build_parcel_repeatUnion(_arg_input)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#repeatUnion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_repeatUnion(_arg_input, _aidl_reply)
+    }
+    fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> {
+      let _aidl_data = self.build_parcel_repeatOtherParcelable(_arg_input)?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#repeatOtherParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_repeatOtherParcelable(_arg_input, _aidl_reply)
+    }
+    fn r#getInterfaceVersion(&self) -> binder::Result<i32> {
+      let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+      if _aidl_version != -1 { return Ok(_aidl_version); }
+      let _aidl_data = self.build_parcel_getInterfaceVersion()?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_getInterfaceVersion(_aidl_reply)
+    }
+    fn r#getInterfaceHash(&self) -> binder::Result<String> {
+      {
+        let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+        if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+          return Ok(_aidl_hash.clone());
+        }
+      }
+      let _aidl_data = self.build_parcel_getInterfaceHash()?;
+      let _aidl_reply = self.binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL);
+      self.read_response_getInterfaceHash(_aidl_reply)
+    }
+  }
+  impl<P: binder::BinderAsyncPool> IMyCallbackAsync<P> for BpMyCallback {
+    fn r#repeatParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable>> {
+      let _aidl_data = match self.build_parcel_repeatParcelable(_arg_input) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#repeatParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_repeatParcelable(_arg_input, _aidl_reply)
+        }
+      )
+    }
+    fn r#repeatEnum<'a>(&'a self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum>> {
+      let _aidl_data = match self.build_parcel_repeatEnum(_arg_input) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#repeatEnum, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_repeatEnum(_arg_input, _aidl_reply)
+        }
+      )
+    }
+    fn r#repeatUnion<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion>> {
+      let _aidl_data = match self.build_parcel_repeatUnion(_arg_input) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#repeatUnion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_repeatUnion(_arg_input, _aidl_reply)
+        }
+      )
+    }
+    fn r#repeatOtherParcelable<'a>(&'a self, _arg_input: &'a crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::BoxFuture<'a, binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable>> {
+      let _aidl_data = match self.build_parcel_repeatOtherParcelable(_arg_input) {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#repeatOtherParcelable, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_repeatOtherParcelable(_arg_input, _aidl_reply)
+        }
+      )
+    }
+    fn r#getInterfaceVersion<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<i32>> {
+      let _aidl_version = self.cached_version.load(std::sync::atomic::Ordering::Relaxed);
+      if _aidl_version != -1 { return Box::pin(std::future::ready(Ok(_aidl_version))); }
+      let _aidl_data = match self.build_parcel_getInterfaceVersion() {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#getInterfaceVersion, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_getInterfaceVersion(_aidl_reply)
+        }
+      )
+    }
+    fn r#getInterfaceHash<'a>(&'a self) -> binder::BoxFuture<'a, binder::Result<String>> {
+      {
+        let _aidl_hash_lock = self.cached_hash.lock().unwrap();
+        if let Some(ref _aidl_hash) = *_aidl_hash_lock {
+          return Box::pin(std::future::ready(Ok(_aidl_hash.clone())));
+        }
+      }
+      let _aidl_data = match self.build_parcel_getInterfaceHash() {
+        Ok(_aidl_data) => _aidl_data,
+        Err(err) => return Box::pin(std::future::ready(Err(err))),
+      };
+      let binder = self.binder.clone();
+      P::spawn(
+        move || binder.submit_transact(transactions::r#getInterfaceHash, _aidl_data, binder::binder_impl::FLAG_PRIVATE_LOCAL),
+        move |_aidl_reply| async move {
+          self.read_response_getInterfaceHash(_aidl_reply)
+        }
+      )
+    }
+  }
+  impl IMyCallback for binder::binder_impl::Binder<BnMyCallback> {
+    fn r#repeatParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable> { self.0.r#repeatParcelable(_arg_input) }
+    fn r#repeatEnum(&self, _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum> { self.0.r#repeatEnum(_arg_input) }
+    fn r#repeatUnion(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion> { self.0.r#repeatUnion(_arg_input) }
+    fn r#repeatOtherParcelable(&self, _arg_input: &crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable) -> binder::Result<crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable> { self.0.r#repeatOtherParcelable(_arg_input) }
+    fn r#getInterfaceVersion(&self) -> binder::Result<i32> { self.0.r#getInterfaceVersion() }
+    fn r#getInterfaceHash(&self) -> binder::Result<String> { self.0.r#getInterfaceHash() }
+  }
+  fn on_transact(_aidl_service: &dyn IMyCallback, _aidl_code: binder::binder_impl::TransactionCode, _aidl_data: &binder::binder_impl::BorrowedParcel<'_>, _aidl_reply: &mut binder::binder_impl::BorrowedParcel<'_>) -> std::result::Result<(), binder::StatusCode> {
+    match _aidl_code {
+      transactions::r#repeatParcelable => {
+        let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#repeatParcelable(&_arg_input);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#repeatEnum => {
+        let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#repeatEnum(_arg_input);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#repeatUnion => {
+        let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#repeatUnion(&_arg_input);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#repeatOtherParcelable => {
+        let _arg_input: crate::mangled::_7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable = _aidl_data.read()?;
+        let _aidl_return = _aidl_service.r#repeatOtherParcelable(&_arg_input);
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#getInterfaceVersion => {
+        let _aidl_return = _aidl_service.r#getInterfaceVersion();
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      transactions::r#getInterfaceHash => {
+        let _aidl_return = _aidl_service.r#getInterfaceHash();
+        match &_aidl_return {
+          Ok(_aidl_return) => {
+            _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+            _aidl_reply.write(_aidl_return)?;
+          }
+          Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+        }
+        Ok(())
+      }
+      _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+    }
+  }
+}
+pub mod r#MyOtherParcelable {
+  #[derive(Debug)]
+  pub struct r#MyOtherParcelable {
+    pub r#a: i32,
+    pub r#b: i32,
+  }
+  impl Default for r#MyOtherParcelable {
+    fn default() -> Self {
+      Self {
+        r#a: 0,
+        r#b: 0,
+      }
+    }
+  }
+  impl binder::Parcelable for r#MyOtherParcelable {
+    fn write_to_parcel(&self, parcel: &mut binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_write(|subparcel| {
+        subparcel.write(&self.r#a)?;
+        subparcel.write(&self.r#b)?;
+        Ok(())
+      })
+    }
+    fn read_from_parcel(&mut self, parcel: &binder::binder_impl::BorrowedParcel) -> std::result::Result<(), binder::StatusCode> {
+      parcel.sized_read(|subparcel| {
+        if subparcel.has_more_data() {
+          self.r#a = subparcel.read()?;
+        }
+        if subparcel.has_more_data() {
+          self.r#b = subparcel.read()?;
+        }
+        Ok(())
+      })
+    }
+  }
+  binder::impl_serialize_for_parcelable!(r#MyOtherParcelable);
+  binder::impl_deserialize_for_parcelable!(r#MyOtherParcelable);
+  impl binder::binder_impl::ParcelableMetadata for r#MyOtherParcelable {
+    fn get_descriptor() -> &'static str { "android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable" }
+  }
+}
+pub(crate) mod mangled {
+ pub use super::r#ITrunkStableTest as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest;
+ pub use super::r#MyParcelable::r#MyParcelable as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_12_MyParcelable;
+ pub use super::r#MyEnum::r#MyEnum as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_6_MyEnum;
+ pub use super::r#MyUnion::r#MyUnion as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion;
+ pub use super::r#MyUnion::r#Tag::r#Tag as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_7_MyUnion_3_Tag;
+ pub use super::r#IMyCallback::r#IMyCallback as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_11_IMyCallback;
+ pub use super::r#MyOtherParcelable::r#MyOtherParcelable as _7_android_4_aidl_4_test_5_trunk_16_ITrunkStableTest_17_MyOtherParcelable;
+}
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs.d b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs.d
new file mode 100644
index 0000000..7f3d91f
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs : \
+  system/tools/aidl/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/timestamp b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/timestamp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/timestamp
diff --git a/tests/golden_test.sh b/tests/golden_test.sh
new file mode 100755
index 0000000..fbd3088
--- /dev/null
+++ b/tests/golden_test.sh
@@ -0,0 +1,128 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2020 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -e
+
+if [ $# != 1 ]; then
+  echo "Usage: golden_test.sh [check|update]"
+fi
+
+function _golden_test() {
+  local update=0
+  case $1 in
+    check)
+      update=0
+      ;;
+    update)
+      update=1
+      ;;
+    *)
+      echo "Argument must be 'check' or 'update'"
+      exit 1
+      ;;
+  esac
+
+  # warning: this list must be kept in sync with system/tools/aidl/Android.bp
+  modules=(
+    "aidl-test-interface-cpp-source"
+    "aidl-test-interface-java-source"
+    "aidl-test-versioned-interface-V1-cpp-source"
+    "aidl-test-versioned-interface-V1-java-source"
+    "aidl-test-versioned-interface-V1-ndk-source"
+    "aidl-test-versioned-interface-V1-rust-source"
+    "aidl-test-versioned-interface-V2-cpp-source"
+    "aidl-test-versioned-interface-V2-java-source"
+    "aidl-test-versioned-interface-V2-ndk-source"
+    "aidl-test-versioned-interface-V2-rust-source"
+    "aidl-test-versioned-interface-V3-cpp-source"
+    "aidl-test-versioned-interface-V3-java-source"
+    "aidl-test-versioned-interface-V3-ndk-source"
+    "aidl-test-versioned-interface-V3-rust-source"
+    "aidl-test-interface-ndk-source"
+    "aidl-test-interface-rust-source"
+    "aidl_test_loggable_interface-cpp-source"
+    "aidl_test_loggable_interface-java-source"
+    "aidl_test_loggable_interface-ndk-source"
+    "aidl-test-interface-permission-java-source"
+    "aidl-test-fixedsizearray-cpp-source"
+    "aidl-test-fixedsizearray-java-source"
+    "aidl-test-fixedsizearray-ndk-source"
+    "aidl-test-fixedsizearray-rust-source"
+    "aidl-test-interface-cpp-analyzer-source"
+    "tests/trunk_stable_test/android.aidl.test.trunk-V1-cpp-source"
+    "tests/trunk_stable_test/android.aidl.test.trunk-V2-cpp-source"
+    "tests/trunk_stable_test/android.aidl.test.trunk-V1-ndk-source"
+    "tests/trunk_stable_test/android.aidl.test.trunk-V2-ndk-source"
+    "tests/trunk_stable_test/android.aidl.test.trunk-V1-java-source"
+    "tests/trunk_stable_test/android.aidl.test.trunk-V2-java-source"
+    "tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source"
+    "tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source"
+  )
+
+  local root="."
+  if [ "$ANDROID_BUILD_TOP" != "" ]; then
+    root="$ANDROID_BUILD_TOP"
+  fi
+
+  if [ "$update" = 1 ]; then
+    "$root"/build/soong/soong_ui.bash --make-mode \
+      $(for i in "${modules[@]}"; do
+          echo "out/soong/.intermediates/system/tools/aidl/$i/timestamp"
+        done)
+  fi
+
+  local e=0
+  for module in "${modules[@]}"; do
+    local built="$root/out/soong/.intermediates/system/tools/aidl/$module/"
+    local module_path
+    if [ "$AIDL_USE_UNFROZEN" == "true" ]; then
+      module_path=$module
+    elif [ "$AIDL_USE_UNFROZEN" == "false" ]; then
+      module_path="frozen/$module"
+    else
+      echo "ERROR: AIDL_USE_UNFROZEN must be set to true or false."
+      echo "ERROR: This should be the same value of the flag RELEASE_AIDL_USE_UNFROZEN"
+      echo "ERROR: when the interfaces were last built."
+      echo "ERROR:     AIDL_USE_UNFROZEN=true golden_test.sh update."
+      exit 1
+    fi
+
+    local golden="$root/system/tools/aidl/tests/golden_output/$module_path/"
+
+    if [ "$update" = 1 ]; then
+      rm -rf "$golden"
+      mkdir -p "$golden"
+      cp -r "$built/gen" "$golden"
+    else
+      diff -rN "$built/gen" "$golden/gen" || e=1
+    fi
+  done
+
+  if [ "$e" = 1 ]; then
+    echo "ERROR: The AIDL compiler is outputting files in an unknown way."
+    echo "ERROR: to accept these changes, please run:"
+    echo "ERROR:     AIDL_USE_UNFROZEN=$AIDL_USE_UNFROZEN \$ANDROID_BUILD_TOP/system/tools/aidl/tests/golden_test.sh update"
+    echo "ERROR: Then, flip the RELEASE_AIDL_USE_UNFROZEN build flag and rebuild/regenerate the"
+    echo "ERROR: other set of golden output files."
+    exit 1
+  else
+    if [ "$update" = 1 ]; then
+      echo "UPDATE GOLDEN TEST SUCCESS"
+    fi
+  fi
+}
+
+_golden_test "$@"
diff --git a/tests/java/src/android/aidl/permission/service/PermissionTestService.java b/tests/java/src/android/aidl/permission/service/PermissionTestService.java
new file mode 100644
index 0000000..f3bb0ce
--- /dev/null
+++ b/tests/java/src/android/aidl/permission/service/PermissionTestService.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.permission.service;
+
+import android.aidl.tests.permission.IProtected;
+import android.annotation.EnforcePermission;
+import android.os.Binder;
+import android.os.ServiceManager;
+import android.os.test.FakePermissionEnforcer;
+import java.util.List;
+
+public class PermissionTestService extends IProtected.Stub {
+  private FakePermissionEnforcer mPermissionEnforcer;
+
+  public static void main(String[] args) {
+    PermissionTestService myServer = new PermissionTestService(new FakePermissionEnforcer());
+    ServiceManager.addService(IProtected.class.getName(), myServer);
+
+    Binder.joinThreadPool();
+  }
+
+  public PermissionTestService(FakePermissionEnforcer permissionEnforcer) {
+    super(permissionEnforcer);
+    mPermissionEnforcer = permissionEnforcer;
+  }
+
+  @Override
+  @EnforcePermission("READ_PHONE_STATE")
+  public void PermissionProtected() {
+    PermissionProtected_enforcePermission();
+  }
+
+  @Override
+  @EnforcePermission(allOf = {"INTERNET", "VIBRATE"})
+  public void MultiplePermissionsAll() {
+    MultiplePermissionsAll_enforcePermission();
+  }
+
+  @Override
+  @EnforcePermission(anyOf = {"INTERNET", "VIBRATE"})
+  public void MultiplePermissionsAny() {
+    MultiplePermissionsAny_enforcePermission();
+  }
+
+  @Override
+  @EnforcePermission("android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK")
+  public void NonManifestPermission() {
+    NonManifestPermission_enforcePermission();
+  }
+
+  @Override
+  public void Grant(String permission) {
+    mPermissionEnforcer.grant(permission);
+  }
+
+  @Override
+  public void Revoke(String permission) {
+    mPermissionEnforcer.revoke(permission);
+  }
+
+  @Override
+  public void RevokeAll() {
+    mPermissionEnforcer.revokeAll();
+  }
+}
diff --git a/tests/java/src/android/aidl/permission/tests/PermissionTests.java b/tests/java/src/android/aidl/permission/tests/PermissionTests.java
new file mode 100644
index 0000000..6eb9035
--- /dev/null
+++ b/tests/java/src/android/aidl/permission/tests/PermissionTests.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.permission.tests;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThrows;
+
+import android.aidl.tests.permission.IProtected;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import java.util.List;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.internal.TextListener;
+import org.junit.runner.JUnitCore;
+import org.junit.runner.Result;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public abstract class PermissionTests {
+  protected IProtected service;
+
+  @Test
+  public void testProtected() throws Exception {
+    // Requires READ_PHONE_STATE.
+    assertThrows(SecurityException.class, () -> service.PermissionProtected());
+    service.Grant("android.permission.READ_PHONE_STATE");
+    service.PermissionProtected();
+  }
+
+  @Test
+  public void testMultiplePermissionsAll() throws Exception {
+    // Requires INTERNET and VIBRATE.
+    assertThrows(SecurityException.class, () -> service.MultiplePermissionsAll());
+
+    service.Grant("android.permission.INTERNET");
+    assertThrows(SecurityException.class, () -> service.MultiplePermissionsAll());
+    service.RevokeAll();
+
+    service.Grant("android.permission.VIBRATE");
+    assertThrows(SecurityException.class, () -> service.MultiplePermissionsAll());
+    service.RevokeAll();
+
+    service.Grant("android.permission.INTERNET");
+    service.Grant("android.permission.VIBRATE");
+    service.MultiplePermissionsAll();
+  }
+
+  @Test
+  public void testMultiplePermissionsAny() throws Exception {
+    // Requires INTERNET or VIBRATE.
+    assertThrows(SecurityException.class, () -> service.MultiplePermissionsAny());
+
+    service.Grant("android.permission.INTERNET");
+    service.MultiplePermissionsAny();
+    service.RevokeAll();
+
+    service.Grant("android.permission.VIBRATE");
+    service.MultiplePermissionsAny();
+  }
+
+  @Test
+  public void testNonManifestPermission() throws Exception {
+    // Requires android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK
+    assertThrows(SecurityException.class, () -> service.NonManifestPermission());
+
+    service.Grant("android.permission.MAINLINE_NETWORK_STACK");
+    service.NonManifestPermission();
+  }
+
+  public static void main(String[] args) {
+    JUnitCore junit = new JUnitCore();
+    junit.addListener(new TextListener(System.out));
+    Result result = junit.run(PermissionTestsRemote.class, PermissionTestsLocal.class);
+    System.out.println(result.wasSuccessful() ? "TEST SUCCESS" : "TEST FAILURE");
+  }
+}
diff --git a/tests/java/src/android/aidl/permission/tests/PermissionTestsLocal.java b/tests/java/src/android/aidl/permission/tests/PermissionTestsLocal.java
new file mode 100644
index 0000000..22aa6bd
--- /dev/null
+++ b/tests/java/src/android/aidl/permission/tests/PermissionTestsLocal.java
@@ -0,0 +1,39 @@
+
+/*
+ * Copyright (C) 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.permission.tests;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThrows;
+
+import android.aidl.permission.service.PermissionTestService;
+import android.aidl.tests.permission.IProtected;
+import android.os.RemoteException;
+import android.os.test.FakePermissionEnforcer;
+import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class PermissionTestsLocal extends PermissionTests {
+  @Before
+  public void setUp() throws RemoteException {
+    service = new PermissionTestService(new FakePermissionEnforcer());
+    assertNotNull(service);
+    service.RevokeAll();
+  }
+}
diff --git a/tests/java/src/android/aidl/permission/tests/PermissionTestsRemote.java b/tests/java/src/android/aidl/permission/tests/PermissionTestsRemote.java
new file mode 100644
index 0000000..0d8620e
--- /dev/null
+++ b/tests/java/src/android/aidl/permission/tests/PermissionTestsRemote.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.permission.tests;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThrows;
+
+import android.aidl.tests.permission.IProtected;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class PermissionTestsRemote extends PermissionTests {
+  @Before
+  public void setUp() throws RemoteException {
+    IBinder binder = ServiceManager.waitForService(IProtected.class.getName());
+    assertNotNull(binder);
+    service = IProtected.Stub.asInterface(binder);
+    assertNotNull(service);
+    service.RevokeAll();
+  }
+}
diff --git a/tests/java/src/android/aidl/sdkversion/ITestService.aidl b/tests/java/src/android/aidl/sdkversion/ITestService.aidl
new file mode 100644
index 0000000..b3302ad
--- /dev/null
+++ b/tests/java/src/android/aidl/sdkversion/ITestService.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.aidl.sdkversion;
+
+interface ITestService {
+    // Since sdk = 29, we have write/readBoolean
+    boolean RepeatBoolean(boolean token);
+
+    @JavaDerive(toString=true, equals=true)
+    parcelable TypedObject {
+        boolean b;
+    }
+
+    // Since sdk = 23, we have write/readTypedObject
+    @nullable TypedObject RepeatTypedObject(in @nullable TypedObject token);
+
+    // Since sdk = 33, we have write/readTypedList (with parcelableFlags)
+    @nullable List<TypedObject> RepeatTypedList(
+            in @nullable List<TypedObject> tokens);
+}
diff --git a/tests/java/src/android/aidl/sdkversion/service/AidlJavaVersionTestService.java b/tests/java/src/android/aidl/sdkversion/service/AidlJavaVersionTestService.java
new file mode 100644
index 0000000..91d1024
--- /dev/null
+++ b/tests/java/src/android/aidl/sdkversion/service/AidlJavaVersionTestService.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.sdkversion.service;
+
+import android.aidl.sdkversion.ITestService;
+import android.aidl.sdkversion.ITestService.TypedObject;
+import android.os.Binder;
+import android.os.ServiceManager;
+import java.util.List;
+
+public class AidlJavaVersionTestService {
+  static class TestServiceServer extends ITestService.Stub {
+    @Override
+    public boolean RepeatBoolean(boolean token) {
+      return token;
+    }
+
+    @Override
+    public TypedObject RepeatTypedObject(TypedObject token) {
+      return token;
+    }
+
+    @Override
+    public List<TypedObject> RepeatTypedList(List<TypedObject> token) {
+      return token;
+    }
+  }
+
+  public static void main(String[] args) {
+    TestServiceServer myServer = new TestServiceServer();
+    ServiceManager.addService(ITestService.class.getName(), myServer);
+    Binder.joinThreadPool();
+  }
+}
diff --git a/tests/java/src/android/aidl/sdkversion/tests/AidlJavaVersionTests.java b/tests/java/src/android/aidl/sdkversion/tests/AidlJavaVersionTests.java
new file mode 100644
index 0000000..27b4208
--- /dev/null
+++ b/tests/java/src/android/aidl/sdkversion/tests/AidlJavaVersionTests.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.sdkversion.tests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import android.aidl.sdkversion.ITestService;
+import android.aidl.sdkversion.ITestService.TypedObject;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import java.util.ArrayList;
+import java.util.List;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.internal.TextListener;
+import org.junit.runner.JUnitCore;
+import org.junit.runner.Result;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class AidlJavaVersionTests {
+  public static void main(String[] args) {
+    JUnitCore junit = new JUnitCore();
+    junit.addListener(new TextListener(System.out));
+    Result result = junit.run(AidlJavaVersionTests.class);
+    System.out.println(result.wasSuccessful() ? "TEST SUCCESS" : "TEST FAILURE");
+  }
+
+  private ITestService mService;
+
+  @Before
+  public void setUp() {
+    IBinder binder = ServiceManager.waitForService(ITestService.class.getName());
+    assertNotNull(binder);
+    mService = ITestService.Stub.asInterface(binder);
+    assertNotNull(mService);
+  }
+
+  @Test
+  public void testBoolean() throws RemoteException {
+    assertTrue(mService.RepeatBoolean(true));
+    assertFalse(mService.RepeatBoolean(false));
+  }
+
+  @Test
+  public void testTypedObject() throws RemoteException {
+    TypedObject token = new TypedObject();
+    assertEquals(mService.RepeatTypedObject(token), token);
+    assertNull(mService.RepeatTypedObject(null));
+    List<TypedObject> list = new ArrayList<>();
+    list.add(token);
+    assertEquals(mService.RepeatTypedList(list), list);
+  }
+}
diff --git a/tests/java/src/android/aidl/service/TestServiceServer.java b/tests/java/src/android/aidl/service/TestServiceServer.java
new file mode 100644
index 0000000..fd79222
--- /dev/null
+++ b/tests/java/src/android/aidl/service/TestServiceServer.java
@@ -0,0 +1,864 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.service;
+
+import android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray;
+import android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable;
+import android.aidl.test.trunk.ITrunkStableTest;
+import android.aidl.test.trunk.ITrunkStableTest.IMyCallback;
+import android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable;
+import android.aidl.test.trunk.ITrunkStableTest.MyParcelable;
+import android.aidl.test.trunk.ITrunkStableTest.MyUnion;
+import android.aidl.tests.BackendType;
+import android.aidl.tests.BadParcelable;
+import android.aidl.tests.ByteEnum;
+import android.aidl.tests.CircularParcelable;
+import android.aidl.tests.ConstantExpressionEnum;
+import android.aidl.tests.GenericStructuredParcelable;
+import android.aidl.tests.ICircular;
+import android.aidl.tests.ICppJavaTests;
+import android.aidl.tests.INamedCallback;
+import android.aidl.tests.INewName;
+import android.aidl.tests.IOldName;
+import android.aidl.tests.ITestService;
+import android.aidl.tests.IntEnum;
+import android.aidl.tests.LongEnum;
+import android.aidl.tests.RecursiveList;
+import android.aidl.tests.SimpleParcelable;
+import android.aidl.tests.StructuredParcelable;
+import android.aidl.tests.Union;
+import android.aidl.tests.extension.ExtendableParcelable;
+import android.aidl.tests.extension.MyExt;
+import android.aidl.tests.nested.INestedService;
+import android.aidl.tests.nested.ParcelableWithNested;
+import android.aidl.versioned.tests.BazUnion;
+import android.aidl.versioned.tests.Foo;
+import android.aidl.versioned.tests.IFooInterface;
+import android.os.Binder;
+import android.os.IBinder;
+import android.os.Parcel;
+import android.os.ParcelFileDescriptor;
+import android.os.PersistableBundle;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import android.os.ServiceSpecificException;
+import android.util.Log;
+import java.io.FileDescriptor;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+
+public class TestServiceServer extends ITestService.Stub {
+  public static void main(String[] args) {
+    // b/235006086: test with debug stack trace parceling feature
+    // which has been broken in the past. This does mean that we
+    // lose Java coverage for when this is false, but we do have
+    // other tests which cover this including CtsNdkBinderTestCases
+    // and other language-specific exception/Status unit tests.
+    Parcel.setStackTraceParceling(true);
+
+    TestServiceServer myServer = new TestServiceServer();
+    ServiceManager.addService(ITestService.class.getName(), myServer);
+
+    FooInterface foo = new FooInterface();
+    ServiceManager.addService(IFooInterface.class.getName(), foo);
+
+    NestedService nested = new NestedService();
+    ServiceManager.addService(INestedService.class.getName(), nested);
+
+    FixedSizeArrayService fixedSize = new FixedSizeArrayService();
+    ServiceManager.addService(IRepeatFixedSizeArray.DESCRIPTOR, fixedSize);
+
+    TrunkStableService trunkStable = new TrunkStableService();
+    ServiceManager.addService(ITrunkStableTest.DESCRIPTOR, trunkStable);
+
+    Binder.joinThreadPool();
+  }
+
+  private static class FooInterface extends IFooInterface.Stub {
+    @Override
+    public void originalApi() {}
+    @Override
+    public String acceptUnionAndReturnString(BazUnion b) {
+      if (b.getTag() == BazUnion.intNum) {
+        return "" + b.getIntNum();
+      }
+      throw new IllegalArgumentException();
+    }
+    @Override
+    public int returnsLengthOfFooArray(Foo[] foos) {
+      return foos.length;
+    }
+    @Override
+    public int ignoreParcelablesAndRepeatInt(Foo inFoo, Foo inoutFoo, Foo outFoo, int value) {
+      return value;
+    }
+    @Override
+    public final int getInterfaceVersion() {
+      return super.VERSION;
+    }
+    @Override
+    public final String getInterfaceHash() {
+      return super.HASH;
+    }
+  }
+
+  private static class NestedService extends INestedService.Stub {
+    @Override
+    public final Result flipStatus(ParcelableWithNested p) {
+      Result result = new Result();
+      if (p.status == ParcelableWithNested.Status.OK) {
+        result.status = ParcelableWithNested.Status.NOT_OK;
+      } else {
+        result.status = ParcelableWithNested.Status.OK;
+      }
+      return result;
+    }
+    @Override
+    public final void flipStatusWithCallback(byte st, ICallback cb) throws RemoteException {
+      if (st == ParcelableWithNested.Status.OK) {
+        cb.done(ParcelableWithNested.Status.NOT_OK);
+      } else {
+        cb.done(ParcelableWithNested.Status.OK);
+      }
+    }
+  }
+
+  @Override
+  public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
+    // UnimplementedMethod
+    if (code == 1)
+      return false;
+    return super.onTransact(code, data, reply, flags);
+  }
+
+  @Override
+  public int UnimplementedMethod(int arg) throws RemoteException {
+    throw new UnsupportedOperationException();
+  }
+  @Override
+  public void TestOneway() throws RemoteException {
+    throw new RemoteException();
+  }
+  @Override
+  public void Deprecated() throws RemoteException {}
+  @Override
+  public boolean RepeatBoolean(boolean token) throws RemoteException {
+    return token;
+  }
+  @Override
+  public byte RepeatByte(byte token) throws RemoteException {
+    return token;
+  }
+  @Override
+  public char RepeatChar(char token) throws RemoteException {
+    return token;
+  }
+  @Override
+  public int RepeatInt(int token) throws RemoteException {
+    return token;
+  }
+  @Override
+  public long RepeatLong(long token) throws RemoteException {
+    return token;
+  }
+  @Override
+  public float RepeatFloat(float token) throws RemoteException {
+    return token;
+  }
+  @Override
+  public double RepeatDouble(double token) throws RemoteException {
+    return token;
+  }
+  @Override
+  public String RepeatString(String token) throws RemoteException {
+    return token;
+  }
+  @Override
+  public byte RepeatByteEnum(byte token) throws RemoteException {
+    return token;
+  }
+  @Override
+  public int RepeatIntEnum(int token) throws RemoteException {
+    return token;
+  }
+  @Override
+  public long RepeatLongEnum(long token) throws RemoteException {
+    return token;
+  }
+  @Override
+  public boolean[] ReverseBoolean(boolean[] input, boolean[] repeated) throws RemoteException {
+    boolean[] reversed = new boolean[input.length];
+    for (int i = 0; i < input.length; i++) {
+      repeated[i] = input[i];
+      reversed[i] = input[input.length - i - 1];
+    }
+    return reversed;
+  }
+  @Override
+  public byte[] ReverseByte(byte[] input, byte[] repeated) throws RemoteException {
+    byte[] reversed = new byte[input.length];
+    for (int i = 0; i < input.length; i++) {
+      repeated[i] = input[i];
+      reversed[i] = input[input.length - i - 1];
+    }
+    return reversed;
+  }
+  @Override
+  public char[] ReverseChar(char[] input, char[] repeated) throws RemoteException {
+    char[] reversed = new char[input.length];
+    for (int i = 0; i < input.length; i++) {
+      repeated[i] = input[i];
+      reversed[i] = input[input.length - i - 1];
+    }
+    return reversed;
+  }
+  @Override
+  public int[] ReverseInt(int[] input, int[] repeated) throws RemoteException {
+    int[] reversed = new int[input.length];
+    for (int i = 0; i < input.length; i++) {
+      repeated[i] = input[i];
+      reversed[i] = input[input.length - i - 1];
+    }
+    return reversed;
+  }
+  @Override
+  public long[] ReverseLong(long[] input, long[] repeated) throws RemoteException {
+    long[] reversed = new long[input.length];
+    for (int i = 0; i < input.length; i++) {
+      repeated[i] = input[i];
+      reversed[i] = input[input.length - i - 1];
+    }
+    return reversed;
+  }
+  @Override
+  public float[] ReverseFloat(float[] input, float[] repeated) throws RemoteException {
+    float[] reversed = new float[input.length];
+    for (int i = 0; i < input.length; i++) {
+      repeated[i] = input[i];
+      reversed[i] = input[input.length - i - 1];
+    }
+    return reversed;
+  }
+  @Override
+  public double[] ReverseDouble(double[] input, double[] repeated) throws RemoteException {
+    double[] reversed = new double[input.length];
+    for (int i = 0; i < input.length; i++) {
+      repeated[i] = input[i];
+      reversed[i] = input[input.length - i - 1];
+    }
+    return reversed;
+  }
+  @Override
+  public String[] ReverseString(String[] input, String[] repeated) throws RemoteException {
+    String[] reversed = new String[input.length];
+    for (int i = 0; i < input.length; i++) {
+      repeated[i] = input[i];
+      reversed[i] = input[input.length - i - 1];
+    }
+    return reversed;
+  }
+  @Override
+  public byte[] ReverseByteEnum(byte[] input, byte[] repeated) throws RemoteException {
+    byte[] reversed = new byte[input.length];
+    for (int i = 0; i < input.length; i++) {
+      repeated[i] = input[i];
+      reversed[i] = input[input.length - i - 1];
+    }
+    return reversed;
+  }
+  @Override
+  public int[] ReverseIntEnum(int[] input, int[] repeated) throws RemoteException {
+    int[] reversed = new int[input.length];
+    for (int i = 0; i < input.length; i++) {
+      repeated[i] = input[i];
+      reversed[i] = input[input.length - i - 1];
+    }
+    return reversed;
+  }
+  @Override
+  public long[] ReverseLongEnum(long[] input, long[] repeated) throws RemoteException {
+    long[] reversed = new long[input.length];
+    for (int i = 0; i < input.length; i++) {
+      repeated[i] = input[i];
+      reversed[i] = input[input.length - i - 1];
+    }
+    return reversed;
+  }
+
+  private static class MyNamedCallback extends INamedCallback.Stub {
+    public MyNamedCallback(String name) { mName = name; }
+    @Override
+    public String GetName() {
+      return mName;
+    }
+    private String mName;
+  }
+
+  private HashMap<String, MyNamedCallback> mNamedCallbacks = new HashMap<>();
+
+  @Override
+  public INamedCallback GetOtherTestService(String name) throws RemoteException {
+    synchronized (mNamedCallbacks) {
+      if (!mNamedCallbacks.containsKey(name)) {
+        mNamedCallbacks.put(name, new MyNamedCallback(name));
+      }
+      return mNamedCallbacks.get(name);
+    }
+  }
+  @Override
+  public boolean SetOtherTestService(String name, INamedCallback service) throws RemoteException {
+    synchronized (mNamedCallbacks) {
+      if (mNamedCallbacks.containsKey(name) && mNamedCallbacks.get(name) == service) {
+        return true;
+      }
+      try {
+        // This restricts the client to only setting services that it gets from this server.
+        mNamedCallbacks.put(name, (MyNamedCallback) service);
+      } catch (Exception e) {
+        Log.i("TestServiceServer", "Failed to cast service");
+      }
+      return false;
+    }
+  }
+  @Override
+  public boolean VerifyName(INamedCallback service, String name) throws RemoteException {
+    return name.equals(service.GetName());
+  }
+  @Override
+  public INamedCallback[] GetInterfaceArray(String[] names) throws RemoteException {
+    return GetNullableInterfaceArray(names);
+  }
+  @Override
+  public boolean VerifyNamesWithInterfaceArray(INamedCallback[] services, String[] names)
+      throws RemoteException {
+    return VerifyNamesWithNullableInterfaceArray(services, names);
+  }
+  @Override
+  public INamedCallback[] GetNullableInterfaceArray(String[] names) throws RemoteException {
+    if (names == null)
+      return null;
+    INamedCallback[] services = new INamedCallback[names.length];
+    for (int i = 0; i < names.length; i++) {
+      if (names[i] == null) {
+        services[i] = null;
+      } else {
+        services[i] = GetOtherTestService(names[i]);
+      }
+    }
+    return services;
+  }
+  @Override
+  public boolean VerifyNamesWithNullableInterfaceArray(INamedCallback[] services, String[] names)
+      throws RemoteException {
+    if (services != null && names != null) {
+      for (int i = 0; i < names.length; i++) {
+        if (services[i] != null && names[i] != null) {
+          if (!VerifyName(services[i], names[i])) {
+            return false;
+          }
+        } else if (services[i] != null || names[i] != null) {
+          return false;
+        }
+      }
+      return true;
+    } else if (services != null || names != null) {
+      return false;
+    } else {
+      return true;
+    }
+  }
+  @Override
+  public List<INamedCallback> GetInterfaceList(String[] names) throws RemoteException {
+    INamedCallback[] services = GetNullableInterfaceArray(names);
+    return services == null ? null : Arrays.asList(services);
+  }
+  @Override
+  public boolean VerifyNamesWithInterfaceList(List<INamedCallback> services, String[] names)
+      throws RemoteException {
+    return VerifyNamesWithNullableInterfaceArray(
+        services == null ? null : services.toArray(new INamedCallback[0]), names);
+  }
+  @Override
+  public List<String> ReverseStringList(List<String> input, List<String> repeated)
+      throws RemoteException {
+    ArrayList<String> reversed = new ArrayList<String>();
+    for (String a : input) {
+      repeated.add(a);
+      reversed.add(0, a);
+    }
+    return reversed;
+  }
+  @Override
+  public ParcelFileDescriptor RepeatParcelFileDescriptor(ParcelFileDescriptor read)
+      throws RemoteException {
+    return read;
+  }
+  @Override
+  public ParcelFileDescriptor[] ReverseParcelFileDescriptorArray(
+      ParcelFileDescriptor[] input, ParcelFileDescriptor[] repeated) throws RemoteException {
+    ParcelFileDescriptor[] reversed = new ParcelFileDescriptor[input.length];
+    for (int i = 0; i < input.length; i++) {
+      repeated[i] = input[i];
+      try {
+        // extra dup, because of PARCELABLE_WRITE_RETURN_VALUE
+        reversed[i] = input[input.length - i - 1].dup();
+      } catch (IOException e) {
+        throw new RuntimeException(e);
+      }
+    }
+    return reversed;
+  }
+  @Override
+  public void ThrowServiceException(int code) throws RemoteException {
+    Log.i("TestServiceServer", "Throwing service specific exception " + code);
+    throw new ServiceSpecificException(code);
+  }
+  @Override
+  public int[] RepeatNullableIntArray(int[] input) throws RemoteException {
+    return input;
+  }
+  @Override
+  public byte[] RepeatNullableByteEnumArray(byte[] input) throws RemoteException {
+    return input;
+  }
+  @Override
+  public int[] RepeatNullableIntEnumArray(int[] input) throws RemoteException {
+    return input;
+  }
+  @Override
+  public long[] RepeatNullableLongEnumArray(long[] input) throws RemoteException {
+    return input;
+  }
+  @Override
+  public String RepeatNullableString(String input) throws RemoteException {
+    return input;
+  }
+  @Override
+  public List<String> RepeatNullableStringList(List<String> input) throws RemoteException {
+    return input;
+  }
+  @Override
+  public ITestService.Empty RepeatNullableParcelable(ITestService.Empty input)
+      throws RemoteException {
+    return input;
+  }
+  @Override
+  public List<ITestService.Empty> RepeatNullableParcelableList(List<ITestService.Empty> input)
+      throws RemoteException {
+    return input;
+  }
+  @Override
+  public ITestService.Empty[] RepeatNullableParcelableArray(ITestService.Empty[] input)
+      throws RemoteException {
+    return input;
+  }
+  @Override
+  public void TakesAnIBinder(IBinder input) throws RemoteException {
+    // do nothing
+  }
+  @Override
+  public void TakesANullableIBinder(IBinder input) throws RemoteException {
+    // do nothing
+  }
+  @Override
+  public void TakesAnIBinderList(List<IBinder> input) throws RemoteException {
+    // do nothing
+  }
+  @Override
+  public void TakesANullableIBinderList(List<IBinder> input) throws RemoteException {
+    // do nothing
+  }
+
+  @Override
+  public String RepeatUtf8CppString(String token) throws RemoteException {
+    return token;
+  }
+  @Override
+  public String RepeatNullableUtf8CppString(String token) throws RemoteException {
+    return token;
+  }
+  @Override
+  public String[] ReverseUtf8CppString(String[] input, String[] repeated) throws RemoteException {
+    String[] reversed = new String[input.length];
+    for (int i = 0; i < input.length; i++) {
+      repeated[i] = input[i];
+      reversed[i] = input[input.length - i - 1];
+    }
+    return reversed;
+  }
+  @Override
+  public String[] ReverseNullableUtf8CppString(String[] input, String[] repeated)
+      throws RemoteException {
+    if (input == null)
+      return null;
+
+    String[] reversed = new String[input.length];
+    for (int i = 0; i < input.length; i++) {
+      repeated[i] = input[i];
+      reversed[i] = input[input.length - i - 1];
+    }
+    return reversed;
+  }
+  @Override
+  public List<String> ReverseUtf8CppStringList(List<String> input, List<String> repeated)
+      throws RemoteException {
+    // note - cannot clear 'repeated' here, we can only change its length
+    if (input == null)
+      return null;
+
+    ArrayList<String> reversed = new ArrayList<String>();
+    for (String a : input) {
+      repeated.add(a);
+      reversed.add(0, a);
+    }
+    return reversed;
+  }
+  @Override
+  public INamedCallback GetCallback(boolean return_null) throws RemoteException {
+    if (return_null)
+      return null;
+    return new MyNamedCallback("a callback named GetCallback");
+  }
+  @Override
+  public void FillOutStructuredParcelable(StructuredParcelable parcelable) throws RemoteException {
+    parcelable.shouldBeJerry = "Jerry";
+    parcelable.shouldContainThreeFs = new int[] {parcelable.f, parcelable.f, parcelable.f};
+    parcelable.shouldBeByteBar = ByteEnum.BAR;
+    parcelable.shouldBeIntBar = IntEnum.BAR;
+    parcelable.shouldBeLongBar = LongEnum.BAR;
+    parcelable.shouldContainTwoByteFoos = new byte[] {ByteEnum.FOO, ByteEnum.FOO};
+    parcelable.shouldContainTwoIntFoos = new int[] {IntEnum.FOO, IntEnum.FOO};
+    parcelable.shouldContainTwoLongFoos = new long[] {LongEnum.FOO, LongEnum.FOO};
+
+    parcelable.const_exprs_1 = ConstantExpressionEnum.decInt32_1;
+    parcelable.const_exprs_2 = ConstantExpressionEnum.decInt32_2;
+    parcelable.const_exprs_3 = ConstantExpressionEnum.decInt64_1;
+    parcelable.const_exprs_4 = ConstantExpressionEnum.decInt64_2;
+    parcelable.const_exprs_5 = ConstantExpressionEnum.decInt64_3;
+    parcelable.const_exprs_6 = ConstantExpressionEnum.decInt64_4;
+    parcelable.const_exprs_7 = ConstantExpressionEnum.hexInt32_1;
+    parcelable.const_exprs_8 = ConstantExpressionEnum.hexInt32_2;
+    parcelable.const_exprs_9 = ConstantExpressionEnum.hexInt32_3;
+    parcelable.const_exprs_10 = ConstantExpressionEnum.hexInt64_1;
+
+    parcelable.shouldSetBit0AndBit2 = StructuredParcelable.BIT0 | StructuredParcelable.BIT2;
+
+    parcelable.u = Union.ns(new int[] {1, 2, 3});
+    parcelable.shouldBeConstS1 = Union.s(Union.S1);
+  }
+  @Override
+  public void RepeatExtendableParcelable(ExtendableParcelable ep, ExtendableParcelable ep2)
+      throws RemoteException {
+    ep2.a = ep.a;
+    ep2.b = ep.b;
+    // no way to copy currently w/o unparceling
+    ep2.ext.setParcelable(ep.ext.getParcelable(MyExt.class));
+    ep2.c = ep.c;
+    ep2.ext2.setParcelable(null);
+  }
+  @Override
+  public RecursiveList ReverseList(RecursiveList list) throws RemoteException {
+    RecursiveList reversed = null;
+    while (list != null) {
+      RecursiveList next = list.next;
+      list.next = reversed;
+      reversed = list;
+      list = next;
+    }
+    return reversed;
+  }
+  @Override
+  public IBinder[] ReverseIBinderArray(IBinder[] input, IBinder[] repeated) {
+    IBinder[] reversed = new IBinder[input.length];
+    for (int i = 0; i < input.length; i++) {
+      repeated[i] = input[i];
+      reversed[i] = input[input.length - i - 1];
+    }
+    return reversed;
+  }
+  @Override
+  public IBinder[] ReverseNullableIBinderArray(IBinder[] input, IBinder[] repeated) {
+    IBinder[] reversed = new IBinder[input.length];
+    for (int i = 0; i < input.length; i++) {
+      repeated[i] = input[i];
+      reversed[i] = input[input.length - i - 1];
+    }
+    return reversed;
+  }
+  private static class MyOldName extends IOldName.Stub {
+    @Override
+    public String RealName() {
+      return "OldName";
+    }
+  }
+
+  @Override
+  public IOldName GetOldNameInterface() throws RemoteException {
+    return new MyOldName();
+  }
+
+  private static class MyNewName extends INewName.Stub {
+    @Override
+    public String RealName() {
+      return "NewName";
+    }
+  }
+
+  @Override
+  public INewName GetNewNameInterface() throws RemoteException {
+    return new MyNewName();
+  }
+
+  @Override
+  public int[] GetUnionTags(Union[] input) throws RemoteException {
+    int[] tags = new int[input.length];
+    for (int i = 0; i < input.length; i++) {
+      tags[i] = input[i].getTag();
+    }
+    return tags;
+  }
+
+  class MyCppJavaTests extends ICppJavaTests.Stub {
+    @Override
+    public BadParcelable RepeatBadParcelable(BadParcelable input) throws RemoteException {
+      return input;
+    }
+    @Override
+    public SimpleParcelable RepeatSimpleParcelable(SimpleParcelable input, SimpleParcelable repeat)
+        throws RemoteException {
+      repeat.set(input.getName(), input.getNumber());
+      return input;
+    }
+    @Override
+    public GenericStructuredParcelable<Integer, StructuredParcelable, Integer>
+    RepeatGenericParcelable(
+        GenericStructuredParcelable<Integer, StructuredParcelable, Integer> input,
+        GenericStructuredParcelable<Integer, StructuredParcelable, Integer> repeat)
+        throws RemoteException {
+      repeat.a = input.a;
+      repeat.b = input.b;
+      return input;
+    }
+    @Override
+    public PersistableBundle RepeatPersistableBundle(PersistableBundle input)
+        throws RemoteException {
+      return input;
+    }
+    @Override
+    public SimpleParcelable[] ReverseSimpleParcelables(
+        SimpleParcelable[] input, SimpleParcelable[] repeated) throws RemoteException {
+      SimpleParcelable[] reversed = new SimpleParcelable[input.length];
+      for (int i = 0; i < input.length; i++) {
+        repeated[i] = input[i];
+        reversed[i] = input[input.length - i - 1];
+      }
+      return reversed;
+    }
+    @Override
+    public PersistableBundle[] ReversePersistableBundles(
+        PersistableBundle[] input, PersistableBundle[] repeated) throws RemoteException {
+      PersistableBundle[] reversed = new PersistableBundle[input.length];
+      for (int i = 0; i < input.length; i++) {
+        repeated[i] = input[i];
+        reversed[i] = input[input.length - i - 1];
+      }
+      return reversed;
+    }
+    @Override
+    public Union ReverseUnion(Union input, Union repeated) throws RemoteException {
+      int[] repeatedArray = new int[input.getNs().length];
+      int[] reversedArray = ReverseInt(input.getNs(), repeatedArray);
+      repeated.setNs(repeatedArray);
+      return Union.ns(reversedArray);
+    }
+    @Override
+    public List<IBinder> ReverseNamedCallbackList(List<IBinder> input, List<IBinder> repeated)
+        throws RemoteException {
+      ArrayList<IBinder> reversed = new ArrayList<IBinder>();
+      for (IBinder a : input) {
+        repeated.add(a);
+        reversed.add(0, a);
+      }
+      return reversed;
+    }
+    @Override
+    public FileDescriptor RepeatFileDescriptor(FileDescriptor read) throws RemoteException {
+      return read;
+    }
+    @Override
+    public FileDescriptor[] ReverseFileDescriptorArray(
+        FileDescriptor[] input, FileDescriptor[] repeated) throws RemoteException {
+      FileDescriptor[] reversed = new FileDescriptor[input.length];
+      for (int i = 0; i < input.length; i++) {
+        repeated[i] = input[i];
+        reversed[i] = input[input.length - i - 1];
+      }
+      return reversed;
+    }
+  }
+
+  public static class FixedSizeArrayService extends IRepeatFixedSizeArray.Stub {
+    @Override
+    public byte[] RepeatBytes(byte[] input, byte[] repeated) throws RemoteException {
+      for (int i = 0; i < input.length; i++) {
+        repeated[i] = input[i];
+      }
+      return input;
+    }
+    @Override
+    public int[] RepeatInts(int[] input, int[] repeated) throws RemoteException {
+      for (int i = 0; i < input.length; i++) {
+        repeated[i] = input[i];
+      }
+      return input;
+    }
+    @Override
+    public IBinder[] RepeatBinders(IBinder[] input, IBinder[] repeated) throws RemoteException {
+      for (int i = 0; i < input.length; i++) {
+        repeated[i] = input[i];
+      }
+      return input;
+    }
+    @Override
+    public IntParcelable[] RepeatParcelables(IntParcelable[] input, IntParcelable[] repeated)
+        throws RemoteException {
+      for (int i = 0; i < input.length; i++) {
+        repeated[i] = input[i];
+      }
+      return input;
+    }
+    @Override
+    public byte[][] Repeat2dBytes(byte[][] input, byte[][] repeated) throws RemoteException {
+      for (int i = 0; i < input.length; i++) {
+        for (int j = 0; j < input[i].length; j++) {
+          repeated[i][j] = input[i][j];
+        }
+      }
+      return input;
+    }
+    @Override
+    public int[][] Repeat2dInts(int[][] input, int[][] repeated) throws RemoteException {
+      for (int i = 0; i < input.length; i++) {
+        for (int j = 0; j < input[i].length; j++) {
+          repeated[i][j] = input[i][j];
+        }
+      }
+      return input;
+    }
+    @Override
+    public IBinder[][] Repeat2dBinders(IBinder[][] input, IBinder[][] repeated)
+        throws RemoteException {
+      for (int i = 0; i < input.length; i++) {
+        for (int j = 0; j < input[i].length; j++) {
+          repeated[i][j] = input[i][j];
+        }
+      }
+      return input;
+    }
+    @Override
+    public IntParcelable[][] Repeat2dParcelables(
+        IntParcelable[][] input, IntParcelable[][] repeated) throws RemoteException {
+      for (int i = 0; i < input.length; i++) {
+        for (int j = 0; j < input[i].length; j++) {
+          repeated[i][j] = input[i][j];
+        }
+      }
+      return input;
+    }
+  }
+
+  @Override
+  public IBinder GetCppJavaTests() throws RemoteException {
+    return new MyCppJavaTests();
+  }
+  @Override
+  public byte getBackendType() throws RemoteException {
+    return BackendType.JAVA;
+  }
+
+  private static class MyCircular extends ICircular.Stub {
+    private ITestService mSrv;
+
+    MyCircular(ITestService srv) { mSrv = srv; }
+
+    @Override
+    public ITestService GetTestService() {
+      return mSrv;
+    }
+  }
+
+  @Override
+  public ICircular GetCircular(CircularParcelable cp) throws RemoteException {
+    cp.testService = this;
+    return new MyCircular(this);
+  }
+
+  public static class TrunkStableService extends ITrunkStableTest.Stub {
+    @Override
+    public MyParcelable repeatParcelable(MyParcelable input) throws android.os.RemoteException {
+      return input;
+    }
+    @Override
+    public byte repeatEnum(byte input) throws android.os.RemoteException {
+      return input;
+    }
+    @Override
+    public ITrunkStableTest.MyUnion repeatUnion(MyUnion input) throws android.os.RemoteException {
+      return input;
+    }
+    @Override
+    public void callMyCallback(IMyCallback cb) throws android.os.RemoteException {
+      MyParcelable p1, p2;
+      p1 = new MyParcelable();
+      p2 = cb.repeatParcelable(p1);
+
+      byte e1, e2;
+      e1 = MyEnum.THREE;
+      e2 = cb.repeatEnum(e1);
+
+      MyUnion u1, u2;
+      u1 = new MyUnion();
+      u2 = cb.repeatUnion(u1);
+
+      MyOtherParcelable o1, o2;
+      o1 = new MyOtherParcelable();
+      // expected to fail when not using the frozen version
+      try {
+        o2 = cb.repeatOtherParcelable(o1);
+      } catch (RemoteException e) {
+      }
+    }
+    @Override
+    public MyOtherParcelable repeatOtherParcelable(MyOtherParcelable input)
+        throws android.os.RemoteException {
+      return input;
+    }
+
+    @Override
+    public final int getInterfaceVersion() {
+      return super.VERSION;
+    }
+
+    @Override
+    public final String getInterfaceHash() {
+      return super.HASH;
+    }
+  }
+}
diff --git a/tests/java/src/android/aidl/tests/AidlJavaTests.java b/tests/java/src/android/aidl/tests/AidlJavaTests.java
new file mode 100644
index 0000000..178df70
--- /dev/null
+++ b/tests/java/src/android/aidl/tests/AidlJavaTests.java
@@ -0,0 +1,19 @@
+package android.aidl.tests;
+
+import org.junit.internal.TextListener;
+import org.junit.runner.JUnitCore;
+import org.junit.runner.Result;
+
+public class AidlJavaTests {
+
+    public static void main(String[] args) {
+        JUnitCore junit = new JUnitCore();
+        junit.addListener(new TextListener(System.out));
+        Result result = junit.run(ExtensionTests.class, GenericTests.class,
+            JavaOnlyImmutableAnnotationTests.class, MapTests.class, NullableTests.class,
+            TestServiceClient.class, TestVersionedInterface.class, UnionTests.class,
+            VintfTests.class, BuiltInTests.class, DelegatorTests.class, TrunkStableTests.class);
+
+        System.out.println(result.wasSuccessful() ? "TEST SUCCESS" : "TEST FAILURE");
+    }
+}
diff --git a/tests/java/src/android/aidl/tests/BadParcelable.java b/tests/java/src/android/aidl/tests/BadParcelable.java
new file mode 100644
index 0000000..077fbf5
--- /dev/null
+++ b/tests/java/src/android/aidl/tests/BadParcelable.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class BadParcelable implements Parcelable {
+  private boolean mBad;
+  private String mName;
+  private int mNumber;
+
+  BadParcelable() {}
+  BadParcelable(boolean bad, String name, int number) {
+    this.mBad = bad;
+    this.mName = name;
+    this.mNumber = number;
+  }
+
+  public int describeContents() { return 0; }
+
+  public void writeToParcel(Parcel dest, int flags) {
+    dest.writeBoolean(mBad);
+    dest.writeString(mName);
+    dest.writeInt(mNumber);
+    // BAD! write superfluous data
+    if (mBad) {
+      dest.writeInt(42);
+    }
+  }
+
+  public void readFromParcel(Parcel source) {
+    mBad = source.readBoolean();
+    mName = source.readString();
+    mNumber = source.readInt();
+  }
+
+  public boolean equals(Object o) {
+    if (o == null) {
+      return false;
+    }
+    if (!(o instanceof BadParcelable)) {
+      return false;
+    }
+    BadParcelable p = (BadParcelable) o;
+    if (mBad != p.mBad) {
+      return false;
+    }
+    if ((mName == null && p.mName != null) || (mName != null && !mName.equals(p.mName))) {
+      return false;
+    }
+    return mNumber == p.mNumber;
+  }
+
+  public String toString() {
+    return "BadParcelable(bad=" + mBad + ",name=" + mName + ",number=" + mNumber + "}";
+  }
+
+  public static final Parcelable.Creator<BadParcelable> CREATOR =
+      new Parcelable.Creator<BadParcelable>() {
+        public BadParcelable createFromParcel(Parcel source) {
+          BadParcelable p = new BadParcelable();
+          p.readFromParcel(source);
+          return p;
+        }
+
+        public BadParcelable[] newArray(int size) { return new BadParcelable[size]; }
+      };
+}
diff --git a/tests/java/src/android/aidl/tests/BuiltInTests.java b/tests/java/src/android/aidl/tests/BuiltInTests.java
new file mode 100644
index 0000000..4babc37
--- /dev/null
+++ b/tests/java/src/android/aidl/tests/BuiltInTests.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class BuiltInTests {
+  private IBinder mBinder;
+
+  @Before
+  public void setUp() throws RemoteException {
+    mBinder = ServiceManager.waitForService(ITestService.class.getName());
+    assertNotNull(mBinder);
+  }
+
+  @Test
+  public void testPing() {
+    assertTrue(mBinder.pingBinder());
+  }
+
+  @Test
+  public void testInterfaceDescriptor() throws RemoteException {
+    assertThat(mBinder.getInterfaceDescriptor(), is("android.aidl.tests.ITestService"));
+  }
+}
diff --git a/tests/java/src/android/aidl/tests/DelegatorTests.java b/tests/java/src/android/aidl/tests/DelegatorTests.java
new file mode 100644
index 0000000..a01356e
--- /dev/null
+++ b/tests/java/src/android/aidl/tests/DelegatorTests.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class DelegatorTests {
+  static byte kFakeByte = 16;
+  static byte kExpectedByte = 12;
+
+  private class Custom extends ITestService.Delegator {
+    public Custom(ITestService impl) { super(impl); }
+    @Override
+    public byte RepeatByte(byte token) throws RemoteException {
+      return kFakeByte;
+    }
+  }
+
+  @Test
+  public void testDelegator() throws RemoteException {
+    IBinder binder = ServiceManager.waitForService(ITestService.class.getName());
+    assertNotNull(binder);
+    ITestService service = ITestService.Stub.asInterface(binder);
+    ITestService.Delegator delegator = new ITestService.Delegator(service);
+    assertThat(delegator.RepeatByte(kExpectedByte), is(kExpectedByte));
+  }
+
+  @Test
+  public void testCustomDelegator() throws RemoteException {
+    IBinder binder = ServiceManager.waitForService(ITestService.class.getName());
+    assertNotNull(binder);
+    ITestService service = ITestService.Stub.asInterface(binder);
+    ITestService.Delegator custom = new Custom(service);
+    assertThat(custom.RepeatByte(kExpectedByte), is(kFakeByte));
+  }
+
+  @Test
+  public void testAsBinderAsInterface() throws RemoteException {
+    IBinder binder = ServiceManager.waitForService(ITestService.class.getName());
+    assertNotNull(binder);
+    ITestService service = ITestService.Stub.asInterface(binder);
+    ITestService.Delegator delegator = new ITestService.Delegator(service);
+    assertThat(ITestService.Delegator.asInterface(delegator.asBinder()).RepeatByte(kExpectedByte),
+        is(kExpectedByte));
+  }
+}
diff --git a/tests/java/src/android/aidl/tests/ExtensionTests.java b/tests/java/src/android/aidl/tests/ExtensionTests.java
new file mode 100644
index 0000000..d573156
--- /dev/null
+++ b/tests/java/src/android/aidl/tests/ExtensionTests.java
@@ -0,0 +1,249 @@
+/*
+ * Copyright (C) 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsNull.nullValue;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assume.assumeTrue;
+import static org.testng.Assert.assertThrows;
+
+import android.aidl.tests.extension.ExtendableParcelable;
+import android.aidl.tests.extension.MyExt;
+import android.aidl.tests.extension.MyExt2;
+import android.aidl.tests.extension.MyExtLike;
+import android.aidl.tests.nonvintf.NonVintfExtendableParcelable;
+import android.aidl.tests.nonvintf.NonVintfParcelable;
+import android.aidl.tests.unstable.UnstableExtendableParcelable;
+import android.aidl.tests.unstable.UnstableParcelable;
+import android.aidl.tests.vintf.VintfExtendableParcelable;
+import android.aidl.tests.vintf.VintfParcelable;
+import android.os.BadParcelableException;
+import android.os.IBinder;
+import android.os.Parcel;
+import android.os.ParcelableHolder;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import java.util.Arrays;
+import java.util.HashMap;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class ExtensionTests {
+    private VintfExtendableParcelable vep;
+    private VintfParcelable vp;
+
+    private NonVintfExtendableParcelable sep;
+    private NonVintfParcelable sp;
+
+    private UnstableExtendableParcelable uep;
+    private UnstableParcelable up;
+
+    private ITestService mService;
+
+    @Before
+    public void setUp() {
+      IBinder binder = ServiceManager.waitForService(ITestService.class.getName());
+      assertNotNull(binder);
+      mService = ITestService.Stub.asInterface(binder);
+      assertNotNull(mService);
+
+      vep = new VintfExtendableParcelable();
+      vp = new VintfParcelable();
+
+      sep = new NonVintfExtendableParcelable();
+      sp = new NonVintfParcelable();
+
+      uep = new UnstableExtendableParcelable();
+      up = new UnstableParcelable();
+    }
+
+    @Test
+    public void testRepeatExtendableParcelable() throws RemoteException {
+      MyExt ext = new MyExt();
+      ext.a = 42;
+      ext.b = "EXT";
+
+      ExtendableParcelable ep = new ExtendableParcelable();
+      ep.a = 1;
+      ep.b = "a";
+      ep.c = 42L;
+
+      ep.ext.setParcelable(ext);
+
+      ExtendableParcelable ep2 = new ExtendableParcelable();
+      mService.RepeatExtendableParcelable(ep, ep2);
+      assertThat(ep2.a, is(ep.a));
+      assertThat(ep2.b, is(ep.b));
+
+      MyExt retExt = ep2.ext.getParcelable(MyExt.class);
+      assertThat(retExt.a, is(ext.a));
+      assertThat(retExt.b, is(ext.b));
+    }
+
+    @Test
+    public void testVintfParcelableHolderCanContainVintfParcelable() {
+      vep.ext.setParcelable(vp);
+      assertThat(vep.ext.getParcelable(VintfParcelable.class), is(vp));
+    }
+
+    @Test
+    public void testVintfParcelableHolderCannotContainNonVintfParcelable() {
+      assertThrows(BadParcelableException.class, () -> { vep.ext.setParcelable(sp); });
+      assertThat(vep.ext.getParcelable(VintfParcelable.class), is(nullValue()));
+    }
+
+    @Test
+    public void testVintfParcelableHolderCannotContainUnstableParcelable() {
+      assertThrows(BadParcelableException.class, () -> { vep.ext.setParcelable(up); });
+      assertThat(vep.ext.getParcelable(UnstableParcelable.class), is(nullValue()));
+    }
+
+    @Test
+    public void testStableParcelableHolderCanContainVintfParcelable() {
+      sep.ext.setParcelable(vp);
+      assertThat(sep.ext.getParcelable(VintfParcelable.class), is(vp));
+    }
+
+    @Test
+    public void testStableParcelableHolderCanContainNonVintfParcelable() {
+      sep.ext.setParcelable(sp);
+      assertThat(sep.ext.getParcelable(NonVintfParcelable.class), is(sp));
+    }
+
+    @Test
+    public void testStableParcelableHolderCanContainUnstableParcelable() {
+      sep.ext.setParcelable(up);
+      assertThat(sep.ext.getParcelable(UnstableParcelable.class), is(up));
+    }
+
+    @Test
+    public void testUnstableParcelableHolderCanContainVintfParcelable() {
+      uep.ext.setParcelable(vp);
+      assertThat(uep.ext.getParcelable(VintfParcelable.class), is(vp));
+    }
+
+    @Test
+    public void testUnstableParcelableHolderCanContainNonVintfParcelable() {
+      uep.ext.setParcelable(sp);
+      assertThat(uep.ext.getParcelable(NonVintfParcelable.class), is(sp));
+    }
+
+    @Test
+    public void testUnstableParcelableHolderCanContainUnstableParcelable() {
+      uep.ext.setParcelable(up);
+      assertThat(uep.ext.getParcelable(UnstableParcelable.class), is(up));
+    }
+
+    @Test
+    public void testReadWriteExtension() {
+        MyExt ext = new MyExt();
+        ext.a = 42;
+        ext.b = "EXT";
+
+        MyExt2 ext2 = new MyExt2();
+        ext2.a = 42;
+        ext2.b = new MyExt();
+        ext2.b.a = 24;
+        ext2.b.b = "INEXT";
+        ext2.c = "EXT2";
+
+        Parcel parcel = Parcel.obtain();
+        {
+            ExtendableParcelable ep = new ExtendableParcelable();
+            ep.a = 1;
+            ep.b = "a";
+            ep.c = 42L;
+
+            ep.ext.setParcelable(ext);
+
+            ep.ext2.setParcelable(ext2);
+            // The extension type must be MyExt, so it has to fail
+            // even though MyExtLike has the same structure as MyExt.
+            assertThrows(BadParcelableException.class,
+                () -> { MyExtLike extLike = ep.ext.<MyExtLike>getParcelable(MyExtLike.class); });
+
+            MyExt actualExt = ep.ext.getParcelable(MyExt.class);
+            MyExt2 actualExt2 = ep.ext2.getParcelable(MyExt2.class);
+
+            checkContent(ep, ext, ext2);
+
+            ep.writeToParcel(parcel, 0);
+        }
+
+        parcel.setDataPosition(0);
+        {
+            ExtendableParcelable ep1 = new ExtendableParcelable();
+            ep1.readFromParcel(parcel);
+
+            parcel.setDataPosition(0);
+            ep1.writeToParcel(parcel, 0);
+            parcel.setDataPosition(0);
+
+            ExtendableParcelable ep2 = new ExtendableParcelable();
+
+            ep2.readFromParcel(parcel);
+
+            // The extension type must be MyExt, so it has to fail
+            // even though MyExtLike has the same structure as MyExt.
+            assertThrows(BadParcelableException.class,
+                () -> { MyExtLike extLike = ep2.ext.<MyExtLike>getParcelable(MyExtLike.class); });
+
+            MyExt actualExt = ep2.ext.getParcelable(MyExt.class);
+
+            MyExt2 newExt2 = new MyExt2();
+            newExt2.a = 79;
+            newExt2.b = new MyExt();
+            newExt2.b.a = 42;
+            newExt2.b.b = "INNEWEXT";
+            newExt2.c = "NEWEXT2";
+            ep2.ext2.setParcelable(newExt2);
+            checkContent(ep1, ext, ext2);
+            checkContent(ep2, ext, newExt2);
+        }
+    }
+
+    private void checkContent(ExtendableParcelable ep, MyExt ext, MyExt2 ext2) {
+        assertThat(ep.a, is(1));
+        assertThat(ep.b, is("a"));
+        assertThat(ep.c, is(42L));
+
+        MyExt actualExt = ep.ext.getParcelable(MyExt.class);
+        assertThat(dumpMyExt(actualExt), is(dumpMyExt(ext)));
+
+        MyExt2 actualExt2 = ep.ext2.getParcelable(MyExt2.class);
+        assertThat(dumpMyExt2(actualExt2), is(dumpMyExt2(ext2)));
+    }
+
+    private static String dumpMyExt(MyExt ext) {
+        if (ext == null) {
+            return null;
+        }
+        return "{a: " + ext.a + ", b: " + ext.b + "}";
+    }
+
+    private static String dumpMyExt2(MyExt2 ext2) {
+        if (ext2 == null) {
+            return null;
+        }
+        return "{a: " + ext2.a + ", b: " + dumpMyExt(ext2.b) + ", " + ext2.c + "}";
+    }
+}
diff --git a/tests/java/src/android/aidl/tests/GenericTests.java b/tests/java/src/android/aidl/tests/GenericTests.java
new file mode 100644
index 0000000..4b9b910
--- /dev/null
+++ b/tests/java/src/android/aidl/tests/GenericTests.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2019, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+import android.aidl.tests.IntEnum;
+import android.aidl.tests.generic.Baz;
+import android.aidl.tests.generic.IFaz;
+import android.aidl.tests.generic.Pair;
+import android.os.IBinder;
+import android.os.RemoteException;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class GenericTests {
+
+    @Test
+    public void testGeneric() throws RemoteException {
+        IFaz.Stub ifaz = new IFaz.Stub() {
+            public Pair<Integer, String> getPair() {
+                Pair<Integer, String> ret = new Pair<Integer, String>();
+                ret.mFirst = 15;
+                ret.mSecond = "My";
+                return ret;
+            }
+            public Pair<Baz, Baz> getPair2() {
+                Pair<Baz, Baz> ret = new Pair<Baz, Baz>();
+                ret.mFirst = new Baz();
+                ret.mFirst.a = 15;
+                ret.mSecond = new Baz();
+                ret.mSecond.a = 16;
+                return ret;
+            }
+
+            public Pair<Integer, Integer> getPair3() {
+              Pair<Integer, Integer> ret = new Pair<Integer, Integer>();
+              ret.mFirst = 15;
+              ret.mSecond = IntEnum.BAR;
+              return ret;
+            }
+        };
+
+        IFaz service = IFaz.Stub.asInterface(ifaz);
+        assertThat(service.getPair().mFirst, is(15));
+        assertThat(service.getPair().mSecond, is("My"));
+
+        assertThat(service.getPair2().mFirst.a, is(15));
+        assertThat(service.getPair2().mSecond.a, is(16));
+
+        assertThat(service.getPair3().mFirst, is(15));
+        assertThat(service.getPair3().mSecond, is(IntEnum.BAR));
+    }
+}
diff --git a/tests/java/src/android/aidl/tests/JavaOnlyImmutableAnnotationTests.java b/tests/java/src/android/aidl/tests/JavaOnlyImmutableAnnotationTests.java
new file mode 100644
index 0000000..a4ea0e4
--- /dev/null
+++ b/tests/java/src/android/aidl/tests/JavaOnlyImmutableAnnotationTests.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright (C) 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+import android.aidl.tests.immutable.Bar;
+import android.aidl.tests.immutable.Foo;
+import android.aidl.tests.immutable.Union;
+import android.os.Parcel;
+import android.os.RemoteException;
+import java.lang.UnsupportedOperationException;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class JavaOnlyImmutableAnnotationTests {
+  @Test
+  public void testReadWriteJavaOnlyImmutableParcelable() {
+    Parcel parcel = Parcel.obtain();
+    List<Bar> list = new ArrayList<Bar>();
+    list.add(new Bar("aa"));
+    Map<String, Bar> map = new HashMap<String, Bar>();
+    map.put("key", new Bar("value"));
+    Bar[] array = new Bar[3];
+    array[0] = new Bar("zero");
+    array[1] = new Bar("one");
+    array[2] = new Bar("two");
+
+    Foo foo = new Foo(7, new Bar("my"), list, map, array, Union.num(42));
+    foo.writeToParcel(parcel, 0);
+    parcel.setDataPosition(0);
+    Foo foo2 = Foo.CREATOR.createFromParcel(parcel);
+
+    assertThat(foo.a, is(foo2.a));
+    assertThat(foo.b.s, is(foo2.b.s));
+    assertThat(foo.c.size(), is(foo.c.size()));
+    assertThat(foo.c.get(0).s, is(foo2.c.get(0).s));
+    assertThat(foo.c.size(), is(foo.c.size()));
+    assertThat(foo.d.get("key").s, is(foo2.d.get("key").s));
+    assertThat(foo.e.length, is(foo.e.length));
+
+    for (int i = 0; i < foo.e.length; i++) {
+      assertThat(foo.e[i].s, is(foo2.e[i].s));
+    }
+
+    assertThat(foo.u.getNum(), is(foo2.u.getNum()));
+  }
+
+  @Test
+  public void testEveryFieldIsFinal() {
+    for (Field f : Foo.class.getDeclaredFields()) {
+      if (!Modifier.isFinal(f.getModifiers())) {
+        fail(f.getName() + " should be final.");
+      }
+    }
+  }
+
+  @Test(expected = UnsupportedOperationException.class)
+  public void testListIsUnmodifiable() {
+    Foo foo = new Foo(7, new Bar("my"), new ArrayList<Bar>(), new HashMap<String, Bar>(),
+        new Bar[5], Union.num(42));
+    foo.c.add(new Bar("hi"));
+    // It is supposed to fail.
+    fail("A List in an immutable parcelable isn't modifiable.");
+  }
+
+  @Test(expected = UnsupportedOperationException.class)
+  public void testMapIsUnmodifiable() {
+    Foo foo = new Foo(7, new Bar("my"), new ArrayList<Bar>(), new HashMap<String, Bar>(),
+        new Bar[5], Union.num(42));
+    foo.d.put("key", new Bar("value"));
+    // It is supposed to fail.
+    fail("A Map in an immutable parcelable isn't modifiable.");
+  }
+
+  @Test
+  public void testBuilderRespectDefaultValue() {
+    assertThat(new Foo.Builder().build().a, is(10));
+    assertThat(new Bar.Builder().build().s, is("bar"));
+  }
+
+  @Test
+  public void testBuilder() {
+    Bar b = new Bar("my");
+    List<Bar> list = new ArrayList<Bar>();
+    list.add(new Bar("aa"));
+    Map<String, Bar> map = new HashMap<String, Bar>();
+    map.put("key", new Bar("value"));
+    Bar[] array = new Bar[3];
+    array[0] = new Bar("zero");
+    array[1] = new Bar("one");
+    array[2] = new Bar("two");
+
+    Foo foo = new Foo(7, b, list, map, array, Union.num(42));
+    Foo foo2 = new Foo.Builder()
+                   .setA(7)
+                   .setB(b)
+                   .setC(list)
+                   .setD(map)
+                   .setE(array)
+                   .setU(Union.num(42))
+                   .build();
+
+    assertThat(foo.a, is(foo2.a));
+    assertThat(foo.b.s, is(foo2.b.s));
+    assertThat(foo.c.size(), is(foo.c.size()));
+    assertThat(foo.c.get(0).s, is(foo2.c.get(0).s));
+    assertThat(foo.c.size(), is(foo.c.size()));
+    assertThat(foo.d.get("key").s, is(foo2.d.get("key").s));
+    assertThat(foo.e.length, is(foo.e.length));
+
+    for (int i = 0; i < foo.e.length; i++) {
+      assertThat(foo.e[i].s, is(foo2.e[i].s));
+    }
+
+    assertThat(foo.u.getNum(), is(foo2.u.getNum()));
+  }
+}
diff --git a/tests/java/src/android/aidl/tests/MapTests.java b/tests/java/src/android/aidl/tests/MapTests.java
new file mode 100644
index 0000000..1bb81cd
--- /dev/null
+++ b/tests/java/src/android/aidl/tests/MapTests.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2019, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+import android.aidl.tests.map.Bar;
+import android.aidl.tests.map.Foo;
+import android.aidl.tests.map.IEmpty;
+import android.aidl.tests.map.IntEnum;
+import android.os.Parcel;
+import java.util.HashMap;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class MapTests {
+
+    @Test
+    public void testWriteAndThenReadMaps() {
+        Parcel parcel = Parcel.obtain();
+
+        // Write
+        Foo foo = new Foo();
+
+        foo.intEnumArrayMap = new HashMap<>();
+        foo.intEnumArrayMap.put("Foo", new int[] {IntEnum.FOO});
+
+        foo.intArrayMap = new HashMap<>();
+        foo.intArrayMap.put("Foo", new int[] {42});
+
+        Bar bar = new Bar();
+        bar.a = 42;
+        bar.b = "Bar";
+        foo.barMap = new HashMap<>();
+        foo.barMap.put("Foo", bar);
+
+        foo.barArrayMap = new HashMap<>();
+        foo.barArrayMap.put("Foo", new Bar[] {bar});
+
+        foo.stringMap = new HashMap<>();
+        foo.stringMap.put("Foo", "Bar");
+
+        foo.stringArrayMap = new HashMap<>();
+        foo.stringArrayMap.put("Foo", new String[] {"Bar"});
+
+        IEmpty intf = new IEmpty.Stub() {};
+        foo.interfaceMap = new HashMap<>();
+        foo.interfaceMap.put("Foo", intf);
+
+        foo.ibinderMap = new HashMap<>();
+        foo.ibinderMap.put("Foo", intf.asBinder());
+
+        foo.writeToParcel(parcel, 0);
+
+        // And then read
+        parcel.setDataPosition(0);
+
+        Foo readFoo = new Foo();
+        readFoo.readFromParcel(parcel);
+
+        assertThat(readFoo.intEnumArrayMap.size(), is(1));
+        assertThat(readFoo.intEnumArrayMap.get("Foo"), is(new int[] {IntEnum.FOO}));
+
+        assertThat(readFoo.intArrayMap.size(), is(1));
+        assertThat(readFoo.intArrayMap.get("Foo"), is(new int[] {42}));
+
+        assertThat(readFoo.barMap.containsKey("Foo"), is(true));
+        assertThat(readFoo.barMap.size(), is(1));
+
+        Bar readBar = readFoo.barMap.get("Foo");
+        assertThat(readBar.a, is(42));
+        assertThat(readBar.b, is("Bar"));
+
+        Bar[] bars = readFoo.barArrayMap.get("Foo");
+        assertThat(bars.length, is(1));
+        assertThat(bars[0].a, is(42));
+        assertThat(bars[0].b, is("Bar"));
+
+        assertThat(readFoo.stringMap.size(), is(1));
+        assertThat(readFoo.stringMap.get("Foo"), is("Bar"));
+
+        String[] strings = readFoo.stringArrayMap.get("Foo");
+        assertThat(strings.length, is(1));
+        assertThat(strings[0], is("Bar"));
+
+        assertThat(readFoo.interfaceMap.size(), is(1));
+        assertThat(readFoo.interfaceMap.get("Foo"), is(intf));
+
+        assertThat(readFoo.ibinderMap.size(), is(1));
+        assertThat(readFoo.ibinderMap.get("Foo"), is(intf.asBinder()));
+    }
+}
diff --git a/tests/java/src/android/aidl/tests/NestedTypesTests.java b/tests/java/src/android/aidl/tests/NestedTypesTests.java
new file mode 100644
index 0000000..c5851d5
--- /dev/null
+++ b/tests/java/src/android/aidl/tests/NestedTypesTests.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assume.assumeTrue;
+
+import android.aidl.tests.nested.INestedService;
+import android.aidl.tests.nested.ParcelableWithNested;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class NestedTypesTests {
+  @Test
+  public void testUseNestedTypes() throws RemoteException {
+    IBinder binder = ServiceManager.waitForService(INestedService.class.getName());
+    assertNotNull(binder);
+    INestedService nestedService = INestedService.Stub.asInterface(binder);
+    assertNotNull(nestedService);
+
+    // OK -> NOT_OK
+    ParcelableWithNested p = new ParcelableWithNested();
+    p.status = ParcelableWithNested.Status.OK;
+    INestedService.Result result = nestedService.flipStatus(p);
+    assertThat(result, is(ParcelableWithNested.Status.NOT_OK));
+
+    // NOT_OK -> OK with nested callback interface
+    class Callback extends INestedService.ICallback.Stub {
+      byte received = ParcelableWithNested.Status.NOT_OK;
+      @Override
+      public void done(byte st) {
+        received = st;
+      }
+    }
+    Callback cb = new Callback();
+    nestedService.flipStatusWithCallback(p.status, cb);
+    assertThat(cb.received, is(ParcelableWithNested.Status.OK));
+  }
+}
diff --git a/tests/java/src/android/aidl/tests/NullableTests.java b/tests/java/src/android/aidl/tests/NullableTests.java
new file mode 100644
index 0000000..2cab3a2
--- /dev/null
+++ b/tests/java/src/android/aidl/tests/NullableTests.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2016, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsNull.notNullValue;
+import static org.hamcrest.core.IsNull.nullValue;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
+
+import android.os.Binder;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class NullableTests {
+    private ITestService mService;
+    private ICppJavaTests mCppJavaTests;
+
+    @Before
+    public void setUp() throws RemoteException {
+        IBinder binder = ServiceManager.waitForService(ITestService.class.getName());
+        assertNotNull(binder);
+        mService = ITestService.Stub.asInterface(binder);
+        assertNotNull(mService);
+
+        IBinder binder2 = mService.GetCppJavaTests();
+        if (binder2 != null) {
+            mCppJavaTests = ICppJavaTests.Stub.asInterface(binder2);
+        }
+    }
+
+    @Test
+    public void testExpectNpeWithNullString() throws RemoteException {
+        try {
+            String response = mService.RepeatString(null);
+        } catch (NullPointerException ex) {
+            return;
+        }
+        if (mService.getBackendType() != BackendType.JAVA) {
+          fail("NullPointerException was expected, but wasn't thrown");
+        }
+    }
+
+    @Test
+    public void testRepeatNullableParcelableArray() throws RemoteException {
+      ITestService.Empty[] input = {new ITestService.Empty(), null};
+      assertThat(mService.RepeatNullableParcelableArray(input), is(input));
+      assertThat(mService.RepeatNullableParcelableArray(null), is(nullValue()));
+    }
+
+    @Test
+    public void testRepeatNullableParcelableList() throws RemoteException {
+      List<ITestService.Empty> input = Arrays.asList(new ITestService.Empty(), null);
+      assertThat(mService.RepeatNullableParcelableList(input), is(input));
+      assertThat(mService.RepeatNullableParcelableList(null), is(nullValue()));
+    }
+
+    @Test
+    public void testExpectNpeWithNullBinder() throws RemoteException {
+        try {
+            mService.TakesAnIBinder(null);
+        } catch (NullPointerException ex) {
+            return;
+        }
+
+        if (mService.getBackendType() != BackendType.JAVA) {
+          fail("NullPointerException was expected, but wasn't thrown");
+        }
+    }
+
+    @Test
+    public void testExpectNpeWithNullBinderList() throws RemoteException {
+        List<IBinder> listWithNulls = new ArrayList<IBinder>();
+        listWithNulls.add(null);
+        try {
+          mService.TakesAnIBinderList(listWithNulls);
+        } catch (NullPointerException ex) {
+            return;
+        }
+        if (mService.getBackendType() != BackendType.JAVA) {
+          fail("NullPointerException was expected, but wasn't thrown");
+        }
+    }
+
+    @Test
+    public void testReverseIBinderArray() throws RemoteException {
+      IBinder[] input = {new Binder(), new Binder()};
+      IBinder[] repeated = new IBinder[input.length];
+      IBinder[] reversed = mService.ReverseIBinderArray(input, repeated);
+
+      assertThat(repeated, is(input));
+      assertThat(reversed.length, is(input.length));
+      for (int i = 0; i < input.length; ++i) {
+        int j = reversed.length - (1 + i);
+        assertThat(reversed[j], is(input[i]));
+      }
+    }
+
+    @Test
+    public void testReverseNullableIBinderArray() throws RemoteException {
+      IBinder[] input = {new Binder(), null};
+      IBinder[] repeated = new IBinder[input.length];
+      IBinder[] reversed = mService.ReverseNullableIBinderArray(input, repeated);
+
+      assertThat(repeated, is(input));
+      assertThat(reversed.length, is(input.length));
+      for (int i = 0; i < input.length; ++i) {
+        int j = reversed.length - (1 + i);
+        assertThat(reversed[j], is(input[i]));
+      }
+    }
+
+    @Test
+    public void testNullableIInterface() throws RemoteException {
+        INamedCallback callback  = mService.GetCallback(false);
+        assertThat(callback, is(notNullValue()));
+
+        callback = mService.GetCallback(true);
+        assertThat(callback, is(nullValue()));
+    }
+}
diff --git a/tests/java/src/android/aidl/tests/SimpleParcelable.java b/tests/java/src/android/aidl/tests/SimpleParcelable.java
new file mode 100644
index 0000000..d3918c7
--- /dev/null
+++ b/tests/java/src/android/aidl/tests/SimpleParcelable.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class SimpleParcelable implements Parcelable {
+    private String mName;
+    private int mNumber;
+
+    SimpleParcelable() {}
+    SimpleParcelable(String name, int number) { set(name, number); }
+
+    public int describeContents() { return 0; }
+
+    public void set(String name, int number) {
+      mName = name;
+      mNumber = number;
+    }
+
+    public String getName() { return mName; }
+    public int getNumber() { return mNumber; }
+
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(mName);
+        dest.writeInt(mNumber);
+    }
+
+    public void readFromParcel(Parcel source) {
+        mName = source.readString();
+        mNumber = source.readInt();
+    }
+
+    public boolean equals(Object o) {
+        if (o == null) {
+            return false;
+        }
+        if (!(o instanceof SimpleParcelable)) {
+            return false;
+        }
+        SimpleParcelable p = (SimpleParcelable)o;
+        if ((mName == null && p.mName != null) ||
+            (mName != null && !mName.equals(p.mName))) {
+            return false;
+        }
+        return mNumber == p.mNumber;
+    }
+
+    public String toString() {
+        return "SimpleParcelable(" + mName + ", " + mNumber + ")";
+    }
+
+    public static final Parcelable.Creator<SimpleParcelable> CREATOR =
+            new Parcelable.Creator<SimpleParcelable>() {
+        public SimpleParcelable createFromParcel(Parcel source) {
+            String name = source.readString();
+            int number = source.readInt();
+            return new SimpleParcelable(name, number);
+        }
+
+        public SimpleParcelable[] newArray(int size) {
+            return new SimpleParcelable[size];
+        }
+    };
+}
diff --git a/tests/java/src/android/aidl/tests/TestServiceClient.java b/tests/java/src/android/aidl/tests/TestServiceClient.java
new file mode 100644
index 0000000..2cc17b2
--- /dev/null
+++ b/tests/java/src/android/aidl/tests/TestServiceClient.java
@@ -0,0 +1,1058 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsNull.notNullValue;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeTrue;
+
+import android.aidl.fixedsizearray.FixedSizeArrayExample.IRepeatFixedSizeArray;
+import android.aidl.fixedsizearray.FixedSizeArrayExample.IntParcelable;
+import android.aidl.tests.BadParcelable;
+import android.aidl.tests.ByteEnum;
+import android.aidl.tests.GenericStructuredParcelable;
+import android.aidl.tests.INamedCallback;
+import android.aidl.tests.ITestService;
+import android.aidl.tests.ITestService.CompilerChecks;
+import android.aidl.tests.IntEnum;
+import android.aidl.tests.LongEnum;
+import android.aidl.tests.SimpleParcelable;
+import android.aidl.tests.StructuredParcelable;
+import android.aidl.tests.Union;
+import android.aidl.versioned.tests.IFooInterface;
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.os.BadParcelableException;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.os.ParcelFileDescriptor;
+import android.os.Parcelable;
+import android.os.PersistableBundle;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import android.os.ServiceSpecificException;
+import android.util.Log;
+import java.io.File;
+import java.io.FileDescriptor;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class TestServiceClient {
+    private ITestService service;
+    private ICppJavaTests cpp_java_tests;
+
+    @Before
+    public void setUp() throws RemoteException {
+        IBinder binder = ServiceManager.waitForService(ITestService.class.getName());
+        assertNotNull(binder);
+        service = ITestService.Stub.asInterface(binder);
+        assertNotNull(service);
+
+        IBinder binder2 = service.GetCppJavaTests();
+        if (binder2 != null) {
+            cpp_java_tests = ICppJavaTests.Stub.asInterface(binder2);
+        }
+    }
+
+    @Test
+    public void testBinderIdentity() throws RemoteException {
+        IBinder binder = ServiceManager.waitForService(ITestService.class.getName());
+
+        assertEquals(binder, service.asBinder());
+    }
+
+    @Test
+    public void testOneway() throws RemoteException {
+      service.TestOneway();
+    }
+
+    @Test
+    public void testBooleanRepeat() throws RemoteException {
+        boolean query = true;
+        assertThat(service.RepeatBoolean(query), is(query));
+    }
+
+    @Test
+    public void testCharRepeat() throws RemoteException {
+        char query = 'A';
+        assertThat(service.RepeatChar(query), is(query));
+    }
+
+    @Test
+    public void testByteRepeat() throws RemoteException {
+        byte query = -128;
+        assertThat(service.RepeatByte(query), is(query));
+    }
+
+    @Test
+    public void testIntRepeat() throws RemoteException {
+        int query = 1 << 30;
+        assertThat(service.RepeatInt(query), is(query));
+    }
+
+    @Test
+    public void testConstRepeat() throws RemoteException {
+        int query[] = {ITestService.CONSTANT, ITestService.CONSTANT2, ITestService.CONSTANT3,
+            ITestService.CONSTANT4, ITestService.CONSTANT5, ITestService.CONSTANT6,
+            ITestService.CONSTANT7, ITestService.CONSTANT8};
+        for (int i = 0; i < query.length; i++) {
+            assertThat(service.RepeatInt(query[i]), is(query[i]));
+        }
+    }
+
+    @Test
+    public void testConstFloatRepeat() throws RemoteException {
+        float query[] = {ITestService.FLOAT_CONSTANT, ITestService.FLOAT_CONSTANT2,
+            ITestService.FLOAT_CONSTANT3, ITestService.FLOAT_CONSTANT4,
+            ITestService.FLOAT_CONSTANT5, ITestService.FLOAT_CONSTANT6,
+            ITestService.FLOAT_CONSTANT7};
+        for (int i = 0; i < query.length; i++) {
+            assertThat(service.RepeatFloat(query[i]), is(query[i]));
+        }
+    }
+
+    @Test
+    public void testConstDoubleRepeat() throws RemoteException {
+        double query[] = {ITestService.DOUBLE_CONSTANT, ITestService.DOUBLE_CONSTANT2,
+            ITestService.DOUBLE_CONSTANT3, ITestService.DOUBLE_CONSTANT4,
+            ITestService.DOUBLE_CONSTANT5, ITestService.DOUBLE_CONSTANT6,
+            ITestService.DOUBLE_CONSTANT7};
+        for (int i = 0; i < query.length; i++) {
+            assertThat(service.RepeatDouble(query[i]), is(query[i]));
+        }
+    }
+
+    @Test
+    public void testLongRepeat() throws RemoteException {
+        long query = 1L << 60;
+        assertThat(service.RepeatLong(query), is(query));
+    }
+
+    @Test
+    public void testFloatRepeat() throws RemoteException {
+        float query = 1.0f/3.0f;
+        assertThat(service.RepeatFloat(query), is(query));
+    }
+
+    @Test
+    public void testDoubleRepeat() throws RemoteException {
+        double query = 1.0/3.0;
+        assertThat(service.RepeatDouble(query), is(query));
+    }
+
+    @Test
+    public void testByteEnumRepeat() throws RemoteException {
+        byte query = ByteEnum.FOO;
+        assertThat(service.RepeatByteEnum(query), is(query));
+    }
+
+    @Test
+    public void testIntEnumRepeat() throws RemoteException {
+        int query = IntEnum.FOO;
+        assertThat(service.RepeatIntEnum(query), is(query));
+    }
+
+    @Test
+    public void testLongEnumRepeat() throws RemoteException {
+        long query = LongEnum.FOO;
+        assertThat(service.RepeatLongEnum(query), is(query));
+    }
+
+    @Test
+    public void testStringListRepeat() throws RemoteException {
+        List<String> queries = Arrays.asList(
+            "not empty", "", "\0", ITestService.STRING_CONSTANT, ITestService.STRING_CONSTANT2);
+        for (String query : queries) {
+            assertThat(service.RepeatString(query), is(query));
+        }
+    }
+
+    @Test
+    public void testBooleanArrayReversal() throws RemoteException {
+        boolean[] input = {true, false, false, false};
+        boolean echoed[] = new boolean[input.length];
+        boolean[] reversed = service.ReverseBoolean(input, echoed);
+        assertThat(echoed, is(input));
+        assertThat(reversed.length, is(input.length));
+        for (int i = 0; i < input.length; ++i) {
+            int j = reversed.length - (1 + i);
+            assertThat(reversed[j], is(input[i]));
+        }
+    }
+
+    @Test
+    public void testByteArrayReversal() throws RemoteException {
+        byte[] input = {0, 1, 2};
+        byte echoed[] = new byte[input.length];
+        byte[] reversed = service.ReverseByte(input, echoed);
+        assertThat(echoed, is(input));
+        assertThat(reversed.length, is(input.length));
+        for (int i = 0; i < input.length; ++i) {
+            int j = reversed.length - (1 + i);
+            assertThat(reversed[j], is(input[i]));
+        }
+    }
+
+    @Test
+    public void testCharArrayReversal() throws RemoteException {
+        char[] input = {'A', 'B', 'C', 'D', 'E'};
+        char echoed[] = new char[input.length];
+        char[] reversed = service.ReverseChar(input, echoed);
+        assertThat(echoed, is(input));
+        assertThat(reversed.length, is(input.length));
+        for (int i = 0; i < input.length; ++i) {
+            int j = reversed.length - (1 + i);
+            assertThat(reversed[j], is(input[i]));
+        }
+    }
+
+    @Test
+    public void testIntArrayReversal() throws RemoteException {
+        int[] input = {-1, 0, 1, 2, 3, 4, 5, 6};
+        int echoed[] = new int[input.length];
+        int[] reversed = service.ReverseInt(input, echoed);
+        assertThat(echoed, is(input));
+        assertThat(reversed.length, is(input.length));
+        for (int i = 0; i < input.length; ++i) {
+            int j = reversed.length - (1 + i);
+            assertThat(reversed[j], is(input[i]));
+        }
+    }
+
+    @Test
+    public void testLongArrayReversal() throws RemoteException {
+        long[] input = {-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8};
+        long echoed[] = new long[input.length];
+        long[] reversed = service.ReverseLong(input, echoed);
+        assertThat(echoed, is(input));
+        assertThat(reversed.length, is(input.length));
+        for (int i = 0; i < input.length; ++i) {
+            int j = reversed.length - (1 + i);
+            assertThat(reversed[j], is(input[i]));
+        }
+    }
+
+    @Test
+    public void testFloatArrayReversal() throws RemoteException {
+        float[] input = {0.0f, 1.0f, -0.3f};
+        float echoed[] = new float[input.length];
+        float[] reversed = service.ReverseFloat(input, echoed);
+        assertThat(echoed, is(input));
+        assertThat(reversed.length, is(input.length));
+        for (int i = 0; i < input.length; ++i) {
+            int j = reversed.length - (1 + i);
+            assertThat(reversed[j], is(input[i]));
+        }
+    }
+
+    @Test
+    public void testDoubleArrayReversal() throws RemoteException {
+        double[] input = {-1.0, -4.0, -2.0};
+        double echoed[] = new double[input.length];
+        double[] reversed = service.ReverseDouble(input, echoed);
+        assertThat(echoed, is(input));
+        assertThat(reversed.length, is(input.length));
+        for (int i = 0; i < input.length; ++i) {
+            int j = reversed.length - (1 + i);
+            assertThat(reversed[j], is(input[i]));
+        }
+    }
+
+    @Test
+    public void testStringArrayReversal() throws RemoteException {
+        String[] input = {"For", "relaxing", "times"};
+        String echoed[] = new String[input.length];
+        String[] reversed = service.ReverseString(input, echoed);
+        assertThat(echoed, is(input));
+        assertThat(reversed.length, is(input.length));
+        for (int i = 0; i < input.length; ++i) {
+            int j = reversed.length - (1 + i);
+            assertThat(reversed[j], is(input[i]));
+        }
+    }
+
+    @Test
+    public void testBinderExchange() throws RemoteException {
+        INamedCallback got = service.GetOtherTestService("Smythe");
+        assertThat(got.GetName(), is("Smythe"));
+
+        assertThat(service.VerifyName(got, "Smythe"), is(true));
+    }
+
+    @Test
+    public void testBinderArrayExchange() throws RemoteException {
+      String[] names = {"Fizz", "Buzz"};
+      INamedCallback[] got = service.GetInterfaceArray(names);
+      assertThat(got[0].GetName(), is(names[0]));
+      assertThat(got[1].GetName(), is(names[1]));
+
+      assertThat(service.VerifyNamesWithInterfaceArray(got, names), is(true));
+    }
+
+    @Test
+    public void testNullableBinderArrayExchange() throws RemoteException {
+      String[] names = {"Fizz", null, "Buzz"};
+      INamedCallback[] got = service.GetNullableInterfaceArray(names);
+      assertThat(got[0].GetName(), is(names[0]));
+      assertNull(got[1]);
+      assertThat(got[2].GetName(), is(names[2]));
+
+      assertThat(service.VerifyNamesWithNullableInterfaceArray(got, names), is(true));
+    }
+
+    @Test
+    public void testInterfaceListExchange() throws RemoteException {
+      String[] names = {"Fizz", null, "Buzz"};
+      List<INamedCallback> got = service.GetInterfaceList(names);
+      assertThat(got.get(0).GetName(), is(names[0]));
+      assertNull(got.get(1));
+      assertThat(got.get(2).GetName(), is(names[2]));
+
+      assertThat(service.VerifyNamesWithInterfaceList(got, names), is(true));
+    }
+
+    @Test
+    public void testListReversal() throws RemoteException {
+        List<String> input = Arrays.asList("Walk", "into", "Córdoba");
+        List<String> echoed = new ArrayList<String>();
+        List<String> reversed = service.ReverseStringList(input, echoed);
+        assertThat(echoed, is(input));
+
+        Collections.reverse(input);
+        assertThat(reversed, is(input));
+    }
+
+    @Test
+    public void testRepeatGenericParcelable() throws RemoteException {
+      assumeTrue(cpp_java_tests != null);
+
+      GenericStructuredParcelable<Integer, StructuredParcelable, Integer> input =
+          new GenericStructuredParcelable<Integer, StructuredParcelable, Integer>();
+      GenericStructuredParcelable<Integer, StructuredParcelable, Integer> out_param =
+          new GenericStructuredParcelable<Integer, StructuredParcelable, Integer>();
+      input.a = 41;
+      input.b = 42;
+      GenericStructuredParcelable<Integer, StructuredParcelable, Integer> testing = input;
+      assertThat(testing, is(input));
+      GenericStructuredParcelable<Integer, StructuredParcelable, Integer> returned =
+          cpp_java_tests.RepeatGenericParcelable(input, out_param);
+      assertThat(out_param.a, is(input.a));
+      assertThat(out_param.b, is(input.b));
+      assertThat(returned.a, is(input.a));
+      assertThat(returned.b, is(input.b));
+    }
+
+    @Test
+    public void testBadParcelable() throws RemoteException {
+      assumeTrue(cpp_java_tests != null);
+      BadParcelable bad = new BadParcelable(/*bad=*/true, "foo", 42);
+      Throwable error =
+          assertThrows(BadParcelableException.class, () -> cpp_java_tests.RepeatBadParcelable(bad));
+      assertTrue(error.getMessage().contains("Parcel data not fully consumed"));
+
+      BadParcelable notBad = new BadParcelable(/*bad=*/false, "foo", 42);
+      BadParcelable output = cpp_java_tests.RepeatBadParcelable(notBad);
+      assertThat(notBad, is(output));
+    }
+
+    @Test
+    public void testRepeatParcelable() throws RemoteException {
+        assumeTrue(cpp_java_tests != null);
+
+        SimpleParcelable input = new SimpleParcelable("foo", 42);
+        SimpleParcelable out_param = new SimpleParcelable();
+        SimpleParcelable returned = cpp_java_tests.RepeatSimpleParcelable(input, out_param);
+        assertThat(out_param, is(input));
+        assertThat(returned, is(input));
+    }
+
+    @Test
+    public void testReverseParcelable() throws RemoteException {
+        assumeTrue(cpp_java_tests != null);
+
+        SimpleParcelable[] input = new SimpleParcelable[3];
+        input[0] = new SimpleParcelable("a", 1);
+        input[1] = new SimpleParcelable("b", 2);
+        input[2] = new SimpleParcelable("c", 3);
+        SimpleParcelable[] repeated = new SimpleParcelable[3];
+        SimpleParcelable[] reversed = cpp_java_tests.ReverseSimpleParcelables(input, repeated);
+        assertThat(repeated, is(input));
+        assertThat(reversed.length, is(input.length));
+        for (int i = 0, k = input.length - 1; i < input.length; ++i, --k) {
+            assertThat(reversed[k], is(input[i]));
+        }
+    }
+
+    @Test
+    public void testRepeatEmptyPersistableBundle() throws RemoteException {
+        assumeTrue(cpp_java_tests != null);
+
+        PersistableBundle emptyBundle = new PersistableBundle();
+        PersistableBundle returned = cpp_java_tests.RepeatPersistableBundle(emptyBundle);
+        assertThat(returned.size(), is(emptyBundle.size()));
+        assertThat(returned.toString(), is(emptyBundle.toString()));
+    }
+
+    @Test
+    public void testRepeatNonEmptyPersistableBundle() throws RemoteException {
+        assumeTrue(cpp_java_tests != null);
+
+        PersistableBundle pb = new PersistableBundle();
+
+        final String testBoolKey = "testBool";
+        final String testIntKey = "testInt";
+        final String testNestedIntKey = "testNestedInt";
+        final String testLongKey = "testLong";
+        final String testDoubleKey = "testDouble";
+        final String testStringKey = "testString";
+        final String testBoolArrayKey = "testBoolArray";
+        final String testIntArrayKey = "testIntArray";
+        final String testLongArrayKey = "testLongArray";
+        final String testDoubleArrayKey = "testDoubleArray";
+        final String testStringArrayKey = "testStringArray";
+        final String testPersistableBundleKey = "testPersistableBundle";
+
+        pb.putBoolean(testBoolKey, false);
+        pb.putInt(testIntKey, 33);
+        pb.putLong(testLongKey, 34359738368L);
+        pb.putDouble(testDoubleKey, 1.1);
+        pb.putString(testStringKey, new String("Woot!"));
+        pb.putBooleanArray(testBoolArrayKey, new boolean[] {true, false, true});
+        pb.putIntArray(testIntArrayKey, new int[] {33, 44, 55, 142});
+        pb.putLongArray(testLongArrayKey, new long[] {34L, 8371L, 34359738375L});
+        pb.putDoubleArray(testDoubleArrayKey, new double[] {2.2, 5.4});
+        pb.putStringArray(testStringArrayKey, new String[] {"hello", "world!"});
+        PersistableBundle testNestedPersistableBundle = new PersistableBundle();
+        testNestedPersistableBundle.putInt(testNestedIntKey, 345);
+        pb.putPersistableBundle(testPersistableBundleKey, testNestedPersistableBundle);
+
+        PersistableBundle ret = cpp_java_tests.RepeatPersistableBundle(pb);
+
+        assertThat(ret.size(), is(pb.size()));
+        assertThat(ret.getBoolean(testBoolKey), is(pb.getBoolean(testBoolKey)));
+        assertThat(ret.getInt(testIntKey), is(pb.getInt(testIntKey)));
+        assertThat(ret.getLong(testLongKey), is(pb.getLong(testLongKey)));
+        assertThat(ret.getDouble(testDoubleKey), is(pb.getDouble(testDoubleKey)));
+        assertThat(ret.getString(testStringKey), is(pb.getString(testStringKey)));
+        assertThat(ret.getBooleanArray(testBoolArrayKey), is(pb.getBooleanArray(testBoolArrayKey)));
+        assertThat(ret.getIntArray(testIntArrayKey), is(pb.getIntArray(testIntArrayKey)));
+        assertThat(ret.getLongArray(testLongArrayKey), is(pb.getLongArray(testLongArrayKey)));
+        assertThat(ret.getDoubleArray(testDoubleArrayKey), is(pb.getDoubleArray(testDoubleArrayKey)));
+        assertThat(ret.getStringArray(testStringArrayKey), is(pb.getStringArray(testStringArrayKey)));
+
+        PersistableBundle nested = ret.getPersistableBundle(testPersistableBundleKey);
+        assertThat(nested, is(notNullValue()));
+        assertThat(nested.getInt(testNestedIntKey), is(testNestedPersistableBundle.getInt(testNestedIntKey)));
+    }
+
+    @Test
+    public void testReversePersistableBundleArray() throws RemoteException {
+        assumeTrue(cpp_java_tests != null);
+
+        PersistableBundle[] input = new PersistableBundle[3];
+        PersistableBundle first = new PersistableBundle();
+        PersistableBundle second = new PersistableBundle();
+        PersistableBundle third = new PersistableBundle();
+        final String testIntKey = new String("testInt");
+        final String testLongKey = new String("testLong");
+        final String testDoubleKey = new String("testDouble");
+        first.putInt(testIntKey, 1231);
+        second.putLong(testLongKey, 222222L);
+        third.putDouble(testDoubleKey, 10.8);
+        input[0] = first;
+        input[1] = second;
+        input[2] = third;
+        final int original_input_size = input.length;
+
+        PersistableBundle[] repeated = new PersistableBundle[input.length];
+        PersistableBundle[] reversed = cpp_java_tests.ReversePersistableBundles(input, repeated);
+
+        assertThat(repeated.length, is(input.length));
+        assertThat(input.length, is(original_input_size));
+        assertThat(repeated[0].getInt(testIntKey), is(input[0].getInt(testIntKey)));
+        assertThat(repeated[1].getLong(testLongKey), is(input[1].getLong(testLongKey)));
+        assertThat(repeated[2].getDouble(testDoubleKey), is(input[2].getDouble(testDoubleKey)));
+
+        assertThat(reversed.length, is(input.length));
+        assertThat(reversed[0].getInt(testIntKey), is(input[2].getInt(testIntKey)));
+        assertThat(reversed[1].getLong(testLongKey), is(input[1].getLong(testLongKey)));
+        assertThat(reversed[2].getDouble(testDoubleKey), is(input[0].getDouble(testDoubleKey)));
+    }
+
+    private void writeToFd(FileDescriptor fd, byte[] testData) throws IOException {
+      FileOutputStream fdStream = new FileOutputStream(fd);
+      fdStream.write(testData);
+      fdStream.close();
+    }
+
+    private void verifyFileContents(String file, byte[] testData) throws IOException {
+      FileInputStream fis = new FileInputStream(file);
+      byte[] readData = new byte[testData.length];
+
+      assertThat(fis.read(readData), is(readData.length));
+      assertThat(readData, is(testData));
+      assertThat(fis.read(), is(-1));
+    }
+
+    @Test
+    public void testFileDescriptorPassing() throws RemoteException, IOException {
+        assumeTrue(cpp_java_tests != null);
+
+        String file = "/data/local/tmp/aidl-test-file";
+        FileOutputStream fos = new FileOutputStream(file, false /*append*/);
+
+        FileDescriptor descriptor = fos.getFD();
+        FileDescriptor journeyed = cpp_java_tests.RepeatFileDescriptor(descriptor);
+        fos.close();
+
+        String testData = "FrazzleSnazzleFlimFlamFlibbityGumboChops";
+        writeToFd(journeyed, testData.getBytes());
+        verifyFileContents(file, testData.getBytes());
+    }
+
+    @Test
+    public void testFileDescriptorArrayPassing() throws RemoteException, IOException {
+      assumeTrue(cpp_java_tests != null);
+
+      final int kTestSize = 2;
+
+      String fileBase = "/data/local/tmp/aidl-test-file_";
+      String[] files = new String[kTestSize]; // any size to test
+      FileOutputStream[] fos = new FileOutputStream[kTestSize];
+      FileDescriptor[] descriptors = new FileDescriptor[kTestSize];
+      for (int i = 0; i < kTestSize; i++) {
+        files[i] = fileBase + i;
+        fos[i] = new FileOutputStream(files[i], false /*append*/);
+        descriptors[i] = fos[i].getFD();
+      }
+
+      FileDescriptor[] repeated = new FileDescriptor[kTestSize];
+      FileDescriptor[] reversed = cpp_java_tests.ReverseFileDescriptorArray(descriptors, repeated);
+
+      for (int i = 0; i < kTestSize; i++) {
+        fos[i].close();
+      }
+
+      for (int i = 0; i < kTestSize; i++) {
+        String testData = "Something " + i;
+
+        writeToFd(reversed[kTestSize - 1 - i], testData.getBytes());
+        verifyFileContents(files[i], testData.getBytes());
+
+        writeToFd(repeated[i], testData.getBytes());
+        verifyFileContents(files[i], (testData + testData).getBytes());
+      }
+    }
+
+    @Test
+    public void testParcelFileDescriptorPassing() throws RemoteException, IOException {
+        String file = "/data/local/tmp/aidl-test-file";
+        ParcelFileDescriptor descriptor = ParcelFileDescriptor.open(
+                new File(file), ParcelFileDescriptor.MODE_CREATE |
+                    ParcelFileDescriptor.MODE_WRITE_ONLY);
+        ParcelFileDescriptor journeyed = service.RepeatParcelFileDescriptor(descriptor);
+
+        FileOutputStream journeyedStream = new ParcelFileDescriptor.AutoCloseOutputStream(journeyed);
+
+        String testData = "FrazzleSnazzleFlimFlamFlibbityGumboChops";
+        byte[] output = testData.getBytes();
+        journeyedStream.write(output);
+        journeyedStream.close();
+
+        FileInputStream fis = new FileInputStream(file);
+        byte[] input = new byte[output.length];
+
+        assertThat(fis.read(input), is(input.length));
+        assertThat(input, is(output));
+    }
+
+    @Test
+    public void testServiceSpecificExceptions() throws RemoteException {
+        for (int i = -1; i < 2; ++i) {
+            try {
+                service.ThrowServiceException(i);
+            } catch (ServiceSpecificException ex) {
+                assertThat(ex.errorCode, is(i));
+            }
+        }
+    }
+
+    private static final List<String> utf8_queries = Arrays.asList(
+            "typical string",
+            "",
+            "\0\0\0",
+            // Java doesn't handle unicode code points above U+FFFF well.
+            new String(Character.toChars(0x1F701)) + "\u03A9");
+
+    @Test
+    public void testRepeatUtf8String() throws RemoteException {
+        for (String query : utf8_queries) {
+            String response = service.RepeatUtf8CppString(query);
+            assertThat(response, is(query));
+        }
+    }
+
+    @Test
+    public void testReverseUtf8StringArray() throws RemoteException {
+        String[] input = utf8_queries.toArray(new String[0]);
+        String echoed[] = new String[input.length];
+
+        String[] reversed = service.ReverseUtf8CppString(input, echoed);
+
+        assertThat(echoed, is(input));
+        assertThat(reversed.length, is(input.length));
+        for (int i = 0; i < input.length; ++i) {
+            int j = reversed.length - (1 + i);
+            assertThat(reversed[j], is(input[i]));
+        }
+    }
+
+    @Test
+    public void testReverseNullableUtf8StringArray() throws RemoteException {
+        final List<String> utf8_queries_and_nulls = Arrays.asList(
+                "typical string",
+                null,
+                "",
+                "\0\0\0",
+                null,
+                // Java doesn't handle unicode code points above U+FFFF well.
+                new String(Character.toChars(0x1F701)) + "\u03A9");
+        String[] input = utf8_queries_and_nulls.toArray(new String[0]);
+        String echoed[] = new String[input.length];
+
+        String[] reversed = service.ReverseNullableUtf8CppString(input, echoed);
+
+        assertThat(echoed, is(input));
+        assertThat(reversed.length, is(input.length));
+        for (int i = 0; i < input.length; ++i) {
+            int j = reversed.length - (1 + i);
+            if (input[i] == null && reversed[j] == null) {
+                continue;
+            }
+            assertThat(reversed[j], is(input[i]));
+        }
+    }
+
+    @Test
+    public void testOutArrayWithNull() throws RemoteException {
+        // In Java out-array parameter can't be null. The proxy code always throws NPE.
+        assertThrows(NullPointerException.class, () -> service.ReverseUtf8CppString(null, null));
+        assertThrows(NullPointerException.class,
+            () -> service.ReverseNullableUtf8CppString(null, null));
+    }
+
+    private void shouldBeTheSame(StructuredParcelable a, StructuredParcelable b) {
+        assertTrue(a.equals(b));
+        assertTrue(b.equals(a));
+        assertTrue(a.equals(a));
+        assertTrue(b.equals(b));
+        assertTrue(a.hashCode() == b.hashCode());
+    }
+
+    private void shouldBeDifferent(StructuredParcelable a, StructuredParcelable b) {
+        assertFalse(a.equals(b));
+        assertFalse(b.equals(a));
+        assertFalse(a.hashCode() == b.hashCode());
+    }
+
+    @Test
+    public void testStructuredParcelableEquality() {
+        StructuredParcelable p = new StructuredParcelable();
+        p.shouldContainThreeFs = new int[] {1, 2, 3};
+        p.shouldBeJerry = "Jerry";
+
+        StructuredParcelable p2 = new StructuredParcelable();
+        p2.shouldContainThreeFs = new int[] {1, 2, 3};
+        p2.shouldBeJerry = "Jerry";
+        shouldBeTheSame(p, p2);
+
+        StructuredParcelable p3 = new StructuredParcelable();
+        p3.shouldContainThreeFs = new int[] {1, 2, 3, 4};
+        p3.shouldBeJerry = "Jerry";
+        shouldBeDifferent(p, p3);
+
+        StructuredParcelable p4 = new StructuredParcelable();
+        p4.shouldContainThreeFs = new int[] {1, 2, 3};
+        p4.shouldBeJerry = "Tom";
+        shouldBeDifferent(p, p4);
+    }
+
+    @Test
+    public void testStructuredParcelable() throws RemoteException {
+        final int kDesiredFValue = 17;
+
+        StructuredParcelable p = new StructuredParcelable();
+        p.shouldContainThreeFs = new int[0];
+        p.f = kDesiredFValue;
+        p.shouldBeJerry = "";
+        p.shouldContainTwoByteFoos = new byte[2];
+        p.shouldContainTwoIntFoos = new int[2];
+        p.shouldContainTwoLongFoos = new long[2];
+        p.empty = new StructuredParcelable.Empty();
+
+        // Check the default values
+        assertThat(p.stringDefaultsToFoo, is("foo"));
+        final byte byteFour = 4;
+        assertThat(p.byteDefaultsToFour, is(byteFour));
+        assertThat(p.intDefaultsToFive, is(5));
+        assertThat(p.longDefaultsToNegativeSeven, is(-7L));
+        assertThat(p.booleanDefaultsToTrue, is(true));
+        assertThat(p.charDefaultsToC, is('C'));
+        assertThat(p.floatDefaultsToPi, is(3.14f));
+        assertThat(p.doubleWithDefault, is(-3.14e17));
+        assertThat(p.arrayDefaultsTo123, is(new int[] {1, 2, 3}));
+        assertThat(p.arrayDefaultsToEmpty.length, is(0));
+        assertThat(p.defaultWithFoo, is(IntEnum.FOO));
+
+        service.FillOutStructuredParcelable(p);
+
+        // Check the returned values
+        assertThat(p.shouldContainThreeFs, is(new int[] {kDesiredFValue, kDesiredFValue, kDesiredFValue}));
+        assertThat(p.shouldBeJerry, is("Jerry"));
+        assertThat(p.shouldBeByteBar, is(ByteEnum.BAR));
+        assertThat(p.shouldBeIntBar, is(IntEnum.BAR));
+        assertThat(p.shouldBeLongBar, is(LongEnum.BAR));
+        assertThat(p.shouldContainTwoByteFoos, is(new byte[] {ByteEnum.FOO, ByteEnum.FOO}));
+        assertThat(p.shouldContainTwoIntFoos, is(new int[] {IntEnum.FOO, IntEnum.FOO}));
+        assertThat(p.shouldContainTwoLongFoos, is(new long[] {LongEnum.FOO, LongEnum.FOO}));
+        assertThat(p.int32_min, is(Integer.MIN_VALUE));
+        assertThat(p.int32_max, is(Integer.MAX_VALUE));
+        assertThat(p.int64_max, is(Long.MAX_VALUE));
+        assertThat(p.hexInt32_neg_1, is(-1));
+        for (int ndx = 0; ndx < p.int8_1.length; ndx++) {
+          assertThat(p.int8_1[ndx], is((byte) 1));
+        }
+        for (int ndx = 0; ndx < p.int32_1.length; ndx++) {
+            assertThat(p.int32_1[ndx], is(1));
+        }
+        for (int ndx = 0; ndx < p.int64_1.length; ndx++) {
+            assertThat(p.int64_1[ndx], is(1L));
+        }
+        assertThat(p.hexInt32_pos_1, is(1));
+        assertThat(p.hexInt64_pos_1, is(1));
+        assertThat(p.const_exprs_1, is(1));
+        assertThat(p.const_exprs_2, is(1));
+        assertThat(p.const_exprs_3, is(1));
+        assertThat(p.const_exprs_4, is(1));
+        assertThat(p.const_exprs_5, is(1));
+        assertThat(p.const_exprs_6, is(1));
+        assertThat(p.const_exprs_7, is(1));
+        assertThat(p.const_exprs_8, is(1));
+        assertThat(p.const_exprs_9, is(1));
+        assertThat(p.const_exprs_10, is(1));
+
+        assertThat(
+            p.shouldSetBit0AndBit2, is(StructuredParcelable.BIT0 | StructuredParcelable.BIT2));
+
+        assertThat(p.u.getNs(), is(new int[] {1, 2, 3}));
+        assertThat(p.shouldBeConstS1.getS(), is(Union.S1));
+
+        final String expected = "StructuredParcelable{"
+            + "shouldContainThreeFs: [17, 17, 17], "
+            + "f: 17, "
+            + "shouldBeJerry: Jerry, "
+            + "shouldBeByteBar: 2, "
+            + "shouldBeIntBar: BAR, "
+            + "shouldBeLongBar: 200000000000, "
+            + "shouldContainTwoByteFoos: [1, 1], "
+            + "shouldContainTwoIntFoos: [FOO, FOO], "
+            + "shouldContainTwoLongFoos: [100000000000, 100000000000], "
+            + "stringDefaultsToFoo: foo, "
+            + "byteDefaultsToFour: 4, "
+            + "intDefaultsToFive: 5, "
+            + "longDefaultsToNegativeSeven: -7, "
+            + "booleanDefaultsToTrue: true, "
+            + "charDefaultsToC: C, "
+            + "floatDefaultsToPi: 3.14, "
+            + "doubleWithDefault: -3.14E17, "
+            + "arrayDefaultsTo123: [1, 2, 3], "
+            + "arrayDefaultsToEmpty: [], "
+            + "boolDefault: false, "
+            + "byteDefault: 0, "
+            + "intDefault: 0, "
+            + "longDefault: 0, "
+            + "floatDefault: 0.0, "
+            + "doubleDefault: 0.0, "
+            + "checkDoubleFromFloat: 3.14, "
+            + "checkStringArray1: [a, b], "
+            + "checkStringArray2: [a, b], "
+            + "int32_min: -2147483648, "
+            + "int32_max: 2147483647, "
+            + "int64_max: 9223372036854775807, "
+            + "hexInt32_neg_1: -1, "
+            + "ibinder: null, "
+            + "empty: Empty{}, "
+            + "int8_1: [1, 1, 1, 1, 1], "
+            + "int32_1: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "
+            + "1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "
+            + "1, 1, 1, 1], "
+            + "int64_1: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "
+            + "hexInt32_pos_1: 1, "
+            + "hexInt64_pos_1: 1, "
+            + "const_exprs_1: 1, "
+            + "const_exprs_2: 1, "
+            + "const_exprs_3: 1, "
+            + "const_exprs_4: 1, "
+            + "const_exprs_5: 1, "
+            + "const_exprs_6: 1, "
+            + "const_exprs_7: 1, "
+            + "const_exprs_8: 1, "
+            + "const_exprs_9: 1, "
+            + "const_exprs_10: 1, "
+            + "addString1: hello world!, "
+            + "addString2: The quick brown fox jumps over the lazy dog., "
+            + "shouldSetBit0AndBit2: 5, "
+            + "u: Union.ns([1, 2, 3]), "
+            + "shouldBeConstS1: Union.s(a string constant in union), "
+            + "defaultWithFoo: FOO"
+            + "}";
+        assertThat(p.toString(), is(expected));
+    }
+
+    @Test
+    public void testDefaultImpl() throws RemoteException {
+      final int expectedArg = 100;
+      final int expectedReturnValue = 200;
+
+      boolean success = ITestService.Stub.setDefaultImpl(new ITestService.Default() {
+        @Override
+        public int UnimplementedMethod(int arg) throws RemoteException {
+          if (arg != expectedArg) {
+            throw new RemoteException("Argument for UnimplementedMethod is expected "
+                + " to be " + expectedArg + ", but got " + arg);
+          }
+          return expectedReturnValue;
+        }
+      });
+      assertThat(success, is(true));
+
+      int ret = service.UnimplementedMethod(expectedArg);
+      assertThat(ret, is(expectedReturnValue));
+    }
+
+    @Test
+    public void testToString() {
+        ParcelableForToString p = new ParcelableForToString();
+        p.intValue = 10;
+        p.intArray = new int[]{20, 30};
+        p.longValue = 100L;
+        p.longArray = new long[]{200L, 300L};
+        p.doubleValue = 3.14d;
+        p.doubleArray = new double[]{1.1d, 1.2d};
+        p.floatValue = 3.14f;
+        p.floatArray = new float[]{1.1f, 1.2f};
+        p.byteValue = 3;
+        p.byteArray = new byte[]{5, 6};
+        p.booleanValue = true;
+        p.booleanArray = new boolean[]{true, false};
+        p.stringValue = "this is a string";
+        p.stringArray = new String[]{"hello", "world"};
+        p.stringList = Arrays.asList(new String[]{"alice", "bob"});
+        OtherParcelableForToString op = new OtherParcelableForToString();
+        op.field = "other";
+        p.parcelableValue = op;
+        p.parcelableArray = new OtherParcelableForToString[]{op, op};
+        p.enumValue = IntEnum.FOO;
+        p.enumArray = new int[]{IntEnum.FOO, IntEnum.BAR};
+        p.nullArray = null;
+        p.nullList = null;
+        GenericStructuredParcelable<Integer, StructuredParcelable, Integer> gen =
+            new GenericStructuredParcelable<Integer, StructuredParcelable, Integer>();
+        gen.a = 1;
+        gen.b = 2;
+        p.parcelableGeneric = gen;
+        p.unionValue = null; // for testing even though it is not @nullable in .aidl
+
+        final String expected = "ParcelableForToString{"
+            + "intValue: 10, "
+            + "intArray: [20, 30], "
+            + "longValue: 100, "
+            + "longArray: [200, 300], "
+            + "doubleValue: 3.14, "
+            + "doubleArray: [1.1, 1.2], "
+            + "floatValue: 3.14, "
+            + "floatArray: [1.1, 1.2], "
+            + "byteValue: 3, "
+            + "byteArray: [5, 6], "
+            + "booleanValue: true, "
+            + "booleanArray: [true, false], "
+            + "stringValue: this is a string, "
+            + "stringArray: [hello, world], "
+            + "stringList: [alice, bob], "
+            + "parcelableValue: OtherParcelableForToString{field: other}, "
+            + "parcelableArray: ["
+            + "OtherParcelableForToString{field: other}, "
+            + "OtherParcelableForToString{field: other}], "
+            + "enumValue: FOO, "
+            + "enumArray: [FOO, BAR], "
+            + "nullArray: null, "
+            + "nullList: null, "
+            + "parcelableGeneric: GenericStructuredParcelable{a: 1, b: 2}, "
+            + "unionValue: null"
+            + "}";
+
+        assertThat(p.toString(), is(expected));
+    }
+
+    @Test
+    public void testEnumToString() {
+      assertThat(IntEnum.$.toString(IntEnum.FOO), is("FOO"));
+      assertThat(IntEnum.$.toString(0), is("0"));
+      assertThat(IntEnum.$.arrayToString(null), is("null"));
+      assertThat(IntEnum.$.arrayToString(new int[] {}), is("[]"));
+      assertThat(IntEnum.$.arrayToString(new int[] {IntEnum.FOO, IntEnum.BAR}), is("[FOO, BAR]"));
+      assertThat(IntEnum.$.arrayToString(new int[] {IntEnum.FOO, 0}), is("[FOO, 0]"));
+      assertThat(IntEnum.$.arrayToString(new int[][] {{IntEnum.FOO, IntEnum.BAR}, {IntEnum.BAZ}}),
+          is("[[FOO, BAR], [BAZ]]"));
+      assertThrows(IllegalArgumentException.class, () -> IntEnum.$.arrayToString(IntEnum.FOO));
+      assertThrows(
+          IllegalArgumentException.class, () -> IntEnum.$.arrayToString(new long[] {LongEnum.FOO}));
+    }
+
+    @Test
+    public void testRenamedInterface() throws RemoteException {
+      IOldName oldAsOld = service.GetOldNameInterface();
+      assertNotNull(oldAsOld);
+      assertThat(oldAsOld.DESCRIPTOR, is("android.aidl.tests.IOldName"));
+      assertThat(oldAsOld.RealName(), is("OldName"));
+
+      INewName newAsNew = service.GetNewNameInterface();
+      assertNotNull(newAsNew);
+      assertThat(newAsNew.DESCRIPTOR, is("android.aidl.tests.IOldName"));
+      assertThat(oldAsOld.RealName(), is("OldName"));
+
+      IOldName newAsOld = IOldName.Stub.asInterface(service.GetNewNameInterface().asBinder());
+      assertNotNull(newAsOld);
+      assertThat(newAsOld.DESCRIPTOR, is("android.aidl.tests.IOldName"));
+      assertThat(newAsOld.RealName(), is("NewName"));
+
+      INewName oldAsNew = INewName.Stub.asInterface(service.GetOldNameInterface().asBinder());
+      assertNotNull(oldAsNew);
+      assertThat(oldAsNew.DESCRIPTOR, is("android.aidl.tests.IOldName"));
+      assertThat(oldAsNew.RealName(), is("OldName"));
+    }
+
+    @Test
+    public void testReverseUnion() throws RemoteException {
+      assumeTrue(cpp_java_tests != null);
+
+      Union original = Union.ns(new int[] {1, 2, 3});
+      Union repeated = new Union();
+
+      Union reversed = cpp_java_tests.ReverseUnion(original, repeated);
+
+      assertNotNull(reversed);
+      assertThat(repeated.getNs(), is(new int[] {1, 2, 3}));
+      assertThat(reversed.getNs(), is(new int[] {3, 2, 1}));
+    }
+
+    @Test
+    public void testReverseRecursiveList() throws RemoteException {
+      RecursiveList head = null;
+      for (int i = 0; i < 10; i++) {
+        RecursiveList node = new RecursiveList();
+        node.value = i;
+        node.next = head;
+        head = node;
+      }
+      // head: [9, 8, .. , 0]
+      RecursiveList reversed = service.ReverseList(head);
+      // reversed should be [0, 1, .. 9]
+      for (int i = 0; i < 10; i++) {
+        assertThat(reversed.value, is(i));
+        reversed = reversed.next;
+      }
+      assertNull(reversed);
+    }
+
+    @Test
+    public void testGetUnionTags() throws RemoteException {
+      assertArrayEquals(new int[] {}, service.GetUnionTags(new Union[] {}));
+      assertArrayEquals(new int[] {Union.n, Union.ns},
+          service.GetUnionTags(new Union[] {Union.n(0), Union.ns(new int[] {})}));
+    }
+
+    @Test
+    public void testDescribeContents() throws Exception {
+      CompilerChecks cc = new CompilerChecks();
+      cc.pfd_array = new ParcelFileDescriptor[] {null, null, null};
+      assertThat(cc.describeContents(), is(0));
+
+      String file = "/data/local/tmp/aidl-test-file";
+      cc.pfd_array[1] = ParcelFileDescriptor.open(
+          new File(file), ParcelFileDescriptor.MODE_CREATE | ParcelFileDescriptor.MODE_WRITE_ONLY);
+      assertThat(cc.describeContents(), is(Parcelable.CONTENTS_FILE_DESCRIPTOR));
+    }
+
+    @Test
+    public void testFixedSizeArrayOverBinder() throws Exception {
+      IBinder binder = ServiceManager.waitForService(IRepeatFixedSizeArray.DESCRIPTOR);
+      assertNotNull(binder);
+      IRepeatFixedSizeArray service = IRepeatFixedSizeArray.Stub.asInterface(binder);
+      assertNotNull(service);
+
+      {
+        byte[] input = new byte[] {1, 2, 3};
+        byte[] repeated = new byte[3];
+        byte[] output = service.RepeatBytes(input, repeated);
+        assertArrayEquals(input, repeated);
+        assertArrayEquals(input, output);
+      }
+      {
+        int[] input = new int[] {1, 2, 3};
+        int[] repeated = new int[3];
+        int[] output = service.RepeatInts(input, repeated);
+        assertArrayEquals(input, repeated);
+        assertArrayEquals(input, output);
+      }
+      {
+        IntParcelable p1 = new IntParcelable();
+        p1.value = 1;
+        IntParcelable p2 = new IntParcelable();
+        p2.value = 1;
+        IntParcelable p3 = new IntParcelable();
+        p3.value = 1;
+        IntParcelable[][] input = new IntParcelable[][] {{p1, p2, p3}, {p1, p2, p3}};
+        IntParcelable[][] repeated = new IntParcelable[2][3];
+        IntParcelable[][] output = service.Repeat2dParcelables(input, repeated);
+        assertArrayEquals(input, repeated);
+        assertArrayEquals(input, output);
+      }
+    }
+}
diff --git a/tests/java/src/android/aidl/tests/TestVersionedInterface.java b/tests/java/src/android/aidl/tests/TestVersionedInterface.java
new file mode 100644
index 0000000..dd25ccd
--- /dev/null
+++ b/tests/java/src/android/aidl/tests/TestVersionedInterface.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+import android.aidl.versioned.tests.BazUnion;
+import android.aidl.versioned.tests.Foo;
+import android.aidl.versioned.tests.IFooInterface;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class TestVersionedInterface {
+    private IFooInterface service;
+
+    @Before
+    public void setUp() {
+        IBinder binder = ServiceManager.waitForService(IFooInterface.class.getName());
+        assertNotNull(binder);
+        service = IFooInterface.Stub.asInterface(binder);
+        assertNotNull(service);
+    }
+
+    @Test
+    public void testGetInterfaceVersion() throws RemoteException {
+        assertThat(service.getInterfaceVersion(), is(1));
+    }
+
+    @Test
+    public void testGetInterfaceHash() throws RemoteException {
+      assertThat(service.getInterfaceHash(), is("9e7be1859820c59d9d55dd133e71a3687b5d2e5b"));
+    }
+
+    @Rule public ExpectedException expectedException = ExpectedException.none();
+
+    @Test
+    public void testUnimplementedMethodTriggersException() throws RemoteException {
+      expectedException.expect(RemoteException.class);
+      expectedException.expectMessage("Method newApi is unimplemented.");
+
+      service.newApi();
+    }
+
+    @Test
+    public void testOldServerAcceptsUnionWithOldField() throws RemoteException {
+      assertThat(service.acceptUnionAndReturnString(BazUnion.intNum(42)), is("42"));
+    }
+
+    @Test
+    public void testUnknownUnionFieldTriggersException() throws RemoteException {
+      expectedException.expect(IllegalArgumentException.class);
+
+      service.acceptUnionAndReturnString(BazUnion.longNum(42L));
+    }
+
+    @Test
+    public void testArrayOfPacelableWithNewField() throws RemoteException {
+      Foo[] foos = new Foo[42];
+      for (int i = 0; i < foos.length; i++) {
+        foos[i] = new Foo();
+      }
+      int length = service.returnsLengthOfFooArray(foos);
+      assertThat(length, is(foos.length));
+    }
+
+    @Test
+    public void testReadDataCorrectlyAfterParcelableWithNewField() throws RemoteException {
+      Foo inFoo = new Foo();
+      Foo inoutFoo = new Foo();
+      inoutFoo.intDefault42 = 0;
+      Foo outFoo = new Foo();
+      outFoo.intDefault42 = 0;
+      int ret = service.ignoreParcelablesAndRepeatInt(inFoo, inoutFoo, outFoo, 43);
+      assertThat(ret, is(43));
+      assertThat(inoutFoo.intDefault42, is(0));
+      assertThat(outFoo.intDefault42, is(0));
+    }
+
+    @Test
+    public void testDelegatorGetInterfaceVersion() throws RemoteException {
+      IFooInterface.Delegator delegator = new IFooInterface.Delegator(service);
+      assertThat(delegator.getInterfaceVersion(), is(1));
+    }
+
+    @Test
+    public void testDelegatorGetInterfaceHash() throws RemoteException {
+      IFooInterface.Delegator delegator = new IFooInterface.Delegator(service);
+      assertThat(delegator.getInterfaceHash(), is("9e7be1859820c59d9d55dd133e71a3687b5d2e5b"));
+    }
+}
diff --git a/tests/java/src/android/aidl/tests/TrunkStableTests.java b/tests/java/src/android/aidl/tests/TrunkStableTests.java
new file mode 100644
index 0000000..288b93c
--- /dev/null
+++ b/tests/java/src/android/aidl/tests/TrunkStableTests.java
@@ -0,0 +1,183 @@
+/*
+ * Copyright (C) 2023, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsNot.not;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+import android.aidl.test.trunk.ITrunkStableTest;
+import android.aidl.test.trunk.ITrunkStableTest.IMyCallback;
+import android.aidl.test.trunk.ITrunkStableTest.MyEnum;
+import android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable;
+import android.aidl.test.trunk.ITrunkStableTest.MyParcelable;
+import android.aidl.test.trunk.ITrunkStableTest.MyUnion;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class TrunkStableTests {
+  private ITrunkStableTest service;
+  // Java doesn't know about the build-time flag, so this test is based on the
+  // reported version of the service. The cpp/ndk client tests will make sure
+  // the reported version is due to the build-time flag.
+  private int mRemoteVersion;
+  @Rule public ExpectedException expectedException = ExpectedException.none();
+
+  @Before
+  public void setUp() throws RemoteException {
+    IBinder binder = ServiceManager.waitForService(ITrunkStableTest.class.getName());
+    assertNotNull(binder);
+    service = ITrunkStableTest.Stub.asInterface(binder);
+    assertNotNull(service);
+    mRemoteVersion = service.getInterfaceVersion();
+  }
+
+  @Test
+  public void testGetInterfaceVersion() throws RemoteException {
+    if (mRemoteVersion == 1) {
+      assertThat(service.getInterfaceVersion(), is(1));
+      assertThat(ITrunkStableTest.VERSION, is(1));
+    } else {
+      assertThat(service.getInterfaceVersion(), is(2));
+      assertThat(ITrunkStableTest.VERSION, is(2));
+    }
+  }
+
+  @Test
+  public void testGetInterfaceHash() throws RemoteException {
+    if (mRemoteVersion == 1) {
+      assertThat(service.getInterfaceHash(), is("88311b9118fb6fe9eff4a2ca19121de0587f6d5f"));
+      assertThat(ITrunkStableTest.HASH, is("88311b9118fb6fe9eff4a2ca19121de0587f6d5f"));
+    } else {
+      assertThat(service.getInterfaceHash(), is("notfrozen"));
+      assertThat(ITrunkStableTest.HASH, is("notfrozen"));
+    }
+  }
+
+  @Test
+  public void testRepeatParcelable() throws RemoteException {
+    MyParcelable p1 = new MyParcelable();
+    p1.a = 12;
+    p1.b = 13;
+    p1.c = 14;
+    MyParcelable p2;
+    p2 = service.repeatParcelable(p1);
+    assertThat(p2.a, is(p1.a));
+    assertThat(p2.b, is(p1.b));
+    if (mRemoteVersion == 1) {
+      assertTrue(p2.c != p1.c);
+    } else {
+      assertTrue(p2.c == p1.c);
+    }
+  }
+
+  @Test
+  public void testRepeatEnum() throws RemoteException {
+    byte e1 = MyEnum.THREE;
+    byte e2 = 0;
+    e2 = service.repeatEnum(e1);
+    assertThat(e2, is(e1));
+  }
+
+  @Test
+  public void testRepeatUnion() throws RemoteException {
+    MyUnion u1, u2;
+    u1 = MyUnion.c(13);
+
+    if (mRemoteVersion == 1) {
+      // 'c' is a new field only in V2 and will throw the exception
+      expectedException.expect(IllegalArgumentException.class);
+    }
+    u2 = service.repeatUnion(u1);
+    if (mRemoteVersion != 1) {
+      assertThat(u2.getC(), is(u1.getC()));
+    }
+  }
+
+  @Test
+  public void testRepeatOtherParcelable() throws RemoteException {
+    MyOtherParcelable p1 = new MyOtherParcelable();
+    p1.a = 12;
+    p1.b = 13;
+    MyOtherParcelable p2;
+
+    if (mRemoteVersion == 1) {
+      expectedException.expect(RemoteException.class);
+    }
+    p2 = service.repeatOtherParcelable(p1);
+  }
+
+  public static class MyCallback extends IMyCallback.Stub {
+    @Override
+    public MyParcelable repeatParcelable(MyParcelable input) throws android.os.RemoteException {
+      repeatParcelableCalled = true;
+      return input;
+    }
+    @Override
+    public byte repeatEnum(byte input) throws android.os.RemoteException {
+      repeatEnumCalled = true;
+      return input;
+    }
+    @Override
+    public ITrunkStableTest.MyUnion repeatUnion(MyUnion input) throws android.os.RemoteException {
+      repeatUnionCalled = true;
+      return input;
+    }
+    @Override
+    public MyOtherParcelable repeatOtherParcelable(MyOtherParcelable input)
+        throws android.os.RemoteException {
+      repeatOtherParcelableCalled = true;
+      return input;
+    }
+    @Override
+    public final int getInterfaceVersion() {
+      return super.VERSION;
+    }
+
+    @Override
+    public final String getInterfaceHash() {
+      return super.HASH;
+    }
+    boolean repeatParcelableCalled = false;
+    boolean repeatEnumCalled = false;
+    boolean repeatUnionCalled = false;
+    boolean repeatOtherParcelableCalled = false;
+  }
+  @Test
+  public void testCallMyCallback() throws RemoteException {
+    MyCallback cb = new MyCallback();
+    service.callMyCallback(cb);
+    assertTrue(cb.repeatParcelableCalled);
+    assertTrue(cb.repeatEnumCalled);
+    assertTrue(cb.repeatUnionCalled);
+    if (mRemoteVersion == 1) {
+      assertTrue(!cb.repeatOtherParcelableCalled);
+    } else {
+      assertTrue(cb.repeatOtherParcelableCalled);
+    }
+  }
+}
diff --git a/tests/java/src/android/aidl/tests/UnionTests.java b/tests/java/src/android/aidl/tests/UnionTests.java
new file mode 100644
index 0000000..11f4115
--- /dev/null
+++ b/tests/java/src/android/aidl/tests/UnionTests.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright (C) 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+import android.aidl.tests.Union;
+import android.aidl.tests.UnionWithFd;
+import android.aidl.tests.unions.EnumUnion;
+import android.os.Parcel;
+import android.os.ParcelFileDescriptor;
+import android.os.Parcelable;
+import java.io.File;
+import java.io.FileDescriptor;
+import java.io.FileNotFoundException;
+import java.util.Arrays;
+import java.util.List;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class UnionTests {
+  @Test
+  public void defaultConstructorInitsWithFirstField() {
+    assertThat(new Union(), is(Union.ns(new int[] {}))); // int[] ns = {}
+    assertThat(
+        new EnumUnion(), is(EnumUnion.intEnum(IntEnum.FOO))); // IntEnum intEnum = IntEnum.FOO
+  }
+
+  @Test
+  public void updatesUnionWithSetter() {
+    Union u = new Union();
+    u.setNs(new int[] {1, 2, 3});
+    assertThat(u.getTag(), is(Union.ns));
+    assertThat(u.getNs(), is(new int[] {1, 2, 3}));
+  }
+
+  @Test(expected = IllegalStateException.class)
+  public void gettingWrongFieldThrowsException() {
+    Union u = new Union();
+    u.getSs();
+  }
+
+  @Test
+  public void readWriteViaParcel() {
+    List<String> ss = Arrays.asList("hello", "world");
+
+    Union u = Union.ss(ss);
+    Parcel parcel = Parcel.obtain();
+    u.writeToParcel(parcel, 0);
+    parcel.setDataPosition(0);
+
+    Union v = Union.CREATOR.createFromParcel(parcel);
+
+    assertThat(v.getTag(), is(Union.ss));
+    assertThat(v.getSs(), is(ss));
+
+    parcel.recycle();
+  }
+
+  @Test
+  public void unionDescribeContents() {
+    UnionWithFd u = UnionWithFd.num(0);
+    assertTrue((u.describeContents() & Parcelable.CONTENTS_FILE_DESCRIPTOR) == 0);
+
+    final Parcel parcel = Parcel.obtain();
+    try {
+      u.setPfd(ParcelFileDescriptor.open(new File("/system"), ParcelFileDescriptor.MODE_READ_ONLY));
+    } catch (FileNotFoundException e) {
+      throw new RuntimeException("can't open /system", e);
+    }
+    assertTrue((u.describeContents() & Parcelable.CONTENTS_FILE_DESCRIPTOR) != 0);
+
+    u.writeToParcel(parcel, 0);
+
+    UnionWithFd v = UnionWithFd.num(0);
+    parcel.setDataPosition(0);
+    v.readFromParcel(parcel);
+    assertTrue((v.describeContents() & Parcelable.CONTENTS_FILE_DESCRIPTOR) != 0);
+
+    parcel.recycle();
+  }
+
+  private void shouldBeTheSame(Union a, Union b) {
+    assertTrue(a.equals(b));
+    assertTrue(b.equals(a));
+    assertTrue(a.equals(a));
+    assertTrue(b.equals(b));
+    assertTrue(a.hashCode() == b.hashCode());
+  }
+
+  private void shouldBeDifferent(Union a, Union b) {
+    assertFalse(a.equals(b));
+    assertFalse(b.equals(a));
+    assertFalse(a.hashCode() == b.hashCode());
+  }
+
+  @Test
+  public void equalsAndHashCode() {
+    // same tag, same value
+    shouldBeTheSame(Union.s("hello"), Union.s("hello"));
+
+    // different tag, same value
+    shouldBeDifferent(Union.m(10), Union.n(10));
+
+    // same tag, different value
+    shouldBeDifferent(Union.s("hello"), Union.s("world"));
+
+    // with array
+    shouldBeTheSame(Union.ns(new int[]{1, 2, 3}),Union.ns(new int[]{1, 2, 3}));
+    shouldBeDifferent(Union.ns(new int[]{1, 2, 3}), Union.ns(new int[]{1, 2, 4}));
+  }
+}
diff --git a/tests/java/src/android/aidl/tests/VintfTests.java b/tests/java/src/android/aidl/tests/VintfTests.java
new file mode 100644
index 0000000..2df1b1c
--- /dev/null
+++ b/tests/java/src/android/aidl/tests/VintfTests.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2021, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsNull.notNullValue;
+import static org.hamcrest.core.IsNull.nullValue;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
+
+import android.os.Binder;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import java.util.ArrayList;
+import java.util.List;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class VintfTests {
+  private static final String kInstance = "android.does.not.exist.IFoo/default";
+
+  @Test
+  public void cantAddVintfService() throws RemoteException {
+    Binder binder = new Binder();
+    binder.markVintfStability(); // <- do not do this, for test only
+
+    boolean hasException = false;
+    try {
+      ServiceManager.addService(kInstance, binder);
+    } catch (IllegalArgumentException e) {
+      hasException = true;
+    }
+
+    assertTrue(hasException);
+  }
+
+  @Test
+  public void canDowngradeVintfService() throws RemoteException {
+    Binder binder = new Binder();
+    binder.markVintfStability(); // <- do not do this, for test only
+
+    binder.forceDowngradeToSystemStability();
+
+    ServiceManager.addService(kInstance, binder);
+  }
+}
diff --git a/tests/java/src/android/aidl/tests/generic/Pair.java b/tests/java/src/android/aidl/tests/generic/Pair.java
new file mode 100644
index 0000000..a0631df
--- /dev/null
+++ b/tests/java/src/android/aidl/tests/generic/Pair.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2019, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.generic;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class Pair<A, B> implements Parcelable {
+  public A mFirst;
+  public B mSecond;
+
+  public Pair() {}
+  public Pair(Parcel source) { readFromParcel(source); }
+
+  public int describeContents() { return 0; }
+
+  public void writeToParcel(Parcel dest, int flags) {
+    dest.writeValue(mFirst);
+    dest.writeValue(mSecond);
+  }
+
+  public void readFromParcel(Parcel source) {
+    mFirst = (A) source.readValue(null);
+    mSecond = (B) source.readValue(null);
+  }
+
+  public static final Parcelable.Creator<Pair> CREATOR = new Parcelable.Creator<Pair>() {
+    public Pair createFromParcel(Parcel source) { return new Pair(source); }
+
+    public Pair[] newArray(int size) { return new Pair[size]; }
+  };
+}
diff --git a/tests/lazy_test/Android.bp b/tests/lazy_test/Android.bp
new file mode 100644
index 0000000..dd44ae9
--- /dev/null
+++ b/tests/lazy_test/Android.bp
@@ -0,0 +1,86 @@
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "system_tools_aidl_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["system_tools_aidl_license"],
+}
+
+cc_test {
+    name: "aidl_lazy_test",
+    srcs: ["main.cpp"],
+    test_suites: ["general-tests"],
+    require_root: true,
+
+    shared_libs: [
+        "libbase",
+        "liblog",
+        "libutils",
+        "libbinder",
+    ],
+
+    static_libs: [
+        "lazy_test_service_aidl-cpp",
+        "lazy_cb_test_service_aidl-cpp",
+    ],
+}
+
+cc_binary {
+    name: "aidl_lazy_test_server",
+    srcs: [
+        "server.cpp",
+        "LazyTestService.cpp",
+    ],
+    init_rc: ["aidl_lazy_test_server.rc"],
+    system_ext_specific: true,
+
+    shared_libs: [
+        "libbase",
+        "libbinder",
+        "liblog",
+        "libutils",
+    ],
+
+    static_libs: [
+        "lazy_test_service_aidl-cpp",
+    ],
+}
+
+aidl_interface {
+    name: "lazy_test_service_aidl",
+    unstable: true,
+    flags: ["-Werror"],
+    srcs: [
+        "ILazyTestService.aidl",
+    ],
+}
+
+cc_binary {
+    name: "aidl_lazy_cb_test_server",
+    srcs: [
+        "ServerCb.cpp",
+        "LazyTestServiceCb.cpp",
+    ],
+    init_rc: ["aidl_lazy_cb_test_server.rc"],
+    system_ext_specific: true,
+
+    shared_libs: [
+        "libbinder",
+        "liblog",
+        "libutils",
+    ],
+
+    static_libs: [
+        "lazy_cb_test_service_aidl-cpp",
+    ],
+}
+
+aidl_interface {
+    name: "lazy_cb_test_service_aidl",
+    unstable: true,
+    flags: ["-Werror"],
+    srcs: [
+        "ILazyTestServiceCb.aidl",
+    ],
+}
diff --git a/tests/lazy_test/ILazyTestService.aidl b/tests/lazy_test/ILazyTestService.aidl
new file mode 100644
index 0000000..9cafdd1
--- /dev/null
+++ b/tests/lazy_test/ILazyTestService.aidl
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+interface ILazyTestService {
+    void forcePersist(boolean persist);
+}
diff --git a/tests/lazy_test/ILazyTestServiceCb.aidl b/tests/lazy_test/ILazyTestServiceCb.aidl
new file mode 100644
index 0000000..a304761
--- /dev/null
+++ b/tests/lazy_test/ILazyTestServiceCb.aidl
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+interface ILazyTestServiceCb {
+    /**
+     * Set the eventfd used to notify that the active services
+     * callback is being executed and is about to terminate the process.
+     */
+    void setEventFd(in ParcelFileDescriptor parcelFd);
+}
diff --git a/tests/lazy_test/LazyTestService.cpp b/tests/lazy_test/LazyTestService.cpp
new file mode 100644
index 0000000..d6a5cd3
--- /dev/null
+++ b/tests/lazy_test/LazyTestService.cpp
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "LazyTestService.h"
+#include <binder/LazyServiceRegistrar.h>
+
+namespace android {
+namespace binder {
+
+Status LazyTestService::forcePersist(bool persist) {
+  auto lazyRegistrar = LazyServiceRegistrar::getInstance();
+  lazyRegistrar.forcePersist(persist);
+
+  return Status::ok();
+}
+
+}  // namespace binder
+}  // namespace android
diff --git a/tests/lazy_test/LazyTestService.h b/tests/lazy_test/LazyTestService.h
new file mode 100644
index 0000000..31d1155
--- /dev/null
+++ b/tests/lazy_test/LazyTestService.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <BnLazyTestService.h>
+#include <binder/Status.h>
+
+namespace android {
+namespace binder {
+
+class LazyTestService : public BnLazyTestService {
+ public:
+  LazyTestService() {}
+  virtual ~LazyTestService() {}
+
+  ::android::binder::Status forcePersist(bool persist);
+};
+
+}  // namespace binder
+}  // namespace android
diff --git a/tests/lazy_test/LazyTestServiceCb.cpp b/tests/lazy_test/LazyTestServiceCb.cpp
new file mode 100644
index 0000000..f6e1d84
--- /dev/null
+++ b/tests/lazy_test/LazyTestServiceCb.cpp
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <sys/eventfd.h>
+
+#include <binder/LazyServiceRegistrar.h>
+#include "LazyTestServiceCb.h"
+
+namespace android {
+namespace binder {
+
+void LazyTestServiceCb::setCustomActiveServicesCallback() {
+  auto lazyRegistrar = LazyServiceRegistrar::getInstance();
+  lazyRegistrar.setActiveServicesCallback([lazyRegistrar, this](bool hasClients) mutable -> bool {
+    if (hasClients) {
+      return false;
+    }
+
+    if (mFd < 0) {
+      // Prevent shutdown (test will fail)
+      return true;
+    }
+
+    // Unregister all services
+    if (!lazyRegistrar.tryUnregister()) {
+      // Prevent shutdown (test will fail)
+      return true;
+    }
+
+    // Re-register all services
+    lazyRegistrar.reRegister();
+
+    // Unregister again before shutdown
+    if (!lazyRegistrar.tryUnregister()) {
+      // Prevent shutdown (test will fail)
+      return true;
+    }
+
+    // Tell the test we're shutting down
+    if (TEMP_FAILURE_RETRY(eventfd_write(mFd, /* value */ 1)) < 0) {
+      // Prevent shutdown (test will fail)
+      return true;
+    }
+
+    exit(EXIT_SUCCESS);
+    // Unreachable
+  });
+}
+
+Status LazyTestServiceCb::setEventFd(const ::android::os::ParcelFileDescriptor& parcelFd) {
+  mFd = dup(parcelFd.get());
+
+  return mFd < 0 ? Status::fromExceptionCode(Status::EX_ILLEGAL_ARGUMENT) : Status::ok();
+}
+
+}  // namespace binder
+}  // namespace android
diff --git a/tests/lazy_test/LazyTestServiceCb.h b/tests/lazy_test/LazyTestServiceCb.h
new file mode 100644
index 0000000..68fc808
--- /dev/null
+++ b/tests/lazy_test/LazyTestServiceCb.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <BnLazyTestServiceCb.h>
+#include <binder/Status.h>
+
+namespace android {
+namespace binder {
+
+class LazyTestServiceCb : public BnLazyTestServiceCb {
+ public:
+  LazyTestServiceCb() : mFd(-1) {}
+  virtual ~LazyTestServiceCb() {}
+
+  ::android::binder::Status setEventFd(const ::android::os::ParcelFileDescriptor& parcelFd);
+  void setCustomActiveServicesCallback();
+
+ private:
+  int mFd;
+};
+
+}  // namespace binder
+}  // namespace android
diff --git a/tests/lazy_test/README b/tests/lazy_test/README
new file mode 100644
index 0000000..134353a
--- /dev/null
+++ b/tests/lazy_test/README
@@ -0,0 +1,102 @@
+==================================================================================================
+aidl_lazy_test
+==================================================================================================
+This test can be run in one of two ways:
+
+--------------------------------------------
+Without arguments: aidl_lazy_test
+--------------------------------------------
+This will run tests on the test service (described below), the goal being to test the dynamic
+service infrastructure.
+
+--------------------------------------------
+With a service: aidl_lazy_test serviceName...
+--------------------------------------------
+This will run tests on the input service, verifying whether it successfully displays lazy behavior.
+If the service has multiple interfaces, each can be entered as a separate argument to be tested
+simultaneously.
+Infrastructure tests that rely on specific features of the dedicated test service will be skipped.
+
+==================================================================================================
+aidl_lazy_test_server
+==================================================================================================
+aidl_lazy_test_server is a simple test service.
+
+Because it represents the bare minimum requirements for implementing a service, it also serves as
+an example of how to add a new service. The required files are as follows:
+
+============================================
+In this directory
+============================================
+--------------------------------------------
+server.cpp
+--------------------------------------------
+The implementation of the server. The only required function is main(), wherein the service must be
+instantiated and added (either to servicemanager as a standard service or to LazyServiceRegistrar
+to be a dynamic service). The server then joins the thread pool.
+
+--------------------------------------------
+aidl_lazy_test_server.rc
+--------------------------------------------
+This file is read by init, which later starts the service. The interface, oneshot, and disabled
+lines are only required for dynamic services.
+
+--------------------------------------------
+LazyTestService.h/.cpp
+--------------------------------------------
+The implementation of the service's functionality.
+
+--------------------------------------------
+ILazyTestService.aidl
+--------------------------------------------
+The AIDL interface for the service, this will generate code that clients can use to interact with
+the service via IPC.
+
+--------------------------------------------
+Android.bp
+--------------------------------------------
+An aidl_interface entry will need to be added for the .aidl file.
+
+A cc_binary entry will need to be added for the service with:
+name
+srcs - The source file(s)
+init_rc - The .rc file
+shared_libs - Any shared libraries the source file depends on
+static_libs - The AIDL interface
+
+============================================
+In system/sepolicy
+============================================
+--------------------------------------------
+private/aidl_lazy_test_server.te
+--------------------------------------------
+Only two lines are required in this file.
+
+--------------------------------------------
+public/aidl_lazy_test_server.te
+--------------------------------------------
+The first two lines establish types for aidl_lazy_test_server and aidl_lazy_test_server_exec.
+binder_use and binder_call allow for basic use of this service.
+add_service allows the service to be registered. Note that an additional service type is required
+as the second argument to this function.
+
+--------------------------------------------
+private/compat/<number>/<number>.ignore.cil
+--------------------------------------------
+aidl_lazy_test_server and aidl_lazy_test_server_exec, and aidl_lazy_test_service need to be added
+to the new objects list.
+
+--------------------------------------------
+private/file_contexts
+--------------------------------------------
+A line is required to map aidl_lazy_test_server to aidl_lazy_test_server_exec.
+
+--------------------------------------------
+private/service_contexts
+--------------------------------------------
+Each interface for the service must be mapped to aidl_lazy_test_service here.
+
+--------------------------------------------
+public/service.te
+--------------------------------------------
+A line is required to define aidl_lazy_test_service.
diff --git a/tests/lazy_test/ServerCb.cpp b/tests/lazy_test/ServerCb.cpp
new file mode 100644
index 0000000..c05b889
--- /dev/null
+++ b/tests/lazy_test/ServerCb.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <binder/IBinder.h>
+#include <binder/IPCThreadState.h>
+#include <binder/IServiceManager.h>
+#include <binder/LazyServiceRegistrar.h>
+#include <utils/Log.h>
+#include "LazyTestServiceCb.h"
+
+using android::BBinder;
+using android::IBinder;
+using android::IPCThreadState;
+using android::OK;
+using android::sp;
+using android::binder::LazyServiceRegistrar;
+using android::binder::LazyTestServiceCb;
+
+// TODO: shouldn't be expanded or copied - instead, merge with server.cpp
+int main() {
+  sp<LazyTestServiceCb> service = new LazyTestServiceCb();
+
+  // Set the callback before registering the service
+  service->setCustomActiveServicesCallback();
+
+  auto lazyRegistrar = LazyServiceRegistrar::getInstance();
+  LOG_ALWAYS_FATAL_IF(OK != lazyRegistrar.registerService(service, "aidl_lazy_cb_test"), "");
+
+  IPCThreadState::self()->joinThreadPool();
+
+  return 1;
+}
diff --git a/tests/lazy_test/aidl_lazy_cb_test_server.rc b/tests/lazy_test/aidl_lazy_cb_test_server.rc
new file mode 100644
index 0000000..d3b505b
--- /dev/null
+++ b/tests/lazy_test/aidl_lazy_cb_test_server.rc
@@ -0,0 +1,6 @@
+service aidl_lazy_cb_test /system_ext/bin/aidl_lazy_cb_test_server
+    interface aidl aidl_lazy_cb_test
+    user system
+    group system
+    oneshot
+    disabled
diff --git a/tests/lazy_test/aidl_lazy_test_server.rc b/tests/lazy_test/aidl_lazy_test_server.rc
new file mode 100644
index 0000000..130173c
--- /dev/null
+++ b/tests/lazy_test/aidl_lazy_test_server.rc
@@ -0,0 +1,14 @@
+service aidl_lazy_test /system_ext/bin/aidl_lazy_test_server
+    interface aidl aidl_lazy_test_1
+    interface aidl aidl_lazy_test_2
+    user system
+    group system
+    oneshot
+    disabled
+
+service aidl_lazy_test_quit /system_ext/bin/aidl_lazy_test_server quit
+    interface aidl aidl_lazy_test_quit
+    user system
+    group system
+    oneshot
+    disabled
diff --git a/tests/lazy_test/main.cpp b/tests/lazy_test/main.cpp
new file mode 100644
index 0000000..0556b73
--- /dev/null
+++ b/tests/lazy_test/main.cpp
@@ -0,0 +1,291 @@
+/*
+ * Copyright (C) 2019, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <sys/eventfd.h>
+#include <cstdlib>
+#include <ctime>
+#include <iostream>
+#include <numeric>
+#include <string>
+#include <thread>
+
+#include <sys/epoll.h>
+#include <unistd.h>
+
+#include <ILazyTestService.h>
+#include <ILazyTestServiceCb.h>
+#include <binder/IPCThreadState.h>
+#include <binder/IServiceManager.h>
+#include <gtest/gtest.h>
+#include <utils/String8.h>
+
+using ::ILazyTestService;
+using ::android::DEAD_OBJECT;
+using ::android::IBinder;
+using ::android::IPCThreadState;
+using ::android::IServiceManager;
+using ::android::OK;
+using ::android::sp;
+using ::android::String16;
+using ::android::base::unique_fd;
+using ::android::os::ParcelFileDescriptor;
+
+std::vector<String16> gServiceNames;
+static constexpr size_t SHUTDOWN_WAIT_MS = 10000;
+static constexpr size_t CALLBACK_SHUTDOWN_WAIT_MS = 5000;
+
+sp<IBinder> waitForService(const String16& name) {
+  sp<IServiceManager> manager;
+  manager = android::defaultServiceManager();
+  EXPECT_NE(manager, nullptr);
+
+  return manager->waitForService(name);
+}
+
+bool isServiceRunning(const String16& name) {
+  sp<IServiceManager> manager;
+  manager = android::defaultServiceManager();
+  EXPECT_NE(manager, nullptr);
+
+  return manager->checkService(name) != nullptr;
+}
+
+TEST(AidlLazyQuitTest, Quits) {
+  const String16 quitter = String16("aidl_lazy_test_quit");
+  usleep(SHUTDOWN_WAIT_MS * 1000);
+  ASSERT_FALSE(isServiceRunning(quitter));
+
+  auto binder = waitForService(quitter);
+
+  // binder dies. Could also linkToDeath to switch to cond var.
+  for (size_t i = 0; i < 1000; i++) {
+    if (binder->pingBinder() != OK) break;
+    usleep(10000);
+  }
+  EXPECT_EQ(DEAD_OBJECT, binder->pingBinder());
+
+  // service should quit immediately, but wait a bit before checking
+  // so that servicemanager has time to process the death notification
+  usleep(SHUTDOWN_WAIT_MS * 1000 / 2);
+  ASSERT_FALSE(isServiceRunning(quitter));
+}
+
+class AidlLazyTest : public ::testing::Test {
+ protected:
+  sp<IServiceManager> manager;
+
+  void SetUp() override {
+    manager = android::defaultServiceManager();
+    ASSERT_NE(manager, nullptr);
+
+    for (size_t i = 0; i < gServiceNames.size(); i++) {
+      ASSERT_FALSE(isServiceRunning(gServiceNames.at(i)))
+          << "Service '" << android::String8(gServiceNames.at(i)) << "' is already running. "
+          << "Please ensure this is implemented as a lazy service, then kill all "
+          << "clients of this service and try again.";
+    }
+  }
+
+  void TearDown() override {
+    std::cout << "Waiting " << SHUTDOWN_WAIT_MS << " milliseconds before checking that the "
+              << "service has shut down." << std::endl;
+    IPCThreadState::self()->flushCommands();
+    usleep(SHUTDOWN_WAIT_MS * 1000);
+    for (size_t i = 0; i < gServiceNames.size(); i++) {
+      ASSERT_FALSE(isServiceRunning(gServiceNames.at(i))) << "Service failed to shut down.";
+    }
+  }
+};
+
+static constexpr size_t NUM_IMMEDIATE_GETS = 100;
+TEST_F(AidlLazyTest, GetRelease) {
+  size_t nServices = gServiceNames.size();
+
+  for (size_t i = 0; i < nServices * NUM_IMMEDIATE_GETS; i++) {
+    IPCThreadState::self()->flushCommands();
+    sp<IBinder> service = waitForService(gServiceNames.at(i % nServices));
+    ASSERT_NE(service.get(), nullptr);
+    ASSERT_EQ(service->pingBinder(), android::NO_ERROR);
+  }
+}
+
+static std::vector<size_t> waitMs(size_t numTimes, size_t maxWait) {
+  std::vector<size_t> times(numTimes);
+  for (size_t i = 0; i < numTimes; i++) {
+    times.at(i) = (size_t)(rand() % (maxWait + 1));
+  }
+  return times;
+}
+
+static void testWithTimes(const std::vector<size_t>& waitMs, bool beforeGet) {
+  size_t nServices = gServiceNames.size();
+  for (size_t i = 0; i < waitMs.size(); i++) {
+    IPCThreadState::self()->flushCommands();
+    if (beforeGet) {
+      std::cout << "Thread waiting " << waitMs.at(i) << " while not holding service." << std::endl;
+      usleep(waitMs.at(i) * 1000);
+    }
+
+    sp<IBinder> service = waitForService(gServiceNames.at(i % nServices));
+
+    if (!beforeGet) {
+      std::cout << "Thread waiting " << waitMs.at(i) << " while holding service." << std::endl;
+      usleep(waitMs.at(i) * 1000);
+    }
+
+    ASSERT_NE(service.get(), nullptr);
+    ASSERT_EQ(service->pingBinder(), android::NO_ERROR);
+  }
+}
+
+static constexpr size_t NUM_TIMES_GET_RELEASE = 5;
+static constexpr size_t MAX_WAITING_DURATION_MS = 10000;
+static constexpr size_t NUM_CONCURRENT_THREADS = 3;
+static void testConcurrentThreadsWithDelays(bool delayBeforeGet) {
+  size_t nServices = gServiceNames.size();
+  std::vector<std::vector<size_t>> threadWaitTimes(NUM_CONCURRENT_THREADS);
+  int maxWait = 0;
+  for (size_t i = 0; i < threadWaitTimes.size(); i++) {
+    threadWaitTimes.at(i) = waitMs(NUM_TIMES_GET_RELEASE * nServices, MAX_WAITING_DURATION_MS);
+    int totalWait = std::accumulate(threadWaitTimes.at(i).begin(), threadWaitTimes.at(i).end(), 0);
+    maxWait = std::max(maxWait, totalWait);
+  }
+  std::cout << "Additional runtime expected from sleeps: " << maxWait << " millisecond(s)."
+            << std::endl;
+
+  std::vector<std::thread> threads(NUM_CONCURRENT_THREADS);
+  for (size_t i = 0; i < threads.size(); i++) {
+    threads.at(i) = std::thread(testWithTimes, threadWaitTimes.at(i), delayBeforeGet);
+  }
+
+  for (auto& thread : threads) {
+    thread.join();
+  }
+}
+
+TEST_F(AidlLazyTest, GetConcurrentWithWaitBefore) {
+  testConcurrentThreadsWithDelays(true);
+}
+
+TEST_F(AidlLazyTest, GetConcurrentWithWaitAfter) {
+  testConcurrentThreadsWithDelays(false);
+}
+
+class AidlLazyRegistrarTest : public ::testing::Test {
+ protected:
+  const String16 serviceName = String16("aidl_lazy_test_1");
+  void SetUp() override {
+    if (std::find(gServiceNames.begin(), gServiceNames.end(), serviceName) == gServiceNames.end()) {
+      GTEST_SKIP() << "Persistence test requires special instance: " << serviceName;
+    }
+  }
+};
+
+template <typename T>
+sp<T> waitForLazyTestService(String16 name) {
+  sp<T> service = android::waitForService<T>(name);
+  EXPECT_NE(service, nullptr);
+  return service;
+}
+
+TEST_F(AidlLazyRegistrarTest, ForcedPersistenceTest) {
+  sp<ILazyTestService> service;
+  for (int i = 0; i < 2; i++) {
+    service = waitForLazyTestService<ILazyTestService>(serviceName);
+    EXPECT_TRUE(service->forcePersist(i == 0).isOk());
+    service = nullptr;
+
+    std::cout << "Waiting " << SHUTDOWN_WAIT_MS << " milliseconds before checking whether the "
+              << "service is still running." << std::endl;
+    IPCThreadState::self()->flushCommands();
+    usleep(SHUTDOWN_WAIT_MS * 1000);
+
+    if (i == 0) {
+      ASSERT_TRUE(isServiceRunning(serviceName)) << "Service shut down when it shouldn't have.";
+    } else {
+      ASSERT_FALSE(isServiceRunning(serviceName)) << "Service failed to shut down.";
+    }
+  }
+}
+
+TEST_F(AidlLazyRegistrarTest, ActiveServicesCountCallbackTest) {
+  const String16 cbServiceName = String16("aidl_lazy_cb_test");
+
+  int efd = eventfd(0, 0);
+  ASSERT_GE(efd, 0) << "Failed to create eventfd";
+
+  unique_fd uniqueEventFd(efd);
+  ParcelFileDescriptor parcelEventFd(std::move(uniqueEventFd));
+
+  sp<ILazyTestServiceCb> service;
+  service = waitForLazyTestService<ILazyTestServiceCb>(cbServiceName);
+  ASSERT_TRUE(service->setEventFd(parcelEventFd).isOk());
+  service = nullptr;
+
+  IPCThreadState::self()->flushCommands();
+
+  std::cout << "Waiting " << SHUTDOWN_WAIT_MS << " milliseconds for callback completion "
+            << "notification." << std::endl;
+
+  int epollFd = epoll_create1(EPOLL_CLOEXEC);
+  ASSERT_GE(epollFd, 0) << "Failed to create epoll";
+  unique_fd epollUniqueFd(epollFd);
+
+  const int EPOLL_MAX_EVENTS = 1;
+  struct epoll_event event, events[EPOLL_MAX_EVENTS];
+
+  event.events = EPOLLIN;
+  event.data.fd = efd;
+  int rc = epoll_ctl(epollFd, EPOLL_CTL_ADD, efd, &event);
+  ASSERT_GE(rc, 0) << "Failed to add fd to epoll";
+
+  rc = TEMP_FAILURE_RETRY(epoll_wait(epollFd, events, EPOLL_MAX_EVENTS, SHUTDOWN_WAIT_MS));
+  ASSERT_NE(rc, 0) << "Service shutdown timeout";
+  ASSERT_GT(rc, 0) << "Error waiting for service shutdown notification";
+
+  eventfd_t counter;
+  rc = TEMP_FAILURE_RETRY(eventfd_read(parcelEventFd.get(), &counter));
+  ASSERT_GE(rc, 0) << "Failed to get callback completion notification from service";
+  ASSERT_EQ(counter, 1);
+
+  std::cout << "Waiting " << CALLBACK_SHUTDOWN_WAIT_MS
+            << " milliseconds before checking whether the "
+            << "service is still running." << std::endl;
+
+  usleep(CALLBACK_SHUTDOWN_WAIT_MS * 1000);
+
+  ASSERT_FALSE(isServiceRunning(serviceName)) << "Service failed to shut down.";
+}
+
+int main(int argc, char** argv) {
+  ::testing::InitGoogleTest(&argc, argv);
+
+  srand(time(nullptr));
+
+  if (argc < 2) {
+    // If the user does not specify any service to test, default to these test interfaces
+    gServiceNames.push_back(String16("aidl_lazy_test_1"));
+    gServiceNames.push_back(String16("aidl_lazy_test_2"));
+  } else {
+    for (int i = 1; i < argc; i++) {
+      gServiceNames.push_back(String16(argv[i]));
+    }
+  }
+
+  android::ProcessState::self()->startThreadPool();
+
+  return RUN_ALL_TESTS();
+}
diff --git a/tests/lazy_test/server.cpp b/tests/lazy_test/server.cpp
new file mode 100644
index 0000000..a425dbf
--- /dev/null
+++ b/tests/lazy_test/server.cpp
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <android-base/logging.h>
+#include <binder/IBinder.h>
+#include <binder/IPCThreadState.h>
+#include <binder/IServiceManager.h>
+#include <binder/LazyServiceRegistrar.h>
+#include "LazyTestService.h"
+
+using android::BBinder;
+using android::IBinder;
+using android::IPCThreadState;
+using android::OK;
+using android::sp;
+using android::binder::LazyServiceRegistrar;
+using android::binder::LazyTestService;
+
+void setupDoubleLazyServer() {
+  sp<LazyTestService> service1 = sp<LazyTestService>::make();
+  sp<LazyTestService> service2 = sp<LazyTestService>::make();
+
+  // Simulate another callback here, to test to make sure the actual instance
+  // we are relying on doesn't have its state messed up when multiple client
+  // callbacks are registered.
+  // DO NOT COPY - INTENTIONALLY TESTING BAD BEHAVIOR
+  auto extra = LazyServiceRegistrar::createExtraTestInstance();
+  extra.forcePersist(true);  // don't allow this instance to handle process lifetime
+  CHECK_EQ(OK, extra.registerService(service1, "aidl_lazy_test_1"));
+  // DO NOT COPY - INTENTIONALLY TESTING BAD BEHAVIOR
+
+  auto lazyRegistrar = LazyServiceRegistrar::getInstance();
+  CHECK_EQ(OK, lazyRegistrar.registerService(service1, "aidl_lazy_test_1"));
+  CHECK_EQ(OK, lazyRegistrar.registerService(service2, "aidl_lazy_test_2"));
+}
+
+void setupQuitterServer() {
+  auto lazyRegistrar = LazyServiceRegistrar::getInstance();
+  lazyRegistrar.setActiveServicesCallback([](bool hasClients) mutable -> bool {
+    // intentional bad behavior, for instance, simulating a system
+    // shutdown at this time
+    if (hasClients) exit(EXIT_SUCCESS);
+    return false;
+  });
+
+  sp<LazyTestService> service = sp<LazyTestService>::make();
+  CHECK_EQ(OK, lazyRegistrar.registerService(service, "aidl_lazy_test_quit"));
+}
+
+int main(int argc, char** argv) {
+  if (argc == 1) {
+    setupDoubleLazyServer();
+  } else if (argc == 2 && argv[1] == std::string("quit")) {
+    setupQuitterServer();
+  } else {
+    LOG_ALWAYS_FATAL("usage: %s [quit]", argv[0]);
+  }
+
+  IPCThreadState::self()->joinThreadPool();
+  return 1;
+}
diff --git a/tests/main.cpp b/tests/main.cpp
new file mode 100644
index 0000000..4d820af
--- /dev/null
+++ b/tests/main.cpp
@@ -0,0 +1,6 @@
+#include <gtest/gtest.h>
+
+int main(int argc, char **argv) {
+  ::testing::InitGoogleTest(&argc, argv);
+  return RUN_ALL_TESTS();
+}
diff --git a/tests/rust/test_client.rs b/tests/rust/test_client.rs
new file mode 100644
index 0000000..67593b6
--- /dev/null
+++ b/tests/rust/test_client.rs
@@ -0,0 +1,1437 @@
+/*
+ * Copyright (C) 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//! Test Rust client for the AIDL compiler.
+
+use ::binder::{binder_impl::Parcel, Parcelable};
+use aidl_test_fixedsizearray::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::{
+    FixedSizeArrayExample,
+    IRepeatFixedSizeArray::{BpRepeatFixedSizeArray, IRepeatFixedSizeArray},
+    IntParcelable::IntParcelable,
+};
+use aidl_test_interface::aidl::android::aidl::tests::nested::{
+    INestedService, ParcelableWithNested,
+};
+use aidl_test_interface::aidl::android::aidl::tests::unions::EnumUnion::EnumUnion;
+use aidl_test_interface::aidl::android::aidl::tests::INewName::{self, BpNewName};
+use aidl_test_interface::aidl::android::aidl::tests::IOldName::{self, BpOldName};
+use aidl_test_interface::aidl::android::aidl::tests::ITestService::{
+    self, BpTestService, Empty::Empty, ITestServiceDefault, ITestServiceDefaultRef,
+};
+use aidl_test_interface::aidl::android::aidl::tests::{
+    extension::ExtendableParcelable::ExtendableParcelable, extension::MyExt::MyExt,
+    extension::MyExt2::MyExt2, extension::MyExtLike::MyExtLike, BackendType::BackendType,
+    ByteEnum::ByteEnum, IntEnum::IntEnum, LongEnum::LongEnum, RecursiveList::RecursiveList,
+    StructuredParcelable, Union,
+};
+use aidl_test_interface::binder::{self, BinderFeatures, IBinder, Interface};
+use aidl_test_nonvintf_parcelable::aidl::android::aidl::tests::nonvintf::{
+    NonVintfExtendableParcelable::NonVintfExtendableParcelable,
+    NonVintfParcelable::NonVintfParcelable,
+};
+use aidl_test_unstable_parcelable::aidl::android::aidl::tests::unstable::{
+    UnstableExtendableParcelable::UnstableExtendableParcelable,
+    UnstableParcelable::UnstableParcelable,
+};
+use aidl_test_versioned_interface::aidl::android::aidl::versioned::tests::{
+    BazUnion::BazUnion, Foo::Foo, IFooInterface, IFooInterface::BpFooInterface,
+};
+use aidl_test_vintf_parcelable::aidl::android::aidl::tests::vintf::{
+    VintfExtendableParcelable::VintfExtendableParcelable, VintfParcelable::VintfParcelable,
+};
+use android_aidl_test_trunk::aidl::android::aidl::test::trunk::{
+    ITrunkStableTest::BpTrunkStableTest, ITrunkStableTest::IMyCallback,
+    ITrunkStableTest::ITrunkStableTest, ITrunkStableTest::MyEnum::MyEnum,
+    ITrunkStableTest::MyOtherParcelable::MyOtherParcelable,
+    ITrunkStableTest::MyParcelable::MyParcelable, ITrunkStableTest::MyUnion::MyUnion,
+};
+
+use std::fs::File;
+use std::io::{Read, Write};
+use std::os::unix::io::FromRawFd;
+use std::sync::{Arc, Mutex};
+
+fn get_test_service() -> binder::Strong<dyn ITestService::ITestService> {
+    binder::get_interface(<BpTestService as ITestService::ITestService>::get_descriptor())
+        .expect("did not get binder service")
+}
+
+fn get_test_trunk_stable_service() -> binder::Strong<dyn ITrunkStableTest> {
+    binder::get_interface(<BpTrunkStableTest as ITrunkStableTest>::get_descriptor())
+        .expect("did not get binder service")
+}
+
+#[test]
+fn test_constants() {
+    assert_eq!(ITestService::A1, 1);
+    assert_eq!(ITestService::A2, 1);
+    assert_eq!(ITestService::A3, 1);
+    assert_eq!(ITestService::A4, 1);
+    assert_eq!(ITestService::A5, 1);
+    assert_eq!(ITestService::A6, 1);
+    assert_eq!(ITestService::A7, 1);
+    assert_eq!(ITestService::A8, 1);
+    assert_eq!(ITestService::A9, 1);
+    assert_eq!(ITestService::A10, 1);
+    assert_eq!(ITestService::A11, 1);
+    assert_eq!(ITestService::A12, 1);
+    assert_eq!(ITestService::A13, 1);
+    assert_eq!(ITestService::A14, 1);
+    assert_eq!(ITestService::A15, 1);
+    assert_eq!(ITestService::A16, 1);
+    assert_eq!(ITestService::A17, 1);
+    assert_eq!(ITestService::A18, 1);
+    assert_eq!(ITestService::A19, 1);
+    assert_eq!(ITestService::A20, 1);
+    assert_eq!(ITestService::A21, 1);
+    assert_eq!(ITestService::A22, 1);
+    assert_eq!(ITestService::A23, 1);
+    assert_eq!(ITestService::A24, 1);
+    assert_eq!(ITestService::A25, 1);
+    assert_eq!(ITestService::A26, 1);
+    assert_eq!(ITestService::A27, 1);
+    assert_eq!(ITestService::A28, 1);
+    assert_eq!(ITestService::A29, 1);
+    assert_eq!(ITestService::A30, 1);
+    assert_eq!(ITestService::A31, 1);
+    assert_eq!(ITestService::A32, 1);
+    assert_eq!(ITestService::A33, 1);
+    assert_eq!(ITestService::A34, 1);
+    assert_eq!(ITestService::A35, 1);
+    assert_eq!(ITestService::A36, 1);
+    assert_eq!(ITestService::A37, 1);
+    assert_eq!(ITestService::A38, 1);
+    assert_eq!(ITestService::A39, 1);
+    assert_eq!(ITestService::A40, 1);
+    assert_eq!(ITestService::A41, 1);
+    assert_eq!(ITestService::A42, 1);
+    assert_eq!(ITestService::A43, 1);
+    assert_eq!(ITestService::A44, 1);
+    assert_eq!(ITestService::A45, 1);
+    assert_eq!(ITestService::A46, 1);
+    assert_eq!(ITestService::A47, 1);
+    assert_eq!(ITestService::A48, 1);
+    assert_eq!(ITestService::A49, 1);
+    assert_eq!(ITestService::A50, 1);
+    assert_eq!(ITestService::A51, 1);
+    assert_eq!(ITestService::A52, 1);
+    assert_eq!(ITestService::A53, 1);
+    assert_eq!(ITestService::A54, 1);
+    assert_eq!(ITestService::A55, 1);
+    assert_eq!(ITestService::A56, 1);
+    assert_eq!(ITestService::A57, 1);
+    assert_eq!(ITestService::FLOAT_CONSTANT4, 2.2_f32);
+    assert_eq!(ITestService::FLOAT_CONSTANT5, -2.2_f32);
+    assert_eq!(ITestService::DOUBLE_CONSTANT4, 2.2_f64);
+    assert_eq!(ITestService::DOUBLE_CONSTANT5, -2.2_f64);
+}
+
+#[test]
+fn test_oneway() {
+    let result = get_test_service().TestOneway();
+    assert_eq!(result, Ok(()));
+}
+
+macro_rules! test_primitive {
+    ($test:ident, $func:ident, $value:expr) => {
+        #[test]
+        fn $test() {
+            let value = $value;
+            let result = get_test_service().$func(value);
+            assert_eq!(result, Ok(value));
+        }
+    };
+}
+
+test_primitive! {test_primitive_bool_false, RepeatBoolean, false}
+test_primitive! {test_primitive_bool_true, RepeatBoolean, true}
+test_primitive! {test_primitive_byte, RepeatByte, -128i8}
+test_primitive! {test_primitive_char, RepeatChar, 'A' as u16}
+test_primitive! {test_primitive_int, RepeatInt, 1i32 << 30}
+test_primitive! {test_primitive_long, RepeatLong, 1i64 << 60}
+test_primitive! {test_primitive_float, RepeatFloat, 1.0f32 / 3.0f32}
+test_primitive! {test_primitive_double, RepeatDouble, 1.0f64 / 3.0f64}
+test_primitive! {test_primitive_byte_constant, RepeatByte, ITestService::BYTE_CONSTANT}
+test_primitive! {test_primitive_constant1, RepeatInt, ITestService::CONSTANT}
+test_primitive! {test_primitive_constant2, RepeatInt, ITestService::CONSTANT2}
+test_primitive! {test_primitive_constant3, RepeatInt, ITestService::CONSTANT3}
+test_primitive! {test_primitive_constant4, RepeatInt, ITestService::CONSTANT4}
+test_primitive! {test_primitive_constant5, RepeatInt, ITestService::CONSTANT5}
+test_primitive! {test_primitive_constant6, RepeatInt, ITestService::CONSTANT6}
+test_primitive! {test_primitive_constant7, RepeatInt, ITestService::CONSTANT7}
+test_primitive! {test_primitive_constant8, RepeatInt, ITestService::CONSTANT8}
+test_primitive! {test_primitive_constant9, RepeatInt, ITestService::CONSTANT9}
+test_primitive! {test_primitive_constant10, RepeatInt, ITestService::CONSTANT10}
+test_primitive! {test_primitive_constant11, RepeatInt, ITestService::CONSTANT11}
+test_primitive! {test_primitive_constant12, RepeatInt, ITestService::CONSTANT12}
+test_primitive! {test_primitive_long_constant, RepeatLong, ITestService::LONG_CONSTANT}
+test_primitive! {test_primitive_byte_enum, RepeatByteEnum, ByteEnum::FOO}
+test_primitive! {test_primitive_int_enum, RepeatIntEnum, IntEnum::BAR}
+test_primitive! {test_primitive_long_enum, RepeatLongEnum, LongEnum::FOO}
+test_primitive! {test_primitive_float_constant, RepeatFloat, ITestService::FLOAT_CONSTANT}
+test_primitive! {test_primitive_float_constant2, RepeatFloat, ITestService::FLOAT_CONSTANT2}
+test_primitive! {test_primitive_float_constant3, RepeatFloat, ITestService::FLOAT_CONSTANT3}
+test_primitive! {test_primitive_float_constant4, RepeatFloat, ITestService::FLOAT_CONSTANT4}
+test_primitive! {test_primitive_float_constant5, RepeatFloat, ITestService::FLOAT_CONSTANT5}
+test_primitive! {test_primitive_float_constant6, RepeatFloat, ITestService::FLOAT_CONSTANT6}
+test_primitive! {test_primitive_float_constant7, RepeatFloat, ITestService::FLOAT_CONSTANT7}
+test_primitive! {test_primitive_double_constant, RepeatDouble, ITestService::DOUBLE_CONSTANT}
+test_primitive! {test_primitive_double_constant2, RepeatDouble, ITestService::DOUBLE_CONSTANT2}
+test_primitive! {test_primitive_double_constant3, RepeatDouble, ITestService::DOUBLE_CONSTANT3}
+test_primitive! {test_primitive_double_constant4, RepeatDouble, ITestService::DOUBLE_CONSTANT4}
+test_primitive! {test_primitive_double_constant5, RepeatDouble, ITestService::DOUBLE_CONSTANT5}
+test_primitive! {test_primitive_double_constant6, RepeatDouble, ITestService::DOUBLE_CONSTANT6}
+test_primitive! {test_primitive_double_constant7, RepeatDouble, ITestService::DOUBLE_CONSTANT7}
+
+#[test]
+fn test_repeat_string() {
+    let service = get_test_service();
+    let inputs = [
+        "typical string".into(),
+        String::new(),
+        "\0\0".into(),
+        // This is actually two unicode code points:
+        //   U+10437: The 'small letter yee' character in the deseret alphabet
+        //   U+20AC: A euro sign
+        String::from_utf16(&[0xD801, 0xDC37, 0x20AC]).expect("error converting string"),
+        ITestService::STRING_CONSTANT.into(),
+        ITestService::STRING_CONSTANT2.into(),
+    ];
+    for input in &inputs {
+        let result = service.RepeatString(input);
+        assert_eq!(result.as_ref(), Ok(input));
+    }
+}
+
+macro_rules! test_reverse_array {
+    ($test:ident, $func:ident, $array:expr) => {
+        #[test]
+        fn $test() {
+            let mut array = $array.to_vec();
+
+            // Java needs initial values here (can't resize arrays)
+            let mut repeated = vec![Default::default(); array.len()];
+
+            let result = get_test_service().$func(&array, &mut repeated);
+            assert_eq!(repeated, array);
+            array.reverse();
+            assert_eq!(result, Ok(array));
+        }
+    };
+}
+
+test_reverse_array! {test_array_boolean, ReverseBoolean, [true, false, false]}
+test_reverse_array! {test_array_byte, ReverseByte, [255u8, 0u8, 127u8]}
+test_reverse_array! {
+    service,
+    ReverseChar,
+    ['A' as u16, 'B' as u16, 'C' as u16]
+}
+test_reverse_array! {test_array_int, ReverseInt, [1, 2, 3]}
+test_reverse_array! {test_array_long, ReverseLong, [-1i64, 0i64, 1i64 << 60]}
+test_reverse_array! {test_array_float, ReverseFloat, [-0.3f32, -0.7f32, 8.0f32]}
+test_reverse_array! {
+    test_array_double,
+    ReverseDouble,
+    [1.0f64 / 3.0f64, 1.0f64 / 7.0f64, 42.0f64]
+}
+test_reverse_array! {
+    test_array_string,
+    ReverseString,
+    ["f".into(), "a".into(), "b".into()]
+}
+test_reverse_array! {
+    test_array_byte_enum,
+    ReverseByteEnum,
+    [ByteEnum::FOO, ByteEnum::BAR, ByteEnum::BAR]
+}
+test_reverse_array! {
+    test_array_byte_enum_values,
+    ReverseByteEnum,
+    ByteEnum::enum_values()
+}
+test_reverse_array! {
+    test_array_byte_enum_v2,
+    ReverseByteEnum,
+    [ByteEnum::FOO, ByteEnum::BAR, ByteEnum::BAZ]
+}
+test_reverse_array! {
+    test_array_int_enum,
+    ReverseIntEnum,
+    [IntEnum::FOO, IntEnum::BAR, IntEnum::BAR]
+}
+test_reverse_array! {
+    test_array_long_enum,
+    ReverseLongEnum,
+    [LongEnum::FOO, LongEnum::BAR, LongEnum::BAR]
+}
+test_reverse_array! {
+    test_array_string_list,
+    ReverseStringList,
+    ["f".into(), "a".into(), "b".into()]
+}
+test_reverse_array! {
+    test_array_utf8_string,
+    ReverseUtf8CppString,
+    [
+        "a".into(),
+        String::new(),
+        std::str::from_utf8(&[0xC3, 0xB8])
+            .expect("error converting string")
+            .into(),
+    ]
+}
+
+#[test]
+fn test_binder_exchange() {
+    const NAME: &str = "Smythe";
+    let service = get_test_service();
+    let got = service.GetOtherTestService(NAME).expect("error calling GetOtherTestService");
+    assert_eq!(got.GetName().as_ref().map(String::as_ref), Ok(NAME));
+    assert_eq!(service.VerifyName(&got, NAME), Ok(true));
+}
+
+#[test]
+fn test_binder_array_exchange() {
+    let names = vec!["Fizz".into(), "Buzz".into()];
+    let service = get_test_service();
+    let got = service.GetInterfaceArray(&names).expect("error calling GetInterfaceArray");
+    assert_eq!(got.iter().map(|s| s.GetName()).collect::<Result<Vec<_>, _>>(), Ok(names.clone()));
+    assert_eq!(service.VerifyNamesWithInterfaceArray(&got, &names), Ok(true));
+}
+
+#[test]
+fn test_binder_nullable_array_exchange() {
+    let names = vec![Some("Fizz".into()), None, Some("Buzz".into())];
+    let service = get_test_service();
+    let got = service
+        .GetNullableInterfaceArray(Some(&names))
+        .expect("error calling GetNullableInterfaceArray");
+    assert_eq!(
+        got.as_ref().map(|arr| arr
+            .iter()
+            .map(|opt_s| opt_s.as_ref().map(|s| s.GetName().expect("error calling GetName")))
+            .collect::<Vec<_>>()),
+        Some(names.clone())
+    );
+    assert_eq!(
+        service.VerifyNamesWithNullableInterfaceArray(got.as_ref().map(|v| &v[..]), Some(&names)),
+        Ok(true)
+    );
+}
+
+#[test]
+fn test_interface_list_exchange() {
+    let names = vec![Some("Fizz".into()), None, Some("Buzz".into())];
+    let service = get_test_service();
+    let got = service.GetInterfaceList(Some(&names)).expect("error calling GetInterfaceList");
+    assert_eq!(
+        got.as_ref().map(|arr| arr
+            .iter()
+            .map(|opt_s| opt_s.as_ref().map(|s| s.GetName().expect("error calling GetName")))
+            .collect::<Vec<_>>()),
+        Some(names.clone())
+    );
+    assert_eq!(
+        service.VerifyNamesWithInterfaceList(got.as_ref().map(|v| &v[..]), Some(&names)),
+        Ok(true)
+    );
+}
+
+fn build_pipe() -> (File, File) {
+    // Safety: we get two file descriptors from pipe()
+    // and pass them after checking if the function returned
+    // without an error, so the descriptors should be valid
+    // by that point
+    unsafe {
+        let mut fds = [0, 0];
+        if libc::pipe(fds.as_mut_ptr()) != 0 {
+            panic!("pipe() error");
+        }
+        (File::from_raw_fd(fds[0]), File::from_raw_fd(fds[1]))
+    }
+}
+
+#[test]
+fn test_parcel_file_descriptor() {
+    let service = get_test_service();
+    let (mut read_file, write_file) = build_pipe();
+
+    let write_pfd = binder::ParcelFileDescriptor::new(write_file);
+    let result_pfd = service
+        .RepeatParcelFileDescriptor(&write_pfd)
+        .expect("error calling RepeatParcelFileDescriptor");
+
+    const TEST_DATA: &[u8] = b"FrazzleSnazzleFlimFlamFlibbityGumboChops";
+    result_pfd.as_ref().write_all(TEST_DATA).expect("error writing to pipe");
+
+    let mut buf = [0u8; TEST_DATA.len()];
+    read_file.read_exact(&mut buf).expect("error reading from pipe");
+    assert_eq!(&buf[..], TEST_DATA);
+}
+
+#[test]
+fn test_parcel_file_descriptor_array() {
+    let service = get_test_service();
+
+    let (read_file, write_file) = build_pipe();
+    let input = vec![
+        binder::ParcelFileDescriptor::new(read_file),
+        binder::ParcelFileDescriptor::new(write_file),
+    ];
+
+    let mut repeated = vec![];
+
+    let backend = service.getBackendType().expect("error getting backend type");
+    if backend == BackendType::JAVA {
+        // Java needs initial values here (can't resize arrays)
+        // Other backends can't accept 'None', but we can use it in Java for convenience, rather
+        // than creating file descriptors.
+        repeated = vec![None, None];
+    }
+
+    let result = service
+        .ReverseParcelFileDescriptorArray(&input[..], &mut repeated)
+        .expect("error calling ReverseParcelFileDescriptorArray");
+
+    input[1].as_ref().write_all(b"First").expect("error writing to pipe");
+    repeated[1]
+        .as_mut()
+        .expect("received None for ParcelFileDescriptor")
+        .as_ref()
+        .write_all(b"Second")
+        .expect("error writing to pipe");
+    result[0].as_ref().write_all(b"Third").expect("error writing to pipe");
+
+    const TEST_DATA: &[u8] = b"FirstSecondThird";
+    let mut buf = [0u8; TEST_DATA.len()];
+    input[0].as_ref().read_exact(&mut buf).expect("error reading from pipe");
+    assert_eq!(&buf[..], TEST_DATA);
+}
+
+#[test]
+fn test_service_specific_exception() {
+    let service = get_test_service();
+
+    for i in -1..2 {
+        let result = service.ThrowServiceException(i);
+        assert!(result.is_err());
+
+        let status = result.unwrap_err();
+        assert_eq!(status.exception_code(), binder::ExceptionCode::SERVICE_SPECIFIC);
+        assert_eq!(status.service_specific_error(), i);
+    }
+}
+
+macro_rules! test_nullable {
+    ($test:ident, $func:ident, $value:expr) => {
+        #[test]
+        fn $test() {
+            let service = get_test_service();
+            let value = Some($value);
+            let result = service.$func(value.as_deref());
+            assert_eq!(result, Ok(value));
+
+            let result = service.$func(None);
+            assert_eq!(result, Ok(None));
+        }
+    };
+}
+
+test_nullable! {test_nullable_array_int, RepeatNullableIntArray, vec![1, 2, 3]}
+test_nullable! {
+    test_nullable_array_byte_enum,
+    RepeatNullableByteEnumArray,
+    vec![ByteEnum::FOO, ByteEnum::BAR]
+}
+test_nullable! {
+    test_nullable_array_int_enum,
+    RepeatNullableIntEnumArray,
+    vec![IntEnum::FOO, IntEnum::BAR]
+}
+test_nullable! {
+    test_nullable_array_long_enum,
+    RepeatNullableLongEnumArray,
+    vec![LongEnum::FOO, LongEnum::BAR]
+}
+test_nullable! {test_nullable_string, RepeatNullableString, "Blooob".into()}
+test_nullable! {
+    test_nullable_string_list,
+    RepeatNullableStringList,
+    vec![
+        Some("Wat".into()),
+        Some("Blooob".into()),
+        Some("Wat".into()),
+        None,
+        Some("YEAH".into()),
+        Some("OKAAAAY".into()),
+    ]
+}
+
+#[test]
+fn test_nullable_parcelable() {
+    let value = Empty {};
+
+    let service = get_test_service();
+    let value = Some(value);
+    let result = service.RepeatNullableParcelable(value.as_ref());
+    assert_eq!(result, Ok(value));
+
+    let result = service.RepeatNullableParcelable(None);
+    assert_eq!(result, Ok(None));
+}
+
+test_nullable! {
+    test_nullable_parcelable_array,
+    RepeatNullableParcelableArray,
+    vec![
+        Some(Empty {}),
+        None,
+    ]
+}
+
+test_nullable! {
+    test_nullable_parcelable_list,
+    RepeatNullableParcelableList,
+    vec![
+        Some(Empty {}),
+        None,
+    ]
+}
+
+#[test]
+fn test_binder() {
+    let service = get_test_service();
+    assert!(service.GetCallback(true).expect("error calling GetCallback").is_none());
+    let callback = service
+        .GetCallback(false)
+        .expect("error calling GetCallback")
+        .expect("expected Some from GetCallback");
+
+    // We don't have any place to get a fresh `SpIBinder`, so we
+    // reuse the interface for the binder tests
+    let binder = callback.as_binder();
+    assert_eq!(service.TakesAnIBinder(&binder), Ok(()));
+    assert_eq!(service.TakesANullableIBinder(None), Ok(()));
+    assert_eq!(service.TakesANullableIBinder(Some(&binder)), Ok(()));
+}
+
+macro_rules! test_reverse_null_array {
+    ($service:expr, $func:ident, $expect_repeated:expr) => {{
+        let mut repeated = None;
+        let result = $service.$func(None, &mut repeated);
+        assert_eq!(repeated, $expect_repeated);
+        assert_eq!(result, Ok(None));
+    }};
+}
+
+macro_rules! test_reverse_nullable_array {
+    ($service:expr, $func:ident, $array:expr) => {{
+        let mut array = $array;
+        // Java needs initial values here (can't resize arrays)
+        let mut repeated = Some(vec![Default::default(); array.len()]);
+        let result = $service.$func(Some(&array[..]), &mut repeated);
+        assert_eq!(repeated.as_ref(), Some(&array));
+        array.reverse();
+        assert_eq!(result, Ok(Some(array)));
+    }};
+}
+
+#[test]
+fn test_utf8_string() {
+    let service = get_test_service();
+    let inputs = [
+        "typical string",
+        "",
+        "\0\0",
+        std::str::from_utf8(&[0xF0, 0x90, 0x90, 0xB7, 0xE2, 0x82, 0xAC])
+            .expect("error converting string"),
+        ITestService::STRING_CONSTANT_UTF8,
+    ];
+    for input in &inputs {
+        let result = service.RepeatUtf8CppString(input);
+        assert_eq!(result.as_ref().map(String::as_str), Ok(*input));
+
+        let result = service.RepeatNullableUtf8CppString(Some(input));
+        assert_eq!(result.as_ref().map(Option::as_deref), Ok(Some(*input)));
+    }
+
+    let result = service.RepeatNullableUtf8CppString(None);
+    assert_eq!(result, Ok(None));
+
+    let inputs = vec![
+        Some("typical string".into()),
+        Some(String::new()),
+        None,
+        Some(
+            std::str::from_utf8(&[0xF0, 0x90, 0x90, 0xB7, 0xE2, 0x82, 0xAC])
+                .expect("error converting string")
+                .into(),
+        ),
+        Some(ITestService::STRING_CONSTANT_UTF8.into()),
+    ];
+
+    // Java can't return a null list as a parameter
+    let backend = service.getBackendType().expect("error getting backend type");
+    let null_output = if backend == BackendType::JAVA { Some(vec![]) } else { None };
+    test_reverse_null_array!(service, ReverseUtf8CppStringList, null_output);
+
+    test_reverse_null_array!(service, ReverseNullableUtf8CppString, None);
+
+    test_reverse_nullable_array!(service, ReverseUtf8CppStringList, inputs.clone());
+    test_reverse_nullable_array!(service, ReverseNullableUtf8CppString, inputs);
+}
+
+#[allow(clippy::approx_constant)]
+#[allow(clippy::float_cmp)]
+#[test]
+fn test_parcelable() {
+    let service = get_test_service();
+    let mut parcelable = StructuredParcelable::StructuredParcelable::default();
+
+    const DESIRED_VALUE: i32 = 23;
+    parcelable.f = DESIRED_VALUE;
+
+    assert_eq!(parcelable.stringDefaultsToFoo, "foo");
+    assert_eq!(parcelable.byteDefaultsToFour, 4);
+    assert_eq!(parcelable.intDefaultsToFive, 5);
+    assert_eq!(parcelable.longDefaultsToNegativeSeven, -7);
+    assert!(parcelable.booleanDefaultsToTrue);
+    assert_eq!(parcelable.charDefaultsToC, 'C' as u16);
+    assert_eq!(parcelable.floatDefaultsToPi, 3.14f32);
+    assert_eq!(parcelable.doubleWithDefault, -3.14e17f64);
+    assert!(!parcelable.boolDefault);
+    assert_eq!(parcelable.byteDefault, 0);
+    assert_eq!(parcelable.intDefault, 0);
+    assert_eq!(parcelable.longDefault, 0);
+    assert_eq!(parcelable.floatDefault, 0.0f32);
+    assert_eq!(parcelable.doubleDefault, 0.0f64);
+    assert_eq!(parcelable.arrayDefaultsTo123, &[1, 2, 3]);
+    assert!(parcelable.arrayDefaultsToEmpty.is_empty());
+
+    let result = service.FillOutStructuredParcelable(&mut parcelable);
+    assert_eq!(result, Ok(()));
+
+    assert_eq!(parcelable.shouldContainThreeFs, [DESIRED_VALUE, DESIRED_VALUE, DESIRED_VALUE]);
+    assert_eq!(parcelable.shouldBeJerry, "Jerry");
+    assert_eq!(parcelable.int32_min, i32::MIN);
+    assert_eq!(parcelable.int32_max, i32::MAX);
+    assert_eq!(parcelable.int64_max, i64::MAX);
+    assert_eq!(parcelable.hexInt32_neg_1, -1);
+    for i in parcelable.int8_1 {
+        assert_eq!(i, 1);
+    }
+    for i in parcelable.int32_1 {
+        assert_eq!(i, 1);
+    }
+    for i in parcelable.int64_1 {
+        assert_eq!(i, 1);
+    }
+    assert_eq!(parcelable.hexInt32_pos_1, 1);
+    assert_eq!(parcelable.hexInt64_pos_1, 1);
+    assert_eq!(parcelable.const_exprs_1.0, 1);
+    assert_eq!(parcelable.const_exprs_2.0, 1);
+    assert_eq!(parcelable.const_exprs_3.0, 1);
+    assert_eq!(parcelable.const_exprs_4.0, 1);
+    assert_eq!(parcelable.const_exprs_5.0, 1);
+    assert_eq!(parcelable.const_exprs_6.0, 1);
+    assert_eq!(parcelable.const_exprs_7.0, 1);
+    assert_eq!(parcelable.const_exprs_8.0, 1);
+    assert_eq!(parcelable.const_exprs_9.0, 1);
+    assert_eq!(parcelable.const_exprs_10.0, 1);
+    assert_eq!(parcelable.addString1, "hello world!");
+    assert_eq!(parcelable.addString2, "The quick brown fox jumps over the lazy dog.");
+
+    assert_eq!(
+        parcelable.shouldSetBit0AndBit2,
+        StructuredParcelable::BIT0 | StructuredParcelable::BIT2
+    );
+
+    assert_eq!(parcelable.u, Some(Union::Union::Ns(vec![1, 2, 3])));
+    assert_eq!(parcelable.shouldBeConstS1, Some(Union::Union::S(Union::S1.to_string())))
+}
+
+#[test]
+fn test_repeat_extendable_parcelable() {
+    let service = get_test_service();
+
+    let ext = Arc::new(MyExt { a: 42, b: "EXT".into() });
+    let mut ep = ExtendableParcelable { a: 1, b: "a".into(), c: 42, ..Default::default() };
+    ep.ext.set_parcelable(Arc::clone(&ext)).expect("error setting parcelable");
+
+    let mut ep2 = ExtendableParcelable::default();
+    let result = service.RepeatExtendableParcelable(&ep, &mut ep2);
+    assert_eq!(result, Ok(()));
+    assert_eq!(ep2.a, ep.a);
+    assert_eq!(ep2.b, ep.b);
+
+    let ret_ext = ep2.ext.get_parcelable::<MyExt>().expect("error getting parcelable");
+    assert!(ret_ext.is_some());
+
+    let ret_ext = ret_ext.unwrap();
+    assert_eq!(ret_ext.a, ext.a);
+    assert_eq!(ret_ext.b, ext.b);
+}
+
+macro_rules! test_parcelable_holder_stability {
+    ($test:ident, $holder:path, $parcelable:path) => {
+        #[test]
+        fn $test() {
+            let mut holder = <$holder>::default();
+            let parcelable = Arc::new(<$parcelable>::default());
+            let result = holder.ext.set_parcelable(Arc::clone(&parcelable));
+            assert_eq!(result, Ok(()));
+
+            let parcelable2 = holder.ext.get_parcelable::<$parcelable>().unwrap().unwrap();
+            assert!(Arc::ptr_eq(&parcelable, &parcelable2));
+        }
+    };
+}
+
+test_parcelable_holder_stability! {
+    test_vintf_parcelable_holder_can_contain_vintf_parcelable,
+    VintfExtendableParcelable,
+    VintfParcelable
+}
+test_parcelable_holder_stability! {
+    test_stable_parcelable_holder_can_contain_vintf_parcelable,
+    NonVintfExtendableParcelable,
+    VintfParcelable
+}
+test_parcelable_holder_stability! {
+    test_stable_parcelable_holder_can_contain_non_vintf_parcelable,
+    NonVintfExtendableParcelable,
+    NonVintfParcelable
+}
+test_parcelable_holder_stability! {
+    test_stable_parcelable_holder_can_contain_unstable_parcelable,
+    NonVintfExtendableParcelable,
+    UnstableParcelable
+}
+test_parcelable_holder_stability! {
+    test_unstable_parcelable_holder_can_contain_vintf_parcelable,
+    UnstableExtendableParcelable,
+    VintfParcelable
+}
+test_parcelable_holder_stability! {
+    test_unstable_parcelable_holder_can_contain_non_vintf_parcelable,
+    UnstableExtendableParcelable,
+    NonVintfParcelable
+}
+test_parcelable_holder_stability! {
+    test_unstable_parcelable_holder_can_contain_unstable_parcelable,
+    UnstableExtendableParcelable,
+    UnstableParcelable
+}
+
+#[test]
+fn test_vintf_parcelable_holder_cannot_contain_not_vintf_parcelable() {
+    let mut holder = VintfExtendableParcelable::default();
+    let parcelable = Arc::new(NonVintfParcelable::default());
+    let result = holder.ext.set_parcelable(Arc::clone(&parcelable));
+    assert_eq!(result, Err(binder::StatusCode::BAD_VALUE));
+
+    let parcelable2 = holder.ext.get_parcelable::<NonVintfParcelable>();
+    assert!(parcelable2.unwrap().is_none());
+}
+
+#[test]
+fn test_vintf_parcelable_holder_cannot_contain_unstable_parcelable() {
+    let mut holder = VintfExtendableParcelable::default();
+    let parcelable = Arc::new(UnstableParcelable::default());
+    let result = holder.ext.set_parcelable(Arc::clone(&parcelable));
+    assert_eq!(result, Err(binder::StatusCode::BAD_VALUE));
+
+    let parcelable2 = holder.ext.get_parcelable::<UnstableParcelable>();
+    assert!(parcelable2.unwrap().is_none());
+}
+
+#[test]
+fn test_read_write_extension() {
+    let ext = Arc::new(MyExt { a: 42, b: "EXT".into() });
+    let ext2 = Arc::new(MyExt2 { a: 42, b: MyExt { a: 24, b: "INEXT".into() }, c: "EXT2".into() });
+
+    let mut ep = ExtendableParcelable { a: 1, b: "a".into(), c: 42, ..Default::default() };
+
+    ep.ext.set_parcelable(Arc::clone(&ext)).unwrap();
+    ep.ext2.set_parcelable(Arc::clone(&ext2)).unwrap();
+
+    let ext_like = ep.ext.get_parcelable::<MyExtLike>();
+    assert_eq!(ext_like.unwrap_err(), binder::StatusCode::BAD_VALUE);
+
+    let actual_ext = ep.ext.get_parcelable::<MyExt>();
+    assert!(actual_ext.unwrap().is_some());
+    let actual_ext2 = ep.ext2.get_parcelable::<MyExt2>();
+    assert!(actual_ext2.unwrap().is_some());
+
+    check_extension_content(&ep, &ext, &ext2);
+
+    let mut parcel = Parcel::new();
+    ep.write_to_parcel(&mut parcel.borrowed()).unwrap();
+
+    // SAFETY: 0 is less than the current size of the parcel data buffer, because the parcel is not
+    // empty.
+    unsafe {
+        parcel.set_data_position(0).unwrap();
+    }
+    let mut ep1 = ExtendableParcelable::default();
+    ep1.read_from_parcel(parcel.borrowed_ref()).unwrap();
+
+    // SAFETY: 0 is less than the current size of the parcel data buffer, because the parcel is not
+    // empty.
+    unsafe {
+        parcel.set_data_position(0).unwrap();
+    }
+    ep1.write_to_parcel(&mut parcel.borrowed()).unwrap();
+
+    // SAFETY: 0 is less than the current size of the parcel data buffer, because the parcel is not
+    // empty.
+    unsafe {
+        parcel.set_data_position(0).unwrap();
+    }
+    let mut ep2 = ExtendableParcelable::default();
+    ep2.read_from_parcel(parcel.borrowed_ref()).unwrap();
+
+    let ext_like = ep2.ext.get_parcelable::<MyExtLike>();
+    assert!(ext_like.unwrap().is_none());
+
+    let actual_ext = ep2.ext.get_parcelable::<MyExt>();
+    assert!(actual_ext.unwrap().is_some());
+
+    let new_ext2 =
+        Arc::new(MyExt2 { a: 79, b: MyExt { a: 42, b: "INNEWEXT".into() }, c: "NEWEXT2".into() });
+    ep2.ext2.set_parcelable(Arc::clone(&new_ext2)).unwrap();
+
+    check_extension_content(&ep1, &ext, &ext2);
+    check_extension_content(&ep2, &ext, &new_ext2);
+}
+
+fn check_extension_content(ep: &ExtendableParcelable, ext: &MyExt, ext2: &MyExt2) {
+    assert_eq!(ep.a, 1);
+    assert_eq!(ep.b, "a");
+    assert_eq!(ep.c, 42);
+
+    let actual_ext = ep.ext.get_parcelable::<MyExt>().unwrap().unwrap();
+    assert_eq!(ext.a, actual_ext.a);
+    assert_eq!(ext.b, actual_ext.b);
+
+    let actual_ext2 = ep.ext2.get_parcelable::<MyExt2>().unwrap().unwrap();
+    assert_eq!(ext2.a, actual_ext2.a);
+    assert_eq!(ext2.b.a, actual_ext2.b.a);
+    assert_eq!(ext2.b.b, actual_ext2.b.b);
+    assert_eq!(ext2.c, actual_ext2.c);
+}
+
+#[test]
+fn test_reverse_recursive_list() {
+    let service = get_test_service();
+
+    let mut head = None;
+    for n in 0..10 {
+        let node = RecursiveList { value: n, next: head };
+        head = Some(Box::new(node));
+    }
+    // head = [9, 8, .., 0]
+    let result = service.ReverseList(head.as_ref().unwrap());
+    assert!(result.is_ok());
+
+    // reversed should be [0, 1, ... 9]
+    let mut reversed: Option<&RecursiveList> = result.as_ref().ok();
+    for n in 0..10 {
+        assert_eq!(reversed.map(|inner| inner.value), Some(n));
+        reversed = reversed.unwrap().next.as_ref().map(|n| n.as_ref());
+    }
+    assert!(reversed.is_none())
+}
+
+#[test]
+fn test_get_union_tags() {
+    let service = get_test_service();
+    let result = service.GetUnionTags(&[]);
+    assert_eq!(result, Ok(vec![]));
+    let result = service.GetUnionTags(&[Union::Union::N(0), Union::Union::Ns(vec![])]);
+    assert_eq!(result, Ok(vec![Union::Tag::Tag::n, Union::Tag::Tag::ns]));
+}
+
+#[test]
+fn test_unions() {
+    assert_eq!(Union::Union::default(), Union::Union::Ns(vec![]));
+    assert_eq!(EnumUnion::default(), EnumUnion::IntEnum(IntEnum::FOO));
+}
+
+const EXPECTED_ARG_VALUE: i32 = 100;
+const EXPECTED_RETURN_VALUE: i32 = 200;
+
+struct TestDefaultImpl;
+
+impl binder::Interface for TestDefaultImpl {}
+
+impl ITestServiceDefault for TestDefaultImpl {
+    fn UnimplementedMethod(&self, arg: i32) -> binder::Result<i32> {
+        assert_eq!(arg, EXPECTED_ARG_VALUE);
+        Ok(EXPECTED_RETURN_VALUE)
+    }
+}
+
+#[test]
+fn test_default_impl() {
+    let service = get_test_service();
+    let di: ITestServiceDefaultRef = Some(Arc::new(TestDefaultImpl));
+    <BpTestService as ITestService::ITestService>::setDefaultImpl(di);
+
+    let result = service.UnimplementedMethod(EXPECTED_ARG_VALUE);
+    assert_eq!(result, Ok(EXPECTED_RETURN_VALUE));
+}
+
+#[test]
+fn test_versioned_interface_version() {
+    let service: binder::Strong<dyn IFooInterface::IFooInterface> =
+        binder::get_interface(<BpFooInterface as IFooInterface::IFooInterface>::get_descriptor())
+            .expect("did not get binder service");
+
+    let version = service.getInterfaceVersion();
+    assert_eq!(version, Ok(1));
+}
+
+#[test]
+fn test_versioned_interface_hash() {
+    let service: binder::Strong<dyn IFooInterface::IFooInterface> =
+        binder::get_interface(<BpFooInterface as IFooInterface::IFooInterface>::get_descriptor())
+            .expect("did not get binder service");
+
+    let hash = service.getInterfaceHash();
+    assert_eq!(hash.as_ref().map(String::as_str), Ok("9e7be1859820c59d9d55dd133e71a3687b5d2e5b"));
+}
+
+#[test]
+fn test_versioned_known_union_field_is_ok() {
+    let service: binder::Strong<dyn IFooInterface::IFooInterface> =
+        binder::get_interface(<BpFooInterface as IFooInterface::IFooInterface>::get_descriptor())
+            .expect("did not get binder service");
+
+    assert_eq!(service.acceptUnionAndReturnString(&BazUnion::IntNum(42)), Ok(String::from("42")));
+}
+
+#[test]
+fn test_versioned_unknown_union_field_triggers_error() {
+    let service: binder::Strong<dyn IFooInterface::IFooInterface> =
+        binder::get_interface(<BpFooInterface as IFooInterface::IFooInterface>::get_descriptor())
+            .expect("did not get binder service");
+
+    let ret = service.acceptUnionAndReturnString(&BazUnion::LongNum(42));
+    assert!(ret.is_err());
+
+    let main_service = get_test_service();
+    let backend = main_service.getBackendType().expect("error getting backend type");
+
+    // b/173458620 - for investigation of fixing difference
+    if backend == BackendType::JAVA {
+        assert_eq!(ret.unwrap_err().exception_code(), binder::ExceptionCode::ILLEGAL_ARGUMENT);
+    } else {
+        assert_eq!(ret.unwrap_err().transaction_error(), binder::StatusCode::BAD_VALUE);
+    }
+}
+
+#[test]
+fn test_array_of_parcelable_with_new_field() {
+    let service: binder::Strong<dyn IFooInterface::IFooInterface> =
+        binder::get_interface(<BpFooInterface as IFooInterface::IFooInterface>::get_descriptor())
+            .expect("did not get binder service");
+
+    let foos = [Default::default(), Default::default(), Default::default()];
+    let ret = service.returnsLengthOfFooArray(&foos);
+    assert_eq!(ret, Ok(foos.len() as i32));
+}
+
+#[test]
+fn test_read_data_correctly_after_parcelable_with_new_field() {
+    let service: binder::Strong<dyn IFooInterface::IFooInterface> =
+        binder::get_interface(<BpFooInterface as IFooInterface::IFooInterface>::get_descriptor())
+            .expect("did not get binder service");
+
+    let in_foo = Default::default();
+    let mut inout_foo = Foo { intDefault42: 0 };
+    let mut out_foo = Foo { intDefault42: 0 };
+    let ret = service.ignoreParcelablesAndRepeatInt(&in_foo, &mut inout_foo, &mut out_foo, 43);
+    assert_eq!(ret, Ok(43));
+    assert_eq!(inout_foo.intDefault42, 0);
+    assert_eq!(out_foo.intDefault42, 0);
+}
+
+#[test]
+fn test_calling_v2_api_triggers_error() {
+    let service: binder::Strong<dyn IFooInterface::IFooInterface> =
+        binder::get_interface(<BpFooInterface as IFooInterface::IFooInterface>::get_descriptor())
+            .expect("did not get binder service");
+
+    let ret = service.newApi();
+
+    assert_eq!(ret.unwrap_err().transaction_error(), binder::StatusCode::UNKNOWN_TRANSACTION);
+}
+
+fn test_renamed_interface<F>(f: F)
+where
+    F: FnOnce(binder::Strong<dyn IOldName::IOldName>, binder::Strong<dyn INewName::INewName>),
+{
+    let service = get_test_service();
+    let old_name = service.GetOldNameInterface();
+    assert!(old_name.is_ok());
+
+    let new_name = service.GetNewNameInterface();
+    assert!(new_name.is_ok());
+
+    f(old_name.unwrap(), new_name.unwrap());
+}
+
+#[test]
+fn test_renamed_interface_old_as_old() {
+    test_renamed_interface(|old_name, _| {
+        assert_eq!(
+            <BpOldName as IOldName::IOldName>::get_descriptor(),
+            "android.aidl.tests.IOldName"
+        );
+
+        let real_name = old_name.RealName();
+        assert_eq!(real_name.as_ref().map(String::as_str), Ok("OldName"));
+    });
+}
+
+#[test]
+fn test_renamed_interface_new_as_new() {
+    test_renamed_interface(|_, new_name| {
+        assert_eq!(
+            <BpNewName as INewName::INewName>::get_descriptor(),
+            "android.aidl.tests.IOldName"
+        );
+
+        let real_name = new_name.RealName();
+        assert_eq!(real_name.as_ref().map(String::as_str), Ok("NewName"));
+    });
+}
+
+#[test]
+fn test_renamed_interface_old_as_new() {
+    test_renamed_interface(|old_name, _| {
+        let new_name = old_name.as_binder().into_interface::<dyn INewName::INewName>();
+        assert!(new_name.is_ok());
+
+        let real_name = new_name.unwrap().RealName();
+        assert_eq!(real_name.as_ref().map(String::as_str), Ok("OldName"));
+    });
+}
+
+#[test]
+fn test_renamed_interface_new_as_old() {
+    test_renamed_interface(|_, new_name| {
+        let old_name = new_name.as_binder().into_interface::<dyn IOldName::IOldName>();
+        assert!(old_name.is_ok());
+
+        let real_name = old_name.unwrap().RealName();
+        assert_eq!(real_name.as_ref().map(String::as_str), Ok("NewName"));
+    });
+}
+
+#[derive(Debug, Default)]
+struct Callback {
+    received: Arc<Mutex<Option<ParcelableWithNested::Status::Status>>>,
+}
+
+impl Interface for Callback {}
+
+impl INestedService::ICallback::ICallback for Callback {
+    fn done(&self, st: ParcelableWithNested::Status::Status) -> binder::Result<()> {
+        *self.received.lock().unwrap() = Some(st);
+        Ok(())
+    }
+}
+
+#[test]
+fn test_nested_type() {
+    let service: binder::Strong<dyn INestedService::INestedService> = binder::get_interface(
+        <INestedService::BpNestedService as INestedService::INestedService>::get_descriptor(),
+    )
+    .expect("did not get binder service");
+
+    let p = ParcelableWithNested::ParcelableWithNested {
+        status: ParcelableWithNested::Status::Status::OK,
+    };
+    // OK -> NOT_OK
+    let ret = service.flipStatus(&p);
+    assert_eq!(
+        ret,
+        Ok(INestedService::Result::Result { status: ParcelableWithNested::Status::Status::NOT_OK })
+    );
+    let received = Arc::new(Mutex::new(None));
+    // NOT_OK -> OK with nested callback interface
+    let cb = INestedService::ICallback::BnCallback::new_binder(
+        Callback { received: Arc::clone(&received) },
+        BinderFeatures::default(),
+    );
+    let ret = service.flipStatusWithCallback(ParcelableWithNested::Status::Status::NOT_OK, &cb);
+    assert_eq!(ret, Ok(()));
+    let received = received.lock().unwrap();
+    assert_eq!(*received, Some(ParcelableWithNested::Status::Status::OK))
+}
+
+#[test]
+fn test_nonnull_binder() {
+    let service = get_test_service();
+    let result = service.TakesAnIBinder(&service.as_binder());
+    assert!(result.is_ok());
+}
+
+#[test]
+fn test_binder_list_without_null() {
+    let service = get_test_service();
+    let result = service.TakesAnIBinderList(&[service.as_binder()]);
+    assert!(result.is_ok());
+}
+
+#[test]
+fn test_null_binder_to_annotated_method() {
+    let service = get_test_service();
+    let result = service.TakesANullableIBinder(None);
+    assert!(result.is_ok());
+}
+
+#[test]
+fn test_binder_list_with_null_to_annotated_method() {
+    let service = get_test_service();
+    let result = service.TakesANullableIBinderList(Some(&[Some(service.as_binder()), None]));
+    assert!(result.is_ok());
+}
+
+#[test]
+fn test_binder_array() {
+    let service = get_test_service();
+    let callback = service
+        .GetCallback(false)
+        .expect("error calling GetCallback")
+        .expect("expected Some from GetCallback");
+
+    let mut array = vec![service.as_binder(), callback.as_binder()];
+
+    // Java needs initial values here (can't resize arrays)
+    let mut repeated = vec![Default::default(); array.len()];
+
+    let result = service.ReverseIBinderArray(&array, &mut repeated);
+    assert_eq!(repeated.into_iter().collect::<Option<Vec<_>>>().as_ref(), Some(&array));
+    array.reverse();
+    assert_eq!(result, Ok(array));
+}
+
+#[test]
+fn test_nullable_binder_array() {
+    let service = get_test_service();
+    let mut array = vec![Some(service.as_binder()), None];
+
+    // Java needs initial values here (can't resize arrays)
+    let mut repeated = Some(vec![Default::default(); array.len()]);
+
+    let result = service.ReverseNullableIBinderArray(Some(&array[..]), &mut repeated);
+    assert_eq!(repeated.as_ref(), Some(&array));
+    array.reverse();
+    assert_eq!(result, Ok(Some(array)));
+}
+
+#[test]
+fn test_read_write_fixed_size_array() {
+    let mut parcel = Parcel::new();
+    let mut p: FixedSizeArrayExample = Default::default();
+    p.byteMatrix[0][0] = 0;
+    p.byteMatrix[0][1] = 1;
+    p.byteMatrix[1][0] = 2;
+    p.byteMatrix[1][1] = 3;
+
+    p.floatMatrix[0][0] = 0.0;
+    p.floatMatrix[0][1] = 1.0;
+    p.floatMatrix[1][0] = 2.0;
+    p.floatMatrix[1][1] = 3.0;
+
+    p.boolNullableArray = Some([true, false]);
+    p.byteNullableArray = Some([42, 0]);
+    p.stringNullableArray = Some([Some("hello".into()), Some("world".into())]);
+
+    p.boolNullableMatrix = Some([[true, false], Default::default()]);
+    p.byteNullableMatrix = Some([[42, 0], Default::default()]);
+    p.stringNullableMatrix =
+        Some([[Some("hello".into()), Some("world".into())], Default::default()]);
+
+    assert_eq!(parcel.write(&p), Ok(()));
+    // SAFETY: 0 is less than the current size of the parcel data buffer, because the parcel is not
+    // empty.
+    unsafe {
+        parcel.set_data_position(0).unwrap();
+    }
+    assert_eq!(p, parcel.read::<FixedSizeArrayExample>().unwrap());
+}
+
+#[test]
+fn test_fixed_size_array_uses_array_optimization() {
+    let mut parcel = Parcel::new();
+    let byte_array = [[1u8, 2u8, 3u8], [4u8, 5u8, 6u8]];
+    assert_eq!(parcel.write(&byte_array), Ok(()));
+    // SAFETY: 0 is less than the current size of the parcel data buffer, because the parcel is not
+    // empty.
+    unsafe {
+        parcel.set_data_position(0).unwrap();
+    }
+    assert_eq!(parcel.read::<i32>(), Ok(2i32));
+    assert_eq!(parcel.read::<Vec<u8>>(), Ok(vec![1u8, 2u8, 3u8]));
+    assert_eq!(parcel.read::<Vec<u8>>(), Ok(vec![4u8, 5u8, 6u8]));
+}
+
+macro_rules! test_repeat_fixed_size_array {
+    ($service:ident, $func:ident, $value:expr) => {
+        let array = $value;
+        let mut repeated = Default::default();
+        let result = $service.$func(&array, &mut repeated).unwrap();
+        assert_eq!(repeated, array);
+        assert_eq!(result, array);
+    };
+}
+
+macro_rules! test_repeat_fixed_size_array_1d_binder {
+    ($service:ident, $func:ident, $value:expr) => {
+        let array = $value;
+        let mut repeated = Default::default();
+        let result = $service.$func(&array, &mut repeated).unwrap();
+        assert_eq!(result, array.clone());
+        assert_eq!(repeated, array.map(Some));
+    };
+}
+
+macro_rules! test_repeat_fixed_size_array_2d_binder {
+    ($service:ident, $func:ident, $value:expr) => {
+        let array = $value;
+        let mut repeated = Default::default();
+        let result = $service.$func(&array, &mut repeated).unwrap();
+        assert_eq!(result, array.clone());
+        assert_eq!(repeated, array.map(|row| row.map(Some)));
+    };
+}
+
+#[test]
+fn test_fixed_size_array_over_binder() {
+    let test_service = get_test_service();
+    let service: binder::Strong<dyn IRepeatFixedSizeArray> =
+        binder::get_interface(<BpRepeatFixedSizeArray as IRepeatFixedSizeArray>::get_descriptor())
+            .expect("did not get binder service");
+
+    test_repeat_fixed_size_array!(service, RepeatBytes, [1u8, 2u8, 3u8]);
+    test_repeat_fixed_size_array!(service, RepeatInts, [1i32, 2i32, 3i32]);
+
+    let binder1 = test_service.as_binder();
+    let binder2 = test_service
+        .GetCallback(false)
+        .expect("error calling GetCallback")
+        .expect("expected Some from GetCallback")
+        .as_binder();
+    let binder3 = service.as_binder();
+    test_repeat_fixed_size_array_1d_binder!(
+        service,
+        RepeatBinders,
+        [binder1.clone(), binder2.clone(), binder3.clone()]
+    );
+
+    let p1 = IntParcelable { value: 1 };
+    let p2 = IntParcelable { value: 2 };
+    let p3 = IntParcelable { value: 3 };
+    test_repeat_fixed_size_array!(service, RepeatParcelables, [p1, p2, p3]);
+
+    test_repeat_fixed_size_array!(service, Repeat2dBytes, [[1u8, 2u8, 3u8], [1u8, 2u8, 3u8]]);
+    test_repeat_fixed_size_array!(service, Repeat2dInts, [[1i32, 2i32, 3i32], [1i32, 2i32, 3i32]]);
+
+    test_repeat_fixed_size_array_2d_binder!(
+        service,
+        Repeat2dBinders,
+        [[binder1.clone(), binder2.clone(), binder3.clone()], [binder1, binder2, binder3]]
+    );
+
+    test_repeat_fixed_size_array!(service, Repeat2dParcelables, [[p1, p2, p3], [p1, p2, p3]]);
+}
+
+#[test]
+fn test_ping() {
+    let test_service = get_test_service();
+    assert_eq!(test_service.as_binder().ping_binder(), Ok(()));
+}
+
+#[test]
+fn test_trunk_stable_parcelable() {
+    let service = get_test_trunk_stable_service();
+    let res = service.getInterfaceVersion();
+    assert!(res.is_ok());
+    let version = res.unwrap();
+
+    let p1 = MyParcelable { a: 12, b: 13, c: 14 };
+    let result = service.repeatParcelable(&p1);
+    assert!(result.is_ok());
+    let p2 = result.unwrap();
+    assert_eq!(p1.a, p2.a);
+    assert_eq!(p1.b, p2.b);
+    if version == 1 {
+        assert_ne!(p1.c, p2.c);
+        assert_eq!(0, p2.c);
+    } else {
+        assert_eq!(p1.c, p2.c);
+    }
+}
+
+#[test]
+fn test_trunk_stable_enum() {
+    let service = get_test_trunk_stable_service();
+    let e1 = MyEnum::THREE;
+    let result = service.repeatEnum(e1);
+    assert!(result.is_ok());
+    assert_eq!(result.unwrap(), e1);
+}
+#[test]
+fn test_trunk_stable_union() {
+    let service = get_test_trunk_stable_service();
+    let res = service.getInterfaceVersion();
+    assert!(res.is_ok());
+    let version = res.unwrap();
+
+    let u1 = MyUnion::C(14);
+    let result = service.repeatUnion(&u1);
+    if version == 1 {
+        assert!(result.is_err());
+    } else {
+        assert!(result.is_ok());
+    }
+}
+#[test]
+fn test_trunk_stable_unimplemented() {
+    let service = get_test_trunk_stable_service();
+    let res = service.getInterfaceVersion();
+    assert!(res.is_ok());
+    let version = res.unwrap();
+
+    let p1 = MyOtherParcelable { a: 12, b: 13 };
+    let result = service.repeatOtherParcelable(&p1);
+    if version == 1 {
+        assert!(result.is_err());
+    } else {
+        assert!(result.is_ok());
+    }
+}
+
+#[test]
+fn test_trunk_stable_hash() {
+    let service = get_test_trunk_stable_service();
+    let res = service.getInterfaceVersion();
+    assert!(res.is_ok());
+    let version = res.unwrap();
+
+    let hash = service.getInterfaceHash();
+    if version == 1 {
+        assert_eq!(
+            hash.as_ref().map(String::as_str),
+            Ok("88311b9118fb6fe9eff4a2ca19121de0587f6d5f")
+        );
+        // Check local values of version and hash
+        assert_eq!(
+            android_aidl_test_trunk::aidl::android::aidl::test::trunk::ITrunkStableTest::VERSION,
+            1
+        );
+        assert_eq!(
+            android_aidl_test_trunk::aidl::android::aidl::test::trunk::ITrunkStableTest::HASH,
+            "88311b9118fb6fe9eff4a2ca19121de0587f6d5f"
+        );
+    } else {
+        assert_eq!(hash.as_ref().map(String::as_str), Ok("notfrozen"));
+        // Check local values of version and hash
+        assert_eq!(
+            android_aidl_test_trunk::aidl::android::aidl::test::trunk::ITrunkStableTest::VERSION,
+            2
+        );
+        assert_eq!(
+            android_aidl_test_trunk::aidl::android::aidl::test::trunk::ITrunkStableTest::HASH,
+            "notfrozen"
+        );
+    }
+}
+
+#[derive(Debug, Default)]
+pub struct MyCallback {
+    pub repeat_parcelable_called: Arc<Mutex<bool>>,
+    pub repeat_enum_called: Arc<Mutex<bool>>,
+    pub repeat_union_called: Arc<Mutex<bool>>,
+    pub repeat_other_parcelable_called: Arc<Mutex<bool>>,
+}
+
+impl Interface for MyCallback {}
+
+impl IMyCallback::IMyCallback for MyCallback {
+    fn repeatParcelable(&self, in_parcel: &MyParcelable) -> binder::Result<MyParcelable> {
+        *self.repeat_parcelable_called.lock().unwrap() = true;
+        let tmp: MyParcelable = MyParcelable { a: in_parcel.a, b: in_parcel.b, c: in_parcel.c };
+        Ok(tmp)
+    }
+    fn repeatEnum(&self, in_enum: MyEnum) -> binder::Result<MyEnum> {
+        *self.repeat_enum_called.lock().unwrap() = true;
+        Ok(in_enum)
+    }
+    fn repeatUnion(&self, in_union: &MyUnion) -> binder::Result<MyUnion> {
+        *self.repeat_union_called.lock().unwrap() = true;
+        match in_union {
+            MyUnion::A(n) => Ok(MyUnion::A(*n)),
+            MyUnion::B(n) => Ok(MyUnion::B(*n)),
+            MyUnion::C(n) => Ok(MyUnion::C(*n)),
+        }
+    }
+    fn repeatOtherParcelable(
+        &self,
+        in_parcel: &MyOtherParcelable,
+    ) -> binder::Result<MyOtherParcelable> {
+        *self.repeat_other_parcelable_called.lock().unwrap() = true;
+        let tmp: MyOtherParcelable = MyOtherParcelable { a: in_parcel.a, b: in_parcel.b };
+        Ok(tmp)
+    }
+}
+
+#[test]
+fn test_trunk_stable_callback() {
+    let service = get_test_trunk_stable_service();
+    let res = service.getInterfaceVersion();
+    assert!(res.is_ok());
+    let version = res.unwrap();
+
+    let repeat_parcelable_called = Arc::new(Mutex::new(false));
+    let repeat_enum_called = Arc::new(Mutex::new(false));
+    let repeat_union_called = Arc::new(Mutex::new(false));
+    let repeat_other_parcelable_called = Arc::new(Mutex::new(false));
+    let cb = IMyCallback::BnMyCallback::new_binder(
+        MyCallback {
+            repeat_parcelable_called: Arc::clone(&repeat_parcelable_called),
+            repeat_enum_called: Arc::clone(&repeat_enum_called),
+            repeat_union_called: Arc::clone(&repeat_union_called),
+            repeat_other_parcelable_called: Arc::clone(&repeat_other_parcelable_called),
+        },
+        BinderFeatures::default(),
+    );
+    let result = service.callMyCallback(&cb);
+    assert!(result.is_ok());
+    assert!(*repeat_parcelable_called.lock().unwrap());
+    assert!(*repeat_enum_called.lock().unwrap());
+    assert!(*repeat_union_called.lock().unwrap());
+    if version == 1 {
+        assert!(!*repeat_other_parcelable_called.lock().unwrap());
+    } else {
+        assert!(*repeat_other_parcelable_called.lock().unwrap());
+    }
+}
diff --git a/tests/rust/test_service.rs b/tests/rust/test_service.rs
new file mode 100644
index 0000000..b2259e9
--- /dev/null
+++ b/tests/rust/test_service.rs
@@ -0,0 +1,714 @@
+/*
+ * Copyright (C) 2020, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//! Test Rust service for the AIDL compiler.
+
+use aidl_test_fixedsizearray::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::{
+    IRepeatFixedSizeArray, IntParcelable::IntParcelable,
+};
+use aidl_test_interface::aidl::android::aidl::tests::nested::{
+    INestedService, ParcelableWithNested,
+};
+use aidl_test_interface::aidl::android::aidl::tests::ITestService::{
+    self, BnTestService, BpTestService, Empty::Empty,
+};
+use aidl_test_interface::aidl::android::aidl::tests::{
+    extension::ExtendableParcelable::ExtendableParcelable, extension::MyExt::MyExt,
+    BackendType::BackendType, ByteEnum::ByteEnum, CircularParcelable::CircularParcelable,
+    ConstantExpressionEnum::ConstantExpressionEnum, ICircular, INamedCallback, INewName, IOldName,
+    IntEnum::IntEnum, LongEnum::LongEnum, RecursiveList::RecursiveList, StructuredParcelable,
+    Union,
+};
+use aidl_test_interface::binder::{
+    self, BinderFeatures, Interface, ParcelFileDescriptor, SpIBinder,
+};
+use aidl_test_versioned_interface::aidl::android::aidl::versioned::tests::{
+    BazUnion::BazUnion, Foo::Foo, IFooInterface, IFooInterface::BnFooInterface,
+    IFooInterface::BpFooInterface,
+};
+use android_aidl_test_trunk::aidl::android::aidl::test::trunk::{
+    ITrunkStableTest, ITrunkStableTest::BnTrunkStableTest, ITrunkStableTest::BpTrunkStableTest,
+    ITrunkStableTest::IMyCallback, ITrunkStableTest::MyEnum::MyEnum,
+    ITrunkStableTest::MyOtherParcelable::MyOtherParcelable,
+    ITrunkStableTest::MyParcelable::MyParcelable, ITrunkStableTest::MyUnion::MyUnion,
+};
+use std::collections::HashMap;
+use std::sync::Mutex;
+
+fn dup_fd(fd: &ParcelFileDescriptor) -> ParcelFileDescriptor {
+    ParcelFileDescriptor::new(fd.as_ref().try_clone().unwrap())
+}
+
+struct NamedCallback(String);
+
+impl Interface for NamedCallback {}
+
+impl INamedCallback::INamedCallback for NamedCallback {
+    fn GetName(&self) -> binder::Result<String> {
+        Ok(self.0.clone())
+    }
+}
+
+struct OldName;
+
+impl Interface for OldName {}
+
+impl IOldName::IOldName for OldName {
+    fn RealName(&self) -> binder::Result<String> {
+        Ok("OldName".into())
+    }
+}
+
+#[derive(Debug, Default)]
+struct NewName;
+
+impl Interface for NewName {}
+
+impl INewName::INewName for NewName {
+    fn RealName(&self) -> binder::Result<String> {
+        Ok("NewName".into())
+    }
+}
+
+#[derive(Debug, Default)]
+struct Circular;
+
+impl Interface for Circular {}
+
+impl ICircular::ICircular for Circular {
+    fn GetTestService(
+        &self,
+    ) -> binder::Result<Option<binder::Strong<dyn ITestService::ITestService>>> {
+        Ok(None)
+    }
+}
+
+#[derive(Default)]
+struct TestService {
+    service_map: Mutex<HashMap<String, binder::Strong<dyn INamedCallback::INamedCallback>>>,
+}
+
+impl Interface for TestService {}
+
+macro_rules! impl_repeat {
+    ($repeat_name:ident, $type:ty) => {
+        fn $repeat_name(&self, token: $type) -> binder::Result<$type> {
+            Ok(token)
+        }
+    };
+}
+
+macro_rules! impl_reverse {
+    ($reverse_name:ident, $type:ty) => {
+        fn $reverse_name(
+            &self,
+            input: &[$type],
+            repeated: &mut Vec<$type>,
+        ) -> binder::Result<Vec<$type>> {
+            repeated.clear();
+            repeated.extend_from_slice(input);
+            Ok(input.iter().rev().cloned().collect())
+        }
+    };
+}
+
+macro_rules! impl_repeat_reverse {
+    ($repeat_name:ident, $reverse_name:ident, $type:ty) => {
+        impl_repeat! {$repeat_name, $type}
+        impl_reverse! {$reverse_name, $type}
+    };
+}
+
+macro_rules! impl_repeat_nullable {
+    ($repeat_nullable_name:ident, $type:ty) => {
+        fn $repeat_nullable_name(
+            &self,
+            input: Option<&[$type]>,
+        ) -> binder::Result<Option<Vec<$type>>> {
+            Ok(input.map(<[$type]>::to_vec))
+        }
+    };
+}
+
+impl ITestService::ITestService for TestService {
+    impl_repeat! {RepeatByte, i8}
+    impl_reverse! {ReverseByte, u8}
+
+    fn UnimplementedMethod(&self, _: i32) -> binder::Result<i32> {
+        // Pretend this method hasn't been implemented
+        Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+
+    fn TestOneway(&self) -> binder::Result<()> {
+        Err(binder::StatusCode::UNKNOWN_ERROR.into())
+    }
+
+    fn Deprecated(&self) -> binder::Result<()> {
+        Ok(())
+    }
+
+    impl_repeat_reverse! {RepeatBoolean, ReverseBoolean, bool}
+    impl_repeat_reverse! {RepeatChar, ReverseChar, u16}
+    impl_repeat_reverse! {RepeatInt, ReverseInt, i32}
+    impl_repeat_reverse! {RepeatLong, ReverseLong, i64}
+    impl_repeat_reverse! {RepeatFloat, ReverseFloat, f32}
+    impl_repeat_reverse! {RepeatDouble, ReverseDouble, f64}
+    impl_repeat_reverse! {RepeatByteEnum, ReverseByteEnum, ByteEnum}
+    impl_repeat_reverse! {RepeatIntEnum, ReverseIntEnum, IntEnum}
+    impl_repeat_reverse! {RepeatLongEnum, ReverseLongEnum, LongEnum}
+    impl_reverse! {ReverseString, String}
+    impl_reverse! {ReverseStringList, String}
+    impl_reverse! {ReverseUtf8CppString, String}
+
+    fn RepeatString(&self, input: &str) -> binder::Result<String> {
+        Ok(input.into())
+    }
+
+    fn RepeatUtf8CppString(&self, input: &str) -> binder::Result<String> {
+        Ok(input.into())
+    }
+
+    fn GetOtherTestService(
+        &self,
+        name: &str,
+    ) -> binder::Result<binder::Strong<dyn INamedCallback::INamedCallback>> {
+        let mut service_map = self.service_map.lock().unwrap();
+        let other_service = service_map.entry(name.into()).or_insert_with(|| {
+            let named_callback = NamedCallback(name.into());
+            INamedCallback::BnNamedCallback::new_binder(named_callback, BinderFeatures::default())
+        });
+        Ok(other_service.to_owned())
+    }
+
+    fn SetOtherTestService(
+        &self,
+        name: &str,
+        service: &binder::Strong<dyn INamedCallback::INamedCallback>,
+    ) -> binder::Result<bool> {
+        let mut service_map = self.service_map.lock().unwrap();
+        if let Some(existing_service) = service_map.get(name) {
+            if existing_service == service {
+                return Ok(true);
+            }
+        }
+        service_map.insert(name.into(), service.clone());
+        Ok(false)
+    }
+
+    fn VerifyName(
+        &self,
+        service: &binder::Strong<dyn INamedCallback::INamedCallback>,
+        name: &str,
+    ) -> binder::Result<bool> {
+        service.GetName().map(|found_name| found_name == name)
+    }
+
+    fn GetInterfaceArray(
+        &self,
+        names: &[String],
+    ) -> binder::Result<Vec<binder::Strong<dyn INamedCallback::INamedCallback>>> {
+        names.iter().map(|name| self.GetOtherTestService(name)).collect()
+    }
+
+    fn VerifyNamesWithInterfaceArray(
+        &self,
+        services: &[binder::Strong<dyn INamedCallback::INamedCallback>],
+        names: &[String],
+    ) -> binder::Result<bool> {
+        if services.len() == names.len() {
+            for (s, n) in services.iter().zip(names) {
+                if !self.VerifyName(s, n)? {
+                    return Ok(false);
+                }
+            }
+            Ok(true)
+        } else {
+            Ok(false)
+        }
+    }
+
+    fn GetNullableInterfaceArray(
+        &self,
+        names: Option<&[Option<String>]>,
+    ) -> binder::Result<Option<Vec<Option<binder::Strong<dyn INamedCallback::INamedCallback>>>>>
+    {
+        if let Some(names) = names {
+            let mut services = vec![];
+            for name in names {
+                if let Some(name) = name {
+                    services.push(Some(self.GetOtherTestService(name)?));
+                } else {
+                    services.push(None);
+                }
+            }
+            Ok(Some(services))
+        } else {
+            Ok(None)
+        }
+    }
+
+    fn VerifyNamesWithNullableInterfaceArray(
+        &self,
+        services: Option<&[Option<binder::Strong<dyn INamedCallback::INamedCallback>>]>,
+        names: Option<&[Option<String>]>,
+    ) -> binder::Result<bool> {
+        if let (Some(services), Some(names)) = (services, names) {
+            for (s, n) in services.iter().zip(names) {
+                if let (Some(s), Some(n)) = (s, n) {
+                    if !self.VerifyName(s, n)? {
+                        return Ok(false);
+                    }
+                } else if s.is_some() || n.is_some() {
+                    return Ok(false);
+                }
+            }
+            Ok(true)
+        } else {
+            Ok(services.is_none() && names.is_none())
+        }
+    }
+
+    fn GetInterfaceList(
+        &self,
+        names: Option<&[Option<String>]>,
+    ) -> binder::Result<Option<Vec<Option<binder::Strong<dyn INamedCallback::INamedCallback>>>>>
+    {
+        self.GetNullableInterfaceArray(names)
+    }
+
+    fn VerifyNamesWithInterfaceList(
+        &self,
+        services: Option<&[Option<binder::Strong<dyn INamedCallback::INamedCallback>>]>,
+        names: Option<&[Option<String>]>,
+    ) -> binder::Result<bool> {
+        self.VerifyNamesWithNullableInterfaceArray(services, names)
+    }
+
+    fn RepeatParcelFileDescriptor(
+        &self,
+        read: &ParcelFileDescriptor,
+    ) -> binder::Result<ParcelFileDescriptor> {
+        Ok(dup_fd(read))
+    }
+
+    fn ReverseParcelFileDescriptorArray(
+        &self,
+        input: &[ParcelFileDescriptor],
+        repeated: &mut Vec<Option<ParcelFileDescriptor>>,
+    ) -> binder::Result<Vec<ParcelFileDescriptor>> {
+        repeated.clear();
+        repeated.extend(input.iter().map(dup_fd).map(Some));
+        Ok(input.iter().rev().map(dup_fd).collect())
+    }
+
+    fn ThrowServiceException(&self, code: i32) -> binder::Result<()> {
+        Err(binder::Status::new_service_specific_error(code, None))
+    }
+
+    impl_repeat_nullable! {RepeatNullableIntArray, i32}
+    impl_repeat_nullable! {RepeatNullableByteEnumArray, ByteEnum}
+    impl_repeat_nullable! {RepeatNullableIntEnumArray, IntEnum}
+    impl_repeat_nullable! {RepeatNullableLongEnumArray, LongEnum}
+    impl_repeat_nullable! {RepeatNullableStringList, Option<String>}
+
+    fn RepeatNullableString(&self, input: Option<&str>) -> binder::Result<Option<String>> {
+        Ok(input.map(String::from))
+    }
+
+    fn RepeatNullableUtf8CppString(&self, input: Option<&str>) -> binder::Result<Option<String>> {
+        Ok(input.map(String::from))
+    }
+
+    fn RepeatNullableParcelable(&self, input: Option<&Empty>) -> binder::Result<Option<Empty>> {
+        Ok(input.cloned())
+    }
+
+    impl_repeat_nullable! {RepeatNullableParcelableArray, Option<Empty>}
+    impl_repeat_nullable! {RepeatNullableParcelableList, Option<Empty>}
+
+    fn TakesAnIBinder(&self, _: &SpIBinder) -> binder::Result<()> {
+        Ok(())
+    }
+
+    fn TakesANullableIBinder(&self, _: Option<&SpIBinder>) -> binder::Result<()> {
+        Ok(())
+    }
+
+    fn TakesAnIBinderList(&self, _: &[SpIBinder]) -> binder::Result<()> {
+        Ok(())
+    }
+
+    fn TakesANullableIBinderList(&self, _: Option<&[Option<SpIBinder>]>) -> binder::Result<()> {
+        Ok(())
+    }
+
+    fn ReverseNullableUtf8CppString(
+        &self,
+        input: Option<&[Option<String>]>,
+        repeated: &mut Option<Vec<Option<String>>>,
+    ) -> binder::Result<Option<Vec<Option<String>>>> {
+        if let Some(input) = input {
+            *repeated = Some(input.to_vec());
+            Ok(Some(input.iter().rev().cloned().collect()))
+        } else {
+            // We don't touch `repeated` here, since
+            // the C++ test service doesn't either
+            Ok(None)
+        }
+    }
+
+    fn ReverseUtf8CppStringList(
+        &self,
+        input: Option<&[Option<String>]>,
+        repeated: &mut Option<Vec<Option<String>>>,
+    ) -> binder::Result<Option<Vec<Option<String>>>> {
+        self.ReverseNullableUtf8CppString(input, repeated)
+    }
+
+    fn GetCallback(
+        &self,
+        return_null: bool,
+    ) -> binder::Result<Option<binder::Strong<dyn INamedCallback::INamedCallback>>> {
+        if return_null {
+            Ok(None)
+        } else {
+            self.GetOtherTestService("ABT: always be testing").map(Some)
+        }
+    }
+
+    fn FillOutStructuredParcelable(
+        &self,
+        parcelable: &mut StructuredParcelable::StructuredParcelable,
+    ) -> binder::Result<()> {
+        parcelable.shouldBeJerry = "Jerry".into();
+        parcelable.shouldContainThreeFs = vec![parcelable.f, parcelable.f, parcelable.f];
+        parcelable.shouldBeByteBar = ByteEnum::BAR;
+        parcelable.shouldBeIntBar = IntEnum::BAR;
+        parcelable.shouldBeLongBar = LongEnum::BAR;
+        parcelable.shouldContainTwoByteFoos = vec![ByteEnum::FOO, ByteEnum::FOO];
+        parcelable.shouldContainTwoIntFoos = vec![IntEnum::FOO, IntEnum::FOO];
+        parcelable.shouldContainTwoLongFoos = vec![LongEnum::FOO, LongEnum::FOO];
+
+        parcelable.const_exprs_1 = ConstantExpressionEnum::decInt32_1;
+        parcelable.const_exprs_2 = ConstantExpressionEnum::decInt32_2;
+        parcelable.const_exprs_3 = ConstantExpressionEnum::decInt64_1;
+        parcelable.const_exprs_4 = ConstantExpressionEnum::decInt64_2;
+        parcelable.const_exprs_5 = ConstantExpressionEnum::decInt64_3;
+        parcelable.const_exprs_6 = ConstantExpressionEnum::decInt64_4;
+        parcelable.const_exprs_7 = ConstantExpressionEnum::hexInt32_1;
+        parcelable.const_exprs_8 = ConstantExpressionEnum::hexInt32_2;
+        parcelable.const_exprs_9 = ConstantExpressionEnum::hexInt32_3;
+        parcelable.const_exprs_10 = ConstantExpressionEnum::hexInt64_1;
+
+        parcelable.shouldSetBit0AndBit2 = StructuredParcelable::BIT0 | StructuredParcelable::BIT2;
+
+        parcelable.u = Some(Union::Union::Ns(vec![1, 2, 3]));
+        parcelable.shouldBeConstS1 = Some(Union::Union::S(Union::S1.to_string()));
+        Ok(())
+    }
+
+    fn RepeatExtendableParcelable(
+        &self,
+        ep: &ExtendableParcelable,
+        ep2: &mut ExtendableParcelable,
+    ) -> binder::Result<()> {
+        ep2.a = ep.a;
+        ep2.b = ep.b.clone();
+
+        let my_ext = ep.ext.get_parcelable::<MyExt>()?;
+        if let Some(my_ext) = my_ext {
+            ep2.ext.set_parcelable(my_ext)?;
+        } else {
+            ep2.ext.reset();
+        }
+
+        Ok(())
+    }
+
+    fn ReverseList(&self, list: &RecursiveList) -> binder::Result<RecursiveList> {
+        let mut reversed: Option<RecursiveList> = None;
+        let mut cur: Option<&RecursiveList> = Some(list);
+        while let Some(node) = cur {
+            reversed = Some(RecursiveList { value: node.value, next: reversed.map(Box::new) });
+            cur = node.next.as_ref().map(|n| n.as_ref());
+        }
+        // `list` is always not empty, so is `reversed`.
+        Ok(reversed.unwrap())
+    }
+
+    fn ReverseIBinderArray(
+        &self,
+        input: &[SpIBinder],
+        repeated: &mut Vec<Option<SpIBinder>>,
+    ) -> binder::Result<Vec<SpIBinder>> {
+        *repeated = input.iter().cloned().map(Some).collect();
+        Ok(input.iter().rev().cloned().collect())
+    }
+
+    fn ReverseNullableIBinderArray(
+        &self,
+        input: Option<&[Option<SpIBinder>]>,
+        repeated: &mut Option<Vec<Option<SpIBinder>>>,
+    ) -> binder::Result<Option<Vec<Option<SpIBinder>>>> {
+        let input = input.expect("input is null");
+        *repeated = Some(input.to_vec());
+        Ok(Some(input.iter().rev().cloned().collect()))
+    }
+
+    fn GetOldNameInterface(&self) -> binder::Result<binder::Strong<dyn IOldName::IOldName>> {
+        Ok(IOldName::BnOldName::new_binder(OldName, BinderFeatures::default()))
+    }
+
+    fn GetNewNameInterface(&self) -> binder::Result<binder::Strong<dyn INewName::INewName>> {
+        Ok(INewName::BnNewName::new_binder(NewName, BinderFeatures::default()))
+    }
+
+    fn GetUnionTags(&self, input: &[Union::Union]) -> binder::Result<Vec<Union::Tag::Tag>> {
+        Ok(input
+            .iter()
+            .map(|u| match u {
+                Union::Union::Ns(_) => Union::Tag::Tag::ns,
+                Union::Union::N(_) => Union::Tag::Tag::n,
+                Union::Union::M(_) => Union::Tag::Tag::m,
+                Union::Union::S(_) => Union::Tag::Tag::s,
+                Union::Union::Ibinder(_) => Union::Tag::Tag::ibinder,
+                Union::Union::Ss(_) => Union::Tag::Tag::ss,
+                Union::Union::Be(_) => Union::Tag::Tag::be,
+            })
+            .collect::<Vec<_>>())
+    }
+
+    fn GetCppJavaTests(&self) -> binder::Result<Option<SpIBinder>> {
+        Ok(None)
+    }
+
+    fn getBackendType(&self) -> binder::Result<BackendType> {
+        Ok(BackendType::RUST)
+    }
+
+    fn GetCircular(
+        &self,
+        _: &mut CircularParcelable,
+    ) -> binder::Result<binder::Strong<dyn ICircular::ICircular>> {
+        Ok(ICircular::BnCircular::new_binder(Circular, BinderFeatures::default()))
+    }
+}
+
+struct FooInterface;
+
+impl Interface for FooInterface {}
+
+impl IFooInterface::IFooInterface for FooInterface {
+    fn originalApi(&self) -> binder::Result<()> {
+        Ok(())
+    }
+    fn acceptUnionAndReturnString(&self, u: &BazUnion) -> binder::Result<String> {
+        match u {
+            BazUnion::IntNum(n) => Ok(n.to_string()),
+        }
+    }
+    fn returnsLengthOfFooArray(&self, foos: &[Foo]) -> binder::Result<i32> {
+        Ok(foos.len() as i32)
+    }
+    fn ignoreParcelablesAndRepeatInt(
+        &self,
+        _in_foo: &Foo,
+        _inout_foo: &mut Foo,
+        _out_foo: &mut Foo,
+        value: i32,
+    ) -> binder::Result<i32> {
+        Ok(value)
+    }
+}
+
+struct TrunkStableTest;
+
+impl Interface for TrunkStableTest {}
+
+impl ITrunkStableTest::ITrunkStableTest for TrunkStableTest {
+    fn repeatParcelable(&self, in_parcel: &MyParcelable) -> binder::Result<MyParcelable> {
+        let tmp: MyParcelable = MyParcelable { a: in_parcel.a, b: in_parcel.b, c: in_parcel.c };
+        Ok(tmp)
+    }
+    fn repeatEnum(&self, in_enum: MyEnum) -> binder::Result<MyEnum> {
+        Ok(in_enum)
+    }
+    fn repeatUnion(&self, in_union: &MyUnion) -> binder::Result<MyUnion> {
+        match in_union {
+            MyUnion::A(n) => Ok(MyUnion::A(*n)),
+            MyUnion::B(n) => Ok(MyUnion::B(*n)),
+            MyUnion::C(n) => Ok(MyUnion::C(*n)),
+        }
+    }
+    fn repeatOtherParcelable(
+        &self,
+        in_parcel: &MyOtherParcelable,
+    ) -> binder::Result<MyOtherParcelable> {
+        let tmp: MyOtherParcelable = MyOtherParcelable { a: in_parcel.a, b: in_parcel.b };
+        Ok(tmp)
+    }
+    fn callMyCallback(
+        &self,
+        _in_cb: &binder::Strong<dyn IMyCallback::IMyCallback>,
+    ) -> binder::Result<()> {
+        let p1 = MyParcelable::default();
+        let _ = _in_cb.repeatParcelable(&p1);
+
+        let e1 = MyEnum::THREE;
+        let _ = _in_cb.repeatEnum(e1);
+
+        let u1 = MyUnion::A(12);
+        let _ = _in_cb.repeatUnion(&u1);
+
+        let o1 = MyOtherParcelable::default();
+        // expected to fail when not using the frozen version
+        let _ = _in_cb.repeatOtherParcelable(&o1);
+
+        Ok(())
+    }
+}
+
+struct NestedService;
+
+impl Interface for NestedService {}
+
+impl INestedService::INestedService for NestedService {
+    fn flipStatus(
+        &self,
+        p: &ParcelableWithNested::ParcelableWithNested,
+    ) -> binder::Result<INestedService::Result::Result> {
+        if p.status == ParcelableWithNested::Status::Status::OK {
+            Ok(INestedService::Result::Result {
+                status: ParcelableWithNested::Status::Status::NOT_OK,
+            })
+        } else {
+            Ok(INestedService::Result::Result { status: ParcelableWithNested::Status::Status::OK })
+        }
+    }
+    fn flipStatusWithCallback(
+        &self,
+        st: ParcelableWithNested::Status::Status,
+        cb: &binder::Strong<dyn INestedService::ICallback::ICallback>,
+    ) -> binder::Result<()> {
+        if st == ParcelableWithNested::Status::Status::OK {
+            cb.done(ParcelableWithNested::Status::Status::NOT_OK)
+        } else {
+            cb.done(ParcelableWithNested::Status::Status::OK)
+        }
+    }
+}
+
+struct FixedSizeArrayService;
+
+impl Interface for FixedSizeArrayService {}
+
+impl IRepeatFixedSizeArray::IRepeatFixedSizeArray for FixedSizeArrayService {
+    fn RepeatBytes(&self, input: &[u8; 3], repeated: &mut [u8; 3]) -> binder::Result<[u8; 3]> {
+        *repeated = *input;
+        Ok(*input)
+    }
+    fn RepeatInts(&self, input: &[i32; 3], repeated: &mut [i32; 3]) -> binder::Result<[i32; 3]> {
+        *repeated = *input;
+        Ok(*input)
+    }
+    fn RepeatBinders(
+        &self,
+        input: &[SpIBinder; 3],
+        repeated: &mut [Option<SpIBinder>; 3],
+    ) -> binder::Result<[SpIBinder; 3]> {
+        *repeated = input.clone().map(Some);
+        Ok(input.clone())
+    }
+    fn RepeatParcelables(
+        &self,
+        input: &[IntParcelable; 3],
+        repeated: &mut [IntParcelable; 3],
+    ) -> binder::Result<[IntParcelable; 3]> {
+        *repeated = *input;
+        Ok(*input)
+    }
+    fn Repeat2dBytes(
+        &self,
+        input: &[[u8; 3]; 2],
+        repeated: &mut [[u8; 3]; 2],
+    ) -> binder::Result<[[u8; 3]; 2]> {
+        *repeated = *input;
+        Ok(*input)
+    }
+    fn Repeat2dInts(
+        &self,
+        input: &[[i32; 3]; 2],
+        repeated: &mut [[i32; 3]; 2],
+    ) -> binder::Result<[[i32; 3]; 2]> {
+        *repeated = *input;
+        Ok(*input)
+    }
+    fn Repeat2dBinders(
+        &self,
+        input: &[[SpIBinder; 3]; 2],
+        repeated: &mut [[Option<SpIBinder>; 3]; 2],
+    ) -> binder::Result<[[SpIBinder; 3]; 2]> {
+        *repeated = input.clone().map(|nested| nested.map(Some));
+        Ok(input.clone())
+    }
+    fn Repeat2dParcelables(
+        &self,
+        input: &[[IntParcelable; 3]; 2],
+        repeated: &mut [[IntParcelable; 3]; 2],
+    ) -> binder::Result<[[IntParcelable; 3]; 2]> {
+        *repeated = *input;
+        Ok(*input)
+    }
+}
+
+fn main() {
+    binder::ProcessState::set_thread_pool_max_thread_count(0);
+    binder::ProcessState::start_thread_pool();
+
+    let service_name = <BpTestService as ITestService::ITestService>::get_descriptor();
+    let service = BnTestService::new_binder(TestService::default(), BinderFeatures::default());
+    binder::add_service(service_name, service.as_binder()).expect("Could not register service");
+
+    let versioned_service_name = <BpFooInterface as IFooInterface::IFooInterface>::get_descriptor();
+    let versioned_service = BnFooInterface::new_binder(FooInterface, BinderFeatures::default());
+    binder::add_service(versioned_service_name, versioned_service.as_binder())
+        .expect("Could not register service");
+
+    let nested_service_name =
+        <INestedService::BpNestedService as INestedService::INestedService>::get_descriptor();
+    let nested_service =
+        INestedService::BnNestedService::new_binder(NestedService, BinderFeatures::default());
+    binder::add_service(nested_service_name, nested_service.as_binder())
+        .expect("Could not register service");
+
+    let fixed_size_array_service_name =
+        <IRepeatFixedSizeArray::BpRepeatFixedSizeArray as IRepeatFixedSizeArray::IRepeatFixedSizeArray>::get_descriptor();
+    let fixed_size_array_service = IRepeatFixedSizeArray::BnRepeatFixedSizeArray::new_binder(
+        FixedSizeArrayService,
+        BinderFeatures::default(),
+    );
+    binder::add_service(fixed_size_array_service_name, fixed_size_array_service.as_binder())
+        .expect("Could not register service");
+
+    let trunk_stable_service_name =
+        <BpTrunkStableTest as ITrunkStableTest::ITrunkStableTest>::get_descriptor();
+    let trunk_stable_service =
+        BnTrunkStableTest::new_binder(TrunkStableTest, BinderFeatures::default());
+    binder::add_service(trunk_stable_service_name, trunk_stable_service.as_binder())
+        .expect("Could not register service");
+
+    binder::ProcessState::join_thread_pool();
+}
diff --git a/tests/rust/test_service_async.rs b/tests/rust/test_service_async.rs
new file mode 100644
index 0000000..18d18d8
--- /dev/null
+++ b/tests/rust/test_service_async.rs
@@ -0,0 +1,792 @@
+/*
+ * Copyright (C) 2022, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//! Test Rust service for the AIDL compiler.
+
+use aidl_test_fixedsizearray::aidl::android::aidl::fixedsizearray::FixedSizeArrayExample::{
+    IRepeatFixedSizeArray, IntParcelable::IntParcelable,
+};
+use aidl_test_interface::aidl::android::aidl::tests::nested::{
+    INestedService, ParcelableWithNested,
+};
+use aidl_test_interface::aidl::android::aidl::tests::ITestService::{
+    self, BnTestService, BpTestService, Empty::Empty,
+};
+use aidl_test_interface::aidl::android::aidl::tests::{
+    extension::ExtendableParcelable::ExtendableParcelable, extension::MyExt::MyExt,
+    BackendType::BackendType, ByteEnum::ByteEnum, CircularParcelable::CircularParcelable,
+    ConstantExpressionEnum::ConstantExpressionEnum, ICircular, INamedCallback, INewName, IOldName,
+    IntEnum::IntEnum, LongEnum::LongEnum, RecursiveList::RecursiveList, StructuredParcelable,
+    Union,
+};
+use aidl_test_interface::binder::{
+    self, BinderFeatures, Interface, ParcelFileDescriptor, SpIBinder,
+};
+use aidl_test_versioned_interface::aidl::android::aidl::versioned::tests::{
+    BazUnion::BazUnion, Foo::Foo, IFooInterface, IFooInterface::BnFooInterface,
+    IFooInterface::BpFooInterface,
+};
+use android_aidl_test_trunk::aidl::android::aidl::test::trunk::{
+    ITrunkStableTest, ITrunkStableTest::BnTrunkStableTest, ITrunkStableTest::BpTrunkStableTest,
+    ITrunkStableTest::IMyCallback, ITrunkStableTest::MyEnum::MyEnum,
+    ITrunkStableTest::MyOtherParcelable::MyOtherParcelable,
+    ITrunkStableTest::MyParcelable::MyParcelable, ITrunkStableTest::MyUnion::MyUnion,
+};
+use binder_tokio::Tokio;
+use std::collections::HashMap;
+use std::sync::Mutex;
+
+use async_trait::async_trait;
+
+fn dup_fd(fd: &ParcelFileDescriptor) -> ParcelFileDescriptor {
+    ParcelFileDescriptor::new(fd.as_ref().try_clone().unwrap())
+}
+
+struct NamedCallback(String);
+
+impl Interface for NamedCallback {}
+
+#[async_trait]
+impl INamedCallback::INamedCallbackAsyncServer for NamedCallback {
+    async fn GetName(&self) -> binder::Result<String> {
+        Ok(self.0.clone())
+    }
+}
+
+struct OldName;
+
+impl Interface for OldName {}
+
+#[async_trait]
+impl IOldName::IOldNameAsyncServer for OldName {
+    async fn RealName(&self) -> binder::Result<String> {
+        Ok("OldName".into())
+    }
+}
+
+#[derive(Debug, Default)]
+struct NewName;
+
+impl Interface for NewName {}
+
+#[async_trait]
+impl INewName::INewNameAsyncServer for NewName {
+    async fn RealName(&self) -> binder::Result<String> {
+        Ok("NewName".into())
+    }
+}
+
+#[derive(Debug, Default)]
+struct Circular;
+
+impl Interface for Circular {}
+
+#[async_trait]
+impl ICircular::ICircularAsyncServer for Circular {
+    async fn GetTestService(
+        &self,
+    ) -> binder::Result<Option<binder::Strong<dyn ITestService::ITestService>>> {
+        Ok(None)
+    }
+}
+
+#[derive(Default)]
+struct TestService {
+    service_map: Mutex<HashMap<String, binder::Strong<dyn INamedCallback::INamedCallback>>>,
+}
+
+impl Interface for TestService {}
+
+// Macros are expanded in the wrong order, so async_trait does not apply to
+// functions defined by declarative macros.
+
+type BoxFuture<'a, T> = std::pin::Pin<Box<dyn std::future::Future<Output = T> + Send + 'a>>;
+
+macro_rules! impl_repeat {
+    ($repeat_name:ident, $type:ty) => {
+        fn $repeat_name<'a, 'b>(&'a self, token: $type) -> BoxFuture<'b, binder::Result<$type>>
+        where
+            'a: 'b,
+            Self: 'b,
+        {
+            Box::pin(async move { Ok(token) })
+        }
+    };
+}
+
+macro_rules! impl_reverse {
+    ($reverse_name:ident, $type:ty) => {
+        fn $reverse_name<'a, 'b, 'c, 'd>(
+            &'a self,
+            input: &'b [$type],
+            repeated: &'c mut Vec<$type>,
+        ) -> BoxFuture<'d, binder::Result<Vec<$type>>>
+        where
+            'a: 'd,
+            'b: 'd,
+            'c: 'd,
+            Self: 'd,
+        {
+            Box::pin(async move {
+                repeated.clear();
+                repeated.extend_from_slice(input);
+                Ok(input.iter().rev().cloned().collect())
+            })
+        }
+    };
+}
+
+macro_rules! impl_repeat_reverse {
+    ($repeat_name:ident, $reverse_name:ident, $type:ty) => {
+        impl_repeat! {$repeat_name, $type}
+        impl_reverse! {$reverse_name, $type}
+    };
+}
+
+macro_rules! impl_repeat_nullable {
+    ($repeat_nullable_name:ident, $type:ty) => {
+        fn $repeat_nullable_name<'a, 'b, 'c>(
+            &'a self,
+            input: Option<&'b [$type]>,
+        ) -> BoxFuture<'c, binder::Result<Option<Vec<$type>>>>
+        where
+            'a: 'c,
+            'b: 'c,
+            Self: 'c,
+        {
+            Box::pin(async move { Ok(input.map(<[$type]>::to_vec)) })
+        }
+    };
+}
+
+#[async_trait]
+impl ITestService::ITestServiceAsyncServer for TestService {
+    impl_repeat! {RepeatByte, i8}
+    impl_reverse! {ReverseByte, u8}
+
+    async fn UnimplementedMethod(&self, _: i32) -> binder::Result<i32> {
+        // Pretend this method hasn't been implemented
+        Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+    }
+
+    async fn TestOneway(&self) -> binder::Result<()> {
+        Err(binder::StatusCode::UNKNOWN_ERROR.into())
+    }
+
+    async fn Deprecated(&self) -> binder::Result<()> {
+        Ok(())
+    }
+
+    impl_repeat_reverse! {RepeatBoolean, ReverseBoolean, bool}
+    impl_repeat_reverse! {RepeatChar, ReverseChar, u16}
+    impl_repeat_reverse! {RepeatInt, ReverseInt, i32}
+    impl_repeat_reverse! {RepeatLong, ReverseLong, i64}
+    impl_repeat_reverse! {RepeatFloat, ReverseFloat, f32}
+    impl_repeat_reverse! {RepeatDouble, ReverseDouble, f64}
+    impl_repeat_reverse! {RepeatByteEnum, ReverseByteEnum, ByteEnum}
+    impl_repeat_reverse! {RepeatIntEnum, ReverseIntEnum, IntEnum}
+    impl_repeat_reverse! {RepeatLongEnum, ReverseLongEnum, LongEnum}
+    impl_reverse! {ReverseString, String}
+    impl_reverse! {ReverseStringList, String}
+    impl_reverse! {ReverseUtf8CppString, String}
+
+    async fn RepeatString(&self, input: &str) -> binder::Result<String> {
+        Ok(input.into())
+    }
+
+    async fn RepeatUtf8CppString(&self, input: &str) -> binder::Result<String> {
+        Ok(input.into())
+    }
+
+    async fn GetOtherTestService(
+        &self,
+        name: &str,
+    ) -> binder::Result<binder::Strong<dyn INamedCallback::INamedCallback>> {
+        let mut service_map = self.service_map.lock().unwrap();
+        let other_service = service_map.entry(name.into()).or_insert_with(|| {
+            let named_callback = NamedCallback(name.into());
+            INamedCallback::BnNamedCallback::new_async_binder(
+                named_callback,
+                rt(),
+                BinderFeatures::default(),
+            )
+        });
+        Ok(other_service.to_owned())
+    }
+
+    async fn SetOtherTestService(
+        &self,
+        name: &str,
+        service: &binder::Strong<dyn INamedCallback::INamedCallback>,
+    ) -> binder::Result<bool> {
+        let mut service_map = self.service_map.lock().unwrap();
+        if let Some(existing_service) = service_map.get(name) {
+            if existing_service == service {
+                return Ok(true);
+            }
+        }
+        service_map.insert(name.into(), service.clone());
+        Ok(false)
+    }
+
+    async fn VerifyName(
+        &self,
+        service: &binder::Strong<dyn INamedCallback::INamedCallback>,
+        name: &str,
+    ) -> binder::Result<bool> {
+        service.clone().into_async::<Tokio>().GetName().await.map(|found_name| found_name == name)
+    }
+
+    async fn GetInterfaceArray(
+        &self,
+        names: &[String],
+    ) -> binder::Result<Vec<binder::Strong<dyn INamedCallback::INamedCallback>>> {
+        let mut res = Vec::new();
+        for name in names {
+            res.push(self.GetOtherTestService(name).await?);
+        }
+        Ok(res)
+    }
+
+    async fn VerifyNamesWithInterfaceArray(
+        &self,
+        services: &[binder::Strong<dyn INamedCallback::INamedCallback>],
+        names: &[String],
+    ) -> binder::Result<bool> {
+        if services.len() == names.len() {
+            for (s, n) in services.iter().zip(names) {
+                if !self.VerifyName(s, n).await? {
+                    return Ok(false);
+                }
+            }
+            Ok(true)
+        } else {
+            Ok(false)
+        }
+    }
+
+    async fn GetNullableInterfaceArray(
+        &self,
+        names: Option<&[Option<String>]>,
+    ) -> binder::Result<Option<Vec<Option<binder::Strong<dyn INamedCallback::INamedCallback>>>>>
+    {
+        if let Some(names) = names {
+            let mut services = vec![];
+            for name in names {
+                if let Some(name) = name {
+                    services.push(Some(self.GetOtherTestService(name).await?));
+                } else {
+                    services.push(None);
+                }
+            }
+            Ok(Some(services))
+        } else {
+            Ok(None)
+        }
+    }
+
+    async fn VerifyNamesWithNullableInterfaceArray(
+        &self,
+        services: Option<&[Option<binder::Strong<dyn INamedCallback::INamedCallback>>]>,
+        names: Option<&[Option<String>]>,
+    ) -> binder::Result<bool> {
+        if let (Some(services), Some(names)) = (services, names) {
+            for (s, n) in services.iter().zip(names) {
+                if let (Some(s), Some(n)) = (s, n) {
+                    if !self.VerifyName(s, n).await? {
+                        return Ok(false);
+                    }
+                } else if s.is_some() || n.is_some() {
+                    return Ok(false);
+                }
+            }
+            Ok(true)
+        } else {
+            Ok(services.is_none() && names.is_none())
+        }
+    }
+
+    async fn GetInterfaceList(
+        &self,
+        names: Option<&[Option<String>]>,
+    ) -> binder::Result<Option<Vec<Option<binder::Strong<dyn INamedCallback::INamedCallback>>>>>
+    {
+        self.GetNullableInterfaceArray(names).await
+    }
+
+    async fn VerifyNamesWithInterfaceList(
+        &self,
+        services: Option<&[Option<binder::Strong<dyn INamedCallback::INamedCallback>>]>,
+        names: Option<&[Option<String>]>,
+    ) -> binder::Result<bool> {
+        self.VerifyNamesWithNullableInterfaceArray(services, names).await
+    }
+
+    async fn RepeatParcelFileDescriptor(
+        &self,
+        read: &ParcelFileDescriptor,
+    ) -> binder::Result<ParcelFileDescriptor> {
+        Ok(dup_fd(read))
+    }
+
+    async fn ReverseParcelFileDescriptorArray(
+        &self,
+        input: &[ParcelFileDescriptor],
+        repeated: &mut Vec<Option<ParcelFileDescriptor>>,
+    ) -> binder::Result<Vec<ParcelFileDescriptor>> {
+        repeated.clear();
+        repeated.extend(input.iter().map(dup_fd).map(Some));
+        Ok(input.iter().rev().map(dup_fd).collect())
+    }
+
+    async fn ThrowServiceException(&self, code: i32) -> binder::Result<()> {
+        Err(binder::Status::new_service_specific_error(code, None))
+    }
+
+    impl_repeat_nullable! {RepeatNullableIntArray, i32}
+    impl_repeat_nullable! {RepeatNullableByteEnumArray, ByteEnum}
+    impl_repeat_nullable! {RepeatNullableIntEnumArray, IntEnum}
+    impl_repeat_nullable! {RepeatNullableLongEnumArray, LongEnum}
+    impl_repeat_nullable! {RepeatNullableStringList, Option<String>}
+
+    async fn RepeatNullableString(&self, input: Option<&str>) -> binder::Result<Option<String>> {
+        Ok(input.map(String::from))
+    }
+
+    async fn RepeatNullableUtf8CppString(
+        &self,
+        input: Option<&str>,
+    ) -> binder::Result<Option<String>> {
+        Ok(input.map(String::from))
+    }
+
+    async fn RepeatNullableParcelable(
+        &self,
+        input: Option<&Empty>,
+    ) -> binder::Result<Option<Empty>> {
+        Ok(input.cloned())
+    }
+
+    impl_repeat_nullable! {RepeatNullableParcelableArray, Option<Empty>}
+    impl_repeat_nullable! {RepeatNullableParcelableList, Option<Empty>}
+
+    async fn TakesAnIBinder(&self, _: &SpIBinder) -> binder::Result<()> {
+        Ok(())
+    }
+
+    async fn TakesANullableIBinder(&self, _: Option<&SpIBinder>) -> binder::Result<()> {
+        Ok(())
+    }
+
+    async fn TakesAnIBinderList(&self, _: &[SpIBinder]) -> binder::Result<()> {
+        Ok(())
+    }
+
+    async fn TakesANullableIBinderList(
+        &self,
+        _: Option<&[Option<SpIBinder>]>,
+    ) -> binder::Result<()> {
+        Ok(())
+    }
+
+    async fn ReverseNullableUtf8CppString(
+        &self,
+        input: Option<&[Option<String>]>,
+        repeated: &mut Option<Vec<Option<String>>>,
+    ) -> binder::Result<Option<Vec<Option<String>>>> {
+        if let Some(input) = input {
+            *repeated = Some(input.to_vec());
+            Ok(Some(input.iter().rev().cloned().collect()))
+        } else {
+            // We don't touch `repeated` here, since
+            // the C++ test service doesn't either
+            Ok(None)
+        }
+    }
+
+    async fn ReverseUtf8CppStringList(
+        &self,
+        input: Option<&[Option<String>]>,
+        repeated: &mut Option<Vec<Option<String>>>,
+    ) -> binder::Result<Option<Vec<Option<String>>>> {
+        self.ReverseNullableUtf8CppString(input, repeated).await
+    }
+
+    async fn GetCallback(
+        &self,
+        return_null: bool,
+    ) -> binder::Result<Option<binder::Strong<dyn INamedCallback::INamedCallback>>> {
+        if return_null {
+            Ok(None)
+        } else {
+            self.GetOtherTestService("ABT: always be testing").await.map(Some)
+        }
+    }
+
+    async fn FillOutStructuredParcelable(
+        &self,
+        parcelable: &mut StructuredParcelable::StructuredParcelable,
+    ) -> binder::Result<()> {
+        parcelable.shouldBeJerry = "Jerry".into();
+        parcelable.shouldContainThreeFs = vec![parcelable.f, parcelable.f, parcelable.f];
+        parcelable.shouldBeByteBar = ByteEnum::BAR;
+        parcelable.shouldBeIntBar = IntEnum::BAR;
+        parcelable.shouldBeLongBar = LongEnum::BAR;
+        parcelable.shouldContainTwoByteFoos = vec![ByteEnum::FOO, ByteEnum::FOO];
+        parcelable.shouldContainTwoIntFoos = vec![IntEnum::FOO, IntEnum::FOO];
+        parcelable.shouldContainTwoLongFoos = vec![LongEnum::FOO, LongEnum::FOO];
+
+        parcelable.const_exprs_1 = ConstantExpressionEnum::decInt32_1;
+        parcelable.const_exprs_2 = ConstantExpressionEnum::decInt32_2;
+        parcelable.const_exprs_3 = ConstantExpressionEnum::decInt64_1;
+        parcelable.const_exprs_4 = ConstantExpressionEnum::decInt64_2;
+        parcelable.const_exprs_5 = ConstantExpressionEnum::decInt64_3;
+        parcelable.const_exprs_6 = ConstantExpressionEnum::decInt64_4;
+        parcelable.const_exprs_7 = ConstantExpressionEnum::hexInt32_1;
+        parcelable.const_exprs_8 = ConstantExpressionEnum::hexInt32_2;
+        parcelable.const_exprs_9 = ConstantExpressionEnum::hexInt32_3;
+        parcelable.const_exprs_10 = ConstantExpressionEnum::hexInt64_1;
+
+        parcelable.shouldSetBit0AndBit2 = StructuredParcelable::BIT0 | StructuredParcelable::BIT2;
+
+        parcelable.u = Some(Union::Union::Ns(vec![1, 2, 3]));
+        parcelable.shouldBeConstS1 = Some(Union::Union::S(Union::S1.to_string()));
+        Ok(())
+    }
+
+    async fn RepeatExtendableParcelable(
+        &self,
+        ep: &ExtendableParcelable,
+        ep2: &mut ExtendableParcelable,
+    ) -> binder::Result<()> {
+        ep2.a = ep.a;
+        ep2.b = ep.b.clone();
+
+        let my_ext = ep.ext.get_parcelable::<MyExt>()?;
+        if let Some(my_ext) = my_ext {
+            ep2.ext.set_parcelable(my_ext)?;
+        } else {
+            ep2.ext.reset();
+        }
+
+        Ok(())
+    }
+
+    async fn ReverseList(&self, list: &RecursiveList) -> binder::Result<RecursiveList> {
+        let mut reversed: Option<RecursiveList> = None;
+        let mut cur: Option<&RecursiveList> = Some(list);
+        while let Some(node) = cur {
+            reversed = Some(RecursiveList { value: node.value, next: reversed.map(Box::new) });
+            cur = node.next.as_ref().map(|n| n.as_ref());
+        }
+        // `list` is always not empty, so is `reversed`.
+        Ok(reversed.unwrap())
+    }
+
+    async fn ReverseIBinderArray(
+        &self,
+        input: &[SpIBinder],
+        repeated: &mut Vec<Option<SpIBinder>>,
+    ) -> binder::Result<Vec<SpIBinder>> {
+        *repeated = input.iter().cloned().map(Some).collect();
+        Ok(input.iter().rev().cloned().collect())
+    }
+
+    async fn ReverseNullableIBinderArray(
+        &self,
+        input: Option<&[Option<SpIBinder>]>,
+        repeated: &mut Option<Vec<Option<SpIBinder>>>,
+    ) -> binder::Result<Option<Vec<Option<SpIBinder>>>> {
+        let input = input.expect("input is null");
+        *repeated = Some(input.to_vec());
+        Ok(Some(input.iter().rev().cloned().collect()))
+    }
+
+    async fn GetOldNameInterface(&self) -> binder::Result<binder::Strong<dyn IOldName::IOldName>> {
+        Ok(IOldName::BnOldName::new_async_binder(OldName, rt(), BinderFeatures::default()))
+    }
+
+    async fn GetNewNameInterface(&self) -> binder::Result<binder::Strong<dyn INewName::INewName>> {
+        Ok(INewName::BnNewName::new_async_binder(NewName, rt(), BinderFeatures::default()))
+    }
+
+    async fn GetUnionTags(&self, input: &[Union::Union]) -> binder::Result<Vec<Union::Tag::Tag>> {
+        Ok(input
+            .iter()
+            .map(|u| match u {
+                Union::Union::Ns(_) => Union::Tag::Tag::ns,
+                Union::Union::N(_) => Union::Tag::Tag::n,
+                Union::Union::M(_) => Union::Tag::Tag::m,
+                Union::Union::S(_) => Union::Tag::Tag::s,
+                Union::Union::Ibinder(_) => Union::Tag::Tag::ibinder,
+                Union::Union::Ss(_) => Union::Tag::Tag::ss,
+                Union::Union::Be(_) => Union::Tag::Tag::be,
+            })
+            .collect::<Vec<_>>())
+    }
+
+    async fn GetCppJavaTests(&self) -> binder::Result<Option<SpIBinder>> {
+        Ok(None)
+    }
+
+    async fn getBackendType(&self) -> binder::Result<BackendType> {
+        Ok(BackendType::RUST)
+    }
+
+    async fn GetCircular(
+        &self,
+        _: &mut CircularParcelable,
+    ) -> binder::Result<binder::Strong<dyn ICircular::ICircular>> {
+        Ok(ICircular::BnCircular::new_async_binder(Circular, rt(), BinderFeatures::default()))
+    }
+}
+
+struct FooInterface;
+
+impl Interface for FooInterface {}
+
+#[async_trait]
+impl IFooInterface::IFooInterfaceAsyncServer for FooInterface {
+    async fn originalApi(&self) -> binder::Result<()> {
+        Ok(())
+    }
+    async fn acceptUnionAndReturnString(&self, u: &BazUnion) -> binder::Result<String> {
+        match u {
+            BazUnion::IntNum(n) => Ok(n.to_string()),
+        }
+    }
+    async fn returnsLengthOfFooArray(&self, foos: &[Foo]) -> binder::Result<i32> {
+        Ok(foos.len() as i32)
+    }
+    async fn ignoreParcelablesAndRepeatInt(
+        &self,
+        _in_foo: &Foo,
+        _inout_foo: &mut Foo,
+        _out_foo: &mut Foo,
+        value: i32,
+    ) -> binder::Result<i32> {
+        Ok(value)
+    }
+}
+
+struct TrunkStableTest;
+
+impl Interface for TrunkStableTest {}
+
+#[async_trait]
+impl ITrunkStableTest::ITrunkStableTestAsyncServer for TrunkStableTest {
+    async fn repeatParcelable(&self, in_parcel: &MyParcelable) -> binder::Result<MyParcelable> {
+        let tmp: MyParcelable = MyParcelable { a: in_parcel.a, b: in_parcel.b, c: in_parcel.c };
+        Ok(tmp)
+    }
+    async fn repeatEnum(&self, in_enum: MyEnum) -> binder::Result<MyEnum> {
+        Ok(in_enum)
+    }
+    async fn repeatUnion(&self, in_union: &MyUnion) -> binder::Result<MyUnion> {
+        match in_union {
+            MyUnion::A(n) => Ok(MyUnion::A(*n)),
+            MyUnion::B(n) => Ok(MyUnion::B(*n)),
+            MyUnion::C(n) => Ok(MyUnion::C(*n)),
+        }
+    }
+    async fn repeatOtherParcelable(
+        &self,
+        in_parcel: &MyOtherParcelable,
+    ) -> binder::Result<MyOtherParcelable> {
+        let tmp: MyOtherParcelable = MyOtherParcelable { a: in_parcel.a, b: in_parcel.b };
+        Ok(tmp)
+    }
+    async fn callMyCallback(
+        &self,
+        _in_cb: &binder::Strong<dyn IMyCallback::IMyCallback>,
+    ) -> binder::Result<()> {
+        let p1 = MyParcelable::default();
+        let _ = _in_cb.repeatParcelable(&p1);
+
+        let e1 = MyEnum::THREE;
+        let _ = _in_cb.repeatEnum(e1);
+
+        let u1 = MyUnion::A(12);
+        let _ = _in_cb.repeatUnion(&u1);
+
+        let o1 = MyOtherParcelable::default();
+        // expected to fail when not using the frozen version
+        let _ = _in_cb.repeatOtherParcelable(&o1);
+
+        Ok(())
+    }
+}
+
+struct NestedService;
+
+impl Interface for NestedService {}
+
+#[async_trait]
+impl INestedService::INestedServiceAsyncServer for NestedService {
+    async fn flipStatus(
+        &self,
+        p: &ParcelableWithNested::ParcelableWithNested,
+    ) -> binder::Result<INestedService::Result::Result> {
+        if p.status == ParcelableWithNested::Status::Status::OK {
+            Ok(INestedService::Result::Result {
+                status: ParcelableWithNested::Status::Status::NOT_OK,
+            })
+        } else {
+            Ok(INestedService::Result::Result { status: ParcelableWithNested::Status::Status::OK })
+        }
+    }
+    async fn flipStatusWithCallback(
+        &self,
+        st: ParcelableWithNested::Status::Status,
+        cb: &binder::Strong<dyn INestedService::ICallback::ICallback>,
+    ) -> binder::Result<()> {
+        if st == ParcelableWithNested::Status::Status::OK {
+            cb.done(ParcelableWithNested::Status::Status::NOT_OK)
+        } else {
+            cb.done(ParcelableWithNested::Status::Status::OK)
+        }
+    }
+}
+
+struct FixedSizeArrayService;
+
+impl Interface for FixedSizeArrayService {}
+
+#[async_trait]
+impl IRepeatFixedSizeArray::IRepeatFixedSizeArrayAsyncServer for FixedSizeArrayService {
+    async fn RepeatBytes(
+        &self,
+        input: &[u8; 3],
+        repeated: &mut [u8; 3],
+    ) -> binder::Result<[u8; 3]> {
+        *repeated = *input;
+        Ok(*input)
+    }
+    async fn RepeatInts(
+        &self,
+        input: &[i32; 3],
+        repeated: &mut [i32; 3],
+    ) -> binder::Result<[i32; 3]> {
+        *repeated = *input;
+        Ok(*input)
+    }
+    async fn RepeatBinders(
+        &self,
+        input: &[SpIBinder; 3],
+        repeated: &mut [Option<SpIBinder>; 3],
+    ) -> binder::Result<[SpIBinder; 3]> {
+        *repeated = input.clone().map(Some);
+        Ok(input.clone())
+    }
+    async fn RepeatParcelables(
+        &self,
+        input: &[IntParcelable; 3],
+        repeated: &mut [IntParcelable; 3],
+    ) -> binder::Result<[IntParcelable; 3]> {
+        *repeated = *input;
+        Ok(*input)
+    }
+    async fn Repeat2dBytes(
+        &self,
+        input: &[[u8; 3]; 2],
+        repeated: &mut [[u8; 3]; 2],
+    ) -> binder::Result<[[u8; 3]; 2]> {
+        *repeated = *input;
+        Ok(*input)
+    }
+    async fn Repeat2dInts(
+        &self,
+        input: &[[i32; 3]; 2],
+        repeated: &mut [[i32; 3]; 2],
+    ) -> binder::Result<[[i32; 3]; 2]> {
+        *repeated = *input;
+        Ok(*input)
+    }
+    async fn Repeat2dBinders(
+        &self,
+        input: &[[SpIBinder; 3]; 2],
+        repeated: &mut [[Option<SpIBinder>; 3]; 2],
+    ) -> binder::Result<[[SpIBinder; 3]; 2]> {
+        *repeated = input.clone().map(|nested| nested.map(Some));
+        Ok(input.clone())
+    }
+    async fn Repeat2dParcelables(
+        &self,
+        input: &[[IntParcelable; 3]; 2],
+        repeated: &mut [[IntParcelable; 3]; 2],
+    ) -> binder::Result<[[IntParcelable; 3]; 2]> {
+        *repeated = *input;
+        Ok(*input)
+    }
+}
+
+fn rt() -> binder_tokio::TokioRuntime<tokio::runtime::Handle> {
+    binder_tokio::TokioRuntime(tokio::runtime::Handle::current())
+}
+
+fn main() {
+    binder::ProcessState::set_thread_pool_max_thread_count(0);
+    binder::ProcessState::start_thread_pool();
+
+    let runtime = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap();
+    runtime.block_on(async {
+        let service_name = <BpTestService as ITestService::ITestService>::get_descriptor();
+        let service =
+            BnTestService::new_async_binder(TestService::default(), rt(), BinderFeatures::default());
+        binder::add_service(service_name, service.as_binder()).expect("Could not register service");
+
+        let versioned_service_name = <BpFooInterface as IFooInterface::IFooInterface>::get_descriptor();
+        let versioned_service =
+            BnFooInterface::new_async_binder(FooInterface, rt(), BinderFeatures::default());
+        binder::add_service(versioned_service_name, versioned_service.as_binder())
+            .expect("Could not register service");
+
+        let nested_service_name =
+            <INestedService::BpNestedService as INestedService::INestedService>::get_descriptor();
+        let nested_service = INestedService::BnNestedService::new_async_binder(
+            NestedService,
+            rt(),
+            BinderFeatures::default(),
+        );
+        binder::add_service(nested_service_name, nested_service.as_binder())
+            .expect("Could not register service");
+
+        let fixed_size_array_service_name =
+            <IRepeatFixedSizeArray::BpRepeatFixedSizeArray as IRepeatFixedSizeArray::IRepeatFixedSizeArray>::get_descriptor();
+        let fixed_size_array_service = IRepeatFixedSizeArray::BnRepeatFixedSizeArray::new_async_binder(
+            FixedSizeArrayService,
+            rt(),
+            BinderFeatures::default(),
+        );
+        binder::add_service(fixed_size_array_service_name, fixed_size_array_service.as_binder())
+            .expect("Could not register service");
+
+        let trunk_stable_service_name =
+            <BpTrunkStableTest as ITrunkStableTest::ITrunkStableTest>::get_descriptor();
+        let trunk_stable_service = BnTrunkStableTest::new_async_binder(
+            TrunkStableTest,
+            rt(),
+            BinderFeatures::default()
+        );
+        binder::add_service(trunk_stable_service_name, trunk_stable_service.as_binder())
+            .expect("Could not register service");
+
+        // By awaiting `pending`, we yield to the runtime. This results in the current-thread
+        // runtime being driven by the current thread (the main thread in this case). E.g., this
+        // means that anything spawned with `tokio::spawn` will run on this thread.
+        std::future::pending().await
+    })
+}
diff --git a/tests/simple_parcelable.cpp b/tests/simple_parcelable.cpp
new file mode 100644
index 0000000..7af1255
--- /dev/null
+++ b/tests/simple_parcelable.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "tests/simple_parcelable.h"
+
+#include <android-base/stringprintf.h>
+#include <binder/Parcel.h>
+#include <utils/String8.h>
+
+using android::base::StringPrintf;
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+SimpleParcelable::SimpleParcelable(const std::string& name, int32_t number)
+    : name_(name.c_str(), name.length()),
+      number_(number) {}
+
+status_t SimpleParcelable::writeToParcel(Parcel* parcel) const {
+  status_t status = parcel->writeString16(name_);
+  if (status != OK) {
+    return status;
+  }
+  status = parcel->writeInt32(number_);
+  return status;
+}
+
+status_t SimpleParcelable::readFromParcel(const Parcel* parcel) {
+  status_t status = parcel->readString16(&name_);
+  if (status != OK) {
+    return status;
+  }
+  return parcel->readInt32(&number_);
+}
+
+std::string SimpleParcelable::toString() const {
+  return StringPrintf("%s(%d)", String8(name_).c_str(), number_);
+}
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/simple_parcelable.h b/tests/simple_parcelable.h
new file mode 100644
index 0000000..52a20de
--- /dev/null
+++ b/tests/simple_parcelable.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AIDL_TESTS_SIMPLE_PARCELABLE_H_
+#define AIDL_TESTS_SIMPLE_PARCELABLE_H_
+
+#include <cstdint>
+#include <string>
+
+#include <binder/Parcelable.h>
+#include <utils/Errors.h>
+#include <utils/String16.h>
+
+namespace android {
+namespace aidl {
+namespace tests {
+
+class SimpleParcelable : public Parcelable {
+ public:
+  SimpleParcelable() = default;
+  SimpleParcelable(const std::string& name, int32_t number);
+  virtual ~SimpleParcelable() = default;
+
+  // Write |this| parcelable to the given |parcel|.  Keep in mind that
+  // implementations of writeToParcel must be manually kept in sync
+  // with readFromParcel and the Java equivalent versions of these methods.
+  //
+  // Returns android::OK on success and an appropriate error otherwise.
+  status_t writeToParcel(Parcel* parcel) const override;
+
+  // Read data from the given |parcel| into |this|.  After readFromParcel
+  // completes, |this| should have equivalent state to the object that
+  // wrote itself to the parcel.
+  //
+  // Returns android::OK on success and an appropriate error otherwise.
+  status_t readFromParcel(const Parcel* parcel) override;
+
+  std::string toString() const;
+
+  friend bool operator==(const SimpleParcelable& lhs,
+                         const SimpleParcelable& rhs) {
+    return (lhs.name_ == rhs.name_) && (lhs.number_ == rhs.number_);
+  }
+  friend bool operator!=(const SimpleParcelable& lhs,
+                         const SimpleParcelable& rhs) {
+    return !(lhs == rhs);
+  }
+
+ private:
+  String16 name_;
+  int32_t number_ = 0;
+};  // class SimpleParcelable
+
+}  // namespace tests
+}  // namespace aidl
+}  // namespace android
+
+#endif  // AIDL_TESTS_SIMPLE_PARCELABLE_H_
diff --git a/tests/stability_test/Android.bp b/tests/stability_test/Android.bp
new file mode 100644
index 0000000..993f122
--- /dev/null
+++ b/tests/stability_test/Android.bp
@@ -0,0 +1,94 @@
+//
+// Copyright (C) 2020 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "system_tools_aidl_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["system_tools_aidl_license"],
+}
+
+aidl_interface {
+    name: "aidl_test_nonvintf_parcelable",
+    flags: ["-Werror"],
+    srcs: [
+        "android/aidl/tests/nonvintf/*.aidl",
+    ],
+    backend: {
+        java: {
+            platform_apis: true,
+        },
+        cpp: {
+            enabled: false,
+        },
+        ndk: {
+            enabled: false,
+        },
+        rust: {
+            enabled: true,
+        },
+    },
+    versions: ["1"],
+}
+
+aidl_interface {
+    name: "aidl_test_unstable_parcelable",
+    unstable: true,
+    flags: ["-Werror"],
+    srcs: [
+        "android/aidl/tests/unstable/*.aidl",
+    ],
+    backend: {
+        java: {
+            platform_apis: true,
+        },
+        cpp: {
+            enabled: false,
+        },
+        ndk: {
+            enabled: false,
+        },
+        rust: {
+            enabled: true,
+        },
+    },
+}
+
+aidl_interface {
+    name: "aidl_test_vintf_parcelable",
+    stability: "vintf",
+    flags: ["-Werror"],
+    srcs: [
+        "android/aidl/tests/vintf/*.aidl",
+    ],
+    backend: {
+        java: {
+            platform_apis: true,
+        },
+        cpp: {
+            enabled: false,
+        },
+        ndk: {
+            enabled: false,
+        },
+        rust: {
+            enabled: true,
+        },
+    },
+    versions: ["1"],
+}
diff --git a/tests/stability_test/aidl_api/aidl_test_nonvintf_parcelable/1/.hash b/tests/stability_test/aidl_api/aidl_test_nonvintf_parcelable/1/.hash
new file mode 100644
index 0000000..f1295eb
--- /dev/null
+++ b/tests/stability_test/aidl_api/aidl_test_nonvintf_parcelable/1/.hash
@@ -0,0 +1 @@
+873769e09e3ac6d71f380fd36df9e15526d250e5
diff --git a/tests/stability_test/aidl_api/aidl_test_nonvintf_parcelable/1/android/aidl/tests/nonvintf/NonVintfExtendableParcelable.aidl b/tests/stability_test/aidl_api/aidl_test_nonvintf_parcelable/1/android/aidl/tests/nonvintf/NonVintfExtendableParcelable.aidl
new file mode 100644
index 0000000..6f2054e
--- /dev/null
+++ b/tests/stability_test/aidl_api/aidl_test_nonvintf_parcelable/1/android/aidl/tests/nonvintf/NonVintfExtendableParcelable.aidl
@@ -0,0 +1,21 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.tests.nonvintf;
+parcelable NonVintfExtendableParcelable {
+  ParcelableHolder ext;
+}
diff --git a/tests/stability_test/aidl_api/aidl_test_nonvintf_parcelable/1/android/aidl/tests/nonvintf/NonVintfParcelable.aidl b/tests/stability_test/aidl_api/aidl_test_nonvintf_parcelable/1/android/aidl/tests/nonvintf/NonVintfParcelable.aidl
new file mode 100644
index 0000000..291c472
--- /dev/null
+++ b/tests/stability_test/aidl_api/aidl_test_nonvintf_parcelable/1/android/aidl/tests/nonvintf/NonVintfParcelable.aidl
@@ -0,0 +1,21 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.tests.nonvintf;
+parcelable NonVintfParcelable {
+  int a;
+}
diff --git a/tests/stability_test/aidl_api/aidl_test_nonvintf_parcelable/current/android/aidl/tests/nonvintf/NonVintfExtendableParcelable.aidl b/tests/stability_test/aidl_api/aidl_test_nonvintf_parcelable/current/android/aidl/tests/nonvintf/NonVintfExtendableParcelable.aidl
new file mode 100644
index 0000000..55317cd
--- /dev/null
+++ b/tests/stability_test/aidl_api/aidl_test_nonvintf_parcelable/current/android/aidl/tests/nonvintf/NonVintfExtendableParcelable.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.tests.nonvintf;
+parcelable NonVintfExtendableParcelable {
+  ParcelableHolder ext;
+}
diff --git a/tests/stability_test/aidl_api/aidl_test_nonvintf_parcelable/current/android/aidl/tests/nonvintf/NonVintfParcelable.aidl b/tests/stability_test/aidl_api/aidl_test_nonvintf_parcelable/current/android/aidl/tests/nonvintf/NonVintfParcelable.aidl
new file mode 100644
index 0000000..bf17dd9
--- /dev/null
+++ b/tests/stability_test/aidl_api/aidl_test_nonvintf_parcelable/current/android/aidl/tests/nonvintf/NonVintfParcelable.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.tests.nonvintf;
+parcelable NonVintfParcelable {
+  int a;
+}
diff --git a/tests/stability_test/aidl_api/aidl_test_vintf_parcelable/1/.hash b/tests/stability_test/aidl_api/aidl_test_vintf_parcelable/1/.hash
new file mode 100644
index 0000000..8b3d144
--- /dev/null
+++ b/tests/stability_test/aidl_api/aidl_test_vintf_parcelable/1/.hash
@@ -0,0 +1 @@
+10def8b50cda5b371cb022d66b5f7425da9eec4f
diff --git a/tests/stability_test/aidl_api/aidl_test_vintf_parcelable/1/android/aidl/tests/vintf/VintfExtendableParcelable.aidl b/tests/stability_test/aidl_api/aidl_test_vintf_parcelable/1/android/aidl/tests/vintf/VintfExtendableParcelable.aidl
new file mode 100644
index 0000000..63ceb55
--- /dev/null
+++ b/tests/stability_test/aidl_api/aidl_test_vintf_parcelable/1/android/aidl/tests/vintf/VintfExtendableParcelable.aidl
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.tests.vintf;
+@VintfStability
+parcelable VintfExtendableParcelable {
+  ParcelableHolder ext;
+}
diff --git a/tests/stability_test/aidl_api/aidl_test_vintf_parcelable/1/android/aidl/tests/vintf/VintfParcelable.aidl b/tests/stability_test/aidl_api/aidl_test_vintf_parcelable/1/android/aidl/tests/vintf/VintfParcelable.aidl
new file mode 100644
index 0000000..6d00aaf
--- /dev/null
+++ b/tests/stability_test/aidl_api/aidl_test_vintf_parcelable/1/android/aidl/tests/vintf/VintfParcelable.aidl
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.tests.vintf;
+@VintfStability
+parcelable VintfParcelable {
+  int a;
+}
diff --git a/tests/stability_test/aidl_api/aidl_test_vintf_parcelable/current/android/aidl/tests/vintf/VintfExtendableParcelable.aidl b/tests/stability_test/aidl_api/aidl_test_vintf_parcelable/current/android/aidl/tests/vintf/VintfExtendableParcelable.aidl
new file mode 100644
index 0000000..14c6b77
--- /dev/null
+++ b/tests/stability_test/aidl_api/aidl_test_vintf_parcelable/current/android/aidl/tests/vintf/VintfExtendableParcelable.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.tests.vintf;
+@VintfStability
+parcelable VintfExtendableParcelable {
+  ParcelableHolder ext;
+}
diff --git a/tests/stability_test/aidl_api/aidl_test_vintf_parcelable/current/android/aidl/tests/vintf/VintfParcelable.aidl b/tests/stability_test/aidl_api/aidl_test_vintf_parcelable/current/android/aidl/tests/vintf/VintfParcelable.aidl
new file mode 100644
index 0000000..92d6f2f
--- /dev/null
+++ b/tests/stability_test/aidl_api/aidl_test_vintf_parcelable/current/android/aidl/tests/vintf/VintfParcelable.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.tests.vintf;
+@VintfStability
+parcelable VintfParcelable {
+  int a;
+}
diff --git a/tests/stability_test/android/aidl/tests/nonvintf/NonVintfExtendableParcelable.aidl b/tests/stability_test/android/aidl/tests/nonvintf/NonVintfExtendableParcelable.aidl
new file mode 100644
index 0000000..4dc4292
--- /dev/null
+++ b/tests/stability_test/android/aidl/tests/nonvintf/NonVintfExtendableParcelable.aidl
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.nonvintf;
+
+parcelable NonVintfExtendableParcelable {
+    ParcelableHolder ext;
+}
diff --git a/tests/stability_test/android/aidl/tests/nonvintf/NonVintfParcelable.aidl b/tests/stability_test/android/aidl/tests/nonvintf/NonVintfParcelable.aidl
new file mode 100644
index 0000000..485cb43
--- /dev/null
+++ b/tests/stability_test/android/aidl/tests/nonvintf/NonVintfParcelable.aidl
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.nonvintf;
+
+parcelable NonVintfParcelable {
+    int a;
+}
diff --git a/tests/stability_test/android/aidl/tests/unstable/UnstableExtendableParcelable.aidl b/tests/stability_test/android/aidl/tests/unstable/UnstableExtendableParcelable.aidl
new file mode 100644
index 0000000..a594e3c
--- /dev/null
+++ b/tests/stability_test/android/aidl/tests/unstable/UnstableExtendableParcelable.aidl
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.unstable;
+
+parcelable UnstableExtendableParcelable {
+    ParcelableHolder ext;
+}
diff --git a/tests/stability_test/android/aidl/tests/unstable/UnstableParcelable.aidl b/tests/stability_test/android/aidl/tests/unstable/UnstableParcelable.aidl
new file mode 100644
index 0000000..0c02c2d
--- /dev/null
+++ b/tests/stability_test/android/aidl/tests/unstable/UnstableParcelable.aidl
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.unstable;
+
+parcelable UnstableParcelable {
+    int a;
+}
diff --git a/tests/stability_test/android/aidl/tests/vintf/VintfExtendableParcelable.aidl b/tests/stability_test/android/aidl/tests/vintf/VintfExtendableParcelable.aidl
new file mode 100644
index 0000000..398168e
--- /dev/null
+++ b/tests/stability_test/android/aidl/tests/vintf/VintfExtendableParcelable.aidl
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.vintf;
+
+@VintfStability
+parcelable VintfExtendableParcelable {
+    ParcelableHolder ext;
+}
diff --git a/tests/stability_test/android/aidl/tests/vintf/VintfParcelable.aidl b/tests/stability_test/android/aidl/tests/vintf/VintfParcelable.aidl
new file mode 100644
index 0000000..ca794ce
--- /dev/null
+++ b/tests/stability_test/android/aidl/tests/vintf/VintfParcelable.aidl
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests.vintf;
+
+@VintfStability
+parcelable VintfParcelable {
+    int a;
+}
diff --git a/tests/test_util.cpp b/tests/test_util.cpp
new file mode 100644
index 0000000..6d4750a
--- /dev/null
+++ b/tests/test_util.cpp
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <algorithm>
+#include <iostream>
+#include <iterator>
+
+#include <android-base/strings.h>
+
+#include "os.h"
+#include "tests/test_util.h"
+
+using android::base::Split;
+using android::base::Join;
+using std::string;
+using std::vector;
+using std::cout;
+using std::endl;
+using std::distance;
+
+namespace android {
+namespace aidl {
+namespace test {
+
+string CanonicalNameToPath(const char* package_class, const char* extension) {
+  string rel_path{package_class};
+  for (char& c : rel_path) {
+    if (c == '.') {
+      c = OS_PATH_SEPARATOR;
+    }
+  }
+  rel_path += extension;
+  return rel_path;
+}
+
+void SplitPackageClass(const string& package_class,
+                       string* rel_path,
+                       string* package,
+                       string* class_name) {
+  *package = string{package_class, 0, package_class.rfind('.')};
+  *class_name = string{package_class, package_class.rfind('.') + 1};
+  *rel_path = CanonicalNameToPath(package_class.c_str(), ".aidl");
+}
+
+void PrintDiff(const string& a, const string& b) {
+  const int LEFT = 1;
+  const int UP = 2;
+  const int UP_LEFT = 4;
+
+  auto a_lines = Split(a, "\n");
+  auto b_lines = Split(b, "\n");
+
+  struct diff_table_entry {
+    size_t longest_common_subsequence_length;
+    int propagation_directions;
+  };
+
+  diff_table_entry table[a_lines.size() + 1][b_lines.size() + 1];
+
+  for (size_t i = 0; i < a_lines.size() + 1; ++i) {
+    for (size_t j = 0; j < b_lines.size() + 1; ++j) {
+      if (i == 0 || j == 0) {
+        int directions = 0;
+
+        if (i) {
+          directions |= UP;
+        }
+
+        if (j) {
+          directions |= LEFT;
+        }
+
+        table[i][j].longest_common_subsequence_length = 0;
+        table[i][j].propagation_directions = directions;
+      } else if (a_lines[i-1] == b_lines[j-1]) {
+        table[i][j].longest_common_subsequence_length =
+            table[i-1][j-1].longest_common_subsequence_length + 1;
+        table[i][j].propagation_directions = UP_LEFT;
+      } else {
+        size_t length_up = table[i-1][j].longest_common_subsequence_length;
+        size_t length_left = table[i][j-1].longest_common_subsequence_length;
+        int directions = 0;
+        size_t length;
+
+        if (length_up >= length_left) {
+          directions |= UP;
+          length = length_up;
+        }
+
+        if (length_left >= length_up) {
+          directions |= LEFT;
+          length = length_left;
+        }
+
+        table[i][j].longest_common_subsequence_length = length;
+        table[i][j].propagation_directions = directions;
+      }
+    }
+  }
+
+  size_t i = a_lines.size();
+  size_t j = b_lines.size();
+  vector<string> output;
+
+  while (table[i][j].propagation_directions) {
+    if (table[i][j].propagation_directions & UP_LEFT) {
+      output.push_back(" " + a_lines[i-1]);
+      i--;
+      j--;
+    } else if (table[i][j].propagation_directions & UP) {
+      output.push_back("-" + a_lines[i-1]);
+      i--;
+    } else {
+      output.push_back("+" + b_lines[j-1]);
+      j--;
+    }
+  }
+
+  int print_mask = 0;
+  bool printed_last = false;
+  size_t line_number = 0;
+
+  for (auto it = output.crbegin(), frontier = output.crbegin();
+       it != output.crend(); ++it) {
+    while (frontier != output.crend() && distance(it, frontier) <= 3) {
+      print_mask <<= 1;
+      print_mask &= 0x7f;
+
+      if ((*frontier)[0] != ' ') {
+        print_mask |= 1;
+      }
+
+      frontier++;
+    }
+
+    if ((*it)[0] != '-') {
+      line_number++;
+    }
+
+    if (print_mask) {
+      if (!printed_last) {
+        cout << "Line: " << line_number << endl;
+      }
+
+      cout << *it << endl;
+      printed_last = true;
+    } else {
+      printed_last = false;
+    }
+  }
+}
+
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
diff --git a/tests/test_util.h b/tests/test_util.h
new file mode 100644
index 0000000..6c4389c
--- /dev/null
+++ b/tests/test_util.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AIDL_TESTS_TEST_UTIL_H_
+#define AIDL_TESTS_TEST_UTIL_H_
+
+#include <string>
+
+namespace android {
+namespace aidl {
+namespace test {
+
+std::string CanonicalNameToPath(const char* package_class,
+                                const char* extension);
+
+void SplitPackageClass(const std::string& package_class,
+                       std::string* rel_path,
+                       std::string* package,
+                       std::string* class_name);
+
+void PrintDiff(const std::string& a, const std::string& b);
+
+}  // namespace test
+}  // namespace aidl
+}  // namespace android
+
+#endif // AIDL_TESTS_TEST_UTIL_H_
diff --git a/tests/trunk_stable_test/Android.bp b/tests/trunk_stable_test/Android.bp
new file mode 100644
index 0000000..bd71308
--- /dev/null
+++ b/tests/trunk_stable_test/Android.bp
@@ -0,0 +1,97 @@
+// Copyright (C) 2023 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "system_tools_aidl_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["system_tools_aidl_license"],
+}
+
+aidl_interface {
+    name: "android.aidl.test.trunk",
+    srcs: ["android/aidl/test/trunk/*.aidl"],
+    flags: ["-Werror"],
+    gen_trace: true,
+    backend: {
+        cpp: {
+            gen_log: true,
+        },
+        ndk: {
+            gen_log: true,
+        },
+        java: {
+            platform_apis: true,
+        },
+        rust: {
+            enabled: true,
+        },
+    },
+    versions_with_info: [
+        {
+            version: "1",
+            imports: [],
+        },
+    ],
+    frozen: false,
+    // Some tests rely on the last version not being frozen.
+    // Owner is set so the interface isn't frozen with the rest.
+    owner: "aosp",
+
+}
+
+// Test using the same client and server source code including different
+// versions of the generated AIDL library.
+// This is an example of a possible solution to dealing with different
+// configurations of the build without needing to modify the source code.
+// This is the version of the test that uses the V1 library with the
+// V2 code behind #ifdefs.
+cc_test {
+    name: "aidl_ndk_V1_trunk_stable_unittest",
+    srcs: ["trunk_ndk_unittest.cpp"],
+    shared_libs: [
+        "libbinder_ndk",
+        "libbase",
+        "libcutils",
+        "liblog",
+    ],
+    cflags: [
+        "-DAIDL_TEST_TRUNK_VER=1",
+    ],
+    static_libs: [
+        "android.aidl.test.trunk-V1-ndk",
+    ],
+    require_root: true,
+}
+
+// This is the version of the test that uses the latest V2 library.
+cc_test {
+    name: "aidl_ndk_V2_trunk_stable_unittest",
+    srcs: ["trunk_ndk_unittest.cpp"],
+    shared_libs: [
+        "libcutils",
+        "liblog",
+        "libbinder_ndk",
+        "libbase",
+    ],
+    cflags: [
+        "-DAIDL_TEST_TRUNK_VER=2",
+    ],
+    static_libs: [
+        "android.aidl.test.trunk-V2-ndk",
+    ],
+    require_root: true,
+}
diff --git a/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/.hash b/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/.hash
new file mode 100644
index 0000000..890f5f5
--- /dev/null
+++ b/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/.hash
@@ -0,0 +1 @@
+88311b9118fb6fe9eff4a2ca19121de0587f6d5f
diff --git a/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl b/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
new file mode 100644
index 0000000..98bbd2f
--- /dev/null
+++ b/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/1/android/aidl/test/trunk/ITrunkStableTest.aidl
@@ -0,0 +1,43 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.test.trunk;
+interface ITrunkStableTest {
+  android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(in android.aidl.test.trunk.ITrunkStableTest.MyParcelable input);
+  android.aidl.test.trunk.ITrunkStableTest.MyEnum repeatEnum(in android.aidl.test.trunk.ITrunkStableTest.MyEnum input);
+  android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(in android.aidl.test.trunk.ITrunkStableTest.MyUnion input);
+  void callMyCallback(in android.aidl.test.trunk.ITrunkStableTest.IMyCallback cb);
+  parcelable MyParcelable {
+    int a;
+    int b;
+  }
+  enum MyEnum {
+    ZERO,
+    ONE,
+    TWO,
+  }
+  union MyUnion {
+    int a;
+    int b;
+  }
+  interface IMyCallback {
+    android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(in android.aidl.test.trunk.ITrunkStableTest.MyParcelable input);
+    android.aidl.test.trunk.ITrunkStableTest.MyEnum repeatEnum(in android.aidl.test.trunk.ITrunkStableTest.MyEnum input);
+    android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(in android.aidl.test.trunk.ITrunkStableTest.MyUnion input);
+  }
+}
diff --git a/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/current/android/aidl/test/trunk/ITrunkStableTest.aidl b/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/current/android/aidl/test/trunk/ITrunkStableTest.aidl
new file mode 100644
index 0000000..2aa3bb1
--- /dev/null
+++ b/tests/trunk_stable_test/aidl_api/android.aidl.test.trunk/current/android/aidl/test/trunk/ITrunkStableTest.aidl
@@ -0,0 +1,52 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+//     the interface (from the latest frozen version), the build system will
+//     prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.aidl.test.trunk;
+interface ITrunkStableTest {
+  android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(in android.aidl.test.trunk.ITrunkStableTest.MyParcelable input);
+  android.aidl.test.trunk.ITrunkStableTest.MyEnum repeatEnum(in android.aidl.test.trunk.ITrunkStableTest.MyEnum input);
+  android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(in android.aidl.test.trunk.ITrunkStableTest.MyUnion input);
+  void callMyCallback(in android.aidl.test.trunk.ITrunkStableTest.IMyCallback cb);
+  android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable repeatOtherParcelable(in android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable input);
+  parcelable MyParcelable {
+    int a;
+    int b;
+    int c;
+  }
+  enum MyEnum {
+    ZERO,
+    ONE,
+    TWO,
+    THREE,
+  }
+  union MyUnion {
+    int a;
+    int b;
+    int c;
+  }
+  interface IMyCallback {
+    android.aidl.test.trunk.ITrunkStableTest.MyParcelable repeatParcelable(in android.aidl.test.trunk.ITrunkStableTest.MyParcelable input);
+    android.aidl.test.trunk.ITrunkStableTest.MyEnum repeatEnum(in android.aidl.test.trunk.ITrunkStableTest.MyEnum input);
+    android.aidl.test.trunk.ITrunkStableTest.MyUnion repeatUnion(in android.aidl.test.trunk.ITrunkStableTest.MyUnion input);
+    android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable repeatOtherParcelable(in android.aidl.test.trunk.ITrunkStableTest.MyOtherParcelable input);
+  }
+  parcelable MyOtherParcelable {
+    int a;
+    int b;
+  }
+}
diff --git a/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl b/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
new file mode 100644
index 0000000..7c4ce2b
--- /dev/null
+++ b/tests/trunk_stable_test/android/aidl/test/trunk/ITrunkStableTest.aidl
@@ -0,0 +1,41 @@
+package android.aidl.test.trunk;
+
+interface ITrunkStableTest {
+    parcelable MyParcelable {
+        int a;
+        int b;
+        // New in V2
+        int c;
+    }
+    enum MyEnum {
+        ZERO,
+        ONE,
+        TWO,
+        // New in V2
+        THREE,
+    }
+    union MyUnion {
+        int a;
+        int b;
+        // New in V3
+        int c;
+    }
+    interface IMyCallback {
+        MyParcelable repeatParcelable(in MyParcelable input);
+        MyEnum repeatEnum(in MyEnum input);
+        MyUnion repeatUnion(in MyUnion input);
+        MyOtherParcelable repeatOtherParcelable(in MyOtherParcelable input);
+    }
+
+    MyParcelable repeatParcelable(in MyParcelable input);
+    MyEnum repeatEnum(in MyEnum input);
+    MyUnion repeatUnion(in MyUnion input);
+    void callMyCallback(in IMyCallback cb);
+
+    // New in V2
+    parcelable MyOtherParcelable {
+        int a;
+        int b;
+    }
+    MyOtherParcelable repeatOtherParcelable(in MyOtherParcelable input);
+}
diff --git a/tests/trunk_stable_test/trunk_ndk_unittest.cpp b/tests/trunk_stable_test/trunk_ndk_unittest.cpp
new file mode 100644
index 0000000..2ac721d
--- /dev/null
+++ b/tests/trunk_stable_test/trunk_ndk_unittest.cpp
@@ -0,0 +1,185 @@
+/*
+ * Copyright (C) 2023, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "gtest/gtest.h"
+
+/* Shared Client/Service includes */
+#include <aidl/android/aidl/test/trunk/BnTrunkStableTest.h>
+#include <aidl/android/aidl/test/trunk/ITrunkStableTest.h>
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <sys/prctl.h>
+
+/* AIDL Client includes */
+
+/* AIDL Service includes */
+#include <android/binder_process.h>
+
+#ifndef AIDL_TEST_TRUNK_VER
+#define AIDL_TEST_TRUNK_VER 2
+#endif
+
+using ::aidl::android::aidl::test::trunk::ITrunkStableTest;
+using ndk::ScopedAStatus;
+
+/* AIDL Client definition */
+class MyCallback : public ITrunkStableTest::BnMyCallback {
+ public:
+  ScopedAStatus repeatParcelable(const ITrunkStableTest::MyParcelable& in_input,
+                                 ITrunkStableTest::MyParcelable* _aidl_return) override {
+    *_aidl_return = in_input;
+    repeatParcelableCalled = true;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus repeatEnum(const ITrunkStableTest::MyEnum in_input,
+                           ITrunkStableTest::MyEnum* _aidl_return) override {
+    *_aidl_return = in_input;
+    repeatEnumCalled = true;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus repeatUnion(const ITrunkStableTest::MyUnion& in_input,
+                            ITrunkStableTest::MyUnion* _aidl_return) override {
+    *_aidl_return = in_input;
+    repeatUnionCalled = true;
+    return ScopedAStatus::ok();
+  }
+
+#if AIDL_TEST_TRUNK_VER >= 2
+  ScopedAStatus repeatOtherParcelable(const ITrunkStableTest::MyOtherParcelable& in_input,
+                                      ITrunkStableTest::MyOtherParcelable* _aidl_return) override {
+    *_aidl_return = in_input;
+    repeatOtherParcelableCalled = true;
+    return ScopedAStatus::ok();
+  }
+
+  bool repeatOtherParcelableCalled = false;
+#endif
+
+  bool repeatParcelableCalled = false;
+  bool repeatEnumCalled = false;
+  bool repeatUnionCalled = false;
+};
+
+class ClientTest : public testing::Test {
+ public:
+  void SetUp() override {
+    mService = ITrunkStableTest::fromBinder(
+        ndk::SpAIBinder(AServiceManager_waitForService(ITrunkStableTest::descriptor)));
+    ASSERT_NE(nullptr, mService);
+  }
+
+  std::shared_ptr<ITrunkStableTest> mService;
+};
+
+TEST_F(ClientTest, SanityCheck) {
+  ITrunkStableTest::MyParcelable a, b;
+  a.a = 12;
+  a.b = 13;
+#if AIDL_TEST_TRUNK_VER >= 2
+  a.c = 14;
+#endif
+  auto status = mService->repeatParcelable(a, &b);
+  EXPECT_TRUE(status.isOk());
+  EXPECT_EQ(a, b);
+}
+
+TEST_F(ClientTest, Callback) {
+  auto cb = ndk::SharedRefBase::make<MyCallback>();
+  auto status = mService->callMyCallback(cb);
+  EXPECT_TRUE(status.isOk());
+  EXPECT_TRUE(cb->repeatParcelableCalled);
+  EXPECT_TRUE(cb->repeatEnumCalled);
+  EXPECT_TRUE(cb->repeatUnionCalled);
+#if AIDL_TEST_TRUNK_VER >= 2
+  EXPECT_TRUE(cb->repeatOtherParcelableCalled);
+#endif
+}
+
+#if AIDL_TEST_TRUNK_VER >= 2
+TEST_F(ClientTest, CallV2Method) {
+  ITrunkStableTest::MyOtherParcelable a, b;
+  a.a = 12;
+  a.b = 13;
+  auto status = mService->repeatOtherParcelable(a, &b);
+  EXPECT_TRUE(status.isOk());
+  EXPECT_EQ(a, b);
+}
+#endif
+
+/* AIDL service definition */
+using ::aidl::android::aidl::test::trunk::BnTrunkStableTest;
+class TrunkStableTest : public BnTrunkStableTest {
+  ScopedAStatus repeatParcelable(const MyParcelable& in_input,
+                                 MyParcelable* _aidl_return) override {
+    *_aidl_return = in_input;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus repeatEnum(const MyEnum in_input, MyEnum* _aidl_return) override {
+    *_aidl_return = in_input;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus repeatUnion(const MyUnion& in_input, MyUnion* _aidl_return) override {
+    *_aidl_return = in_input;
+    return ScopedAStatus::ok();
+  }
+  ScopedAStatus callMyCallback(const std::shared_ptr<IMyCallback>& in_cb) override {
+    MyParcelable a, b;
+    MyEnum c = MyEnum::ZERO, d = MyEnum::ZERO;
+    MyUnion e, f;
+    auto status = in_cb->repeatParcelable(a, &b);
+    if (!status.isOk()) {
+      return status;
+    }
+    status = in_cb->repeatEnum(c, &d);
+    if (!status.isOk()) {
+      return status;
+    }
+    status = in_cb->repeatUnion(e, &f);
+#if AIDL_TEST_TRUNK_VER >= 2
+    if (!status.isOk()) {
+      return status;
+    }
+    MyOtherParcelable g, h;
+    status = in_cb->repeatOtherParcelable(g, &h);
+#endif
+    return status;
+  }
+#if AIDL_TEST_TRUNK_VER >= 2
+  ScopedAStatus repeatOtherParcelable(const ITrunkStableTest::MyOtherParcelable& in_input,
+                                      ITrunkStableTest::MyOtherParcelable* _aidl_return) override {
+    *_aidl_return = in_input;
+    return ScopedAStatus::ok();
+  }
+#endif
+};
+
+int run_service() {
+  auto trunk = ndk::SharedRefBase::make<TrunkStableTest>();
+  binder_status_t status =
+      AServiceManager_addService(trunk->asBinder().get(), TrunkStableTest::descriptor);
+  CHECK_EQ(status, STATUS_OK);
+
+  ABinderProcess_joinThreadPool();
+  return EXIT_FAILURE;  // should not reach
+}
+
+int main(int argc, char* argv[]) {
+  if (fork() == 0) {
+    prctl(PR_SET_PDEATHSIG, SIGHUP);
+    run_service();
+  }
+  ::testing::InitGoogleTest(&argc, argv);
+  return RUN_ALL_TESTS();
+}
diff --git a/tests/versioned/android/aidl/versioned/tests/BazUnion.aidl b/tests/versioned/android/aidl/versioned/tests/BazUnion.aidl
new file mode 100644
index 0000000..2cd9e25
--- /dev/null
+++ b/tests/versioned/android/aidl/versioned/tests/BazUnion.aidl
@@ -0,0 +1,8 @@
+package android.aidl.versioned.tests;
+
+union BazUnion {
+    // V1
+    int intNum;
+    // V2
+    long longNum;
+}
diff --git a/tests/versioned/android/aidl/versioned/tests/Foo.aidl b/tests/versioned/android/aidl/versioned/tests/Foo.aidl
new file mode 100644
index 0000000..4b8c3e9
--- /dev/null
+++ b/tests/versioned/android/aidl/versioned/tests/Foo.aidl
@@ -0,0 +1,8 @@
+package android.aidl.versioned.tests;
+
+@JavaSuppressLint({"NewApi"})
+parcelable Foo {
+    // V1 is empty
+    // V2
+    int intDefault42 = 42;
+}
diff --git a/tests/versioned/android/aidl/versioned/tests/IFooInterface.aidl b/tests/versioned/android/aidl/versioned/tests/IFooInterface.aidl
new file mode 100644
index 0000000..0ce9101
--- /dev/null
+++ b/tests/versioned/android/aidl/versioned/tests/IFooInterface.aidl
@@ -0,0 +1,15 @@
+package android.aidl.versioned.tests;
+import android.aidl.versioned.tests.BazUnion;
+import android.aidl.versioned.tests.Foo;
+
+@JavaDelegator
+interface IFooInterface {
+    // V1
+    void originalApi();
+    @utf8InCpp String acceptUnionAndReturnString(in BazUnion u);
+    @SuppressWarnings(value={"inout-parameter"})
+    int ignoreParcelablesAndRepeatInt(in Foo inFoo, inout Foo inoutFoo, out Foo outFoo, int value);
+    int returnsLengthOfFooArray(in Foo[] foos);
+    // V2
+    void newApi();
+}
diff --git a/trace/android/trace.h b/trace/android/trace.h
new file mode 100644
index 0000000..cd6294c
--- /dev/null
+++ b/trace/android/trace.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include <cutils/trace.h>
+
+inline void ATrace_beginSection(const char* sectionName) {
+  atrace_begin(ATRACE_TAG_AIDL, sectionName);
+}
+
+inline void ATrace_endSection() {
+  atrace_end(ATRACE_TAG_AIDL);
+}